Changeset 1106


Ignore:
Timestamp:
07/10/06 01:57:41 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • GTP/trunk/Lib/Vis/Preprocessing/scripts/Preprocessor.vcproj

    r1099 r1106  
    544544                        </File> 
    545545                </Filter> 
    546                 <Filter 
    547                         Name="mixkit" 
    548                         Filter=""> 
    549                         <File 
    550                                 RelativePath="..\src\mixkit\getopt.c"> 
    551                         </File> 
    552                         <File 
    553                                 RelativePath="..\src\mixkit\getopt.h"> 
    554                         </File> 
    555                         <File 
    556                                 RelativePath="..\src\mixkit\getopt1.c"> 
    557                         </File> 
    558                         <File 
    559                                 RelativePath="..\src\mixkit\mixio.h"> 
    560                         </File> 
    561                         <File 
    562                                 RelativePath="..\src\mixkit\mixmops.cxx"> 
    563                         </File> 
    564                         <File 
    565                                 RelativePath="..\src\mixkit\mixmops.h"> 
    566                         </File> 
    567                         <File 
    568                                 RelativePath="..\src\mixkit\mixmsg.cxx"> 
    569                         </File> 
    570                         <File 
    571                                 RelativePath="..\src\mixkit\mixmsg.h"> 
    572                         </File> 
    573                         <File 
    574                                 RelativePath="..\src\mixkit\mixvops.h"> 
    575                         </File> 
    576                         <File 
    577                                 RelativePath="..\src\mixkit\MxArcball.cxx"> 
    578                         </File> 
    579                         <File 
    580                                 RelativePath="..\src\mixkit\MxArcball.h"> 
    581                         </File> 
    582                         <File 
    583                                 RelativePath="..\src\mixkit\MxAsp.cxx"> 
    584                         </File> 
    585                         <File 
    586                                 RelativePath="..\src\mixkit\MxAsp.h"> 
    587                         </File> 
    588                         <File 
    589                                 RelativePath="..\src\mixkit\MxBlock.h"> 
    590                         </File> 
    591                         <File 
    592                                 RelativePath="..\src\mixkit\MxBlock2.h"> 
    593                         </File> 
    594                         <File 
    595                                 RelativePath="..\src\mixkit\MxBlock3.h"> 
    596                         </File> 
    597                         <File 
    598                                 RelativePath="..\src\mixkit\MxBlockModel.cxx"> 
    599                         </File> 
    600                         <File 
    601                                 RelativePath="..\src\mixkit\MxBlockModel.h"> 
    602                         </File> 
    603                         <File 
    604                                 RelativePath="..\src\mixkit\MxCamera.cxx"> 
    605                         </File> 
    606                         <File 
    607                                 RelativePath="..\src\mixkit\MxCamera.h"> 
    608                         </File> 
    609                         <File 
    610                                 RelativePath="..\src\mixkit\MxCmdParser.cxx"> 
    611                         </File> 
    612                         <File 
    613                                 RelativePath="..\src\mixkit\MxCmdParser.h"> 
    614                         </File> 
    615                         <File 
    616                                 RelativePath="..\src\mixkit\MxDynBlock.h"> 
    617                         </File> 
    618                         <File 
    619                                 RelativePath="..\src\mixkit\MxEdgeFilter.cxx"> 
    620                         </File> 
    621                         <File 
    622                                 RelativePath="..\src\mixkit\MxEdgeFilter.h"> 
    623                         </File> 
    624                         <File 
    625                                 RelativePath="..\src\mixkit\MxGeom3D.cxx"> 
    626                         </File> 
    627                         <File 
    628                                 RelativePath="..\src\mixkit\MxGeom3D.h"> 
    629                         </File> 
    630                         <File 
    631                                 RelativePath="..\src\mixkit\MxGeoPrims.h"> 
    632                         </File> 
    633                         <File 
    634                                 RelativePath="..\src\mixkit\MxGL.h"> 
    635                         </File> 
    636                         <File 
    637                                 RelativePath="..\src\mixkit\MxGLDebug.cxx"> 
    638                         </File> 
    639                         <File 
    640                                 RelativePath="..\src\mixkit\MxGLPane.cxx"> 
    641                         </File> 
    642                         <File 
    643                                 RelativePath="..\src\mixkit\MxGLPane.h"> 
    644                         </File> 
    645                         <File 
    646                                 RelativePath="..\src\mixkit\MxGLUtils.cxx"> 
    647                         </File> 
    648                         <File 
    649                                 RelativePath="..\src\mixkit\MxGLUtils.h"> 
    650                         </File> 
    651                         <File 
    652                                 RelativePath="..\src\mixkit\MxHeap.cxx"> 
    653                                 <FileConfiguration 
    654                                         Name="Debug|Win32"> 
    655                                         <Tool 
    656                                                 Name="VCCLCompilerTool" 
    657                                                 ObjectFile="$(IntDir)/$(InputName)1.obj"/> 
    658                                 </FileConfiguration> 
    659                                 <FileConfiguration 
    660                                         Name="Release|Win32"> 
    661                                         <Tool 
    662                                                 Name="VCCLCompilerTool" 
    663                                                 ObjectFile="$(IntDir)/$(InputName)1.obj"/> 
    664                                 </FileConfiguration> 
    665                         </File> 
    666                         <File 
    667                                 RelativePath="..\src\mixkit\MxHeap.h"> 
    668                         </File> 
    669                         <File 
    670                                 RelativePath="..\src\mixkit\MxLineModel.cxx"> 
    671                         </File> 
    672                         <File 
    673                                 RelativePath="..\src\mixkit\MxManipulator.h"> 
    674                         </File> 
    675                         <File 
    676                                 RelativePath="..\src\mixkit\MxMat2.cxx"> 
    677                         </File> 
    678                         <File 
    679                                 RelativePath="..\src\mixkit\MxMat2.h"> 
    680                         </File> 
    681                         <File 
    682                                 RelativePath="..\src\mixkit\MxMat3-jacobi.cxx"> 
    683                         </File> 
    684                         <File 
    685                                 RelativePath="..\src\mixkit\MxMat3.cxx"> 
    686                         </File> 
    687                         <File 
    688                                 RelativePath="..\src\mixkit\MxMat3.h"> 
    689                         </File> 
    690                         <File 
    691                                 RelativePath="..\src\mixkit\MxMat4-jacobi.cxx"> 
    692                         </File> 
    693                         <File 
    694                                 RelativePath="..\src\mixkit\MxMat4.cxx"> 
    695                         </File> 
    696                         <File 
    697                                 RelativePath="..\src\mixkit\MxMat4.h"> 
    698                         </File> 
    699                         <File 
    700                                 RelativePath="..\src\mixkit\MxMath.h"> 
    701                         </File> 
    702                         <File 
    703                                 RelativePath="..\src\mixkit\MxMatrix.cxx"> 
    704                         </File> 
    705                         <File 
    706                                 RelativePath="..\src\mixkit\MxMatrix.h"> 
    707                         </File> 
    708                         <File 
    709                                 RelativePath="..\src\mixkit\MxPropSlim.cxx"> 
    710                         </File> 
    711                         <File 
    712                                 RelativePath="..\src\mixkit\MxPropSlim.h"> 
    713                         </File> 
    714                         <File 
    715                                 RelativePath="..\src\mixkit\MxQMetric.cxx"> 
    716                         </File> 
    717                         <File 
    718                                 RelativePath="..\src\mixkit\MxQMetric.h"> 
    719                         </File> 
    720                         <File 
    721                                 RelativePath="..\src\mixkit\MxQMetric2.cxx"> 
    722                         </File> 
    723                         <File 
    724                                 RelativePath="..\src\mixkit\MxQMetric2.h"> 
    725                         </File> 
    726                         <File 
    727                                 RelativePath="..\src\mixkit\MxQMetric3.cxx"> 
    728                         </File> 
    729                         <File 
    730                                 RelativePath="..\src\mixkit\MxQMetric3.h"> 
    731                         </File> 
    732                         <File 
    733                                 RelativePath="..\src\mixkit\MxQSlim.cxx"> 
    734                         </File> 
    735                         <File 
    736                                 RelativePath="..\src\mixkit\MxQSlim.h"> 
    737                         </File> 
    738                         <File 
    739                                 RelativePath="..\src\mixkit\MxQVis3.cxx"> 
    740                         </File> 
    741                         <File 
    742                                 RelativePath="..\src\mixkit\MxRaster-tiff.cxx"> 
    743                         </File> 
    744                         <File 
    745                                 RelativePath="..\src\mixkit\MxRaster.cxx"> 
    746                         </File> 
    747                         <File 
    748                                 RelativePath="..\src\mixkit\MxRaster.h"> 
    749                         </File> 
    750                         <File 
    751                                 RelativePath="..\src\mixkit\MxSMF.cxx"> 
    752                         </File> 
    753                         <File 
    754                                 RelativePath="..\src\mixkit\MxSMF.h"> 
    755                         </File> 
    756                         <File 
    757                                 RelativePath="..\src\mixkit\MxStack.h"> 
    758                         </File> 
    759                         <File 
    760                                 RelativePath="..\src\mixkit\MxStdModel.cxx"> 
    761                         </File> 
    762                         <File 
    763                                 RelativePath="..\src\mixkit\MxStdModel.h"> 
    764                         </File> 
    765                         <File 
    766                                 RelativePath="..\src\mixkit\MxStdPane.cxx"> 
    767                         </File> 
    768                         <File 
    769                                 RelativePath="..\src\mixkit\MxStdPane.h"> 
    770                         </File> 
    771                         <File 
    772                                 RelativePath="..\src\mixkit\MxStdRender.cxx"> 
    773                         </File> 
    774                         <File 
    775                                 RelativePath="..\src\mixkit\MxStdSlim.cxx"> 
    776                         </File> 
    777                         <File 
    778                                 RelativePath="..\src\mixkit\MxStdSlim.h"> 
    779                         </File> 
    780                         <File 
    781                                 RelativePath="..\src\mixkit\MxTimer.cxx"> 
    782                         </File> 
    783                         <File 
    784                                 RelativePath="..\src\mixkit\MxTimer.h"> 
    785                         </File> 
    786                         <File 
    787                                 RelativePath="..\src\mixkit\MxTriProject.cxx"> 
    788                         </File> 
    789                         <File 
    790                                 RelativePath="..\src\mixkit\MxVec2.h"> 
    791                         </File> 
    792                         <File 
    793                                 RelativePath="..\src\mixkit\MxVec3.h"> 
    794                         </File> 
    795                         <File 
    796                                 RelativePath="..\src\mixkit\MxVec4.h"> 
    797                         </File> 
    798                         <File 
    799                                 RelativePath="..\src\mixkit\MxVector.h"> 
    800                         </File> 
    801                         <File 
    802                                 RelativePath="..\src\mixkit\stdmix.h"> 
    803                         </File> 
    804                 </Filter> 
    805546                <File 
    806547                        RelativePath=".\VTune\Preprocessor.vpj"> 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Environment.cpp

    r1074 r1106  
    22062206                                        "1"); 
    22072207 
     2208         
     2209/***************************************************************************/ 
     2210/*               Object space partition tree related options               */ 
     2211/***************************************************************************/ 
     2212 
     2213        RegisterOption("OspTree.Construction.randomize", 
     2214                optBool, 
     2215                "osp_construction_randomize=", 
     2216                "false"); 
     2217 
     2218        RegisterOption("OspTree.Termination.maxDepth", 
     2219                                        optInt, 
     2220                                        "osp_term_max_depth=", 
     2221                                        "30"); 
     2222         
     2223        RegisterOption("OspTree.Termination.maxLeaves", 
     2224                                        optInt, 
     2225                                        "osp_term_max_leaves=", 
     2226                                        "1000"); 
     2227         
     2228        RegisterOption("OspTree.Termination.minObjects", 
     2229                                        optInt, 
     2230                                        "osp_term_min_objects=", 
     2231                                        "1"); 
     2232 
     2233        RegisterOption("OspTree.Termination.minProbability", 
     2234                                        optFloat, 
     2235                                        "osp_term_min_objects=", 
     2236                                        "0.0001"); 
     2237 
     2238        RegisterOption("OspTree.Termination.missTolerance", 
     2239                                        optInt, 
     2240                                        "osp_term_miss_tolerance=", 
     2241                                        "4"); 
     2242 
     2243        RegisterOption("OspTree.Termination.maxCostRatio", 
     2244                                        optFloat, 
     2245                                        "osp_term_max_cost_ratio=", 
     2246                                        "0.99"); 
     2247 
     2248        RegisterOption("OspTree.Termination.minGlobalCostRatio", 
     2249                                        optFloat, 
     2250                                        "osp_term_min_global_cost_ratio=", 
     2251                                        "0.00001"); 
     2252 
     2253        RegisterOption("OspTree.Termination.globalCostMissTolerance", 
     2254                                        optInt, 
     2255                                        "osp_term_global_cost_miss_tolerance=", 
     2256                                        "4"); 
     2257 
     2258        RegisterOption("OspTree.Termination.ct_div_ci", 
     2259                                        optFloat, 
     2260                                        "osp_term_ct_div_ci=", 
     2261                                        "0"); 
     2262         
     2263        RegisterOption("OspTree.Construction.epsilon", 
     2264                                        optFloat, 
     2265                                        "osp_construction_epsilon=", 
     2266                                        "0.00001"); 
     2267         
     2268        // if only the driving axis is used for axis aligned split 
     2269        RegisterOption("OspTree.splitUseOnlyDrivingAxis",  
     2270                                        optBool,  
     2271                                        "osp_split_only_driving_axis=",  
     2272                                        "false"); 
     2273 
     2274        RegisterOption("OspTree.maxStaticMemory",  
     2275                optFloat,  
     2276                "osp_max_static_mem=",  
     2277                "8.0"); 
     2278 
     2279        RegisterOption("OspTree.useCostHeuristics", 
     2280                optBool, 
     2281                "osp_use_cost_heuristics=", 
     2282                "false"); 
     2283 
     2284 
     2285        RegisterOption("OspTree.subdivisionStats", 
     2286                                        optString, 
     2287                                        "osp_subdivision_stats=", 
     2288                                        "ospSubdivisionStats.log"); 
     2289 
     2290        RegisterOption("OspTree.Construction.splitBorder", 
     2291                                        optFloat, 
     2292                                        "osp_construction_split_border=", 
     2293                                        "0.01"); 
     2294 
     2295 
    22082296 
    22092297        ////////////////////////////////////////////////////////////////////////////////// 
  • GTP/trunk/Lib/Vis/Preprocessing/src/Exporter.h

    r1006 r1106  
    2727class Mesh; 
    2828class Beam; 
     29class OspTree; 
     30 
    2931 
    3032class Exporter 
     
    6668  virtual bool 
    6769  ExportBspTree(const BspTree &tree) = 0; 
     70 
     71  virtual bool 
     72  ExportOspTree(const OspTree &tree) = 0; 
    6873 
    6974//    virtual bool 
  • GTP/trunk/Lib/Vis/Preprocessing/src/FlexibleHeap.h

    r1099 r1106  
    193193                return NULL; 
    194194 
    195         Swap(0, mBuffer.size() - 1); 
     195        Swap(0, (int)mBuffer.size() - 1); 
    196196 
    197197        T dead = mBuffer.back(); 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp

    r1027 r1106  
    10941094        mStat.nodes += 2; 
    10951095         
    1096         BspLeaf *leaf = dynamic_cast<BspLeaf *>(tData.mNode); 
    1097  
    1098          
     1096        BspLeaf *leaf = dynamic_cast<BspLeaf *>(tData.mNode);    
    10991097         
    11001098        // select subdivision plane 
    1101         BspInterior *interior =  
    1102                 new BspInterior(SelectPlane(leaf, tData));  
     1099        BspInterior *interior = new BspInterior(SelectPlane(leaf, tData));  
    11031100         
    11041101         
     
    11071104#endif 
    11081105         
    1109  
    11101106        // subdivide rays into front and back rays 
    11111107        SplitRays(interior->mPlane, *tData.mRays, *frontData.mRays, *backData.mRays); 
    1112          
    1113          
    11141108 
    11151109        // subdivide polygons with plane 
     
    11191113                                                                          *backData.mPolygons,  
    11201114                                                                          coincident); 
    1121  
    11221115         
    11231116 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r1077 r1106  
    48104810        mHierarchyManager = new HierarchyManager(*vspTree, *ospTree); 
    48114811        Environment::GetSingleton()->GetIntValue("VspTree.Construction.samples", mInitialSamples); 
     4812 
    48124813        mVspTree->SetViewCellsManager(this); 
     4814        mOspTree->SetViewCellsManager(this); 
     4815 
    48134816        mVspTree->mViewCellsTree = mViewCellsTree; 
    48144817} 
     
    48814884        long startTime; 
    48824885 
    4883         mHierarchyManager->Construct(constructionRays, objects, &mViewSpaceBox); 
     4886        mHierarchyManager->Construct2(constructionRays, objects, &mViewSpaceBox); 
    48844887 
    48854888         
     
    52295232        GetRaySets(sampleRays, mVisualizationSamples, visRays); 
    52305233 
    5231         //-- export final view cells 
    5232  
    52335234        if (1)  
    52345235        {        
     5236                //-- export final view cells 
     5237 
    52355238                // hack pvs 
    52365239                const int savedColorCode = mColorCode; 
     
    52665269                        // HACK: export without clip plane 
    52675270                        const bool b = mUseClipPlaneForViz; 
    5268                         if (0) 
    5269                                 mUseClipPlaneForViz = false; 
     5271                        if (0) mUseClipPlaneForViz = false; 
    52705272 
    52715273                        ExportViewCellsForViz(exporter); 
     
    52785280 
    52795281                mColorCode = savedColorCode; 
     5282        } 
     5283 
     5284        if (1)  
     5285        {        
     5286                //-- export final object partition 
     5287                Exporter *exporter = Exporter::GetExporter("final_object_partition.wrl"); 
     5288                 
     5289                if (exporter) 
     5290                { 
     5291                        cout << "exporting object space partition ... "; 
     5292 
     5293                        if (mExportGeometry) 
     5294                        { 
     5295                                exporter->ExportGeometry(objects); 
     5296                        } 
     5297 
     5298                        // export rays 
     5299                        if (0 && mExportRays) 
     5300                        { 
     5301                                exporter->ExportRays(visRays, RgbColor(0, 1, 0)); 
     5302                        } 
     5303 
     5304                        exporter->SetWireframe(); 
     5305                        exporter->ExportOspTree(*mOspTree); 
     5306 
     5307                        delete exporter; 
     5308 
     5309                        cout << "finished" << endl; 
     5310                } 
    52805311        } 
    52815312 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.cpp

    r1077 r1106  
    1111#include "VssTree.h" 
    1212#include "VspBspTree.h" 
     13#include "VspOspTree.h" 
    1314#include "RssTree.h" 
    1415#include "Beam.h" 
     
    595596} 
    596597 
    597 #if 0 
    598 bool VrmlExporter::ExportVspOspTree(const VspOspTree &tree,  
    599                                                                    const int maxPvs) 
    600 { 
    601         stack<VspKdNode *> tStack; 
    602  
    603         tStack.push(tree.GetRoot()); 
    604  
    605         //Mesh *mesh = new Mesh; 
    606    
    607         if (maxPvs) 
    608                 mUseForcedMaterial = true; 
    609  
    610         while (!tStack.empty())  
    611         { 
    612                 VspKdNode *node = tStack.top(); 
    613      
    614                 tStack.pop(); 
    615  
    616                 if (node->IsLeaf()) 
    617                 { 
    618                         AxisAlignedBox3 box = tree.GetBBox(node); 
    619  
    620                         Mesh *mesh = new Mesh; 
    621  
    622                         // add 6 vertices of the box 
    623                         int index = (int)mesh->mVertices.size(); 
    624  
    625                         for (int i=0; i < 8; ++ i)  
    626                         { 
    627                                 Vector3 v; 
    628                                 box.GetVertex(i, v); 
    629                                 mesh->mVertices.push_back(v); 
    630                         } 
    631  
    632                         mesh->AddFace(new Face(index + 0, index + 1, index + 3, index + 2) ); 
    633                         mesh->AddFace(new Face(index + 0, index + 2, index + 6, index + 4) ); 
    634                         mesh->AddFace(new Face(index + 4, index + 6, index + 7, index + 5) ); 
    635  
    636                         mesh->AddFace(new Face(index + 3, index + 1, index + 5, index + 7) ); 
    637                         mesh->AddFace(new Face(index + 0, index + 4, index + 5, index + 1) ); 
    638                         mesh->AddFace(new Face(index + 2, index + 3, index + 7, index + 6) ); 
    639  
    640                         if (maxPvs) 
    641                         { 
    642                                 VspKdLeaf *leaf = dynamic_cast<VspKdLeaf *>(node); 
    643  
    644                                 mForcedMaterial.mDiffuseColor.b = 1.0f; 
    645                                  
    646                                 leaf->UpdatePvsSize(); 
    647                          
    648                                 const float importance = (float)leaf->GetPvsSize() / (float)maxPvs; 
    649                                 mForcedMaterial.mDiffuseColor.r = importance; 
    650                                 mForcedMaterial.mDiffuseColor.g = 1.0f - mForcedMaterial.mDiffuseColor.r; 
    651                         } 
    652  
    653                         ExportMesh(mesh); 
    654                         DEL_PTR(mesh); 
    655                 } 
    656                 else   
    657                 { 
    658                         VspKdInterior *interior = dynamic_cast<VspKdInterior *>(node); 
    659                         tStack.push(interior->GetFront()); 
    660                         tStack.push(interior->GetBack()); 
    661                 } 
    662         } 
    663    
    664         //ExportMesh(mesh); 
    665         //DEL_PTR(mesh); 
    666  
    667         return true; 
    668 } 
    669 #endif 
    670598 
    671599bool VrmlExporter::ExportKdTree(const KdTree &tree) 
     
    685613         { 
    686614                 KdNode *node = tStack.top(); 
    687                   
     615 
    688616                 tStack.pop(); 
    689                   
     617 
    690618                 AxisAlignedBox3 box = tree.GetBox(node); 
    691619                 // add 6 vertices of the box 
    692620                 int index = (int)mesh->mVertices.size(); 
    693                   
     621 
    694622                 for (int i=0; i < 8; i++)  
    695623                 { 
     
    703631                 mesh->AddFace(new Face(index + 4, index + 6, index + 7, index + 5) ); 
    704632 
    705                 mesh->AddFace(new Face(index + 3, index + 1, index + 5, index + 7) ); 
    706                 mesh->AddFace(new Face(index + 0, index + 4, index + 5, index + 1) ); 
    707                 mesh->AddFace(new Face(index + 2, index + 3, index + 7, index + 6) ); 
    708  
    709                 if (!node->IsLeaf())  
    710                 { 
    711                         KdInterior *interior = (KdInterior *)node; 
    712                         tStack.push(interior->mFront); 
    713                         tStack.push(interior->mBack); 
    714                 } 
    715   } 
    716    
    717   ExportMesh(mesh); 
    718  
    719   delete mesh; 
    720   return true; 
    721 } 
     633                 mesh->AddFace(new Face(index + 3, index + 1, index + 5, index + 7) ); 
     634                 mesh->AddFace(new Face(index + 0, index + 4, index + 5, index + 1) ); 
     635                 mesh->AddFace(new Face(index + 2, index + 3, index + 7, index + 6) ); 
     636 
     637                 if (!node->IsLeaf())  
     638                 { 
     639                         KdInterior *interior = (KdInterior *)node; 
     640                         tStack.push(interior->mFront); 
     641                         tStack.push(interior->mBack); 
     642                 } 
     643         } 
     644 
     645         ExportMesh(mesh); 
     646 
     647         delete mesh; 
     648         return true; 
     649} 
     650 
     651 
     652bool VrmlExporter::ExportOspTree(const OspTree &ospTree) 
     653{ 
     654        vector<KdLeaf *> leaves; 
     655        ospTree.CollectLeaves(leaves); 
     656 
     657        vector<KdLeaf *>::const_iterator it, it_end = leaves.end(); 
     658 
     659        for (it = leaves.begin(); it != it_end; ++ it) 
     660        { 
     661                ExportBox(ospTree.GetBBox(*it)); 
     662        } 
     663 
     664        return true; 
     665} 
     666 
    722667 
    723668bool VrmlExporter::ExportVssTree(const VssTree &tree) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VrmlExporter.h

    r1006 r1106  
    2424class VspBspTree; 
    2525class BspNode; 
    26 //class VspKdViewCell; 
    2726class Beam; 
     27class OspTree; 
    2828 
    2929class VrmlExporter : public Exporter 
     
    4646  bool 
    4747  ExportKdTree(const KdTree &tree); 
     48 
     49  bool 
     50  ExportOspTree(const OspTree &tree); 
    4851 
    4952  bool 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspBspTree.cpp

    r1077 r1106  
    15541554                if (!useSpecialAxis || (axis == sAxis)) 
    15551555                { 
    1556                         //-- place split plane using heuristics 
    1557  
    15581556                        if (mUseCostHeuristics) 
    15591557                        { 
     1558                                //-- place split plane using heuristics 
    15601559                                nCostRatio[axis] = 
    15611560                                        BestCostRatioHeuristics(*tData.mRays, 
     
    15651564                                                                                        nPosition[axis]);                        
    15661565                        } 
    1567                         else //-- split plane position is spatial median 
    1568                         { 
     1566                        else  
     1567                        { 
     1568                                //-- split plane position is spatial median 
    15691569 
    15701570                                nPosition[axis] = (box.Min()[axis] + box.Max()[axis]) * 0.5f; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp

    r1101 r1106  
    2222 
    2323#define USE_FIXEDPOINT_T 0 
    24  
     24#define COUNT_OBJECTS 1 
    2525 
    2626//-- static members 
    27  
    28 int VspTree::sFrontId = 0; 
    29 int VspTree::sBackId = 0; 
    30 int VspTree::sFrontAndBackId = 0; 
    3127 
    3228VspTree *VspTree::VspSplitCandidate::sVspTree = NULL; 
     
    379375 
    380376        Debug << "******* VSP options ******** " << endl; 
     377 
    381378    Debug << "max depth: " << mTermMaxDepth << endl; 
    382379        Debug << "min PVS: " << mTermMinPvs << endl; 
     
    399396        Debug << "minband: " << mMinBand << endl; 
    400397        Debug << "maxband: " << mMaxBand << endl; 
    401         Debug << "pvs count method: " << mPvsCountMethod << endl; 
    402  
     398 
     399        if (mPvsCountMethod == 0) 
     400                Debug << "pvs count method: per object" << endl; 
     401        else 
     402                Debug << "pvs count method: per kd node" << endl; 
    403403 
    404404        mSplitCandidates = new vector<SortableEntry>; 
     
    504504bool VspTree::LocalTerminationCriteriaMet(const VspTraversalData &data) const 
    505505{ 
    506         return 
    507 #if TODO 
    508                 (((int)data.mRays->size() <= mTermMinRays) || 
    509                  (data.mPvs <= mTermMinPvs)   || 
    510                  (data.mProbability <= mTermMinProbability) || 
    511                  (data.GetAvgRayContribution() > mTermMaxRayContribution) || 
    512                  (data.mDepth >= mTermMaxDepth)); 
    513 #else 
    514                 false; 
    515 #endif 
     506        return( 
     507                ((int)data.mRays->size() <= mTermMinRays) || 
     508                (data.mPvs <= mTermMinPvs)   || 
     509                (data.mProbability <= mTermMinProbability) || 
     510                (data.GetAvgRayContribution() > mTermMaxRayContribution) || 
     511                (data.mDepth >= mTermMaxDepth) 
     512                ); 
     513                 
    516514} 
    517515 
     
    519517bool VspTree::GlobalTerminationCriteriaMet(const VspTraversalData &data) const 
    520518{ 
    521         return 
    522 #if TODO 
    523                 (mOutOfMemory ||  
     519        return ( 
     520//              mOutOfMemory ||  
    524521                (mVspStats.Leaves() >= mMaxViewCells) ||  
    525                 (mGlobalCostMisses >= mTermGlobalCostMissTolerance)); 
    526 #else 
    527                 (mVspStats.Leaves() >= mMaxViewCells) ;          
    528 #endif 
     522        (mGlobalCostMisses >= mTermGlobalCostMissTolerance)  
     523                );               
    529524} 
    530525 
     
    729724        // and setup child links 
    730725        interior->SetupChildLinks(new VspLeaf(interior), new VspLeaf(interior)); 
     726         
    731727        // add bounding box 
    732728        interior->SetBoundingBox(tData.mBoundingBox); 
     729 
     730        // set front and back leaf 
     731        frontData.mNode = interior->GetFront(); 
     732        backData.mNode = interior->GetBack(); 
    733733 
    734734        interior->mTimeStamp = mTimeStamp ++; 
     
    915915                        node->mCounter = 1; 
    916916 
    917                         //Debug << "here5 "<<(int)node->mObjects.size() <<" "<< node->mMultipleObjects.size()<< " " <<(int)node->mObjects.size() - node->mMultipleObjects.size()<<endl; 
    918917                        // add objects without the objects which are in several kd leaves 
    919918                        pvsSize += (int)(node->mObjects.size() - node->mMultipleObjects.size()); 
     
    933932                        if (!object->Mailed()) 
    934933                        { 
    935                                 //Debug << "here233: " << object->mKdLeaves.size() << endl; 
    936934                                object->Mail(); 
    937935                                object->mCounter = 1; 
     
    13221320                sAxis = box.Size().DrivingAxis(); 
    13231321        } 
    1324         //sAxis = 2; 
     1322         
    13251323        for (int axis = 0; axis < 3; ++ axis) 
    13261324        { 
    13271325                if (!useSpecialAxis || (axis == sAxis)) 
    13281326                { 
    1329                         //-- place split plane using heuristics 
    1330  
    13311327                        if (mUseCostHeuristics) 
    13321328                        { 
     1329                                //-- place split plane using heuristics 
    13331330                                nCostRatio[axis] = 
    13341331                                        EvalLocalCostHeuristics(*tData.mRays, 
     
    13381335                                                                                        nPosition[axis]);                        
    13391336                        } 
    1340                         else //-- split plane position is spatial median 
    1341                         { 
     1337                        else 
     1338                        { 
     1339                                //-- split plane position is spatial median 
     1340 
    13421341                                nPosition[axis] = (box.Min()[axis] + box.Max()[axis]) * 0.5f; 
    13431342 
     
    25452544mTimeStamp(1) 
    25462545{ 
    2547 #if TODO 
     2546 
    25482547        bool randomize = false; 
    25492548        Environment::GetSingleton()->GetBoolValue("VspTree.Construction.randomize", randomize); 
     
    25522551 
    25532552        //-- termination criteria for autopartition 
    2554         Environment::GetSingleton()->GetIntValue("VspTree.Termination.maxDepth", mTermMaxDepth); 
    2555         Environment::GetSingleton()->GetIntValue("VspTree.Termination.minPvs", mTermMinPvs); 
    2556         Environment::GetSingleton()->GetIntValue("VspTree.Termination.minRays", mTermMinRays); 
    2557         Environment::GetSingleton()->GetFloatValue("VspTree.Termination.minProbability", mTermMinProbability); 
    2558         Environment::GetSingleton()->GetFloatValue("VspTree.Termination.maxRayContribution", mTermMaxRayContribution); 
    2559          
    2560         Environment::GetSingleton()->GetIntValue("VspTree.Termination.missTolerance", mTermMissTolerance); 
    2561         Environment::GetSingleton()->GetIntValue("VspTree.Termination.maxViewCells", mMaxViewCells); 
    2562  
     2553        Environment::GetSingleton()->GetIntValue("OspTree.Termination.maxDepth", mTermMaxDepth); 
     2554        Environment::GetSingleton()->GetIntValue("OspTree.Termination.maxLeaves", mTermMaxLeaves); 
     2555        Environment::GetSingleton()->GetIntValue("OspTree.Termination.minObjects", mTermMinObjects); 
     2556        Environment::GetSingleton()->GetFloatValue("OspTree.Termination.minProbability", mTermMinProbability); 
     2557         
     2558        Environment::GetSingleton()->GetIntValue("OspTree.Termination.missTolerance", mTermMissTolerance); 
     2559         
    25632560        //-- max cost ratio for early tree termination 
    2564         Environment::GetSingleton()->GetFloatValue("VspTree.Termination.maxCostRatio", mTermMaxCostRatio); 
    2565  
    2566         Environment::GetSingleton()->GetFloatValue("VspTree.Termination.minGlobalCostRatio", mTermMinGlobalCostRatio); 
    2567         Environment::GetSingleton()->GetIntValue("VspTree.Termination.globalCostMissTolerance", mTermGlobalCostMissTolerance); 
    2568  
    2569         // HACK//mTermMinPolygons = 25; 
     2561        Environment::GetSingleton()->GetFloatValue("OspTree.Termination.maxCostRatio", mTermMaxCostRatio); 
     2562 
     2563        Environment::GetSingleton()->GetFloatValue("OspTree.Termination.minGlobalCostRatio", mTermMinGlobalCostRatio); 
     2564        Environment::GetSingleton()->GetIntValue("OspTree.Termination.globalCostMissTolerance", mTermGlobalCostMissTolerance); 
     2565 
    25702566 
    25712567        //-- factors for bsp tree split plane heuristics 
    2572         Environment::GetSingleton()->GetFloatValue("VspTree.Termination.ct_div_ci", mCtDivCi); 
     2568        Environment::GetSingleton()->GetFloatValue("OspTree.Termination.ct_div_ci", mCtDivCi); 
    25732569 
    25742570        //-- partition criteria 
    2575         Environment::GetSingleton()->GetFloatValue("VspTree.Construction.epsilon", mEpsilon); 
     2571        Environment::GetSingleton()->GetFloatValue("OspTree.Construction.epsilon", mEpsilon); 
    25762572 
    25772573        // if only the driving axis is used for axis aligned split 
    2578         Environment::GetSingleton()->GetBoolValue("VspTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis); 
    2579          
    2580         //Environment::GetSingleton()->GetFloatValue("VspTree.maxTotalMemory", mMaxTotalMemory); 
    2581         Environment::GetSingleton()->GetFloatValue("VspTree.maxStaticMemory", mMaxMemory); 
    2582  
    2583         Environment::GetSingleton()->GetBoolValue("VspTree.useCostHeuristics", mUseCostHeuristics); 
    2584         Environment::GetSingleton()->GetBoolValue("VspTree.simulateOctree", mCirculatingAxis); 
     2574        Environment::GetSingleton()->GetBoolValue("OspTree.splitUseOnlyDrivingAxis", mOnlyDrivingAxis); 
     2575         
     2576        Environment::GetSingleton()->GetFloatValue("OspTree.maxStaticMemory", mMaxMemory); 
     2577 
     2578        Environment::GetSingleton()->GetBoolValue("OspTree.useCostHeuristics", mUseCostHeuristics); 
    25852579 
    25862580 
    25872581        char subdivisionStatsLog[100]; 
    2588         Environment::GetSingleton()->GetStringValue("VspTree.subdivisionStats", subdivisionStatsLog); 
     2582        Environment::GetSingleton()->GetStringValue("OspTree.subdivisionStats", subdivisionStatsLog); 
    25892583        mSubdivisionStats.open(subdivisionStatsLog); 
    25902584 
    2591         Environment::GetSingleton()->GetFloatValue("VspTree.Construction.minBand", mMinBand); 
    2592         Environment::GetSingleton()->GetFloatValue("VspTree.Construction.maxBand", mMaxBand); 
    2593          
    2594         mSplitBorder = 0.1f; 
     2585        Environment::GetSingleton()->GetFloatValue("OspTree.Construction.splitBorder", mSplitBorder); 
     2586        //mSplitBorder = 0.1f; 
    25952587 
    25962588 
     
    25982590 
    25992591        Debug << "******* OSP options ******** " << endl; 
     2592 
    26002593    Debug << "max depth: " << mTermMaxDepth << endl; 
    2601         Debug << "min PVS: " << mTermMinPvs << endl; 
    26022594        Debug << "min probabiliy: " << mTermMinProbability << endl; 
    2603         Debug << "min rays: " << mTermMinRays << endl; 
    2604         Debug << "max ray contri: " << mTermMaxRayContribution << endl; 
     2595        Debug << "min objects: " << mTermMinObjects << endl; 
    26052596        Debug << "max cost ratio: " << mTermMaxCostRatio << endl; 
    26062597        Debug << "miss tolerance: " << mTermMissTolerance << endl; 
    2607         Debug << "max view cells: " << mMaxViewCells << endl; 
     2598        Debug << "max leaves: " << mTermMaxLeaves << endl; 
     2599 
    26082600        Debug << "randomize: " << randomize << endl; 
    26092601 
     
    26152607        Debug << "subdivision stats log: " << subdivisionStatsLog << endl; 
    26162608         
    2617         Debug << "circulating axis: " << mCirculatingAxis << endl; 
    2618         Debug << "minband: " << mMinBand << endl; 
    2619         Debug << "maxband: " << mMaxBand << endl; 
    2620          
     2609        Debug << "split borders: " << mSplitBorder << endl; 
     2610 
    26212611 
    26222612        mSplitCandidates = new vector<SortableEntry>; 
    26232613 
    26242614        Debug << endl; 
    2625 #endif 
    26262615} 
    26272616 
     
    26302619void OspTree::SplitObjects(const AxisAlignedPlane & splitPlane, 
    26312620                                                   const ObjectContainer &objects, 
    2632                                                    ObjectContainer &back, 
    2633                                                    ObjectContainer &front) 
     2621                                                   ObjectContainer &front, 
     2622                                                   ObjectContainer &back) 
    26342623{ 
    26352624        ObjectContainer::const_iterator oit, oit_end = objects.end(); 
     
    26452634                if (box.Min(splitPlane.mAxis) < splitPlane.mPosition) 
    26462635                        back.push_back(*oit); 
    2647 #if TODO     
    2648                 mStat.objectRefs -= (int)objects.size(); 
    2649                 mStat.objectRefs += objectsBack + objectsFront; 
    2650 #endif 
    2651         } 
    2652 } 
    2653  
    2654  
    2655 KdInterior *OspTree::SubdivideNode(KdLeaf *leaf, 
     2636        } 
     2637 
     2638        mOspStats.objectRefs -= (int)objects.size(); 
     2639        mOspStats.objectRefs += (int)back.size() + (int)front.size(); 
     2640} 
     2641 
     2642 
     2643KdInterior *OspTree::SubdivideNode( 
     2644                                                                   KdLeaf *leaf, 
    26562645                                                                   const AxisAlignedPlane &splitPlane, 
    26572646                                                                   const AxisAlignedBox3 &box, 
    2658                                                                    AxisAlignedBox3 &backBBox, 
    2659                                                                    AxisAlignedBox3 &frontBBox) 
    2660 { 
    2661 #if TODO 
    2662     mSpatialStat.nodes += 2; 
    2663         mSpatialStat.splits[axis]; 
    2664 #endif 
     2647                                                                   OspTraversalData &frontData, 
     2648                                                                   OspTraversalData &backData 
     2649                                                                   ) 
     2650{ 
     2651    mOspStats.nodes += 2; 
    26652652 
    26662653        // add the new nodes to the tree 
     
    26742661        node->mBox = box; 
    26752662 
    2676     backBBox = box; 
    2677         frontBBox = box; 
     2663        backData.mBoundingBox = box; 
     2664        frontData.mBoundingBox = box; 
    26782665   
    26792666        // first count ray sides 
     
    26812668        int objectsFront = 0; 
    26822669   
    2683         backBBox.SetMax(axis, position); 
    2684         frontBBox.SetMin(axis, position); 
     2670        backData.mBoundingBox.SetMax(axis, position); 
     2671        frontData.mBoundingBox.SetMin(axis, position); 
    26852672 
    26862673        ObjectContainer::const_iterator mi, mi_end = leaf->mObjects.end(); 
     
    27012688        KdLeaf *front = new KdLeaf(node, objectsFront); 
    27022689 
     2690        ///////////// 
     2691        //-- create front and back leaf 
     2692 
     2693        KdInterior *parent = leaf->mParent; 
     2694 
    27032695        // replace a link from node's parent 
    2704         if (leaf->mParent) 
    2705                 leaf->mParent->ReplaceChildLink(leaf, node); 
     2696        if (parent) 
     2697        { 
     2698                parent->ReplaceChildLink(leaf, node); 
     2699                node->mParent = parent; 
     2700        } 
     2701        else // new root 
     2702        { 
     2703                mRoot = node; 
     2704        } 
    27062705 
    27072706        // and setup child links 
    27082707        node->SetupChildLinks(back, front); 
    27092708 
    2710         SplitObjects(splitPlane, leaf->mObjects, back->mObjects, front->mObjects); 
     2709        SplitObjects(splitPlane, leaf->mObjects, front->mObjects, back->mObjects); 
    27112710 
    27122711        ProcessLeafObjects(back, leaf); 
    27132712    ProcessLeafObjects(front, leaf); 
    27142713   
     2714        backData.mNode = back; 
     2715        frontData.mNode = front; 
     2716 
    27152717        //delete leaf; 
    27162718        return node; 
     
    27212723                                                   OspSplitCandidate &splitCandidate, 
    27222724                                                   const bool globalCriteriaMet) 
    2723 { 
     2725{Debug << "here11" << endl; 
    27242726        OspTraversalData &tData = splitCandidate.mParentData; 
    2725  
     2727Debug << "here993" << endl; 
    27262728        KdNode *newNode = tData.mNode; 
    27272729 
     2730Debug << "here996" << endl; 
    27282731        if (!LocalTerminationCriteriaMet(tData) && !globalCriteriaMet) 
    27292732        {        
    27302733                OspTraversalData tFrontData; 
    27312734                OspTraversalData tBackData; 
    2732  
     2735Debug << "here3" << endl; 
    27332736                //-- continue subdivision 
    27342737                 
     
    27392742                                                                splitPlane,  
    27402743                                                                tData.mBoundingBox,  
    2741                                                                 tFrontData.mBoundingBox,  
    2742                                                                 tBackData.mBoundingBox); 
     2744                                                                tFrontData,  
     2745                                                                tBackData); 
    27432746         
    27442747                const int maxCostMisses = splitCandidate.mMaxCostMisses; 
     
    27522755                OspSplitCandidate *backCandidate = new OspSplitCandidate(tBackData); 
    27532756 
     2757                Debug << "here 54 " << tFrontData.mNode << " " <<  tBackData.mNode << endl; 
     2758 
    27542759                EvalSplitCandidate(*frontCandidate); 
    27552760                EvalSplitCandidate(*backCandidate); 
     
    27662771        if (newNode->IsLeaf()) 
    27672772        { 
    2768                 //KdLeaf *leaf = dynamic_cast<KdLeaf *>(newNode); 
    27692773                EvaluateLeafStats(tData);                
    27702774        } 
    2771  
     2775        Debug << "here888 "<< endl; 
    27722776        //-- cleanup 
    27732777        tData.Clear(); 
    2774          
     2778        Debug << "here876"<< endl; 
    27752779        return newNode; 
    27762780} 
     
    27822786        float backProb; 
    27832787         
    2784         KdLeaf *leaf = dynamic_cast<KdLeaf *>(splitCandidate.mParentData.mNode); 
    2785  
    27862788        // compute locally best split plane 
    27872789        const bool success =  
    27882790                SelectSplitPlane(splitCandidate.mParentData, splitCandidate.mSplitPlane, frontProb, backProb); 
    27892791 
    2790         //TODO 
     2792        const float priority = EvalRenderCostDecrease(splitCandidate.mSplitPlane, splitCandidate.mParentData); 
    27912793        // compute global decrease in render cost 
    2792         splitCandidate.SetPriority(EvalRenderCostDecrease(splitCandidate.mSplitPlane, splitCandidate.mParentData)); 
    2793         splitCandidate.mMaxCostMisses = success ? splitCandidate.mParentData.mMaxCostMisses : splitCandidate.mParentData.mMaxCostMisses + 1; 
     2794        splitCandidate.SetPriority(priority); 
     2795 
     2796        splitCandidate.mMaxCostMisses =  
     2797                success ? splitCandidate.mParentData.mMaxCostMisses : splitCandidate.mParentData.mMaxCostMisses + 1; 
    27942798} 
    27952799 
     
    27982802{ 
    27992803        // matt: TODO 
    2800         return true; 
    2801     /*          (((int)data.mRays->size() <= mTermMinRays) || 
    2802                  (data.mPvs <= mTermMinPvs)   || 
    2803                  (data.mProbability <= mTermMinProbability) || 
    2804                  (data.GetAvgRayContribution() > mTermMaxRayContribution) || 
    2805                  (data.mDepth >= mTermMaxDepth));*/ 
     2804        return (  
     2805                //(data.mNode->mObjects.size() < mTermMinObjects) || 
     2806                //(data.mProbability <= mTermMinProbability) || 
     2807                (data.mDepth >= mTermMaxDepth) 
     2808                 ); 
    28062809} 
    28072810 
     
    28102813{ 
    28112814        // matt: TODO 
    2812         return true; 
    2813                 /*(mOutOfMemory ||  
    2814                 (mVspStats.Leaves() >= mMaxViewCells) ||  
    2815                 (mGlobalCostMisses >= mTermGlobalCostMissTolerance));*/ 
     2815        Debug << "here888 " << mTermMaxLeaves << " " << mOspStats.Leaves() << endl; 
     2816        return ( 
     2817                (mOspStats.Leaves() >= mTermMaxLeaves) 
     2818                //mOutOfMemory ||  
     2819                //(mGlobalCostMisses >= mTermGlobalCostMissTolerance) 
     2820                ); 
    28162821} 
    28172822 
     
    28192824void OspTree::EvaluateLeafStats(const OspTraversalData &data) 
    28202825{ 
    2821 #if TODO 
    28222826        // the node became a leaf -> evaluate stats for leafs 
    2823         VspLeaf *leaf = dynamic_cast<VspLeaf *>(data.mNode); 
    2824  
    2825         if (data.mPvs > mVspStats.maxPvs) 
    2826         { 
    2827                 mVspStats.maxPvs = data.mPvs; 
    2828         } 
    2829  
    2830         mVspStats.pvs += data.mPvs; 
    2831  
    2832         if (data.mDepth < mVspStats.minDepth) 
    2833         { 
    2834                 mVspStats.minDepth = data.mDepth; 
     2827        KdLeaf *leaf = data.mNode; 
     2828 
     2829        if (data.mPvs > mOspStats.maxPvs) 
     2830        { 
     2831                mOspStats.maxPvs = data.mPvs; 
     2832        } 
     2833 
     2834        mOspStats.pvs += data.mPvs; 
     2835 
     2836        if (data.mDepth < mOspStats.minDepth) 
     2837        { 
     2838                mOspStats.minDepth = data.mDepth; 
    28352839        } 
    28362840         
    28372841        if (data.mDepth >= mTermMaxDepth) 
    28382842        { 
    2839         ++ mVspStats.maxDepthNodes; 
     2843        ++ mOspStats.maxDepthNodes; 
    28402844                //Debug << "new max depth: " << mVspStats.maxDepthNodes << endl; 
    28412845        } 
    28422846 
    2843         // accumulate rays to compute rays /  leaf 
    2844         mVspStats.accumRays += (int)data.mRays->size(); 
    2845  
    2846         if (data.mPvs < mTermMinPvs) 
    2847                 ++ mVspStats.minPvsNodes; 
    2848  
    2849         if ((int)data.mRays->size() < mTermMinRays) 
    2850                 ++ mVspStats.minRaysNodes; 
    2851  
    2852         if (data.GetAvgRayContribution() > mTermMaxRayContribution) 
    2853                 ++ mVspStats.maxRayContribNodes; 
     2847//      if (data.mPvs < mTermMinPvs) 
     2848//              ++ mOspStats.minPvsNodes; 
    28542849 
    28552850        if (data.mProbability <= mTermMinProbability) 
    2856                 ++ mVspStats.minProbabilityNodes; 
     2851                ++ mOspStats.minProbabilityNodes; 
    28572852         
    28582853        // accumulate depth to compute average depth 
    2859         mVspStats.accumDepth += data.mDepth; 
    2860  
    2861         ++ mCreatedViewCells; 
     2854        mOspStats.accumDepth += data.mDepth; 
     2855 
     2856        ++ mCreatedLeaves; 
    28622857 
    28632858#ifdef _DEBUG 
    28642859        Debug << "BSP stats: " 
    28652860                  << "Depth: " << data.mDepth << " (max: " << mTermMaxDepth << "), " 
    2866                   << "PVS: " << data.mPvs << " (min: " << mTermMinPvs << "), " 
    2867                   << "Area: " << data.mProbability << " (min: " << mTermMinProbability << "), " 
    2868                   << "#rays: " << (int)data.mRays->size() << " (max: " << mTermMinRays << "), " 
    2869                   << "#pvs: " << leaf->GetViewCell()->GetPvs().GetSize() << "), " 
    2870                   << "#avg ray contrib (pvs): " << (float)data.mPvs / (float)data.mRays->size() << endl; 
    2871 #endif 
    2872  
     2861                 // << "PVS: " << data.mPvs << " (min: " << mTermMinPvs << "), " 
     2862                  << "Prob: " << data.mProbability << " (min: " << mTermMinProbability << "), " 
     2863                  << "#pvs: " << data.mPvs << ")\n"; 
    28732864#endif 
    28742865} 
     
    28792870                                                                           const int axis, 
    28802871                                                                           float &position, 
    2881                                                                            int &objectsBack, 
    2882                                                                            int &objectsFront) 
     2872                                                                           int &objectsFront, 
     2873                                                                           int &objectsBack) 
    28832874{ 
    28842875         
     
    28892880        // C = ct_div_ci  + (ol + or)/queries 
    28902881         
    2891         int pvsSize = PrepareHeuristics(node->mObjects);; 
     2882        int pvsSize = PrepareHeuristics(node->mObjects); 
    28922883        int pvsl = 0, pvsr = pvsSize; 
    28932884   
     
    30093000int OspTree::PrepareHeuristics(Intersectable *object) 
    30103001{ 
     3002#if COUNT_OBJECTS 
     3003        return 1; 
     3004#else 
    30113005        ViewCellPvsMap::const_iterator vit, vit_end = object->mViewCellPvs.mEntries.end(); 
    30123006         
     
    30303024 
    30313025        return pvsSize; 
     3026#endif 
    30323027} 
    30333028 
     
    30733068 
    30743069 
     3070void OspTree::SetViewCellsManager(ViewCellsManager *vcm) 
     3071{ 
     3072        mViewCellsManager = vcm; 
     3073} 
     3074 
     3075 
     3076AxisAlignedBox3 OspTree::GetBoundingBox() const 
     3077{ 
     3078        return mBoundingBox; 
     3079} 
     3080 
     3081 
    30753082void OspTree::RemoveContriFromPvs(Intersectable *object, int &pvs) const 
    30763083{ 
     3084#if COUNT_OBJECTS 
     3085        -- pvs; 
     3086#else 
    30773087        ViewCellPvsMap::const_iterator vit, vit_end = object->mViewCellPvs.mEntries.end(); 
    30783088         
     
    30863096                } 
    30873097        } 
     3098#endif 
    30883099} 
    30893100 
     
    30933104        ViewCellPvsMap::const_iterator vit, vit_end = object->mViewCellPvs.mEntries.end(); 
    30943105 
     3106#if COUNT_OBJECTS 
     3107        ++ pvs; 
     3108#else 
    30953109        for (vit = object->mViewCellPvs.mEntries.begin(); vit != vit_end; ++ vit) 
    30963110        { 
     
    31033117                } 
    31043118        } 
     3119#endif 
    31053120} 
    31063121 
     
    31273142        } 
    31283143 
    3129 /* 
    3130         //sAxis = 2; 
     3144        // -- evaluate split cost for all three axis 
    31313145        for (int axis = 0; axis < 3; ++ axis) 
    31323146        { 
    31333147                if (!mOnlyDrivingAxis || (axis == sAxis)) 
    31343148                { 
    3135                         //-- place split plane using heuristics 
    3136  
    3137                         if (mUseCostHeuristics) 
    3138                         { 
     3149                        if (1 || mUseCostHeuristics) 
     3150                        { 
     3151                                //-- place split plane using heuristics 
     3152                                int objectsFront, objectsBack; 
     3153 
    31393154                                nCostRatio[axis] = 
    3140                                         EvalLocalCostHeuristics(*tData.mRays, 
    3141                                                                                         box, 
    3142                                                                                         tData.mPvs, 
    3143                                                                                         axis, 
    3144                                                                                         nPosition[axis]);                        
    3145                         } 
    3146                         else //-- split plane position is spatial median 
    3147                         { 
     3155                                        EvalLocalCostHeuristics(tData.mNode, 
     3156                                                                           tData.mBoundingBox, 
     3157                                                                           axis, 
     3158                                                                           nPosition[axis], 
     3159                                                                           objectsFront, 
     3160                                                                           objectsBack);                         
     3161                        } 
     3162                        /*      else  
     3163                        { 
     3164                                //-- split plane position is spatial median 
     3165 
    31483166                                nPosition[axis] = (box.Min()[axis] + box.Max()[axis]) * 0.5f; 
    31493167 
     
    31543172                                                                                                          nProbFront[axis],  
    31553173                                                                                                          nProbBack[axis]); 
    3156                         } 
     3174                        }*/ 
    31573175                                                 
    31583176                        if (bestAxis == -1) 
     
    31673185        } 
    31683186 
    3169 */ 
    31703187        //-- assign values 
    3171          
     3188 
    31723189        plane.mAxis = bestAxis; 
    31733190        // split plane position 
     
    31843201float OspTree::EvalViewCellPvsIncr(Intersectable *object) const 
    31853202{ 
    3186         return 0; 
     3203        // TODO          
     3204        return 1; 
    31873205} 
    31883206 
     
    32063224 
    32073225        Intersectable::NewMail(); 
     3226        KdLeaf::NewMail(); 
    32083227        ViewCell::NewMail(); 
    32093228 
    3210         KdLeaf *leaf = dynamic_cast<KdLeaf *>(data.mNode); 
     3229        KdLeaf *leaf = data.mNode; 
    32113230        ObjectContainer::const_iterator oit, oit_end = leaf->mObjects.end(); 
    32123231 
     
    32523271 
    32533272        const float normalizedOldRenderCost = oldRenderCost / mBoundingBox.GetVolume(); 
     3273 
    32543274        return factor * renderCostDecrease + (1.0f - factor) * normalizedOldRenderCost; 
    32553275} 
     
    33153335 
    33163336 
    3317  
    3318 /*********************************************************************/ 
    3319 /*                class HierarchyManager implementation              */ 
    3320 /*********************************************************************/ 
     3337void OspTree::CollectLeaves(vector<KdLeaf *> &leaves) const 
     3338{ 
     3339        stack<KdNode *> nodeStack; 
     3340        nodeStack.push(mRoot); 
     3341 
     3342        while (!nodeStack.empty())  
     3343        { 
     3344                KdNode *node = nodeStack.top(); 
     3345                nodeStack.pop(); 
     3346                if (node->IsLeaf())  
     3347                { 
     3348                        KdLeaf *leaf = (KdLeaf *)node; 
     3349                        leaves.push_back(leaf); 
     3350                } 
     3351                else  
     3352                { 
     3353                        KdInterior *interior = (KdInterior *)node; 
     3354                        nodeStack.push(interior->mBack); 
     3355                        nodeStack.push(interior->mFront); 
     3356                } 
     3357        } 
     3358} 
     3359 
     3360 
     3361AxisAlignedBox3 OspTree::GetBBox(KdNode *node) const 
     3362{ 
     3363        if (!node->mParent) 
     3364                return mBoundingBox; 
     3365 
     3366        if (!node->IsLeaf()) 
     3367        { 
     3368                return (dynamic_cast<KdInterior *>(node))->mBox;                 
     3369        } 
     3370 
     3371        KdInterior *parent = dynamic_cast<KdInterior *>(node->mParent); 
     3372 
     3373        AxisAlignedBox3 box(parent->mBox); 
     3374 
     3375        if (parent->mFront == node) 
     3376                box.SetMin(parent->mAxis, parent->mPosition); 
     3377    else 
     3378                box.SetMax(parent->mAxis, parent->mPosition); 
     3379 
     3380        return box; 
     3381} 
     3382 
     3383 
     3384/********************************************************************/ 
     3385/*               class HierarchyManager implementation              */ 
     3386/********************************************************************/ 
    33213387 
    33223388 
     
    33303396SplitCandidate *HierarchyManager::NextSplitCandidate() 
    33313397{ 
    3332         SplitCandidate *splitCandidate = static_cast<SplitCandidate *>(mTQueue.Top()); 
    3333         //Debug << "priority: " << splitCandidate->GetPriority() << endl; 
     3398        SplitCandidate *splitCandidate = mTQueue.Top(); 
     3399 
     3400        Debug << "next candidate: " << splitCandidate->Type() 
     3401                << ", priority: " << splitCandidate->GetPriority() << endl; 
     3402 
    33343403        mTQueue.Pop(); 
    33353404 
     
    34153484 
    34163485        // first osp traversal data 
    3417         OspTree::OspTraversalData oData(mOspTree.mRoot, 
     3486        OspTree::OspTraversalData oData(leaf, 
    34183487                                                                        0, 
    3419                                                                         &rays, 
    34203488                                                                        pvsSize, 
    34213489                                                                        prop, 
     
    34553523 
    34563524void HierarchyManager::Construct2(const VssRayContainer &sampleRays, 
    3457                                                                  const ObjectContainer &objects, 
    3458                                                                  AxisAlignedBox3 *forcedViewSpace) 
     3525                                                                  const ObjectContainer &objects, 
     3526                                                                  AxisAlignedBox3 *forcedViewSpace) 
    34593527{ 
    34603528        RayInfoContainer *rays = new RayInfoContainer(); 
     
    34933561 
    34943562        cout << "finished in " << TimeDiff(startTime, GetTime()) * 1e-3 << " secs" << endl; 
    3495  
    34963563 
    34973564        const int pvsSize = mVspTree.ComputePvsSize(*rays); 
     
    35493616 
    35503617        cout << "finished in " << TimeDiff(startTime, GetTime())*1e-3 << " secs" << endl; 
    3551  
    35523618        mVspTree.mVspStats.Stop(); 
    3553  
    3554  
     3619         
     3620        Debug << "object space" << endl; 
    35553621 
    35563622        //-- object space partition 
     
    35663632 
    35673633        //-- first osp traversal data 
    3568         OspTree::OspTraversalData oData(mOspTree.mRoot, 
     3634        OspTree::OspTraversalData oData(leaf, 
    35693635                                                                        0, 
    3570                                                                         rays, 
    35713636                                                                        pvsSize, 
    35723637                                                                        prop, 
     
    35803645    mOspTree.EvalSplitCandidate(*oSplitCandidate); 
    35813646 
    3582         mTQueue.Push(splitCandidate); 
     3647        mTQueue.Push(oSplitCandidate); 
    35833648 
    35843649        i = 0; 
     
    35903655                        GlobalTerminationCriteriaMet(splitCandidate); 
    35913656 
    3592                 cout << "view cells: " << i ++ << endl; 
     3657                cout << "kd nodes: " << i ++ << endl; 
    35933658 
    35943659                // cost ratio of cost decrease / totalCost 
     
    36093674                DEL_PTR(splitCandidate); 
    36103675        } 
    3611  
     3676         
    36123677        cout << "finished in " << TimeDiff(startTime, GetTime())*1e-3 << " secs" << endl; 
    36133678} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h

    r1101 r1106  
    181181        int splits[3]; 
    182182         
    183         // totals number of rays 
    184         int rays; 
    185183        // maximal reached depth 
    186184        int maxDepth; 
     
    194192        // max depth nodes 
    195193        int minPvsNodes; 
    196         // nodes with minimum PVS 
    197         int minRaysNodes; 
    198         // max ray contribution nodes 
    199         int maxRayContribNodes; 
    200194        // minimum area nodes 
    201195        int minProbabilityNodes; 
    202196        /// nodes termination because of max cost ratio; 
    203197        int maxCostNodes; 
    204         // max number of rays per node 
     198        // max number of objects per node 
    205199        int maxObjectRefs; 
     200        int objectRefs; 
    206201        /// samples contributing to pvs 
    207202        int contributingSamples; 
     
    214209        /// accumulated number of rays refs 
    215210        int accumRays; 
     211        /// potentially visible objects from this leaf 
    216212        int pvs; 
     213 
    217214        // accumulated depth (used to compute average) 
    218215        int accumDepth; 
     
    230227        // TODO: computation wrong 
    231228        double AvgDepth() const { return accumDepth / (double)Leaves();};  
    232         double AvgRays() const { return accumRays / (double)Leaves();};  
     229         
    233230 
    234231        void Reset()  
     
    244241                maxDepthNodes = 0; 
    245242                minPvsNodes = 0; 
    246                 minRaysNodes = 0; 
    247                 maxRayContribNodes = 0; 
     243         
    248244                minProbabilityNodes = 0; 
    249245                maxCostNodes = 0; 
     
    254250                maxPvs = 0; 
    255251                invalidLeaves = 0; 
    256                 accumRays = 0; 
     252                objectRefs = 0; 
    257253        } 
     254 
    258255 
    259256        void Print(ostream &app) const; 
     
    558555        public: 
    559556                static VspTree* sVspTree; 
    560                 /// parent data 
     557                /// parent node traversal data 
    561558                VspTraversalData mParentData; 
    562559                 
     
    619616        /** Returns box which bounds the whole tree. 
    620617        */ 
    621         AxisAlignedBox3 GetBoundingBox()const; 
     618        AxisAlignedBox3 GetBoundingBox() const; 
    622619 
    623620        /** Returns root of the view space partitioning tree. 
     
    10601057        /// number of currenly generated view cells 
    10611058        int mCreatedViewCells; 
    1062  
    1063 private: 
    1064  
    1065         /// Generates unique ids for PVS criterium 
    1066         static void GenerateUniqueIdsForPvs(); 
    1067  
    1068         //-- unique ids for PVS criterium 
    1069         static int sFrontId;  
    1070         static int sBackId; 
    1071         static int sFrontAndBackId; 
    10721059}; 
    10731060 
     
    10881075        public: 
    10891076                /// the current node 
    1090                 KdNode *mNode; 
     1077                KdLeaf *mNode; 
    10911078                /// current depth 
    10921079                int mDepth; 
    10931080                /// rays piercing this node 
    1094                 RayInfoContainer *mRays; 
     1081                //RayInfoContainer *mRays; 
    10951082                /// the probability that this node contains view point 
    10961083                float mProbability; 
     
    11061093                float mPriority; 
    11071094 
    1108                  
    1109                 /** Returns average ray contribution. 
    1110                 */ 
    1111                 float GetAvgRayContribution() const 
    1112                 { 
    1113                         return (float)mPvs / ((float)mRays->size() + Limits::Small); 
    1114                 } 
    1115  
    11161095 
    11171096                OspTraversalData(): 
    11181097                mNode(NULL), 
    11191098                mDepth(0), 
    1120                 mRays(NULL), 
    11211099                mPvs(0), 
    11221100                mProbability(0.0), 
     
    11261104                {} 
    11271105                 
    1128                 OspTraversalData(KdNode *node,  
     1106                OspTraversalData(KdLeaf *node,  
    11291107                                                 const int depth,  
    1130                                                  RayInfoContainer *rays, 
    11311108                                                 const int pvs, 
    11321109                                                 const float p, 
     
    11341111                mNode(node),  
    11351112                mDepth(depth),  
    1136                 mRays(rays), 
    11371113                mPvs(pvs), 
    11381114                mProbability(p), 
     
    11441120 
    11451121                OspTraversalData(const int depth,  
    1146                                                  RayInfoContainer *rays, 
    11471122                                                 const AxisAlignedBox3 &box):  
    11481123                mNode(NULL),  
    11491124                mDepth(depth),  
    1150                 mRays(rays), 
    11511125                mPvs(0), 
    11521126                mProbability(0), 
     
    11671141                void Clear() 
    11681142                { 
    1169                         DEL_PTR(mRays); 
    11701143                } 
    11711144 
     
    11891162                {}; 
    11901163 
    1191                 int Type() const { return VIEW_SPACE; } 
     1164                int Type() const { return OBJECT_SPACE; } 
    11921165         
    11931166                void EvalPriority() 
     
    12311204        /** Returns bounding box of the specified node. 
    12321205        */ 
    1233         AxisAlignedBox3 GetBoundingBox(KdNode *node) const; 
    1234  
    1235         /** Returns list of BSP leaves with pvs smaller than 
     1206        AxisAlignedBox3 GetBBox(KdNode *node) const; 
     1207 
     1208        /** Returns list of leaves with pvs smaller than 
    12361209                a certain threshold. 
    12371210                @param onlyUnmailed if only the unmailed leaves should be considered 
    12381211                @param maxPvs the maximal pvs of a leaf to be added (-1 means unlimited) 
    12391212        */ 
    1240         void CollectLeaves(vector<VspLeaf *> &leaves,  
    1241                                            const bool onlyUnmailed = false, 
    1242                                            const int maxPvs = -1) const; 
    1243  
    1244         /** Returns box which bounds the whole tree. 
     1213         
     1214        void CollectLeaves(vector<KdLeaf *> &leaves) const; 
     1215 
     1216 
     1217        /** Returns bounding box of the whole tree (= bbox of root node) 
    12451218        */ 
    12461219        AxisAlignedBox3 GetBoundingBox()const; 
     
    14061379                @returns the root of the subdivision 
    14071380        */ 
     1381        KdInterior *SubdivideNode(KdLeaf *leaf, 
     1382                const AxisAlignedPlane &splitPlane, 
     1383                const AxisAlignedBox3 &box, 
     1384                OspTraversalData &frontData, 
     1385                OspTraversalData &backData); 
     1386 
    14081387        void SplitObjects(const AxisAlignedPlane & splitPlane, 
    14091388                                          const ObjectContainer &objects, 
    1410                                           ObjectContainer &back, 
    1411                                           ObjectContainer &front); 
    1412  
    1413         KdInterior *SubdivideNode(KdLeaf *leaf, 
    1414                                                           const AxisAlignedPlane &splitPlane, 
    1415                                                           const AxisAlignedBox3 &box, 
    1416                                                           AxisAlignedBox3 &backBBox, 
    1417                                                           AxisAlignedBox3 &frontBBox); 
     1389                                          ObjectContainer &front, 
     1390                                          ObjectContainer &back); 
    14181391 
    14191392        void ProcessLeafObjects(KdLeaf *leaf, KdLeaf *parent) const; 
     
    14391412                const int axis, 
    14401413                float &position, 
    1441                 int &objectsBack, 
    1442                 int &objectsFront); 
     1414                int &objectsFront, 
     1415                int &objectsBack); 
    14431416 
    14441417        /** Subdivides the rays into front and back rays according to the split plane. 
     
    15531526        //-- local termination 
    15541527 
    1555         /// minimal number of rays before subdivision termination 
    1556         int mTermMinRays; 
    15571528        /// maximal possible depth 
    15581529        int mTermMaxDepth; 
    15591530        /// mininum probability 
    15601531        float mTermMinProbability; 
    1561         /// mininum PVS 
    1562         int mTermMinPvs; 
     1532        /// minimal number of objects 
     1533        int mTermMinObjects; 
    15631534        /// maximal contribution per ray 
    15641535        float mTermMaxRayContribution; 
     
    15691540 
    15701541 
     1542 
    15711543        //-- global criteria 
    15721544        float mTermMinGlobalCostRatio; 
     
    15751547 
    15761548        /// maximal number of view cells 
    1577         int mMaxViewCells; 
     1549        int mTermMaxLeaves; 
    15781550        /// maximal tree memory 
    15791551        float mMaxMemory; 
     
    15901562        /// if only driving axis should be used for split 
    15911563        bool mOnlyDrivingAxis; 
    1592         /// if random split axis should be used 
    1593         bool mUseRandomAxis; 
    1594         /// if vsp bsp tree should simulate octree 
    1595         bool mCirculatingAxis; 
    1596         /// minimal relative position where the split axis can be placed 
    1597         float mMinBand; 
    1598         /// maximal relative position where the split axis can be placed 
    1599         float mMaxBand; 
    1600  
    1601  
     1564         
    16021565        /// current time stamp (used for keeping split history) 
    16031566        int mTimeStamp; 
     
    16161579        int mTotalPvsSize; 
    16171580        /// number of currenly generated view cells 
    1618         int mCreatedViewCells; 
    1619  
     1581        int mCreatedLeaves; 
     1582 
     1583        /// represents min and max band for sweep 
    16201584        float mSplitBorder; 
    1621  
    1622  
    1623 private: 
    1624  
    1625         /// Generates unique ids for PVS criterium 
    1626         static void GenerateUniqueIdsForPvs(); 
    1627  
    1628         //-- unique ids for PVS criterium 
    1629         static int sFrontId;  
    1630         static int sBackId; 
    1631         static int sFrontAndBackId; 
    16321585}; 
    16331586 
  • GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.cpp

    r1020 r1106  
    99#include "Polygon3.h" 
    1010#include "VssRay.h" 
    11 //#include "VspOspTree.h" 
     11#include "VspOspTree.h" 
    1212#include "VssTree.h" 
    1313#include "VspBspTree.h" 
     
    538538} 
    539539 
    540 #if 0 
    541 bool X3dExporter::ExportVspOspTree(const VspOspTree &tree, const int maxPvs) 
    542 { 
    543         stack<VspKdNode *> tStack; 
    544  
    545         tStack.push(tree.GetRoot()); 
    546  
    547         //Mesh *mesh = new Mesh; 
    548    
    549         if (maxPvs > 0) 
    550                 mUseForcedMaterial = true; 
    551  
    552         while (!tStack.empty())  
    553         { 
    554                 VspKdNode *node = tStack.top(); 
    555      
    556                 tStack.pop(); 
    557  
    558                 if (node->IsLeaf()) 
    559                 { 
    560                         AxisAlignedBox3 box = tree.GetBBox(node); 
    561  
    562                         Mesh *mesh = new Mesh; 
    563  
    564                         // add 6 vertices of the box 
    565                         int index = (int)mesh->mVertices.size(); 
    566  
    567                         for (int i=0; i < 8; ++ i)  
    568                         { 
    569                                 Vector3 v; 
    570                                 box.GetVertex(i, v); 
    571                                 mesh->mVertices.push_back(v); 
    572                         } 
    573  
    574                         mesh->AddFace(new Face(index + 0, index + 1, index + 3, index + 2) ); 
    575                         mesh->AddFace(new Face(index + 0, index + 2, index + 6, index + 4) ); 
    576                         mesh->AddFace(new Face(index + 4, index + 6, index + 7, index + 5) ); 
    577  
    578                         mesh->AddFace(new Face(index + 3, index + 1, index + 5, index + 7) ); 
    579                         mesh->AddFace(new Face(index + 0, index + 4, index + 5, index + 1) ); 
    580                         mesh->AddFace(new Face(index + 2, index + 3, index + 7, index + 6) ); 
    581  
    582                         if (maxPvs > 0) 
    583                         { 
    584                                 VspKdLeaf *leaf = dynamic_cast<VspKdLeaf *>(node); 
    585  
    586                                 mForcedMaterial.mDiffuseColor.b = 1.0f; 
    587                                  
    588                                 leaf->UpdatePvsSize(); 
    589                          
    590                                 const float importance = (float)leaf->GetPvsSize() / (float)maxPvs; 
    591                                 mForcedMaterial.mDiffuseColor.r = importance; 
    592                                 mForcedMaterial.mDiffuseColor.g = 1.0f - mForcedMaterial.mDiffuseColor.r; 
    593                         } 
    594  
    595                         ExportMesh(mesh); 
    596                         DEL_PTR(mesh); 
    597                 } 
    598                 else   
    599                 { 
    600                         VspKdInterior *interior = dynamic_cast<VspKdInterior *>(node); 
    601                         tStack.push(interior->GetFront()); 
    602                         tStack.push(interior->GetBack()); 
    603                 } 
    604         } 
    605    
    606         //ExportMesh(mesh); 
    607         //DEL_PTR(mesh); 
    608  
    609         return true; 
    610 } 
    611 #endif 
    612540 
    613541bool X3dExporter::ExportKdTree(const KdTree &tree) 
     
    13091237} 
    13101238 
    1311 } 
     1239 
     1240bool X3dExporter::ExportOspTree(const OspTree &ospTree) 
     1241{ 
     1242        vector<KdLeaf *> leaves; 
     1243        ospTree.CollectLeaves(leaves); 
     1244 
     1245        vector<KdLeaf *>::const_iterator it, it_end = leaves.end(); 
     1246 
     1247        for (it = leaves.begin(); it != it_end; ++ it) 
     1248        { 
     1249                ExportBox(ospTree.GetBBox(*it)); 
     1250        } 
     1251 
     1252        return true; 
     1253} 
     1254 
     1255 
     1256} 
  • GTP/trunk/Lib/Vis/Preprocessing/src/X3dExporter.h

    r1006 r1106  
    5959                                 const Vector3 direction 
    6060                                 ); 
    61 #if VSP_OPS 
     61 
    6262  bool 
    63   ExportVspOspTree(const VspOspTree &tree, const int maxPvs); 
    64 #endif 
     63  ExportOspTree(const OspTree &tree); 
     64 
    6565  bool ExportBspTree(const BspTree &tree); 
    6666 
Note: See TracChangeset for help on using the changeset viewer.