Changeset 1760


Ignore:
Timestamp:
11/15/06 20:34:23 (18 years ago)
Author:
mattausch
Message:
 
Location:
GTP/trunk/Lib/Vis/Preprocessing/src
Files:
7 edited

Legend:

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

    r1758 r1760  
    274274        //mMemoryConst = (float)(sizeof(VspLeaf) + sizeof(VspViewCell)); 
    275275        //mMemoryConst = (float)sizeof(BvhLeaf); 
    276         mMemoryConst = (float)sizeof(ObjectContainer); 
     276        mMemoryConst = 16;//(float)sizeof(ObjectContainer); 
    277277 
    278278    mUseBboxAreaForSah = true; 
  • GTP/trunk/Lib/Vis/Preprocessing/src/HierarchyManager.cpp

    r1758 r1760  
    21702170                 
    21712171                const float objectSpaceHierarchyMem = float( 
    2172                                                                                           subStats.mObjectSpaceSplits * sizeof(ObjectContainer) 
     2172                                                                                          subStats.mObjectSpaceSplits * mBvHierarchy->mMemoryConst//sizeof(ObjectContainer) 
    21732173                                                                                          //+ (subStats.mObjectSpaceSplits - 1) * sizeof(BvhInterior) 
    21742174                                                                                          //+sizeof(BvHierarchy) 
     
    21772177                         
    21782178                const float viewSpaceHierarchyMem = float( 
    2179                                                                                         subStats.mViewSpaceSplits * sizeof(ObjectPvs) 
     2179                                                                                        subStats.mViewSpaceSplits * mVspTree->mMemoryConst//sizeof(ObjectPvs) 
    21802180                                                                                        //+ (subStats.mViewSpaceSplits - 1) * sizeof(VspInterior) 
    21812181                                                                                        + sizeof(ObjectPvs) 
  • GTP/trunk/Lib/Vis/Preprocessing/src/TestPreprocessor.vcproj

    r1751 r1760  
    206206                                Name="VCLinkerTool" 
    207207                                AdditionalDependencies="xerces-c_2.lib glew32.lib zdll.lib zziplib.lib devil.lib glut32.lib OpenGL32.Lib glu32.lib Preprocessor.lib RTScene.lib RTWorld.lib QtCore4.lib qtmain.lib QtOpenGL4.lib Qt3Support4.lib QtTest4.lib QtGui4.lib QtGlRenderer.lib" 
    208                                 OutputFile="../bin/release/Preprocessor.exe" 
     208                                OutputFile="../bin/release/Preprocessor2.exe" 
    209209                                LinkIncremental="1" 
    210210                                AdditionalLibraryDirectories="..\src\GL;..\lib\release;..\..\Preprocessing\lib\release;..\..\..\..\..\..\NonGTP\Boost\lib;..\..\..\..\..\..\NonGTP\Xerces\xercesc\lib;..\..\..\..\..\..\NonGTP\Zlib\lib;..\..\..\..\..\..\NonGTP\Devil\lib;..\MultiLevelRayTracing\RTScene\Release;..\MultiLevelRayTracing\RTWorld\Release;"$(QTDIR)\lib";.\QtGlRenderer\Release" 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp

    r1758 r1760  
    4242// HACK 
    4343const static bool SAMPLE_AFTER_SUBDIVISION = true; 
    44 //const static bool CLAMP_TO_BOX = false; 
    45 const static bool CLAMP_TO_BOX = true; 
     44const static bool CLAMP_TO_BOX = false; 
     45//const static bool CLAMP_TO_BOX = true; 
    4646 
    4747 
     
    484484 
    485485                        exporter->SetWireframe(); 
    486                         ExportViewCellsForViz(exporter, NULL, GetClipPlane()); 
     486                        ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane()); 
    487487 
    488488                        delete exporter; 
     
    534534        } 
    535535 
    536          
    537536        if (0) 
    538537        { 
     
    15621561                mViewCellsTree->UpdateViewCellsStats(*it, mCurrentViewCellsStats); 
    15631562        } 
     1563        cout << "here44 " << mCurrentViewCellsStats.maxPvs << endl; 
    15641564} 
    15651565 
     
    21942194void ViewCellsManager::ExportViewCellsForViz(Exporter *exporter, 
    21952195                                                                                         const AxisAlignedBox3 *sceneBox, 
    2196                                                                                          const AxisAlignedPlane *clipPlane, 
    2197                                                                                          const bool colorCode 
     2196                                                                                         const bool colorCode, 
     2197                                                                                         const AxisAlignedPlane *clipPlane 
    21982198                                                                                         ) const 
    21992199{ 
    22002200        ViewCellContainer::const_iterator it, it_end = mViewCells.end(); 
    2201  
     2201cout << "here2" << endl; 
    22022202        for (it = mViewCells.begin(); it != it_end; ++ it) 
    2203         { 
     2203        {cout << "here4 " << mOnlyValidViewCells << " " << (*it)->GetValid() <<  endl; 
    22042204                if (!mOnlyValidViewCells || (*it)->GetValid()) 
    2205                 { 
     2205                {cout << "here5 " << mColorCode << endl; 
    22062206                        ExportColor(exporter, *it, colorCode);   
    22072207                        ExportViewCellGeometry(exporter, *it, sceneBox, clipPlane); 
     
    27322732        float importance = 0; 
    27332733        static Material m; 
    2734  
     2734        //cout << "color code: " << colorCode << endl; 
    27352735        switch (mColorCode) 
    27362736        { 
     
    27552755                 
    27562756        case 1: // pvs 
    2757                 { 
     2757                { //cout << "here22 " << mCurrentViewCellsStats.maxPvs << endl; 
    27582758                        if (mCurrentViewCellsStats.maxPvs) 
    27592759                        { 
     2760                                //cout << "pvscost : " << (float)mViewCellsTree->GetPvsCost(vc) << endl; 
     2761                                //cout << "maxPvs : " << (float)mCurrentViewCellsStats.maxPvs << endl; 
     2762 
    27602763                                importance =  
    27612764                                        (float)mViewCellsTree->GetPvsCost(vc) /  
     
    27802783#endif 
    27812784        default: 
     2785                cout << "here10" << endl; 
    27822786                break; 
    27832787        } 
     
    30343038 
    30353039                exporter->SetFilled(); 
    3036                 ExportViewCellsForViz(exporter, NULL, GetClipPlane()); 
     3040                ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane()); 
    30373041 
    30383042                delete exporter; 
     
    30413045 
    30423046        // export merged view cells using pvs color coding 
    3043         mColorCode = 1; 
    3044  
     3047         
    30453048        exporter = Exporter::GetExporter("merged_view_cells_pvs.wrl"); 
    30463049        cout << "exporting view cells after merge (pvs size) ... ";      
     
    30543057 
    30553058                exporter->SetFilled(); 
    3056                 ExportViewCellsForViz(exporter, NULL, GetClipPlane()); 
     3059                mColorCode = 1; 
     3060cout << "here49 " << mColorCode << endl; 
     3061                ExportViewCellsForViz(exporter, NULL,  mColorCode, GetClipPlane()); 
    30573062 
    30583063                delete exporter; 
     
    31443149 
    31453150        //  visualization of the view cells 
    3146         if (1) ExportMergedViewCells(objects); 
     3151        if (0) ExportMergedViewCells(objects); 
    31473152 
    31483153        // compute final meshes and volume / area 
     
    31863191                        } 
    31873192 
    3188                         ExportViewCellsForViz(exporter, NULL, GetClipPlane()); 
     3193                        ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane()); 
    31893194                        delete exporter; 
    31903195                } 
     
    42374242                                exporter->SetFilled(); 
    42384243 
    4239                         ExportViewCellsForViz(exporter, NULL, GetClipPlane()); 
     4244                        ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane()); 
    42404245 
    42414246                        if (mExportGeometry) 
     
    42664271                        exporter->SetFilled(); 
    42674272 
    4268                         ExportViewCellsForViz(exporter, NULL, GetClipPlane()); 
     4273                        ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane()); 
    42694274 
    42704275                        if (mExportGeometry) 
     
    45354540                                exporter->ExportRays(visRays, RgbColor(1, 0, 0)); 
    45364541                        } 
    4537                         ExportViewCellsForViz(exporter, NULL, GetClipPlane()); 
     4542                        ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane()); 
    45384543 
    45394544                        delete exporter; 
     
    54915496                } 
    54925497 
    5493                 mHierarchyManager->ExportObjectSpaceHierarchy(exporter,  
    5494                                 objects, CLAMP_TO_BOX ? &bbox : NULL, false); 
    5495                 ExportViewCellsForViz(exporter, CLAMP_TO_BOX ? &bbox : NULL, GetClipPlane()); 
     5498                mHierarchyManager->ExportObjectSpaceHierarchy(exporter, objects,  
     5499                                                                                                          CLAMP_TO_BOX ? &bbox : NULL, false); 
     5500                ExportViewCellsForViz(exporter, CLAMP_TO_BOX ? &bbox : NULL, mColorCode, GetClipPlane()); 
    54965501 
    54975502                delete exporter; 
     5503 
    54985504                cout << "finished in " << TimeDiff(starttime, GetTime()) * 1e-3f << " secs" << endl; 
    54995505                mColorCode = savedColorCode; 
     
    55175523                cout << "finished in " << TimeDiff(starttime, GetTime()) * 1e-3f << " secs" << endl; 
    55185524        } 
    5519  
    5520          
    5521         //  visualization of the view cells 
    5522         if (0) ExportMergedViewCells(objects); 
     5525         
     5526        cout << "here92 " << mHierarchyManager->GetVspTree()->GetStatistics().maxPvs << endl; 
     5527 
     5528        // visualization of the view cells 
     5529    if (1)  
     5530        {        
     5531                EvaluateViewCellsStats(); 
     5532                ExportMergedViewCells(objects); 
     5533        } 
    55235534 
    55245535        // export some view cell 
  • GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.h

    r1743 r1760  
    611611        void ExportViewCellsForViz(Exporter *exporter,  
    612612                                                           const AxisAlignedBox3 *box, 
    613                                                            const AxisAlignedPlane *clipPlane = NULL, 
    614                                                            const bool colorCode = 0) const; 
     613                                                           const bool colorCode, 
     614                                                           const AxisAlignedPlane *clipPlane 
     615                                                           ) const; 
    615616 
    616617        /** Sets exporter color. 
  • GTP/trunk/Lib/Vis/Preprocessing/src/VspTree.cpp

    r1749 r1760  
    473473 
    474474        //mMemoryConst = (float)(sizeof(VspLeaf) + sizeof(ObjectPvs)); 
    475         mMemoryConst = (float)sizeof(ObjectPvs); 
     475        mMemoryConst = 16;//(float)sizeof(ObjectPvs); 
    476476        cout << "vsp memcost: " << mMemoryConst << endl; 
    477477 
  • GTP/trunk/Lib/Vis/Preprocessing/src/main.cpp

    r1723 r1760  
    251251                Cleanup(); 
    252252                exit(1); 
    253         } 
    254  
    255         if (0){ 
    256         Exporter *exporter= Exporter::GetExporter("test1.wrl"); 
    257         AxisAlignedBox3 bbox = preprocessor->mViewCellsManager->GetViewSpaceBox();  
    258     exporter->SetWireframe(); 
    259         exporter->ExportBox(bbox); 
    260         exporter->SetFilled(); 
    261         exporter->ExportGeometry(preprocessor->mObjects, true); 
    262         delete exporter; 
    263253        } 
    264254         
Note: See TracChangeset for help on using the changeset viewer.