Changeset 2017


Ignore:
Timestamp:
01/22/07 23:35:03 (17 years ago)
Author:
mattausch
Message:

changed to static cast

Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
26 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp

    r2005 r2017  
    490490{ 
    491491        BvhSubdivisionCandidate *sc =  
    492                 dynamic_cast<BvhSubdivisionCandidate *>(splitCandidate); 
     492                static_cast<BvhSubdivisionCandidate *>(splitCandidate); 
    493493        BvhTraversalData &tData = sc->mParentData; 
    494494 
     
    19941994        for (vit = viewCells.begin(); vit != vit_end; ++ vit) 
    19951995        { 
    1996         VspViewCell *vc = dynamic_cast<VspViewCell *>(*vit); 
     1996        VspViewCell *vc = static_cast<VspViewCell *>(*vit); 
    19971997                VspLeaf *leaf = vc->mLeaves[0]; 
    19981998         
     
    20602060                if (node->IsLeaf())  
    20612061                { 
    2062                         leaf = dynamic_cast<BvhLeaf *>(node); 
     2062                        leaf = static_cast<BvhLeaf *>(node); 
    20632063 
    20642064                        if (IsObjectInLeaf(leaf, object)) 
     
    20702070                {        
    20712071                        // find point 
    2072                         BvhInterior *interior = dynamic_cast<BvhInterior *>(node); 
     2072                        BvhInterior *interior = static_cast<BvhInterior *>(node); 
    20732073         
    20742074                        if (interior->GetBack()->GetBoundingBox().Includes(object->GetBox())) 
     
    21122112        if (node->IsLeaf()) 
    21132113        { 
    2114                 BvhLeaf *leaf = dynamic_cast<BvhLeaf *>(node); 
     2114                BvhLeaf *leaf = static_cast<BvhLeaf *>(node); 
    21152115                const AxisAlignedBox3 box = leaf->GetBoundingBox(); 
    21162116                stream << "<Leaf" 
     
    21272127        else 
    21282128        {        
    2129                 BvhInterior *interior = dynamic_cast<BvhInterior *>(node); 
     2129                BvhInterior *interior = static_cast<BvhInterior *>(node); 
    21302130                const AxisAlignedBox3 box = interior->GetBoundingBox(); 
    21312131 
     
    22152215         
    22162216        // root and bounding box was already constructed 
    2217         BvhLeaf *bvhLeaf = dynamic_cast<BvhLeaf *>(mRoot); 
     2217        BvhLeaf *bvhLeaf = static_cast<BvhLeaf *>(mRoot); 
    22182218         
    22192219        // only rays intersecting objects in node are interesting 
     
    22262226        // create bvh traversal data 
    22272227        BvhTraversalData oData(bvhLeaf, 0, prop, nRays); 
    2228         cout << "here4" << endl; 
    2229          
     2228                 
    22302229        // create sorted object lists for the first data 
    22312230        if (mUseGlobalSorting) 
     
    22342233        } 
    22352234         
    2236         cout << "here6" << endl; 
    22372235        /////////////////// 
    22382236        //-- add first candidate for object space partition      
     
    22672265                for (cit = candidateContainer.begin(); cit != cit_end; ++ cit) 
    22682266                { 
    2269                         BvhSubdivisionCandidate *sCandidate = dynamic_cast<BvhSubdivisionCandidate *>(*cit); 
     2267                        BvhSubdivisionCandidate *sCandidate = static_cast<BvhSubdivisionCandidate *>(*cit); 
    22702268                         
    22712269                        // reevaluate priority 
     
    22952293        for (int i = 0; i < 3; ++ i) 
    22962294        { 
    2297                 cout << "here2 " << endl; 
    22982295                SortableEntryContainer *sortedObjects = new SortableEntryContainer(); 
    22992296 
     
    23162313                delete sortedObjects; 
    23172314        } 
    2318 cout << "here102" << endl; 
     2315 
    23192316        // last sorted list: by size 
    23202317        tData.mSortedObjects[3] = new ObjectContainer(); 
     
    23902387 
    23912388        const int nRays = CountRays(objects); 
    2392         BvhLeaf *bvhLeaf = dynamic_cast<BvhLeaf *>(mRoot); 
     2389        BvhLeaf *bvhLeaf = static_cast<BvhLeaf *>(mRoot); 
    23932390 
    23942391        // create bvh traversal data 
     
    25172514{ 
    25182515        BvhSubdivisionCandidate *sc =  
    2519                 dynamic_cast<BvhSubdivisionCandidate *>(splitCandidate); 
     2516                static_cast<BvhSubdivisionCandidate *>(splitCandidate); 
    25202517        BvhTraversalData &tData = sc->mParentData; 
    25212518 
     
    25312528                BvhTraversalData tBackData; 
    25322529                         
    2533                 BvhInterior *oldInterior = dynamic_cast<BvhInterior *>(oldNode); 
     2530                BvhInterior *oldInterior = static_cast<BvhInterior *>(oldNode); 
    25342531                 
    25352532                sc->mFrontObjects.clear(); 
     
    26672664 
    26682665                BvhSubdivisionCandidate *bsc =  
    2669                         dynamic_cast<BvhSubdivisionCandidate *>(candidate); 
     2666                        static_cast<BvhSubdivisionCandidate *>(candidate); 
    26702667 
    26712668                if (!InitialTerminationCriteriaMet(bsc->mParentData)) 
     
    27672764                if (node->IsLeaf()) 
    27682765                { 
    2769                         BvhLeaf *leaf = dynamic_cast<BvhLeaf *>(node); 
     2766                        BvhLeaf *leaf = static_cast<BvhLeaf *>(node); 
    27702767                        node->mRenderCost = EvalAbsCost(leaf->mObjects); 
    27712768                } 
    27722769                else 
    27732770                { 
    2774                         BvhInterior *interior = dynamic_cast<BvhInterior *>(node); 
     2771                        BvhInterior *interior = static_cast<BvhInterior *>(node); 
    27752772                 
    27762773                        node->mRenderCost = GetRenderCostIncrementially(interior->GetFront()) +  
  • GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.cpp

    r2003 r2017  
    8686        { 
    8787                // eyport leaf pvs 
    88                 KdLeaf *leaf = dynamic_cast<KdLeaf *>(node); 
     88                KdLeaf *leaf = static_cast<KdLeaf *>(node); 
    8989 
    9090                ObjectContainer::const_iterator oit, oit_end = leaf->mObjects.end(); 
     
    171171                break; 
    172172        case Intersectable::TRANSFORMED_MESH_INSTANCE: 
    173                 ExportTransformedMeshInstance(dynamic_cast<TransformedMeshInstance *>(object)); 
     173                ExportTransformedMeshInstance(static_cast<TransformedMeshInstance *>(object)); 
    174174                break; 
    175175        case Intersectable::VIEW_CELL: 
    176                 ExportViewCell(dynamic_cast<ViewCell *>(object)); 
     176                ExportViewCell(static_cast<ViewCell *>(object)); 
    177177                break; 
    178178        case Intersectable::KD_INTERSECTABLE: 
    179                 ExportKdIntersectable(*(dynamic_cast<KdIntersectable *>(object))); 
     179                ExportKdIntersectable(*(static_cast<KdIntersectable *>(object))); 
    180180                break; 
    181181        case Intersectable::TRIANGLE_INTERSECTABLE: 
    182182                { 
    183183                        // if (mClampToBox && !Overlap(mBoundingBox, object->GetBox()))  return; 
    184                         const Triangle3 triangle = dynamic_cast<TriangleIntersectable *>(object)->GetItem(); 
     184                        const Triangle3 triangle = static_cast<TriangleIntersectable *>(object)->GetItem(); 
    185185 
    186186            Polygon3 poly(triangle); 
     
    190190        case Intersectable::BVH_INTERSECTABLE: 
    191191                { 
    192                         BvhNode *node = dynamic_cast<BvhNode *>(object); 
     192                        BvhNode *node = static_cast<BvhNode *>(object); 
    193193                         
    194194                        if (node->IsLeaf()) 
    195195                        { 
    196                                 ExportGeometry(dynamic_cast<BvhLeaf *>(node)->mObjects, true); 
     196                                ExportGeometry(static_cast<BvhLeaf *>(node)->mObjects, true); 
    197197                        } 
    198198 
     
    275275                case Intersectable::TRIANGLE_INTERSECTABLE: 
    276276                        { 
    277                                 TriangleIntersectable *ti = dynamic_cast<TriangleIntersectable *>(obj); 
     277                                TriangleIntersectable *ti = static_cast<TriangleIntersectable *>(obj); 
    278278                                polys.push_back(new Polygon3(ti->GetItem())); 
    279279                break; 
     
    281281                case Intersectable::MESH_INSTANCE: 
    282282                        { 
    283                                 MeshInstance *mi = dynamic_cast<MeshInstance *>(obj); 
     283                                MeshInstance *mi = static_cast<MeshInstance *>(obj); 
    284284                                ExportMesh(mi->GetMesh()); 
    285285                                break; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.cpp

    r2006 r2017  
    139139        break; 
    140140  case Intersectable::VIEW_CELL: 
    141         RenderViewCell(dynamic_cast<ViewCell *>(object)); 
     141        RenderViewCell(static_cast<ViewCell *>(object)); 
    142142        break; 
    143143  case Intersectable::TRANSFORMED_MESH_INSTANCE: 
    144         RenderTransformedMeshInstance(dynamic_cast<TransformedMeshInstance *>(object)); 
     144        RenderTransformedMeshInstance(static_cast<TransformedMeshInstance *>(object)); 
    145145        break; 
    146146  case Intersectable::TRIANGLE_INTERSECTABLE: 
    147         RenderTriangle(dynamic_cast<TriangleIntersectable *>(object)); 
     147        RenderTriangle(static_cast<TriangleIntersectable *>(object)); 
    148148        break; 
    149149  case Intersectable::BVH_INTERSECTABLE: { 
    150150 
    151         BvhNode *node = dynamic_cast<BvhNode *>(object); 
     151        BvhNode *node = static_cast<BvhNode *>(object); 
    152152         
    153153        if (mRenderBoxes) 
     
    158158  } 
    159159  case Intersectable::KD_INTERSECTABLE: { 
    160         KdNode *node = (dynamic_cast<KdIntersectable *>(object))->GetItem(); 
     160        KdNode *node = (static_cast<KdIntersectable *>(object))->GetItem(); 
    161161         
    162162        if (mRenderBoxes) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h

    r2008 r2017  
    195195  }; 
    196196friend class GlobalLinesRenderer; 
     197friend class ViewCellsManager; 
     198 
    197199protected: 
    198200 
  • GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp

    r2005 r2017  
    2525}; 
    2626 
    27 static const float MIN_DIST = 0.01f; 
     27static const float MIN_DIST = 0.001f; 
    2828 
    2929static vector<VizStruct> vizContainer; 
     
    286286                                                                   const VssRay &ray2, 
    287287                                                                   const VssRay &oldRay) 
    288 { 
     288{//cout <<"x"<<Magnitude(p1 - p2) << " "; 
    289289        int castRays = 0; 
    290290 
     
    293293        castRays += CheckDiscontinuity(ray2, hitTriangle, oldRay); 
    294294 
    295         if (EqualVisibility(ray1, ray2) || (Magnitude(p1 - p2) <= MIN_DIST)) 
     295        if (EqualVisibility(ray1, ray2) || (SqrMagnitude(p1 - p2) <= MIN_DIST)) 
    296296        { 
    297297                return castRays; 
     
    300300        // the new subdivision point 
    301301        const Vector3 p = (p1 + p2) * 0.5f; 
    302  
     302        //cout << "p: " << p << " " << p1 << " " << p2 << endl; 
    303303        // cast ray into the new point 
    304304        SimpleRay sray(oldRay.mOrigin, p - oldRay.mOrigin, SamplingStrategy::GVS, 1.0f); 
     
    335335        if (tObj->Type() == Intersectable::TRIANGLE_INTERSECTABLE) 
    336336        { 
    337                 hitTriangle = dynamic_cast<TriangleIntersectable *>(tObj)->GetItem(); 
     337                hitTriangle = static_cast<TriangleIntersectable *>(tObj)->GetItem(); 
    338338        } 
    339339        else 
     
    427427 
    428428        CLEAR_CONTAINER(invalidSamples); 
    429  
     429//cout << "***********"<< endl; 
    430430        return castRays; 
    431431} 
     
    495495        // other types not implemented yet 
    496496        if (tObj->Type() == Intersectable::TRIANGLE_INTERSECTABLE) 
    497                 occluder = dynamic_cast<TriangleIntersectable *>(tObj)->GetItem(); 
     497                occluder = static_cast<TriangleIntersectable *>(tObj)->GetItem(); 
    498498        else 
    499499                cout << "not yet implemented" << endl; 
     
    828828                                break; 
    829829                        } 
    830  
     830//if (viewCell->GetId() == 36658) 
     831//{ 
    831832                        mViewCells.push_back(viewCell); 
     833//                      return; 
     834//} 
    832835                } 
    833836 
     
    859862                for (oit = leaf->mObjects.begin(); oit != oit_end; ++ oit) 
    860863                { 
    861                         TriangleIntersectable *triObj = dynamic_cast<TriangleIntersectable *>(*oit); 
     864                        TriangleIntersectable *triObj = static_cast<TriangleIntersectable *>(*oit); 
    862865 
    863866                        if (box.Intersects(triObj->GetItem())) 
     
    10651068        } 
    10661069 
    1067         cout << "here4 " << mKdTree->GetBox() << endl; 
    1068         cout << "here5 " << mViewCellsManager->GetViewSpaceBox() << endl; 
    10691070        mGvsStats.Stop(); 
    10701071        mGvsStats.Print(mGvsStatsStream); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp

    r1933 r2017  
    17241724                if (!mNode->IsLeaf()) 
    17251725                { 
    1726                         VspInterior *interior = dynamic_cast<VspInterior *>(mNode); 
     1726                        VspInterior *interior = static_cast<VspInterior *>(mNode); 
    17271727 
    17281728                        tQueue.push(new VspNodeWrapper(interior->GetFront())); 
     
    17501750                if (!mNode->IsLeaf()) 
    17511751                { 
    1752                         BvhInterior *interior = dynamic_cast<BvhInterior *>(mNode); 
     1752                        BvhInterior *interior = static_cast<BvhInterior *>(mNode); 
    17531753 
    17541754                        tQueue.push(new BvhNodeWrapper(interior->GetFront())); 
     
    17771777                if (!mViewCell->IsLeaf()) 
    17781778                { 
    1779                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(mViewCell); 
     1779                        ViewCellInterior *interior = static_cast<ViewCellInterior *>(mViewCell); 
    17801780 
    17811781                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
     
    18191819                        { 
    18201820                                //cout << "1"; 
    1821                                 ViewCellWrapper *viewCellWrapper = dynamic_cast<ViewCellWrapper *>(nodeWrapper); 
     1821                                ViewCellWrapper *viewCellWrapper = static_cast<ViewCellWrapper *>(nodeWrapper); 
    18221822                                viewCells.push_back(viewCellWrapper->mViewCell); 
    18231823                        } 
     
    18251825                        { 
    18261826                                //cout << "0"; 
    1827                                 BvhNodeWrapper *bvhNodeWrapper = dynamic_cast<BvhNodeWrapper *>(nodeWrapper); 
     1827                                BvhNodeWrapper *bvhNodeWrapper = static_cast<BvhNodeWrapper *>(nodeWrapper); 
    18281828                                bvhNodes.push_back(bvhNodeWrapper->mNode); 
    18291829                        } 
     
    18541854                        cout << "error " << entry.mObject->Type() << endl; 
    18551855 
    1856                 BvhNode *intersect = dynamic_cast<BvhNode *>(entry.mObject); 
     1856                BvhNode *intersect = static_cast<BvhNode *>(entry.mObject); 
    18571857                BvhNode *activeNode; 
    18581858 
     
    18611861                { 
    18621862                        activeNode =  
    1863                                 dynamic_cast<BvhLeaf *>(intersect)->GetActiveNode(); 
     1863                                static_cast<BvhLeaf *>(intersect)->GetActiveNode(); 
    18641864                } 
    18651865                else 
     
    19211921                else if (!vc->IsLeaf()) // interior cells: go down to leaf level 
    19221922                { 
    1923                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     1923                        ViewCellInterior *interior = static_cast<ViewCellInterior *>(vc); 
    19241924                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
    19251925 
     
    19581958                { 
    19591959                        //cout <<" t"; 
    1960                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     1960                        ViewCellInterior *interior = static_cast<ViewCellInterior *>(vc); 
    19611961                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
    19621962 
     
    20002000                { 
    20012001                        //cout <<" t"; 
    2002                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     2002                        ViewCellInterior *interior = static_cast<ViewCellInterior *>(vc); 
    20032003                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
    20042004 
     
    20242024        else 
    20252025        { 
    2026                 ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     2026                ViewCellInterior *interior = static_cast<ViewCellInterior *>(vc); 
    20272027#if 0 
    20282028                ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/IntelRayCaster.cpp

    r2004 r2017  
    7575        if (castDoubleRay) 
    7676        { 
    77                 //cerr<<"HERE"<<endl; 
    7877                Vector3 dir = -simpleRay.mDirection; 
    7978                hittriangle = mlrtaIntersectAS( 
  • GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp

    r2015 r2017  
    744744{ 
    745745        int hits = 0; 
     746 
    746747        float mint = 0.0f, maxt = 1.0f; 
    747748        const Vector3 dir = termination - origin; 
     
    764765        while (1) 
    765766        { 
    766           if (!node->IsLeaf()) { 
    767                 KdInterior *in = (KdInterior *)node; 
    768                 position = in->mPosition; 
    769                 axis = in->mAxis; 
    770                  
    771                 if (entp[axis] <= position) 
    772                   { 
    773                         if (extp[axis] <= position) 
    774                           { 
    775                                 node = in->mBack; 
    776                                 // cases N1,N2,N3,P5,Z2,Z3 
    777                                 continue; 
    778                           }  
     767                if (!node->IsLeaf()) 
     768                { 
     769                        KdInterior *in = static_cast<KdInterior *>(node); 
     770                        position = in->mPosition; 
     771                        axis = in->mAxis; 
     772 
     773                        if (entp[axis] <= position) 
     774                        { 
     775                                if (extp[axis] <= position) 
     776                                { 
     777                                        node = in->mBack; 
     778                                        // cases N1,N2,N3,P5,Z2,Z3 
     779                                        continue; 
     780                                }  
     781                                else 
     782                                { 
     783                                        // case N4 
     784                                        node = in->mBack; 
     785                                        farChild = in->mFront; 
     786                                } 
     787                        } 
    779788                        else 
    780                           { 
    781                                 // case N4 
    782                                 node = in->mBack; 
    783                                 farChild = in->mFront; 
    784                           } 
    785                   } 
     789                        { 
     790                                if (position <= extp[axis]) 
     791                                { 
     792                                        node = in->mFront; 
     793                                        // cases P1,P2,P3,N5,Z1 
     794                                        continue; 
     795                                } 
     796                                else 
     797                                { 
     798                                        node = in->mFront; 
     799                                        farChild = in->mBack; 
     800                                        // case P4 
     801                                } 
     802                        } 
     803 
     804                        // $$ modification 3.5.2004 - hints from Kamil Ghais 
     805                        // case N4 or P4 
     806                        float tdist = (position - origin[axis]) / dir[axis]; 
     807                        //tStack.push(RayTraversalData(farChild, extp, maxt)); //TODO 
     808                        extp = origin + dir * tdist; 
     809                        maxt = tdist; 
     810                } 
    786811                else 
    787                   { 
    788                         if (position <= extp[axis]) 
    789                           { 
    790                                 node = in->mFront; 
    791                                 // cases P1,P2,P3,N5,Z1 
    792                                 continue; 
    793                           } 
    794                         else 
    795                           { 
    796                                 node = in->mFront; 
    797                                 farChild = in->mBack; 
    798                                 // case P4 
    799                           } 
    800                   } 
    801                  
    802                 // $$ modification 3.5.2004 - hints from Kamil Ghais 
    803                 // case N4 or P4 
    804                 float tdist = (position - origin[axis]) / dir[axis]; 
    805                 //tStack.push(RayTraversalData(farChild, extp, maxt)); //TODO 
    806                 extp = origin + dir * tdist; 
    807                 maxt = tdist; 
    808           } 
    809           else 
    810812                { 
    811                   // compute intersection with all objects in this leaf 
    812                   KdLeaf *leaf = (KdLeaf *)node; 
    813                    
    814                   // add view cell to intersections 
    815                   ViewCell *vc = leaf->mViewCell; 
    816                    
    817                   if (!vc->Mailed()) { 
    818                         vc->Mail(); 
    819                         viewcells.push_back(vc); 
    820                         ++ hits; 
    821                   } 
    822                    
    823                   // get the next node from the stack 
    824                   if (tStack.empty()) 
    825                         break; 
    826                    
    827                   entp = extp; 
    828                   mint = maxt; 
    829                    
    830                   RayTraversalData &s  = tStack.top(); 
    831                   node = s.mNode; 
    832                   extp = s.mExitPoint; 
    833                   maxt = s.mMaxT; 
    834                   tStack.pop(); 
     813                        // compute intersection with all objects in this leaf 
     814                        KdLeaf *leaf = static_cast<KdLeaf *>(node); 
     815 
     816                        // add view cell to intersections 
     817                        ViewCell *vc = leaf->mViewCell; 
     818 
     819                        if (!vc->Mailed()) 
     820                        { 
     821                                vc->Mail(); 
     822                                viewcells.push_back(vc); 
     823                                ++ hits; 
     824                        } 
     825 
     826                        // get the next node from the stack 
     827                        if (tStack.empty()) 
     828                                break; 
     829 
     830                        entp = extp; 
     831                        mint = maxt; 
     832                         
     833                        RayTraversalData &s  = tStack.top(); 
     834                        node = s.mNode; 
     835                        extp = s.mExitPoint; 
     836                        maxt = s.mMaxT; 
     837                        tStack.pop(); 
    835838                } 
    836839        } 
    837          
     840 
    838841        return hits; 
    839842} 
     
    13231326                { 
    13241327                        //Debug << "l"; 
    1325                         ExportBinLeaf(stream, dynamic_cast<KdLeaf *>(node)); 
     1328                        ExportBinLeaf(stream, static_cast<KdLeaf *>(node)); 
    13261329                } 
    13271330                else 
    13281331                { 
    13291332                        //Debug << "i"; 
    1330                         KdInterior *interior = dynamic_cast<KdInterior *>(node); 
     1333                        KdInterior *interior = static_cast<KdInterior *>(node); 
    13311334 
    13321335                        ExportBinInterior(stream, interior); 
     
    13501353        if (nodeType == TYPE_LEAF) 
    13511354        { 
    1352                 return ImportBinLeaf(stream, dynamic_cast<KdInterior *>(parent), objects); 
     1355                return ImportBinLeaf(stream, static_cast<KdInterior *>(parent), objects); 
    13531356        } 
    13541357 
    13551358        if (nodeType == TYPE_INTERIOR) 
    13561359        { 
    1357                 return ImportBinInterior(stream, dynamic_cast<KdInterior *>(parent)); 
     1360                return ImportBinInterior(stream, static_cast<KdInterior *>(parent)); 
    13581361        } 
    13591362 
     
    14091412 
    14101413                        //Debug << "i" ; 
    1411                         KdInterior *interior = dynamic_cast<KdInterior *>(node); 
     1414                        KdInterior *interior = static_cast<KdInterior *>(node); 
    14121415                        interior->mBox = tData.mBox; 
    14131416 
     
    15541557                if (node->IsLeaf()) 
    15551558                { 
    1556                         leaves.push_back(dynamic_cast<KdLeaf *>(node)); 
     1559                        leaves.push_back(static_cast<KdLeaf *>(node)); 
    15571560                } 
    15581561                else // interior 
    15591562                { 
    1560                         KdInterior *interior = dynamic_cast<KdInterior *>(node); 
     1563                        KdInterior *interior = static_cast<KdInterior *>(node); 
    15611564 
    15621565                        if (box.Max(interior->mAxis) >= interior->mPosition) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/OspTree.cpp

    r1779 r2017  
    418418                                                   const bool globalCriteriaMet) 
    419419{ 
    420         OspSubdivisionCandidate *sc = dynamic_cast<OspSubdivisionCandidate *>(splitCandidate); 
     420        OspSubdivisionCandidate *sc = static_cast<OspSubdivisionCandidate *>(splitCandidate); 
    421421        OspTraversalData &tData = sc->mParentData; 
    422422 
     
    475475                if (mStoreRays) 
    476476                { 
    477                         KdLeaf *leaf = dynamic_cast<KdLeaf *>(newNode); 
     477                        KdLeaf *leaf = static_cast<KdLeaf *>(newNode); 
    478478 
    479479                        RayInfoContainer::const_iterator it, it_end = tData.mRays->end(); 
     
    15091509        if (!node->IsLeaf()) 
    15101510        { 
    1511                 return (dynamic_cast<KdInterior *>(node))->mBox;                 
    1512         } 
    1513  
    1514         KdInterior *parent = dynamic_cast<KdInterior *>(node->mParent); 
     1511                return (static_cast<KdInterior *>(node))->mBox;          
     1512        } 
     1513 
     1514        KdInterior *parent = static_cast<KdInterior *>(node->mParent); 
    15151515 
    15161516        AxisAlignedBox3 box(parent->mBox); 
     
    15751575                for (vit = tmpViewCells.begin(); vit != vit_end; ++ vit) 
    15761576                { 
    1577                         VspViewCell *vc = dynamic_cast<VspViewCell *>(*vit); 
     1577                        VspViewCell *vc = static_cast<VspViewCell *>(*vit); 
    15781578 
    15791579                        if (!vc->Mailed()) 
     
    15901590        for (vit = viewCells.begin(); vit != vit_end; ++ vit) 
    15911591        { 
    1592                 VspViewCell *vc = dynamic_cast<VspViewCell *>(*vit); 
     1592                VspViewCell *vc = static_cast<VspViewCell *>(*vit); 
    15931593 
    15941594                VspLeaf *leaf = vc->mLeaves[0]; 
     
    16301630                if (node->IsLeaf())  
    16311631                { 
    1632                         leaf = dynamic_cast<KdLeaf *>(node); 
     1632                        leaf = static_cast<KdLeaf *>(node); 
    16331633                }  
    16341634                else     
    16351635                {        
    16361636                        // find point 
    1637                         KdInterior *interior = dynamic_cast<KdInterior *>(node); 
     1637                        KdInterior *interior = static_cast<KdInterior *>(node); 
    16381638         
    16391639                        if (interior->mPosition > pt[interior->mAxis]) 
     
    22832283        if (node->IsLeaf()) 
    22842284        { 
    2285                 KdLeaf *leaf = dynamic_cast<KdLeaf *>(node); 
     2285                KdLeaf *leaf = static_cast<KdLeaf *>(node); 
    22862286 
    22872287                stream << "<Leaf "; 
     
    22952295        else 
    22962296        {        
    2297                 KdInterior *interior = dynamic_cast<KdInterior *>(node); 
     2297                KdInterior *interior = static_cast<KdInterior *>(node); 
    22982298         
    22992299                stream << "<Interior plane=\"" << interior->mPosition << " "  
     
    23282328                if (node->IsLeaf()) 
    23292329                { 
    2330                         KdLeaf *leaf = dynamic_cast<KdLeaf *>(node); 
     2330                        KdLeaf *leaf = static_cast<KdLeaf *>(node); 
    23312331 
    23322332                        ObjectContainer::const_iterator oit, oit_end = tData.objects->end(); 
     
    23402340                { 
    23412341                        KdObjectsTraversalData frontData, backData; 
    2342                         KdInterior *interior = dynamic_cast<KdInterior *>(node); 
     2342                        KdInterior *interior = static_cast<KdInterior *>(node); 
    23432343 
    23442344                        frontData.objects = new ObjectContainer(); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.cpp

    r2012 r2017  
    208208        cout << "done.\n"; 
    209209 
     210        cout << "deleting render simulator ... \n"; 
    210211        DEL_PTR(mRenderSimulator); 
     212        mRenderSimulator = NULL; 
     213        cout << "deleting renderer ... \n"; 
    211214        DEL_PTR(renderer); 
     215        renderer = NULL; 
     216        cout << "deleting ray caster ... \n"; 
    212217        DEL_PTR(mRayCaster); 
    213218 
    214219#ifdef USE_CG 
     220        cout << "deleting global lines renderer ... \n"; 
    215221        DEL_PTR(mGlobalLinesRenderer); 
    216222#endif 
     223        cout << "finished" << endl; 
    217224} 
    218225 
     
    336343                if (obj->Type() == Intersectable::TRIANGLE_INTERSECTABLE) 
    337344                { 
    338                         Triangle3 tri = dynamic_cast<TriangleIntersectable *>(obj)->GetItem(); 
     345                        Triangle3 tri = static_cast<TriangleIntersectable *>(obj)->GetItem(); 
    339346 
    340347                        samplesOut.write(reinterpret_cast<char *>(tri.mVertices + 0), sizeof(Vector3)); 
     
    370377                if (obj->Type() == Intersectable::TRIANGLE_INTERSECTABLE) 
    371378                { 
    372                         Triangle3 tri = dynamic_cast<TriangleIntersectable *>(obj)->GetItem(); 
     379                        Triangle3 tri = static_cast<TriangleIntersectable *>(obj)->GetItem(); 
    373380                        //if (!(bbox.IsInside(tri.mVertices[0]) && bbox.IsInside(tri.mVertices[1]) && bbox.IsInside(tri.mVertices[2])))continue; 
    374381                         
     
    391398                if (obj->Type() == Intersectable::TRIANGLE_INTERSECTABLE) 
    392399                { 
    393                         //Triangle3 tri = dynamic_cast<TriangleIntersectable *>(obj)->GetItem(); 
     400                        //Triangle3 tri = static_cast<TriangleIntersectable *>(obj)->GetItem(); 
    394401                        //if (!(bbox.IsInside(tri.mVertices[0]) && bbox.IsInside(tri.mVertices[1]) && bbox.IsInside(tri.mVertices[2]))) continue; 
    395402                         
    396                         Triangle3 tri = dynamic_cast<TriangleIntersectable *>(obj)->GetItem(); 
     403                        Triangle3 tri = static_cast<TriangleIntersectable *>(obj)->GetItem(); 
    397404                        samplesOut << "f " << i << " " << i + 1 << " " << i + 2 << endl; 
    398405                        i += 3; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.h

    r2012 r2017  
    262262        ///////////////////////// 
    263263 
    264   GlobalLinesRenderer *mGlobalLinesRenderer; 
    265   RayCaster *mRayCaster; 
    266   /// samples used for construction of the BSP view cells tree. 
     264        GlobalLinesRenderer *mGlobalLinesRenderer; 
     265 
     266        RayCaster *mRayCaster; 
     267        /// samples used for construction of the BSP view cells tree. 
    267268        int mBspConstructionSamples; 
    268269        /// samples used for construction of the VSP OSP tree. 
     
    281282}; 
    282283 
    283   extern Preprocessor *preprocessor; 
     284extern Preprocessor *preprocessor; 
    284285 
    285286} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Preprocessor.vcproj

    r1977 r2017  
    213213                                Name="VCCLCompilerTool" 
    214214                                Optimization="3" 
     215                                GlobalOptimizations="TRUE" 
    215216                                InlineFunctionExpansion="0" 
    216                                 FavorSizeOrSpeed="0" 
     217                                EnableIntrinsicFunctions="TRUE" 
     218                                FavorSizeOrSpeed="1" 
     219                                OmitFramePointers="TRUE" 
     220                                EnableFiberSafeOptimizations="TRUE" 
    217221                                OptimizeForProcessor="3" 
    218222                                OptimizeForWindowsApplication="TRUE" 
     
    221225                                ExceptionHandling="TRUE" 
    222226                                RuntimeLibrary="2" 
     227                                EnableEnhancedInstructionSet="2" 
    223228                                DisableLanguageExtensions="FALSE" 
    224229                                ForceConformanceInForLoopScope="FALSE" 
    225                                 RuntimeTypeInfo="TRUE" 
     230                                RuntimeTypeInfo="FALSE" 
    226231                                UsePrecompiledHeader="0" 
    227232                                BrowseInformation="1" 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Pvs.cpp

    r1785 r2017  
    4242                        if (node->IsLeaf()) 
    4343                        { 
    44                                 KdLeaf *leaf = dynamic_cast<KdLeaf *>(node); 
     44                                KdLeaf *leaf = static_cast<KdLeaf *>(node); 
    4545                        
    4646                                // add #objects exclusivly in this node 
     
    6464                        else // traverse tree 
    6565                        { 
    66                                 KdInterior *interior = dynamic_cast<KdInterior *>(node); 
     66                                KdInterior *interior = static_cast<KdInterior *>(node); 
    6767 
    6868                                tStack.push(interior->mFront); 
     
    8585        // hack for choosing which node to account for 
    8686        if (bvhObj->IsLeaf()) 
    87                 node = dynamic_cast<BvhLeaf *>(bvhObj)->GetActiveNode(); 
     87                node = static_cast<BvhLeaf *>(bvhObj)->GetActiveNode(); 
    8888        else 
    8989                node = bvhObj; 
     
    9292        if (node->IsLeaf())      
    9393        {        
    94                 BvhLeaf *leaf = dynamic_cast<BvhLeaf *>(node); 
     94                BvhLeaf *leaf = static_cast<BvhLeaf *>(node); 
    9595                // objects already accounted for 
    9696                if (leaf->Mailed()) 
     
    118118                        if (node->IsLeaf()) 
    119119                        { 
    120                                 BvhLeaf *leaf = dynamic_cast<BvhLeaf *>(node); 
     120                                BvhLeaf *leaf = static_cast<BvhLeaf *>(node); 
    121121 
    122122                                // add #objects exclusivly in this node 
     
    125125                        else // traverse tree 
    126126                        { 
    127                                 BvhInterior *interior = dynamic_cast<BvhInterior *>(node); 
     127                                BvhInterior *interior = static_cast<BvhInterior *>(node); 
    128128 
    129129                                tStack.push(interior->GetFront()); 
     
    156156                                { 
    157157                                        // found kd node 
    158                                         KdIntersectable *kdObj = dynamic_cast<KdIntersectable *>(obj); 
     158                                        KdIntersectable *kdObj = static_cast<KdIntersectable *>(obj); 
    159159                                        pvs += EvalKdNodeContribution(kdObj);    
    160160                                        break; 
     
    162162                        case Intersectable::BVH_INTERSECTABLE: 
    163163                                { 
    164                                         BvhNode *bvhObj = dynamic_cast<BvhNode *>(obj); 
     164                                        BvhNode *bvhObj = static_cast<BvhNode *>(obj); 
    165165                                        pvs += EvalBvhNodeContribution(bvhObj); 
    166166                                        break; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtGlViewer.h

    r1984 r2017  
    1212{ 
    1313 
    14   Q_OBJECT 
     14  //Q_OBJECT 
    1515 
    1616        friend class QtGlRendererWidget; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/QtInterface/QtInterface.vcproj

    r1969 r2017  
    180180                                Name="VCMIDLTool"/> 
    181181                        <Tool 
    182                                 Name="VCPostBuildEventTool" 
    183                                 Description="&quot;copy dll to preprocessor dir&quot;" 
    184                                 CommandLine="copy Release\*.dll ..\..\bin\"/> 
     182                                Name="VCPostBuildEventTool"/> 
    185183                        <Tool 
    186184                                Name="VCPreBuildEventTool"/> 
  • GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj

    r2005 r2017  
    189189                                GlobalOptimizations="TRUE" 
    190190                                InlineFunctionExpansion="2" 
    191                                 FavorSizeOrSpeed="1" 
     191                                EnableIntrinsicFunctions="TRUE" 
     192                                FavorSizeOrSpeed="1" 
     193                                OmitFramePointers="TRUE" 
    192194                                EnableFiberSafeOptimizations="TRUE" 
    193195                                OptimizeForProcessor="3" 
    194196                                OptimizeForWindowsApplication="TRUE" 
    195197                                AdditionalIncludeDirectories="..\include;..\..\..\..\..\..\NonGTP\Boost;..\src;..\..\..\..\..\..\NonGTP\Devil\include;..\..\..\..\..\..\NonGTP\Zlib\include;..\..\..\..\..\..\NonGTP\Xerces;&quot;$(QTDIR)\include\QtOpenGl&quot;;&quot;$(QTDIR)\include\Qt&quot;;&quot;$(QTDIR)\include\QtCore&quot;;&quot;$(QTDIR)\include&quot;;QtInterface" 
    196                                 PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT3" 
    197                                 RuntimeLibrary="2" 
    198                                 RuntimeTypeInfo="TRUE" 
     198                                PreprocessorDefinitions="WIN32;NDEBUG;_CONSOLE;GTP_INTERNAL;USE_QT" 
     199                                RuntimeLibrary="2" 
     200                                EnableEnhancedInstructionSet="2" 
     201                                RuntimeTypeInfo="FALSE" 
    199202                                UsePrecompiledHeader="0" 
    200203                                WarningLevel="3" 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.cpp

    r2015 r2017  
    471471                else 
    472472                { 
    473                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     473                        ViewCellInterior *interior = static_cast<ViewCellInterior *>(vc); 
    474474 
    475475                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
     
    504504                else 
    505505                { 
    506                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     506                        ViewCellInterior *interior = static_cast<ViewCellInterior *>(vc); 
    507507                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
    508508 
     
    12741274 
    12751275         
    1276         ViewCellInterior *p = dynamic_cast<ViewCellInterior *>(leaf->GetParent()); 
     1276        ViewCellInterior *p = static_cast<ViewCellInterior *>(leaf->GetParent()); 
    12771277 
    12781278        p->RemoveChildLink(leaf); 
     
    12851285        float cost1, cost2; 
    12861286 
    1287         ViewCellInterior *vc1 = dynamic_cast<ViewCellInterior *>(mc.GetLeftViewCell()); 
    1288         ViewCellInterior *vc2 = dynamic_cast<ViewCellInterior *>(mc.GetRightViewCell()); 
     1287        ViewCellInterior *vc1 = static_cast<ViewCellInterior *>(mc.GetLeftViewCell()); 
     1288        ViewCellInterior *vc2 = static_cast<ViewCellInterior *>(mc.GetRightViewCell()); 
    12891289 
    12901290        ViewCell *leaf1 = mc.GetInitialLeftViewCell(); 
     
    14801480        if (!root->IsLeaf()) 
    14811481        { 
    1482                 ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(root); 
     1482                ViewCellInterior *interior = static_cast<ViewCellInterior *>(root); 
    14831483 
    14841484        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
     
    15771577                if (!vc->IsLeaf())  
    15781578                {        
    1579                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     1579                        ViewCellInterior *interior = static_cast<ViewCellInterior *>(vc); 
    15801580 
    15811581                        const float parentCost = GetPvsCost(interior); 
     
    16511651                else  
    16521652                {        
    1653                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     1653                        ViewCellInterior *interior = static_cast<ViewCellInterior *>(vc); 
    16541654 
    16551655                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
     
    17891789                if (!vc->IsLeaf()) // interior cells: go down to leaf level 
    17901790                { 
    1791                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     1791                        ViewCellInterior *interior = static_cast<ViewCellInterior *>(vc); 
    17921792                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
    17931793 
     
    19251925                if (!vc->IsLeaf()) 
    19261926                { 
    1927                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     1927                        ViewCellInterior *interior = static_cast<ViewCellInterior *>(vc); 
    19281928                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
    19291929 
     
    19761976                if (!vc->IsLeaf()) 
    19771977                { 
    1978                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     1978                        ViewCellInterior *interior = static_cast<ViewCellInterior *>(vc); 
    19791979 
    19801980                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
     
    20682068        if (!root->IsLeaf()) 
    20692069        { 
    2070                 ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(root); 
     2070                ViewCellInterior *interior = static_cast<ViewCellInterior *>(root); 
    20712071 
    20722072                ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
     
    21262126                if (!viewCell->IsLeaf()) 
    21272127                { 
    2128                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(viewCell); 
     2128                        ViewCellInterior *interior = static_cast<ViewCellInterior *>(viewCell); 
    21292129 
    21302130                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
     
    21562156                if (!vc->IsLeaf())  
    21572157                {        
    2158                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     2158                        ViewCellInterior *interior = static_cast<ViewCellInterior *>(vc); 
    21592159                   
    21602160                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
     
    22192219                if (!vc->IsLeaf())  
    22202220                {        
    2221                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     2221                        ViewCellInterior *interior = static_cast<ViewCellInterior *>(vc); 
    22222222 
    22232223                        const float parentCost = GetPvsCost(interior); 
     
    22842284                if (!vc->IsLeaf())  
    22852285                {        
    2286                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     2286                        ViewCellInterior *interior = static_cast<ViewCellInterior *>(vc); 
    22872287 
    22882288                        const float parentPvsCost = GetPvsCost(interior); 
     
    23722372                if (!vc->IsLeaf()) 
    23732373                { 
    2374                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     2374                        ViewCellInterior *interior = static_cast<ViewCellInterior *>(vc); 
    23752375                         
    23762376                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
     
    23972397                { 
    23982398                        ObjectContainer objects;  
    2399                         BvhNode *node = dynamic_cast<BvhNode *>(obj); 
     2399                        BvhNode *node = static_cast<BvhNode *>(obj); 
    24002400                        node->CollectObjects(objects); 
    24012401                 
     
    24222422                stream << "<Leaf "; 
    24232423                stream << "id=\"" << viewCell->GetId() << "\" "; 
    2424                 stream << "active=\"" << dynamic_cast<ViewCellLeaf *>(viewCell)->GetActiveViewCell()->GetId() << "\" "; 
     2424                stream << "active=\"" << static_cast<ViewCellLeaf *>(viewCell)->GetActiveViewCell()->GetId() << "\" "; 
    24252425                stream << "mergecost=\"" << viewCell->GetMergeCost() << "\" "; 
    24262426                stream << "pvs=\""; 
     
    24352435        else 
    24362436        { 
    2437                 ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(viewCell); 
     2437                ViewCellInterior *interior = static_cast<ViewCellInterior *>(viewCell); 
    24382438         
    24392439                stream << "<Interior "; 
     
    24812481                if (!vc->IsLeaf()) 
    24822482                { 
    2483                         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(vc); 
     2483                        ViewCellInterior *interior = static_cast<ViewCellInterior *>(vc); 
    24842484                        ViewCellContainer::const_iterator it, it_end = interior->mChildren.end(); 
    24852485 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp

    r1923 r2017  
    498498                if (!tData.mNode->IsLeaf()) 
    499499                { 
    500                         BspInterior *interior = dynamic_cast<BspInterior *>(tData.mNode); 
     500                        BspInterior *interior = static_cast<BspInterior *>(tData.mNode); 
    501501 
    502502                        /////////////////// 
     
    636636                { 
    637637                case Intersectable::MESH_INSTANCE: 
    638                         mesh = dynamic_cast<MeshInstance *>(object)->GetMesh(); 
     638                        mesh = static_cast<MeshInstance *>(object)->GetMesh(); 
    639639                        break; 
    640640                case Intersectable::VIEW_CELL: 
    641                         mesh = dynamic_cast<ViewCell *>(object)->GetMesh(); 
     641                        mesh = static_cast<ViewCell *>(object)->GetMesh(); 
    642642                        break; 
    643643                case Intersectable::TRANSFORMED_MESH_INSTANCE: 
    644644                        { 
    645                                 TransformedMeshInstance *mi = dynamic_cast<TransformedMeshInstance *>(object); 
     645                                TransformedMeshInstance *mi = static_cast<TransformedMeshInstance *>(object); 
    646646 
    647647                                if (!mi->GetMesh())      
     
    801801                if (!ray->intersections.empty()) 
    802802                { 
    803                         MeshInstance *obj = dynamic_cast<MeshInstance *>(ray->intersections[0].mObject); 
     803                        MeshInstance *obj = static_cast<MeshInstance *>(ray->intersections[0].mObject); 
    804804 
    805805                        Mesh *mesh; 
     
    807807                        { 
    808808                                TransformedMeshInstance *tmobj =  
    809                                         dynamic_cast<TransformedMeshInstance *>(obj); 
     809                                        static_cast<TransformedMeshInstance *>(obj); 
    810810                         
    811811                                mesh = new Mesh(); 
     
    10061006        if (TerminationCriteriaMet(tData))               
    10071007        { 
    1008                 BspLeaf *leaf = dynamic_cast<BspLeaf *>(tData.mNode); 
     1008                BspLeaf *leaf = static_cast<BspLeaf *>(tData.mNode); 
    10091009         
    10101010                BspViewCell *viewCell; 
     
    10171017                {        
    10181018                        // add predefined view cell to leaf 
    1019                         viewCell = dynamic_cast<BspViewCell *>(tData.mViewCell); 
     1019                        viewCell = static_cast<BspViewCell *>(tData.mViewCell); 
    10201020 
    10211021                        // out of bounds cell can be handled as any other view cell, 
     
    11541154                if (DotProd((*it)->GetNormal(), splitPlane.mNormal) > 0) 
    11551155                { 
    1156                         backData.mViewCell = dynamic_cast<ViewCellLeaf *>((*it)->mParent); 
     1156                        backData.mViewCell = static_cast<ViewCellLeaf *>((*it)->mParent); 
    11571157                        foundBack = true; 
    11581158                } 
    11591159                else 
    11601160                { 
    1161                         frontData.mViewCell = dynamic_cast<ViewCellLeaf *>((*it)->mParent); 
     1161                        frontData.mViewCell = static_cast<ViewCellLeaf *>((*it)->mParent); 
    11621162                        foundFront = true; 
    11631163                } 
     
    11731173        mStat.nodes += 2; 
    11741174         
    1175         BspLeaf *leaf = dynamic_cast<BspLeaf *>(tData.mNode);    
     1175        BspLeaf *leaf = static_cast<BspLeaf *>(tData.mNode);     
    11761176         
    11771177        // select subdivision plane 
     
    19721972                else  
    19731973                { 
    1974                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     1974                        BspInterior *interior = static_cast<BspInterior *>(node); 
    19751975 
    19761976                        nodeStack.push(interior->GetBack()); 
     
    19901990{ 
    19911991        // the node became a leaf -> evaluate stats for leafs 
    1992         BspLeaf *leaf = dynamic_cast<BspLeaf *>(data.mNode); 
     1992        BspLeaf *leaf = static_cast<BspLeaf *>(data.mNode); 
    19931993 
    19941994        // store maximal and minimal depth 
     
    20552055                if (!node->IsLeaf())  
    20562056                { 
    2057                         BspInterior *in = dynamic_cast<BspInterior *>(node); 
     2057                        BspInterior *in = static_cast<BspInterior *>(node); 
    20582058                         
    20592059                        Plane3 splitPlane = in->GetPlane(); 
     
    20972097                } else // reached leaf => intersection with view cell 
    20982098                { 
    2099                         BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 
     2099                        BspLeaf *leaf = static_cast<BspLeaf *>(node); 
    21002100       
    21012101                        if (!leaf->mViewCell->Mailed()) 
     
    21542154                if (!node->IsLeaf())   
    21552155                { 
    2156                         BspInterior *in = dynamic_cast<BspInterior *>(node); 
     2156                        BspInterior *in = static_cast<BspInterior *>(node); 
    21572157 
    21582158                        Plane3 splitPlane = in->GetPlane(); 
     
    22022202                { 
    22032203                        // reached leaf => intersection with view cell 
    2204                         BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 
     2204                        BspLeaf *leaf = static_cast<BspLeaf *>(node); 
    22052205                 
    22062206                        if (!leaf->mViewCell->Mailed())  
     
    22462246                if (node->IsLeaf())  
    22472247                { 
    2248                         ViewCellLeaf *viewCell = dynamic_cast<BspLeaf *>(node)->mViewCell; 
     2248                        ViewCellLeaf *viewCell = static_cast<BspLeaf *>(node)->mViewCell; 
    22492249 
    22502250                        if (!viewCell->Mailed())  
     
    22562256                else  
    22572257                { 
    2258                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     2258                        BspInterior *interior = static_cast<BspInterior *>(node); 
    22592259 
    22602260                        nodeStack.push(interior->GetFront()); 
     
    23722372                if (n) 
    23732373                { 
    2374                         BspInterior *interior = dynamic_cast<BspInterior *>(n); 
    2375                         Plane3 halfSpace = dynamic_cast<BspInterior *>(interior)->GetPlane(); 
     2374                        BspInterior *interior = static_cast<BspInterior *>(n); 
     2375                        Plane3 halfSpace = static_cast<BspInterior *>(interior)->GetPlane(); 
    23762376 
    23772377            if (interior->GetBack() != lastNode) 
     
    24032403                        continue; 
    24042404 
    2405                 BspViewCell *bspVc = dynamic_cast<BspViewCell *>(*it); 
     2405                BspViewCell *bspVc = static_cast<BspViewCell *>(*it); 
    24062406                vector<BspLeaf *>::const_iterator bit, bit_end = bspVc->mLeaves.end(); 
    24072407 
     
    25922592                                if (isAdjacent) 
    25932593                                {        
    2594                                         neighbors.push_back(dynamic_cast<BspLeaf *>(node)); 
     2594                                        neighbors.push_back(static_cast<BspLeaf *>(node)); 
    25952595                                } 
    25962596                        } 
     
    25982598                else 
    25992599                { 
    2600                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     2600                        BspInterior *interior = static_cast<BspInterior *>(node); 
    26012601 
    26022602                        const int cf = Polygon3::ClassifyPlane(nodeGeom.GetPolys(), 
     
    26602660                { 
    26612661                        if ( (!onlyUnmailed || !node->Mailed()) ) 
    2662                                 return dynamic_cast<BspLeaf *>(node); 
     2662                                return static_cast<BspLeaf *>(node); 
    26632663                } 
    26642664                else  
    26652665                { 
    2666                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     2666                        BspInterior *interior = static_cast<BspInterior *>(node); 
    26672667 
    26682668                        // random decision 
     
    28292829 
    28302830                iit = ray->mViewCells.begin(); 
    2831                 BspViewCell *bspVc = dynamic_cast<BspViewCell *>(*(iit ++)); 
     2831                BspViewCell *bspVc = static_cast<BspViewCell *>(*(iit ++)); 
    28322832                BspLeaf *leaf = bspVc->mLeaves[0]; 
    28332833                 
     
    28382838                        // next pair 
    28392839                        BspLeaf *prevLeaf = leaf; 
    2840                         bspVc = dynamic_cast<BspViewCell *>(*iit); 
     2840                        bspVc = static_cast<BspViewCell *>(*iit); 
    28412841            leaf = bspVc->mLeaves[0]; 
    28422842 
     
    33403340                if (node->IsLeaf())  
    33413341                { 
    3342                         viewcell = dynamic_cast<BspLeaf *>(node)->mViewCell; 
     3342                        viewcell = static_cast<BspLeaf *>(node)->mViewCell; 
    33433343                        break; 
    33443344                }  
     
    33463346                { 
    33473347 
    3348                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     3348                        BspInterior *interior = static_cast<BspInterior *>(node); 
    33493349 
    33503350                        // random decision 
     
    33753375        if (node->IsLeaf()) 
    33763376        { 
    3377                 BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 
     3377                BspLeaf *leaf = static_cast<BspLeaf *>(node); 
    33783378                ViewCell *viewCell = mViewCellsTree->GetActiveViewCell(leaf->GetViewCell()); 
    33793379 
     
    33843384        else 
    33853385        { 
    3386                 BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     3386                BspInterior *interior = static_cast<BspInterior *>(node); 
    33873387         
    33883388                Plane3 plane = interior->GetPlane(); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r2015 r2017  
    238238                mEvaluationSamplingType = SamplingStrategy::REVERSE_OBJECT_BASED_DISTRIBUTION; 
    239239        } 
    240         /*else if (strcmp(buf, "interior") == 0) 
    241         { 
    242                 mEvaluationSamplingType = SamplingStrategy::OBJECTS_INTERIOR_DISTRIBUTION; 
    243         }*/ 
    244240        else 
    245241        { 
     
    311307 
    312308 
     309ViewCell *ViewCellsManager::GetViewCellById(const int id) 
     310{ 
     311        ViewCellContainer::const_iterator vit, vit_end = mViewCells.end(); 
     312 
     313        for (vit = mViewCells.begin(); vit != vit_end; ++ vit) 
     314        { 
     315                if ((*vit)->GetId() == id) 
     316                        return (*vit); 
     317        } 
     318        return NULL; 
     319} 
     320 
     321 
     322bool ViewCellsManager::ExportRandomViewCells(const string &filename, 
     323                                                                                         const vector<ViewCellPoints *> &viewCells) 
     324{ 
     325        std::ofstream outStream; 
     326        outStream.open(filename.c_str()); 
     327 
     328        vector<ViewCellPoints *>::const_iterator vit, vit_end = viewCells.end(); 
     329     
     330        for (vit = viewCells.begin(); vit != vit_end; ++ vit) 
     331        { 
     332                ViewCell *vc = (*vit)->first; 
     333 
     334                outStream << "v " << vc->GetId() << endl; 
     335 
     336                SimpleRayContainer viewPoints; 
     337         
     338                SimpleRayContainer::const_iterator pit, pit_end = (*vit)->second.end(); 
     339 
     340                for (pit = (*vit)->second.begin(); pit != pit_end; ++ pit) 
     341                { 
     342                        const Vector3 pt = (*pit).mOrigin; 
     343                        const Vector3 dir = (*pit).mDirection; 
     344 
     345                        outStream << "p " << pt.x  << " " << pt.y  << " " << pt.z  
     346                                      << " "  << dir.x << " " << dir.y << " " << dir.z << endl; 
     347                } 
     348        } 
     349 
     350        return true; 
     351} 
     352 
     353 
     354bool ViewCellsManager::GenerateRandomViewCells(vector<ViewCellPoints *> &viewCells, 
     355                                                                                           const int nViewCells, 
     356                                                                                           const int nViewPoints) 
     357{ 
     358        ViewCellContainer rViewCells; 
     359 
     360        cout << "generating " << nViewCells << " random view cells" << endl; 
     361        GenerateRandomViewCells(rViewCells, nViewCells); 
     362 
     363        cout << "finished" << endl; 
     364 
     365        //for (int i = 0; i < viewCells.size(); ++ i) 
     366        //      cout << "vc " << i << ": " << viewCells[i]->GetId() << endl; 
     367 
     368        cout << "generating " << nViewPoints << " view points per view cell" << endl; 
     369        ViewCellContainer::const_iterator vit, vit_end = rViewCells.end(); 
     370     
     371        for (vit = rViewCells.begin(); vit != vit_end; ++ vit) 
     372        { 
     373                ViewCell *vc = *vit; 
     374 
     375                ViewCellPoints *vcPts = new ViewCellPoints(); 
     376                viewCells.push_back(vcPts); 
     377 
     378                vcPts->first = vc; 
     379 
     380                SimpleRayContainer viewPoints; 
     381                // generate random view points 
     382                GenerateViewPoints(vc, nViewPoints, viewPoints); 
     383                 
     384                SimpleRayContainer::const_iterator pit, pit_end = viewPoints.end(); 
     385 
     386                for (pit = viewPoints.begin(); pit != pit_end; ++ pit) 
     387                { 
     388                        vcPts->second.push_back(*pit);   
     389                } 
     390        } 
     391 
     392        return true; 
     393} 
     394 
     395 
     396bool ViewCellsManager::ImportRandomViewCells(const string &filename,  
     397                                                                                         vector<ViewCellPoints *> &viewCells) 
     398{ 
     399        ifstream inStream(filename.c_str()); 
     400        if (!inStream.is_open()) 
     401                return false; 
     402 
     403        ViewCellPoints *currentViewCell = NULL; 
     404 
     405        string buf; 
     406        while (!(getline(inStream, buf)).eof()) 
     407        { 
     408                switch (buf[0]) 
     409                { 
     410                case 'v': 
     411                        { 
     412                                int id; 
     413                                sscanf(buf.c_str(), "v %d", &id); 
     414                         
     415                                currentViewCell = new ViewCellPoints(); 
     416                                currentViewCell->first = GetViewCellById(id); 
     417                                                 
     418                                viewCells.push_back(currentViewCell); 
     419                                break; 
     420                        } 
     421                case 'p': 
     422                        { 
     423                                Vector3 pt, dir; 
     424                                sscanf(buf.c_str(), "p %f %f %f %f %f %f", &pt.x, &pt.y, &pt.z, &dir.x, &dir.y, &dir.z); 
     425                                 
     426                                SimpleRay ray(pt, dir, 0, 1); 
     427                                currentViewCell->second.push_back(ray); 
     428                                break; 
     429                        } 
     430                default: 
     431                        break; 
     432                } 
     433        } 
     434 
     435        return true; 
     436} 
     437 
     438 
     439bool ViewCellsManager::GenerateViewPoints(ViewCell *viewCell,  
     440                                                                                  const int numViewPoints, 
     441                                                                                  SimpleRayContainer &viewPoints) 
     442{ 
     443        bool success = true; 
     444        int generatedPts = 0; 
     445        int i = 0; 
     446 
     447        while (generatedPts < numViewPoints) 
     448        { 
     449                SimpleRay pt; 
     450 
     451                if (GenerateViewPoint(viewCell, pt)) 
     452                { 
     453                        ++ generatedPts; 
     454                        viewPoints.push_back(pt); 
     455                } 
     456 
     457                // savety criterium 
     458                if (++ i > numViewPoints + 100000) 
     459                { 
     460                        return false; 
     461                } 
     462        } 
     463         
     464        return true; 
     465} 
     466 
     467 
     468bool ViewCellsManager::GenerateViewPoint(ViewCell *viewCell,  
     469                                                                                 SimpleRay &ray) 
     470{ 
     471        // do not use this function since it could return different viewpoints for 
     472        // different executions of the algorithm 
     473        int tries = 0; 
     474        Vector3 viewPoint, direction; 
     475        const int maxTries = 100; 
     476 
     477        while (1)  
     478        { 
     479                // hack 
     480                if (!viewCell->GetMesh()) 
     481                        CreateMesh(viewCell); 
     482 
     483        Mesh *mesh = viewCell->GetMesh(); 
     484                AxisAlignedBox3 box = mesh->mBox; 
     485                //cout <<"box: " << box << endl; 
     486                /*Vector3 pVector = Vector3(halton.GetNumber(1), 
     487                                                                  halton.GetNumber(2), 
     488                                                                  halton.GetNumber(3));*/ 
     489 
     490                Vector3 pVector = Vector3(Random(1.0f), 
     491                                                                  Random(1.0f), 
     492                                                                  Random(1.0f)); 
     493 
     494                viewPoint =  box.GetPoint(pVector); 
     495         
     496                //const Vector3 dVector = Vector3(2 * M_PI * halton.GetNumber(4), M_PI*halton.GetNumber(5),0.0f); 
     497                const Vector3 dVector = Vector3(2 * M_PI * Random(1.0f), M_PI * Random(1.0f), 0.0f); 
     498                direction = Normalize(Vector3(sin(dVector.x), 0.0f, cos(dVector.x))); 
     499                //halton.GenerateNext(); 
     500 
     501                //cout << "vp: " << viewPoint << endl; 
     502                //cout << "dir: " << direction << endl; 
     503 
     504                ViewCell *v = GetViewCell(viewPoint); 
     505 
     506                if (v && v->GetValid()) 
     507                { 
     508                        //cout << "validating view point" << endl; 
     509 
     510                        mPreprocessor->GetRenderer()->mViewPoint = viewPoint; 
     511                        mPreprocessor->GetRenderer()->mViewDirection = direction; 
     512 
     513                        if (mPreprocessor->GetRenderer()->ValidViewPoint()) 
     514                        { 
     515                                cout << "view point valid" << endl; 
     516                                break; 
     517                        } 
     518                } 
     519 
     520                // generate a new vector 
     521                //halton.GenerateNext(); 
     522 
     523                //if (!box.IsInside(viewPoint)) 
     524                //      cout << "error!" << endl; 
     525                if (++ tries > maxTries) 
     526                        return false; 
     527        } 
     528 
     529        ray = SimpleRay(viewPoint, direction, 0, 1); 
     530        //cout << "view point generated: " << viewPoint << " " << direction << endl; 
     531 
     532        return true; 
     533} 
     534 
     535 
     536bool ViewCellsManager::IsValidViewSpace(ViewCell *vc) 
     537{ 
     538        SimpleRay simpleRay; 
     539        //check if view point can be generated 
     540        return GenerateViewPoint(vc, simpleRay); 
     541} 
     542 
     543 
     544bool ViewCellsManager::GenerateRandomViewCells(ViewCellContainer &viewCells,  
     545                                                                                           const int numViewCells) 
     546{ 
     547        int generatedViewCells = 0; 
     548        //HaltonSequence halton; 
     549        //float r[1]; 
     550 
     551        ViewCell::NewMail(); 
     552 
     553        while (generatedViewCells < numViewCells) 
     554        { 
     555                // savety criterium 
     556                const int tries = 100000 + generatedViewCells; 
     557                int i = 0; 
     558 
     559                // generate next view cell 
     560                while (1) 
     561                { 
     562                        //halton.GetNext(1, r); 
     563                        //const int idx = (int)(r[0] * mViewCells.size() - 1.0f); 
     564                        const int idx = (int)RandomValue(0.0f, (float)mViewCells.size() - 0.5f); 
     565                         
     566                        ViewCell *viewCell = GetViewCell(idx); 
     567 
     568                        if (!viewCell->Mailed()) 
     569                        { 
     570                                viewCell->Mail(); 
     571 
     572                                // check for valid view space 
     573                                if (IsValidViewSpace(viewCell)) 
     574                                { 
     575                                        // valid view cell found 
     576                                        viewCells.push_back(viewCell); 
     577 
     578                        ++ generatedViewCells; 
     579                                        //cout << "view cell " << generatedViewCells << " generated: " << viewCell->GetId() << endl;     
     580                                        break; 
     581                                } 
     582                                else 
     583                                { 
     584                                        cout << "error: invalid view cell " << generatedViewCells << " generated: " << viewCell->GetId() << endl;        
     585                                } 
     586                        } 
     587 
     588                        if (++ i == tries) // no new view cell fond 
     589                        { 
     590                                cerr << "big error! no view cell found" << endl; 
     591                                return false; 
     592                        }                
     593                }                        
     594        } 
     595 
     596        return true; 
     597} 
     598 
     599 
    313600ViewCellsManager::~ViewCellsManager() 
    314601{ 
     
    575862                mRenderer->RenderScene(); 
    576863                SimulationStatistics ss; 
    577                 dynamic_cast<RenderSimulator *>(mRenderer)->GetStatistics(ss); 
     864                static_cast<RenderSimulator *>(mRenderer)->GetStatistics(ss); 
    578865 
    579866                Debug << ss << endl; 
     
    16161903                        if ((*oit)->Type() == Intersectable::TRANSFORMED_MESH_INSTANCE) 
    16171904                        { 
    1618                                 TransformedMeshInstance *mit = dynamic_cast<TransformedMeshInstance *>(*oit); 
     1905                                TransformedMeshInstance *mit = static_cast<TransformedMeshInstance *>(*oit); 
    16191906                                mesh = MeshManager::GetSingleton()->CreateResource(); 
    16201907                                mit->GetTransformedMesh(*mesh); 
     
    16221909                        else if ((*oit)->Type() == Intersectable::MESH_INSTANCE) 
    16231910                        { 
    1624                                 MeshInstance *mit = dynamic_cast<MeshInstance *>(*oit); 
     1911                                MeshInstance *mit = static_cast<MeshInstance *>(*oit); 
    16251912                                mesh = mit->GetMesh(); 
    16261913                        } 
     
    26082895        for (lit = leaves.begin(); lit != lit_end; ++ lit) 
    26092896        { 
    2610                 dynamic_cast<ViewCellLeaf *>(*lit)->SetActiveViewCell(vc); 
     2897                static_cast<ViewCellLeaf *>(*lit)->SetActiveViewCell(vc); 
    26112898        } 
    26122899} 
     
    26482935                for (it = objects.begin(); it != it_end; ++ it) 
    26492936                { 
    2650                         MeshInstance *mi = dynamic_cast<MeshInstance *>(*it); 
     2937                        MeshInstance *mi = static_cast<MeshInstance *>(*it); 
    26512938                        const AxisAlignedBox3 box = mi->GetBox(); 
    26522939 
     
    26712958                for (it = objects.begin(); it != it_end; ++ it) 
    26722959                {        
    2673                         MeshInstance *mi = dynamic_cast<MeshInstance *>(*it); 
     2960                        MeshInstance *mi = static_cast<MeshInstance *>(*it); 
    26742961                        const AxisAlignedBox3 box = mi->GetBox(); 
    26752962                        Vector3 bmin = box.Min(); 
     
    32523539        //-- interior node => propagate pvs up the tree 
    32533540 
    3254         ViewCellInterior *interior = dynamic_cast<ViewCellInterior *>(root); 
     3541        ViewCellInterior *interior = static_cast<ViewCellInterior *>(root); 
    32553542 
    32563543        // reset interior pvs 
     
    39204207 
    39214208        Mesh *mesh = MeshManager::GetSingleton()->CreateResource(); 
    3922  
     4209         
    39234210        IncludeNodeGeomInMesh(geom, *mesh); 
     4211        mesh->ComputeBoundingBox(); 
     4212 
    39244213        vc->SetMesh(mesh); 
    39254214} 
     
    41014390        if (root->IsLeaf()) 
    41024391        { 
    4103                 BspLeaf *leaf = dynamic_cast<BspLeaf *>(root); 
     4392                BspLeaf *leaf = static_cast<BspLeaf *>(root); 
    41044393                leaf->GetViewCell()->SetMergeCost(0.0f); 
    41054394                return leaf->GetViewCell(); 
    41064395        } 
    41074396         
    4108         BspInterior *interior = dynamic_cast<BspInterior *>(root); 
     4397        BspInterior *interior = static_cast<BspInterior *>(root); 
    41094398        ViewCellInterior *viewCellInterior = new ViewCellInterior(); 
    41104399                 
     
    42434532 
    42444533                for (int i = 0; i < leafOut; ++ i) 
    4245                         kdLeaves.push_back(dynamic_cast<KdLeaf *>(mKdTree->GetRandomLeaf())); 
     4534                        kdLeaves.push_back(static_cast<KdLeaf *>(mKdTree->GetRandomLeaf())); 
    42464535 
    42474536                for (int i = 0; i < kdLeaves.size(); ++ i) 
     
    44064695        for (it = leaves.begin(); it != it_end; ++ it) 
    44074696        { 
    4408                 KdViewCell *kdVc = dynamic_cast<KdViewCell *>(*it); 
     4697                KdViewCell *kdVc = static_cast<KdViewCell *>(*it); 
    44094698                exporter->ExportBox(mKdTree->GetBox(kdVc->mLeaves[0])); 
    44104699        } 
     
    47465035 
    47475036        SimulationStatistics ss; 
    4748         dynamic_cast<RenderSimulator *>(mRenderer)->GetStatistics(ss); 
     5037        static_cast<RenderSimulator *>(mRenderer)->GetStatistics(ss); 
    47495038    Debug << "render time before refine\n\n" << ss << endl; 
    47505039 
     
    48265115 
    48275116        cout << "\nview cells partition render time before compress" << endl << endl;; 
    4828         dynamic_cast<RenderSimulator *>(mRenderer)->RenderScene(); 
     5117        static_cast<RenderSimulator *>(mRenderer)->RenderScene(); 
    48295118        SimulationStatistics ss; 
    4830         dynamic_cast<RenderSimulator *>(mRenderer)->GetStatistics(ss); 
     5119        static_cast<RenderSimulator *>(mRenderer)->GetStatistics(ss); 
    48315120        cout << ss << endl; 
    48325121         
     
    48575146        if (root->IsLeaf()) 
    48585147        { 
    4859                 BspLeaf *leaf = dynamic_cast<BspLeaf *>(root); 
     5148                BspLeaf *leaf = static_cast<BspLeaf *>(root); 
    48605149                leaf->GetViewCell()->SetMergeCost(0.0f); 
    48615150                return leaf->GetViewCell(); 
     
    48635152         
    48645153         
    4865         BspInterior *interior = dynamic_cast<BspInterior *>(root); 
     5154        BspInterior *interior = static_cast<BspInterior *>(root); 
    48665155        ViewCellInterior *viewCellInterior = new ViewCellInterior(); 
    48675156                 
     
    50955384                for (vit = leaves.begin(); vit != vit_end; ++ vit) 
    50965385                        {        
    5097                                 BspLeaf *vcLeaf = dynamic_cast<BspViewCell *>(*vit)->mLeaves[0]; 
     5386                                BspLeaf *vcLeaf = static_cast<BspViewCell *>(*vit)->mLeaves[0]; 
    50985387                                VssRayContainer::const_iterator rit, rit_end = vcLeaf->mVssRays.end(); 
    50995388 
     
    53875676                for (int j = 0; j < (int)leaves.size(); ++ j) 
    53885677                { 
    5389                         BspLeaf *leaf = dynamic_cast<BspViewCell *>(leaves[i])->mLeaves[0]; 
     5678                        BspLeaf *leaf = static_cast<BspViewCell *>(leaves[i])->mLeaves[0]; 
    53905679 
    53915680                        if (i != j) 
    53925681                        { 
    5393                                 BspLeaf *leaf2 =dynamic_cast<BspViewCell *>(leaves[j])->mLeaves[0]; 
     5682                                BspLeaf *leaf2 =static_cast<BspViewCell *>(leaves[j])->mLeaves[0]; 
    53945683                                const int dist = mVspBspTree->TreeDistance(leaf, leaf2); 
    53955684                                 
     
    54225711         
    54235712        Mesh *mesh = MeshManager::GetSingleton()->CreateResource(); 
     5713         
    54245714        IncludeNodeGeomInMesh(geom, *mesh); 
     5715        mesh->ComputeBoundingBox(); 
    54255716 
    54265717        vc->SetMesh(mesh); 
     
    55005791{ 
    55015792        // TODO: do I still need this here? 
    5502         if (0) 
    5503                 mVspBspTree->RepairViewCellsLeafLists(); 
     5793        if (0) mVspBspTree->RepairViewCellsLeafLists(); 
    55045794} 
    55055795 
     
    57486038 
    57496039        cout << "\nview cells partition render time before compress" << endl << endl; 
    5750         dynamic_cast<RenderSimulator *>(mRenderer)->RenderScene(); 
     6040        static_cast<RenderSimulator *>(mRenderer)->RenderScene(); 
    57516041        SimulationStatistics ss; 
    5752         dynamic_cast<RenderSimulator *>(mRenderer)->GetStatistics(ss); 
     6042        static_cast<RenderSimulator *>(mRenderer)->GetStatistics(ss); 
    57536043        cout << ss << endl; 
    57546044         
     
    57826072        if (root->IsLeaf()) 
    57836073        { 
    5784                 VspLeaf *leaf = dynamic_cast<VspLeaf *>(root); 
     6074                VspLeaf *leaf = static_cast<VspLeaf *>(root); 
    57856075                leaf->GetViewCell()->SetMergeCost(0.0f); 
    57866076                return leaf->GetViewCell(); 
    57876077        } 
    57886078         
    5789         VspInterior *interior = dynamic_cast<VspInterior *>(root); 
     6079        VspInterior *interior = static_cast<VspInterior *>(root); 
    57906080        ViewCellInterior *viewCellInterior = new ViewCellInterior(); 
    57916081                 
     
    58616151        for (it = leaves.begin(); it != it_end; ++ it) 
    58626152        { 
    5863                 VspViewCell *vspVc = dynamic_cast<VspViewCell *>(*it); 
     6153                VspViewCell *vspVc = static_cast<VspViewCell *>(*it); 
    58646154                VspLeaf *l = vspVc->mLeaves[0]; 
    58656155 
     
    59276217                        ObjectPvsEntry entry = pit.Next(); 
    59286218                                 
    5929                         BvhNode *node = dynamic_cast<BvhNode *>(entry.mObject); 
     6219                        BvhNode *node = static_cast<BvhNode *>(entry.mObject); 
    59306220                         
    59316221                        // hack!! 
     
    61656455                        for (vit = leaves.begin(); vit != vit_end; ++ vit) 
    61666456                        { 
    6167                                 VspLeaf *vcLeaf = dynamic_cast<VspViewCell *>(*vit)->mLeaves[0]; 
     6457                                VspLeaf *vcLeaf = static_cast<VspViewCell *>(*vit)->mLeaves[0]; 
    61686458                                VssRayContainer::const_iterator rit, rit_end = vcLeaf->mVssRays.end(); 
    61696459 
     
    63116601void VspOspViewCellsManager::CreateMesh(ViewCell *vc) 
    63126602{ 
    6313         // matt: TODO 
    63146603        Mesh *mesh = MeshManager::GetSingleton()->CreateResource(); 
    6315  
     6604         
    63166605        ViewCellContainer leaves; 
    63176606        mViewCellsTree->CollectLeaves(vc, leaves); 
     
    63216610    for (it = leaves.begin(); it != it_end; ++ it) 
    63226611        { 
    6323                 VspLeaf *leaf = dynamic_cast<VspViewCell *>(*it)->mLeaves[0]; 
     6612                VspLeaf *leaf = static_cast<VspViewCell *>(*it)->mLeaves[0]; 
    63246613                const AxisAlignedBox3 box = mHierarchyManager->GetVspTree()->GetBoundingBox(leaf); 
    63256614        IncludeBoxInMesh(box, *mesh); 
    63266615        } 
    63276616 
     6617        mesh->ComputeBoundingBox(); 
     6618 
    63286619        vc->SetMesh(mesh); 
    63296620} 
     
    63496640    for (it = leaves.begin(); it != it_end; ++ it) 
    63506641        { 
    6351                 VspLeaf *leaf = dynamic_cast<VspViewCell *>(*it)->mLeaves[0]; 
     6642                VspLeaf *leaf = static_cast<VspViewCell *>(*it)->mLeaves[0]; 
    63526643                 
    63536644                const AxisAlignedBox3 box = mHierarchyManager->GetVspTree()->GetBoundingBox(leaf); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h

    r2015 r2017  
    7777}; 
    7878 
     79typedef pair<ViewCell *, SimpleRayContainer> ViewCellPoints; 
    7980 
    8081/**     Manages different higher order operations on the view cells. 
     
    513514        virtual void CompressViewCells(); 
    514515 
     516        ViewCell *GetViewCellById(const int id); 
     517 
     518        /** Returns number of view cells. 
     519        */ 
    515520        int GetNumViewCells() const; 
    516521 
    517         ///////////////////////////// 
     522        bool GenerateRandomViewCells(ViewCellContainer &viewCells,  
     523                                                                 const int numViewCells); 
     524 
     525        bool GenerateRandomViewCells(vector<ViewCellPoints *> &viewCells, 
     526                                                                 const int nViewCells, 
     527                                                                 const int nViewPoints); 
     528 
     529 
     530        bool GenerateViewPoints(ViewCell *viewCell,  
     531                                                        const int numViewPoints, 
     532                                                        SimpleRayContainer &viewPoints); 
     533 
     534        bool ImportRandomViewCells(const string &filename,  
     535                                                           vector<ViewCellPoints *> &viewCells); 
     536 
     537 
     538        bool ExportRandomViewCells(const string &filename, 
     539                                                           const vector<ViewCellPoints *> &viewCells); 
     540 
     541        bool GenerateViewPoint(ViewCell *viewCell, SimpleRay &ray); 
     542 
     543        bool IsValidViewSpace(ViewCell *vc); 
     544 
     545        ////////////// 
    518546        // static members 
    519547         
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsParser.cpp

    r2005 r2017  
    660660        if (mCurrentBspNode) // replace front or (if not NULL) back child 
    661661        { 
    662                 BspInterior *interior = dynamic_cast<BspInterior *>(mCurrentBspNode); 
     662                BspInterior *interior = static_cast<BspInterior *>(mCurrentBspNode); 
    663663 
    664664                leaf = new BspLeaf(interior); 
     
    701701                 
    702702                //ViewCellsMap::iterator vit = mViewCells.find(viewCellId); 
    703 //              BspViewCell *viewCell = dynamic_cast<BspViewCell *>((*vit).second); 
    704                 BspViewCell *viewCell = dynamic_cast<BspViewCell *>(*vit); 
     703//              BspViewCell *viewCell = static_cast<BspViewCell *>((*vit).second); 
     704                BspViewCell *viewCell = static_cast<BspViewCell *>(*vit); 
    705705                if (viewCell->GetId() == viewCellId) 
    706706                { 
     
    746746        if (mCurrentBspNode) // replace NULL child of parent with current node 
    747747        { 
    748                 BspInterior *parent = dynamic_cast<BspInterior *>(mCurrentBspNode); 
     748                BspInterior *parent = static_cast<BspInterior *>(mCurrentBspNode); 
    749749 
    750750                parent->ReplaceChildLink(NULL, interior); 
     
    825825                        {        
    826826                                ViewCellInterior *interior =  
    827                                         dynamic_cast<ViewCellInterior *>(mCurrentViewCell); 
     827                                        static_cast<ViewCellInterior *>(mCurrentViewCell); 
    828828                                interior->SetupChildLink(viewCell); 
    829829                        } 
     
    10221022        if (mCurrentVspNode) // replace front or (if not NULL) back child 
    10231023        { 
    1024                 VspInterior *interior = dynamic_cast<VspInterior *>(mCurrentVspNode); 
     1024                VspInterior *interior = static_cast<VspInterior *>(mCurrentVspNode); 
    10251025                leaf = new VspLeaf(interior); 
    10261026                interior->ReplaceChildLink(NULL, leaf); 
     
    10651065                        Debug << "error: view cell " << viewCellId << " not found" << endl; 
    10661066         
    1067                 //VspViewCell *viewCell = dynamic_cast<VspViewCell *>((*vit).second); 
    1068                 VspViewCell *viewCell = dynamic_cast<VspViewCell *>(*vit); 
     1067                //VspViewCell *viewCell = static_cast<VspViewCell *>((*vit).second); 
     1068                VspViewCell *viewCell = static_cast<VspViewCell *>(*vit); 
    10691069                 
    10701070                if (viewCell->GetId() == viewCellId) 
     
    11091109        if (mCurrentVspNode) // replace NULL child of parent with current node 
    11101110        { 
    1111                 VspInterior *parent = dynamic_cast<VspInterior *>(mCurrentVspNode); 
     1111                VspInterior *parent = static_cast<VspInterior *>(mCurrentVspNode); 
    11121112 
    11131113                parent->ReplaceChildLink(NULL, interior); 
     
    11611161        if (mCurrentOspNode) // replace NULL child of parent with current node 
    11621162        { 
    1163                 KdInterior *parent = dynamic_cast<KdInterior *>(mCurrentOspNode); 
     1163                KdInterior *parent = static_cast<KdInterior *>(mCurrentOspNode); 
    11641164                parent->ReplaceChildLink(NULL, interior); 
    11651165                interior->mParent = parent; 
     
    11861186void ViewCellsParseHandlers::StartOspLeaf(AttributeList& attributes) 
    11871187{ 
    1188         KdLeaf * leaf = new KdLeaf(dynamic_cast<KdInterior *>(mCurrentOspNode), NULL); 
     1188        KdLeaf * leaf = new KdLeaf(static_cast<KdInterior *>(mCurrentOspNode), NULL); 
    11891189 
    11901190        if (mCurrentOspNode) 
    11911191        { 
    11921192                 // replace front or (if not NULL) back child 
    1193                 dynamic_cast<KdInterior *>(mCurrentOspNode)->ReplaceChildLink(NULL, leaf); 
     1193                static_cast<KdInterior *>(mCurrentOspNode)->ReplaceChildLink(NULL, leaf); 
    11941194        } 
    11951195        else 
     
    12331233        if (mCurrentBvhNode) // replace front or (if not NULL) back child 
    12341234        { 
    1235                 BvhInterior *interior = dynamic_cast<BvhInterior *>(mCurrentBvhNode); 
     1235                BvhInterior *interior = static_cast<BvhInterior *>(mCurrentBvhNode); 
    12361236                leaf = new BvhLeaf(box, interior, (int)objects.size()); 
    12371237                interior->ReplaceChildLink(NULL, leaf); 
     
    13171317        if (mCurrentBvhNode) // replace NULL child of parent with current node 
    13181318        { 
    1319                 BvhInterior *parent = dynamic_cast<BvhInterior *>(mCurrentBvhNode); 
     1319                BvhInterior *parent = static_cast<BvhInterior *>(mCurrentBvhNode); 
    13201320                parent->ReplaceChildLink(NULL, interior); 
    13211321                interior->SetParent(parent); 
     
    13801380    } 
    13811381 
    1382   cout<<"parsing started"<<endl<<flush; 
     1382  //cout<<"parsing started"<<endl<<flush; 
    13831383 
    13841384  // 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp

    r1960 r2017  
    202202                if (!node->IsLeaf())  
    203203                { 
    204                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     204                        BspInterior *interior = static_cast<BspInterior *>(node); 
    205205                                                                 
    206206                        BspNodeGeometry *front = new BspNodeGeometry(); 
     
    220220                        if (maxPvs) 
    221221                        { 
    222                                 BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 
     222                                BspLeaf *leaf = static_cast<BspLeaf *>(node); 
    223223 
    224224                                mForcedMaterial.mDiffuseColor.b = 1.0f; 
     
    816816                if (node->IsLeaf())  
    817817                { 
    818                         ViewCell *vc = dynamic_cast<BspLeaf *>(node)->GetViewCell(); 
     818                        ViewCell *vc = static_cast<BspLeaf *>(node)->GetViewCell(); 
    819819#if 0      
    820820                        // set the mesh material according to the ray density 
     
    990990                else 
    991991                { 
    992                         BspInterior *interior = dynamic_cast<BspInterior *>(tData.mNode); 
     992                        BspInterior *interior = static_cast<BspInterior *>(tData.mNode); 
    993993 
    994994                        // add current side of split plane 
     
    11071107                if (!node->IsLeaf()) 
    11081108                { 
    1109                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     1109                        BspInterior *interior = static_cast<BspInterior *>(node); 
    11101110 
    11111111                        // bounded plane is added to the polygons 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp

    r2015 r2017  
    273273                case Intersectable::MESH_INSTANCE: 
    274274                        { 
    275                                 Mesh *mesh = dynamic_cast<MeshInstance *>(object)->GetMesh(); 
     275                                Mesh *mesh = static_cast<MeshInstance *>(object)->GetMesh(); 
    276276                                AddMeshToPolygons(mesh, polys); 
    277277                        } 
     
    279279                case Intersectable::VIEW_CELL: 
    280280                        { 
    281                                 Mesh *mesh = dynamic_cast<ViewCell *>(object)->GetMesh(); 
     281                                Mesh *mesh = static_cast<ViewCell *>(object)->GetMesh(); 
    282282                                AddMeshToPolygons(mesh, polys); 
    283283                                break; 
     
    286286                        { 
    287287                                TransformedMeshInstance *mi =  
    288                                         dynamic_cast<TransformedMeshInstance *>(object); 
     288                                        static_cast<TransformedMeshInstance *>(object); 
    289289 
    290290                                Mesh mesh; 
     
    296296                        { 
    297297                                TriangleIntersectable *intersect =  
    298                                         dynamic_cast<TriangleIntersectable *>(object); 
     298                                        static_cast<TriangleIntersectable *>(object); 
    299299 
    300300                                Polygon3 *poly = new Polygon3(intersect->GetItem()); 
     
    762762                 
    763763                Plane3 splitPlane; 
    764                 BspLeaf *leaf = dynamic_cast<BspLeaf *>(tData.mNode); 
     764                BspLeaf *leaf = static_cast<BspLeaf *>(tData.mNode); 
    765765                 
    766766                // choose next split plane 
     
    817817        if (newNode->IsLeaf()) 
    818818        { 
    819                 BspLeaf *leaf = dynamic_cast<BspLeaf *>(newNode); 
     819                BspLeaf *leaf = static_cast<BspLeaf *>(newNode); 
    820820                 
    821821                BspViewCell *viewCell = new BspViewCell(); 
     
    961961        if (newNode->IsLeaf()) 
    962962        { 
    963                 BspLeaf *leaf = dynamic_cast<BspLeaf *>(newNode); 
     963                BspLeaf *leaf = static_cast<BspLeaf *>(newNode); 
    964964 
    965965                BspViewCell *viewCell = new BspViewCell(); 
     
    10371037        VspBspTraversalData backData; 
    10381038         
    1039         BspLeaf *leaf = dynamic_cast<BspLeaf *>(splitCandidate.mParentData.mNode); 
     1039        BspLeaf *leaf = static_cast<BspLeaf *>(splitCandidate.mParentData.mNode); 
    10401040         
    10411041        // compute locally best split plane 
     
    11091109                                                                           PolygonContainer &coincident) 
    11101110{ 
    1111         BspLeaf *leaf = dynamic_cast<BspLeaf *>(tData.mNode); 
     1111        BspLeaf *leaf = static_cast<BspLeaf *>(tData.mNode); 
    11121112         
    11131113        //-- the front and back traversal data is filled with the new values 
     
    22052205                        if (node->IsLeaf()) 
    22062206                        { 
    2207                                 BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 
     2207                                BspLeaf *leaf = static_cast<BspLeaf *>(node); 
    22082208                         
    22092209                                if (!leaf->GetViewCell()->Mailed() && leaf->TreeValid()) 
     
    22152215                        else  
    22162216                        { 
    2217                                 BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     2217                                BspInterior *interior = static_cast<BspInterior *>(node); 
    22182218                         
    22192219                                BspNode *first = interior->GetFront(); 
     
    23982398                { 
    23992399                        // test if this leaf is in valid view space 
    2400                         BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 
     2400                        BspLeaf *leaf = static_cast<BspLeaf *>(node); 
    24012401                        if (leaf->TreeValid() &&  
    24022402                                (!onlyUnmailed || !leaf->Mailed()) && 
     
    24082408                else 
    24092409                { 
    2410                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     2410                        BspInterior *interior = static_cast<BspInterior *>(node); 
    24112411 
    24122412                        nodeStack.push(interior->GetBack()); 
     
    24322432{ 
    24332433        // the node became a leaf -> evaluate stats for leafs 
    2434         BspLeaf *leaf = dynamic_cast<BspLeaf *>(data.mNode); 
     2434        BspLeaf *leaf = static_cast<BspLeaf *>(data.mNode); 
    24352435 
    24362436 
     
    25082508                if (!node->IsLeaf()) 
    25092509                { 
    2510                         BspInterior *in = dynamic_cast<BspInterior *>(node); 
     2510                        BspInterior *in = static_cast<BspInterior *>(node); 
    25112511 
    25122512                        Plane3 splitPlane = in->GetPlane(); 
     
    25502550                else // reached leaf => intersection with view cell 
    25512551                { 
    2552                         BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 
     2552                        BspLeaf *leaf = static_cast<BspLeaf *>(node); 
    25532553 
    25542554                        if (!leaf->GetViewCell()->Mailed()) 
     
    26122612                        if (!onlyValid || node->TreeValid()) 
    26132613                        { 
    2614                                 ViewCellLeaf *leafVc = dynamic_cast<BspLeaf *>(node)->GetViewCell(); 
     2614                                ViewCellLeaf *leafVc = static_cast<BspLeaf *>(node)->GetViewCell(); 
    26152615 
    26162616                                ViewCell *viewCell = mViewCellsTree->GetActiveViewCell(leafVc); 
     
    26252625                else 
    26262626                { 
    2627                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     2627                        BspInterior *interior = static_cast<BspInterior *>(node); 
    26282628                 
    26292629                        nodeStack.push(interior->GetFront()); 
     
    26522652                if (node->IsLeaf()) 
    26532653        { 
    2654                         BspViewCell *viewCell = dynamic_cast<BspLeaf *>(node)->GetViewCell(); 
     2654                        BspViewCell *viewCell = static_cast<BspLeaf *>(node)->GetViewCell(); 
    26552655 
    26562656                        if (!viewCell->GetValid()) 
    26572657                        { 
    2658                                 BspViewCell *viewCell = dynamic_cast<BspLeaf *>(node)->GetViewCell(); 
     2658                                BspViewCell *viewCell = static_cast<BspLeaf *>(node)->GetViewCell(); 
    26592659         
    26602660                                ViewCellContainer leaves; 
     
    26652665                                for (it = leaves.begin(); it != it_end; ++ it) 
    26662666                                { 
    2667                                         BspLeaf *l = dynamic_cast<BspViewCell *>(*it)->mLeaf; 
     2667                                        BspLeaf *l = static_cast<BspViewCell *>(*it)->mLeaf; 
    26682668                                        l->SetViewCell(GetOrCreateOutOfBoundsCell()); 
    26692669                                        ++ mBspStats.invalidLeaves; 
     
    26772677                else 
    26782678                { 
    2679                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     2679                        BspInterior *interior = static_cast<BspInterior *>(node); 
    26802680                 
    26812681                        nodeStack.push(interior->GetFront()); 
     
    27232723                if (node->IsLeaf()) 
    27242724                { 
    2725                         BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 
     2725                        BspLeaf *leaf = static_cast<BspLeaf *>(node); 
    27262726 
    27272727                        if (!leaf->GetViewCell()->GetValid()) 
     
    27372737                else 
    27382738                { 
    2739                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     2739                        BspInterior *interior = static_cast<BspInterior *>(node); 
    27402740                 
    27412741                        nodeStack.push(interior->GetFront()); 
     
    28802880                if (n) 
    28812881                { 
    2882                         BspInterior *interior = dynamic_cast<BspInterior *>(n); 
    2883                         Plane3 halfSpace = dynamic_cast<BspInterior *>(interior)->GetPlane(); 
     2882                        BspInterior *interior = static_cast<BspInterior *>(n); 
     2883                        Plane3 halfSpace = static_cast<BspInterior *>(interior)->GetPlane(); 
    28842884 
    28852885            if (interior->GetBack() != lastNode) 
     
    30233023                        continue; 
    30243024                 
    3025                 BspViewCell *bspVc = dynamic_cast<BspViewCell *>(*it); 
     3025                BspViewCell *bspVc = static_cast<BspViewCell *>(*it); 
    30263026                vector<BspLeaf *>::const_iterator bit, bit_end = bspVc->mLeaves.end(); 
    30273027 
     
    31103110                                if (isAdjacent) 
    31113111                                {        
    3112                                         neighbors.push_back(dynamic_cast<BspLeaf *>(node)); 
     3112                                        neighbors.push_back(static_cast<BspLeaf *>(node)); 
    31133113                                } 
    31143114                        } 
     
    31163116                else 
    31173117                { 
    3118                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     3118                        BspInterior *interior = static_cast<BspInterior *>(node); 
    31193119 
    31203120                        const int cf = Polygon3::ClassifyPlane(nodeGeom.GetPolys(), 
     
    32043204                                if (isAdjacent) 
    32053205                                {        
    3206                                         neighbors.push_back(dynamic_cast<BspLeaf *>(node)); 
     3206                                        neighbors.push_back(static_cast<BspLeaf *>(node)); 
    32073207                                } 
    32083208                        } 
     
    32103210                else 
    32113211                { 
    3212                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     3212                        BspInterior *interior = static_cast<BspInterior *>(node); 
    32133213 
    32143214                        const int cf = Polygon3::ClassifyPlane(nodeGeom.GetPolys(), 
     
    32713271                if (node->IsLeaf()) 
    32723272                { 
    3273                         return dynamic_cast<BspLeaf *>(node); 
     3273                        return static_cast<BspLeaf *>(node); 
    32743274                } 
    32753275                else 
    32763276                { 
    3277                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     3277                        BspInterior *interior = static_cast<BspInterior *>(node); 
    32783278                        BspNode *next; 
    32793279                        BspNodeGeometry geom; 
     
    33243324                { 
    33253325                        if ( (!onlyUnmailed || !node->Mailed()) ) 
    3326                                 return dynamic_cast<BspLeaf *>(node); 
     3326                                return static_cast<BspLeaf *>(node); 
    33273327                } 
    33283328                else 
    33293329                { 
    3330                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     3330                        BspInterior *interior = static_cast<BspInterior *>(node); 
    33313331 
    33323332                        // random decision 
     
    34523452                if (!node->IsLeaf()) 
    34533453                { 
    3454                         BspInterior *in = dynamic_cast<BspInterior *>(node); 
     3454                        BspInterior *in = static_cast<BspInterior *>(node); 
    34553455 
    34563456                        Plane3 splitPlane = in->GetPlane(); 
     
    34993499                { 
    35003500                        // reached leaf => intersection with view cell 
    3501                         BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 
     3501                        BspLeaf *leaf = static_cast<BspLeaf *>(node); 
    35023502                        ViewCell *viewCell; 
    35033503                         
     
    35773577                return node; 
    35783578 
    3579         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     3579        BspInterior *interior = static_cast<BspInterior *>(node); 
    35803580 
    35813581        BspNode *front = CollapseTree(interior->GetFront(), collapsed); 
     
    35843584        if (front->IsLeaf() && back->IsLeaf()) 
    35853585        { 
    3586                 BspLeaf *frontLeaf = dynamic_cast<BspLeaf *>(front); 
    3587                 BspLeaf *backLeaf = dynamic_cast<BspLeaf *>(back); 
     3586                BspLeaf *frontLeaf = static_cast<BspLeaf *>(front); 
     3587                BspLeaf *backLeaf = static_cast<BspLeaf *>(back); 
    35883588 
    35893589                //-- collapse tree 
     
    36433643                if (node->IsLeaf()) 
    36443644                { 
    3645                         BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 
     3645                        BspLeaf *leaf = static_cast<BspLeaf *>(node); 
    36463646 
    36473647                        BspViewCell *viewCell = leaf->GetViewCell(); 
     
    36583658                else 
    36593659                { 
    3660                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     3660                        BspInterior *interior = static_cast<BspInterior *>(node); 
    36613661 
    36623662                        nodeStack.push(interior->GetFront()); 
     
    36993699                        if (node->IsLeaf()) 
    37003700                        { 
    3701                                 BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 
     3701                                BspLeaf *leaf = static_cast<BspLeaf *>(node); 
    37023702                         
    37033703                                if (!leaf->GetViewCell()->Mailed() && leaf->TreeValid()) 
     
    37093709                        else  
    37103710                        { 
    3711                                 BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     3711                                BspInterior *interior = static_cast<BspInterior *>(node); 
    37123712                         
    37133713                                BspNode *first = interior->GetFront(); 
     
    38373837 
    38383838                iit = ray->mViewCells.begin(); 
    3839                 BspViewCell *bspVc = dynamic_cast<BspViewCell *>(*(iit ++)); 
     3839                BspViewCell *bspVc = static_cast<BspViewCell *>(*(iit ++)); 
    38403840                BspLeaf *leaf = bspVc->mLeaves[0]; 
    38413841                 
     
    38463846                        // next pair 
    38473847                        BspLeaf *prevLeaf = leaf; 
    3848                         bspVc = dynamic_cast<BspViewCell *>(*iit); 
     3848                        bspVc = static_cast<BspViewCell *>(*iit); 
    38493849            leaf = bspVc->mLeaves[0]; // exactly one leaf 
    38503850 
     
    39293929                if (node->IsLeaf())  
    39303930                { 
    3931                         viewcell = dynamic_cast<BspLeaf *>(node)->GetViewCell(); 
     3931                        viewcell = static_cast<BspLeaf *>(node)->GetViewCell(); 
    39323932                        break; 
    39333933                }  
    39343934                else     
    39353935                {        
    3936                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     3936                        BspInterior *interior = static_cast<BspInterior *>(node); 
    39373937         
    39383938                        // random decision 
     
    39643964                        return false; 
    39653965                         
    3966                 BspInterior *in = dynamic_cast<BspInterior *>(node); 
     3966                BspInterior *in = static_cast<BspInterior *>(node); 
    39673967                                         
    39683968                if (in->GetPlane().Side(viewPoint) <= 0)  
     
    40004000                { 
    40014001            node = node->GetParent(); 
    4002                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     4002                        BspInterior *interior = static_cast<BspInterior *>(node); 
    40034003                         
    40044004                        // the parent is valid iff both leaves are valid 
     
    40214021        if (node->IsLeaf()) 
    40224022        { 
    4023                 BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 
     4023                BspLeaf *leaf = static_cast<BspLeaf *>(node); 
    40244024                ViewCell *viewCell = mViewCellsTree->GetActiveViewCell(leaf->GetViewCell()); 
    40254025 
     
    40324032        else 
    40334033        { 
    4034                 BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     4034                BspInterior *interior = static_cast<BspInterior *>(node); 
    40354035         
    40364036                Plane3 plane = interior->GetPlane(); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp

    r2015 r2017  
    268268 
    269269 
    270  
    271  
     270bool VspInterior::IsLeaf() const 
     271{  
     272        return false;  
     273} 
     274 
     275 
     276VspNode *VspInterior::GetBack()  
     277{ 
     278        return mBack; 
     279} 
     280 
     281 
     282VspNode *VspInterior::GetFront()  
     283{ 
     284        return mFront; 
     285} 
     286 
     287 
     288AxisAlignedPlane VspInterior::GetPlane() const 
     289{ 
     290        return mPlane; 
     291} 
     292 
     293 
     294float VspInterior::GetPosition() const 
     295{ 
     296        return mPlane.mPosition; 
     297} 
     298 
     299 
     300int VspInterior::GetAxis() const 
     301{ 
     302        return mPlane.mAxis; 
     303} 
    272304 
    273305 
     
    356388 
    357389 
     390ViewCellLeaf *VspLeaf::GetViewCell() const 
     391{ 
     392        return mViewCell; 
     393} 
    358394 
    359395 
     
    364400 
    365401 
     402bool VspLeaf::IsLeaf() const  
     403{  
     404        return true;  
     405} 
    366406 
    367407 
     
    665705        // todo remove dynamic cast 
    666706        VspSubdivisionCandidate *sc =  
    667                 dynamic_cast<VspSubdivisionCandidate *>(splitCandidate); 
     707                static_cast<VspSubdivisionCandidate *>(splitCandidate); 
    668708 
    669709        VspTraversalData &tData = sc->mParentData; 
     
    718758        if (newNode->IsLeaf()) // subdivision terminated 
    719759        { 
    720                 VspLeaf *leaf = dynamic_cast<VspLeaf *>(newNode); 
     760                VspLeaf *leaf = static_cast<VspLeaf *>(newNode); 
    721761                 
    722762#if 0 
     
    787827        } 
    788828         
    789         VspLeaf *leaf = dynamic_cast<VspLeaf *>(splitCandidate.mParentData.mNode); 
     829        VspLeaf *leaf = static_cast<VspLeaf *>(splitCandidate.mParentData.mNode); 
    790830 
    791831        ///////////// 
     
    882922                                                                        VspTraversalData &backData) 
    883923{ 
    884         VspLeaf *leaf = dynamic_cast<VspLeaf *>(sc.mParentData.mNode); 
     924        VspLeaf *leaf = static_cast<VspLeaf *>(sc.mParentData.mNode); 
    885925 
    886926        const VspTraversalData &tData = sc.mParentData; 
     
    14411481                if (parent) 
    14421482                { 
    1443                         parentAxis = dynamic_cast<VspInterior *>(parent)->GetAxis(); 
     1483                        parentAxis = static_cast<VspInterior *>(parent)->GetAxis(); 
    14441484                } 
    14451485 
     
    18161856                { 
    18171857                        // test if this leaf is in valid view space 
    1818                         VspLeaf *leaf = dynamic_cast<VspLeaf *>(node); 
     1858                        VspLeaf *leaf = static_cast<VspLeaf *>(node); 
    18191859 
    18201860                        if (leaf->TreeValid() &&  
     
    18271867                else 
    18281868                { 
    1829                         VspInterior *interior = dynamic_cast<VspInterior *>(node); 
     1869                        VspInterior *interior = static_cast<VspInterior *>(node); 
    18301870 
    18311871                        nodeStack.push(interior->GetBack()); 
     
    18511891{ 
    18521892        // the node became a leaf -> evaluate stats for leafs 
    1853         VspLeaf *leaf = dynamic_cast<VspLeaf *>(data.mNode); 
     1893        VspLeaf *leaf = static_cast<VspLeaf *>(data.mNode); 
    18541894 
    18551895        if (data.mPvs > mVspStats.maxPvs) 
     
    19261966                if (node->IsLeaf()) 
    19271967        { 
    1928                         BspViewCell *viewCell = dynamic_cast<VspLeaf *>(node)->GetViewCell(); 
     1968                        BspViewCell *viewCell = static_cast<VspLeaf *>(node)->GetViewCell(); 
    19291969 
    19301970                        if (!viewCell->GetValid()) 
    19311971                        { 
    1932                                 BspViewCell *viewCell = dynamic_cast<VspLeaf *>(node)->GetViewCell(); 
     1972                                BspViewCell *viewCell = static_cast<VspLeaf *>(node)->GetViewCell(); 
    19331973         
    19341974                                ViewCellContainer leaves; 
     
    19391979                                for (it = leaves.begin(); it != it_end; ++ it) 
    19401980                                { 
    1941                                         VspLeaf *l = dynamic_cast<BspViewCell *>(*it)->mLeaf; 
     1981                                        VspLeaf *l = static_cast<BspViewCell *>(*it)->mLeaf; 
    19421982                                        l->SetViewCell(GetOrCreateOutOfBoundsCell()); 
    19431983                                        ++ mVspStats.invalidLeaves; 
     
    19521992                else 
    19531993                { 
    1954                         VspInterior *interior = dynamic_cast<VspInterior *>(node); 
     1994                        VspInterior *interior = static_cast<VspInterior *>(node); 
    19551995                 
    19561996                        nodeStack.push(interior->GetFront()); 
     
    20052045                if (node->IsLeaf()) 
    20062046                { 
    2007                         VspLeaf *leaf = dynamic_cast<VspLeaf *>(node); 
     2047                        VspLeaf *leaf = static_cast<VspLeaf *>(node); 
    20082048 
    20092049                        if (!leaf->GetViewCell()->GetValid()) 
     
    20192059                else 
    20202060                { 
    2021                         VspInterior *interior = dynamic_cast<VspInterior *>(node); 
     2061                        VspInterior *interior = static_cast<VspInterior *>(node); 
    20222062                 
    20232063                        nodeStack.push(interior->GetFront()); 
     
    20512091                        if (!onlyValid || node->TreeValid()) 
    20522092                        { 
    2053                                 ViewCellLeaf *leafVc = dynamic_cast<VspLeaf *>(node)->GetViewCell(); 
     2093                                ViewCellLeaf *leafVc = static_cast<VspLeaf *>(node)->GetViewCell(); 
    20542094 
    20552095                                ViewCell *viewCell = mViewCellsTree->GetActiveViewCell(leafVc); 
     
    20642104                else 
    20652105                { 
    2066                         VspInterior *interior = dynamic_cast<VspInterior *>(node); 
     2106                        VspInterior *interior = static_cast<VspInterior *>(node); 
    20672107                 
    20682108                        nodeStack.push(interior->GetFront()); 
     
    20892129                if (node->IsLeaf()) 
    20902130                { 
    2091                         VspLeaf *leaf = dynamic_cast<VspLeaf *>(node); 
     2131                        VspLeaf *leaf = static_cast<VspLeaf *>(node); 
    20922132 
    20932133                        if (leaf != n && (!onlyUnmailed || !leaf->Mailed())) 
     
    20962136                else 
    20972137                { 
    2098                         VspInterior *interior = dynamic_cast<VspInterior *>(node); 
     2138                        VspInterior *interior = static_cast<VspInterior *>(node); 
    20992139                         
    21002140                        if (interior->GetPosition() > box.Max(interior->GetAxis())) 
     
    21342174                if (node->IsLeaf())  
    21352175                { 
    2136                         return dynamic_cast<VspLeaf *>(node); 
     2176                        return static_cast<VspLeaf *>(node); 
    21372177                }  
    21382178                else  
    21392179                { 
    2140                         VspInterior *interior = dynamic_cast<VspInterior *>(node); 
     2180                        VspInterior *interior = static_cast<VspInterior *>(node); 
    21412181                        VspNode *next; 
    21422182                         
     
    21862226                { 
    21872227                        if ( (!onlyUnmailed || !node->Mailed()) ) 
    2188                                 return dynamic_cast<VspLeaf *>(node); 
     2228                                return static_cast<VspLeaf *>(node); 
    21892229                } 
    21902230                else 
    21912231                { 
    2192                         VspInterior *interior = dynamic_cast<VspInterior *>(node); 
     2232                        VspInterior *interior = static_cast<VspInterior *>(node); 
    21932233 
    21942234                        // random decision 
     
    23362376        int axis; 
    23372377 
    2338         ViewCell::NewMail(); 
    2339          
    23402378        while (1) 
    23412379        { 
    23422380                if (!node->IsLeaf()) 
    23432381                { 
    2344                         VspInterior *in = (VspInterior *)node; 
     2382                        VspInterior *in = static_cast<VspInterior *>(node); 
    23452383                        position = in->GetPosition(); 
    23462384                        axis = in->GetAxis(); 
     
    23872425                { 
    23882426                        // compute intersection with all objects in this leaf 
    2389                         VspLeaf *leaf = (VspLeaf *)node; 
     2427                        VspLeaf *leaf = static_cast<VspLeaf *>(node); 
    23902428                        ViewCell *viewCell; 
    2391                         //                      if (0) 
    2392                         //                              viewCell = mViewCellsTree->GetActiveViewCell(leaf->GetViewCell()); 
    2393                         //                      else 
    2394  
    2395                         viewCell = leaf->GetViewCell(); 
    2396                          
     2429                        if (0) 
     2430                                viewCell = mViewCellsTree->GetActiveViewCell(leaf->GetViewCell()); 
     2431                        else 
     2432                                viewCell = leaf->GetViewCell(); 
     2433 
    23972434                        // don't have to mail if each view cell belongs to exactly one leaf 
    2398                         // $$ JB -> always mailbox so that we have less conditions 
    2399                         if (!viewCell->Mailed()) { 
    2400                           viewCell->Mail(); 
    2401                            
    2402                           viewcells.push_back(viewCell); 
    2403                           ++ hits; 
    2404                         } 
    2405                          
     2435                        if (!useMailboxing || !viewCell->Mailed()) 
     2436                        { 
     2437                                if (useMailboxing) 
     2438                                        viewCell->Mail(); 
     2439 
     2440                                viewcells.push_back(viewCell); 
     2441                                ++ hits; 
     2442                        } 
     2443 
    24062444                        // get the next node from the stack 
    24072445                        if (tStack.empty()) 
    2408                           break; 
    2409                          
     2446                                break; 
     2447 
    24102448                        entp = extp; 
    24112449                        mint = maxt; 
     
    24542492                if (!node->IsLeaf()) 
    24552493                { 
    2456                         VspInterior *in = dynamic_cast<VspInterior *>(node); 
     2494                        VspInterior *in = static_cast<VspInterior *>(node); 
    24572495                        position = in->GetPosition(); 
    24582496                        axis = in->GetAxis(); 
     
    24992537                { 
    25002538                        // compute intersection with all objects in this leaf 
    2501                         VspLeaf *leaf = dynamic_cast<VspLeaf *>(node); 
     2539                        VspLeaf *leaf = static_cast<VspLeaf *>(node); 
    25022540                        ViewCell *vc = leaf->GetViewCell(); 
    25032541 
     
    25452583                if (node->IsLeaf())  
    25462584                { 
    2547                         /*const AxisAlignedBox3 box = GetBoundingBox(dynamic_cast<VspLeaf *>(node)); 
     2585                        /*const AxisAlignedBox3 box = GetBoundingBox(static_cast<VspLeaf *>(node)); 
    25482586                        if (!box.IsInside(point)) 
    25492587                                cerr << "error, point " << point << " should be in view cell " << box << endl; 
    25502588                        */       
    2551                         viewcell = dynamic_cast<VspLeaf *>(node)->GetViewCell(); 
     2589                        viewcell = static_cast<VspLeaf *>(node)->GetViewCell(); 
    25522590                        break; 
    25532591                }  
    25542592                else     
    25552593                {        
    2556                         VspInterior *interior = dynamic_cast<VspInterior *>(node); 
     2594                        VspInterior *interior = static_cast<VspInterior *>(node); 
    25572595      
    25582596                        // random decision 
     
    25922630                        return false; 
    25932631                         
    2594                 VspInterior *in = dynamic_cast<VspInterior *>(node); 
     2632                VspInterior *in = static_cast<VspInterior *>(node); 
    25952633                                         
    25962634                if (in->GetPosition() - viewPoint[in->GetAxis()] <= 0)  
     
    26282666                { 
    26292667            node = node->GetParent(); 
    2630                         VspInterior *interior = dynamic_cast<VspInterior *>(node); 
     2668                        VspInterior *interior = static_cast<VspInterior *>(node); 
    26312669                         
    26322670                        // the parent is valid iff both leaves are valid 
     
    26502688        if (node->IsLeaf()) 
    26512689        { 
    2652                 VspLeaf *leaf = dynamic_cast<VspLeaf *>(node); 
     2690                VspLeaf *leaf = static_cast<VspLeaf *>(node); 
    26532691                ViewCell *viewCell = mViewCellsTree->GetActiveViewCell(leaf->GetViewCell()); 
    26542692 
     
    26612699        else 
    26622700        {        
    2663                 VspInterior *interior = dynamic_cast<VspInterior *>(node); 
     2701                VspInterior *interior = static_cast<VspInterior *>(node); 
    26642702         
    26652703                AxisAlignedPlane plane = interior->GetPlane(); 
     
    27312769        if (!node->IsLeaf()) 
    27322770        { 
    2733                 return (dynamic_cast<VspInterior *>(node))->GetBoundingBox();            
    2734         } 
    2735  
    2736         VspInterior *parent = dynamic_cast<VspInterior *>(node->GetParent()); 
     2771                return (static_cast<VspInterior *>(node))->GetBoundingBox();             
     2772        } 
     2773 
     2774        VspInterior *parent = static_cast<VspInterior *>(node->GetParent()); 
    27372775 
    27382776        AxisAlignedBox3 box(parent->GetBoundingBox()); 
     
    27662804                  if (node->IsLeaf()) 
    27672805                        { 
    2768                           VspLeaf *leaf = dynamic_cast<VspLeaf *>(node); 
     2806                          VspLeaf *leaf = static_cast<VspLeaf *>(node); 
    27692807                           
    27702808                          if (!leaf->GetViewCell()->Mailed() && leaf->TreeValid()) 
     
    27762814                  else  
    27772815                        { 
    2778                           VspInterior *interior = dynamic_cast<VspInterior *>(node); 
     2816                          VspInterior *interior = static_cast<VspInterior *>(node); 
    27792817                           
    27802818                          VspNode *first = interior->GetFront(); 
     
    28872925         
    28882926        // root and bounding box were already constructed 
    2889         VspLeaf *leaf = dynamic_cast<VspLeaf *>(mRoot); 
     2927        VspLeaf *leaf = static_cast<VspLeaf *>(mRoot); 
    28902928 
    28912929        ////////// 
     
    33043342{ 
    33053343        // todo remove dynamic cast 
    3306         VspSubdivisionCandidate *sc = dynamic_cast<VspSubdivisionCandidate *>(splitCandidate); 
     3344        VspSubdivisionCandidate *sc = static_cast<VspSubdivisionCandidate *>(splitCandidate); 
    33073345 
    33083346        VspTraversalData &tData = sc->mParentData; 
     
    33183356                VspTraversalData tBackData; 
    33193357                 
    3320                 VspInterior *oldInterior = dynamic_cast<VspInterior *>(oldNode); 
     3358                VspInterior *oldInterior = static_cast<VspInterior *>(oldNode); 
    33213359 
    33223360                // create new interior node and two leaf node 
     
    33873425                { 
    33883426                        const ObjectPvsEntry &entry = oit.Next(); 
    3389                         BvhNode *obj = dynamic_cast<BvhNode *>(entry.mObject); 
     3427                        BvhNode *obj = static_cast<BvhNode *>(entry.mObject); 
    33903428 
    33913429                        if (!obj->IsRoot()) 
     
    34163454                { 
    34173455                        const ObjectPvsEntry &entry = oit.Next(); 
    3418                         BvhNode *obj = dynamic_cast<BvhNode *>(entry.mObject); 
     3456                        BvhNode *obj = static_cast<BvhNode *>(entry.mObject); 
    34193457 
    34203458                        if (!obj->IsRoot()) 
     
    34863524                if (!node->IsLeaf()) 
    34873525                { 
    3488                         VspInterior *in = dynamic_cast<VspInterior *>(node); 
     3526                        VspInterior *in = static_cast<VspInterior *>(node); 
    34893527                        position = in->GetPosition(); 
    34903528                        axis = in->GetAxis(); 
     
    35313569                { 
    35323570                        // compute intersection with all objects in this leaf 
    3533                         VspLeaf *leaf = dynamic_cast<VspLeaf *>(node); 
     3571                        VspLeaf *leaf = static_cast<VspLeaf *>(node); 
    35343572                        ViewCell *viewCell; 
    35353573                        if (0) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.cpp

    r1707 r2017  
    225225                if (!node->IsLeaf())  
    226226                { 
    227                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     227                        BspInterior *interior = static_cast<BspInterior *>(node); 
    228228                                                                 
    229229                        BspNodeGeometry *front = new BspNodeGeometry(); 
     
    243243                        if (maxPvs) 
    244244                        { 
    245                                 BspLeaf *leaf = dynamic_cast<BspLeaf *>(node); 
     245                                BspLeaf *leaf = static_cast<BspLeaf *>(node); 
    246246 
    247247                                mForcedMaterial.mDiffuseColor.b = 1.0f; 
     
    584584                SetFilled(); 
    585585                SetForcedMaterial(RandomMaterial()); 
    586                 ExportGeometry(dynamic_cast<KdLeaf *>(node)->mObjects);  
     586                ExportGeometry(static_cast<KdLeaf *>(node)->mObjects);   
    587587                SetWireframe(); 
    588588        } 
     
    764764                if (node->IsLeaf())  
    765765                { 
    766                         ViewCell *vc = dynamic_cast<BspLeaf *>(node)->GetViewCell(); 
     766                        ViewCell *vc = static_cast<BspLeaf *>(node)->GetViewCell(); 
    767767#if 0      
    768768                        // set the mesh material according to the ray density 
     
    918918                else 
    919919                { 
    920                         BspInterior *interior = dynamic_cast<BspInterior *>(tData.mNode); 
     920                        BspInterior *interior = static_cast<BspInterior *>(tData.mNode); 
    921921 
    922922                        // add current side of split plane 
     
    10351035                if (!node->IsLeaf()) 
    10361036                { 
    1037                         BspInterior *interior = dynamic_cast<BspInterior *>(node); 
     1037                        BspInterior *interior = static_cast<BspInterior *>(node); 
    10381038 
    10391039                        // bounded plane is added to the polygons 
  • GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp

    r2008 r2017  
    220220        } 
    221221         
    222  
    223222        //////////// 
    224223        //-- initialize external ray caster 
     
    269268                exit(1); 
    270269        } 
    271          
     270 
     271        const string viewCellsFile = ReplaceSuffix(filename, ".obj", ".vc"); 
     272        const int numViewCells = 2; 
     273        const int numViewPoints = 2; 
    272274 
    273275        bool useHwGlobalLines; 
     
    357359                } 
    358360 
     361        /*      vector<ViewCellPoints *> myViewCells; 
     362 
     363                preprocessor->mViewCellsManager->GenerateRandomViewCells(myViewCells, numViewCells, numViewPoints); 
     364                cout << "exporting random view cells" << endl; 
     365                preprocessor->mViewCellsManager->ExportRandomViewCells(viewCellsFile, myViewCells); 
     366 
     367                //preprocessor->mViewCellsManager->ImportRandomViewCells(viewCellsFile, myViewCells); 
     368                CLEAR_CONTAINER(myViewCells); 
     369*/ 
    359370                qApp->exec(); 
    360371#endif 
     
    381392        // release memory 
    382393        Cleanup(); 
     394         
    383395        delete pt; 
    384396 
Note: See TracChangeset for help on using the changeset viewer.