Ignore:
Timestamp:
05/24/07 18:33:00 (17 years ago)
Author:
mattausch
Message:
 
File:
1 edited

Legend:

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

    r2387 r2394  
    35693569void ViewCellsManager::ExportColor(Exporter *exporter,  
    35703570                                                                   ViewCell *vc,  
    3571                                                                    bool colorCode) const 
     3571                                                                   int colorCode) const 
    35723572{ 
    35733573        const bool vcValid = CheckValidity(vc, mMinPvsSize, mMaxPvsSize); 
     
    35763576        static Material m; 
    35773577        //cout << "color code: " << colorCode << endl; 
    3578         switch (mColorCode) 
     3578                 
     3579        switch (colorCode) 
    35793580        { 
    35803581        case 0: // Random 
     
    36013602                        if (mCurrentViewCellsStats.maxPvs) 
    36023603                        { 
    3603                                 importance = (float)mViewCellsTree->GetTrianglesInPvs(vc) / 700; 
    3604                                                          //(float)mCurrentViewCellsStats.maxPvs; 
     3604                                importance = //(float)mViewCellsTree->GetTrianglesInPvs(vc) / 700; 
     3605                                                         (float)mCurrentViewCellsStats.maxPvs; 
    36053606                        } 
    36063607                } 
     
    39963997        if (1) // export final view cells 
    39973998        { 
    3998                 mColorCode = 1; // hack color code 
     3999                mColorCode = 1; // 0 = pvs, 1 = random 
    39994000                Exporter *exporter = Exporter::GetExporter("final_view_cells.wrl"); 
    40004001         
     
    40734074                                                                                                const bool exportRays, 
    40744075                                                                                                const int maxRays, 
    4075                                                                                                 const string prefix, 
     4076                                                                                                const string &prefix, 
    40764077                                                                                                VssRayContainer *visRays) 
    40774078{ 
     
    45894590                                                                                           const bool exportRays, 
    45904591                                                                                           const int maxRays, 
    4591                                                                                            const string prefix, 
     4592                                                                                           const string &prefix, 
    45924593                                                                                           VssRayContainer *visRays) 
    45934594{ 
     
    53955396                                                                                                   const bool exportRays, 
    53965397                                                                                                   const int maxRays, 
    5397                                                                                                    const string prefix, 
     5398                                                                                                   const string &prefix, 
    53985399                                                                                                   VssRayContainer *visRays) 
    53995400{        
     
    63286329        if (exporter) 
    63296330        { 
     6331                // clamp to a scene boudning box 
    63306332                if (CLAMP_TO_BOX) 
    6331                 {        
    63326333                        exporter->mClampToBox = true;    
    6333                 } 
    6334  
    6335                 EvaluateViewCellsStats(); 
    6336  
     6334                 
    63376335                const long starttime = GetTime(); 
    63386336                cout << "exporting final view cells (after initial construction + post process) ... " << endl; 
     
    63506348                const int savedColorCode = mColorCode; 
    63516349 
    6352                 const float maxRenderCost = UpdateObjectCosts(); 
    6353                 cout << "maxRenderCost: " << maxRenderCost << endl; 
    6354                 mColorCode = 0; // 0 = random, 1 = export pvs 
    6355  
    6356                 if (1) 
    6357                 mHierarchyManager->ExportObjectSpaceHierarchy(exporter, objects,  
    6358                                                                                                           CLAMP_TO_BOX ? &bbox : NULL, maxRenderCost, false); 
    6359                  
    6360  
    6361                 if (1) 
    6362                 { 
    6363                         //ExportViewCellsForViz(exporter, CLAMP_TO_BOX ? &bbox : NULL, mColorCode, GetClipPlane()); 
    6364                         ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane()); 
    6365                 } 
    6366  
    6367                 delete exporter; 
    6368  
    6369                 cout << "finished in " << TimeDiff(starttime, GetTime()) * 1e-3f << " secs" << endl; 
    6370                 mColorCode = savedColorCode; 
    6371         } 
    6372  
    6373         exporter = Exporter::GetExporter("final_object_partition.wrl"); 
    6374  
    6375         if (exporter) 
    6376         { 
    6377                 if (CLAMP_TO_BOX) 
    6378                 {        
    6379                         exporter->mClampToBox = true;    
    6380                 } 
    6381  
    63826350                EvaluateViewCellsStats(); 
    6383  
    6384                 const long starttime = GetTime(); 
    6385                 cout << "exporting final objects (after initial construction + post process) ... "; 
    6386  
    6387                 // matt: hack for clamping scene 
    6388                 AxisAlignedBox3 bbox = mViewSpaceBox; 
    6389                 bbox.Scale(scale); 
    6390  
    6391                 // hack color code (show pvs size) 
    6392                 const int savedColorCode = mColorCode; 
    6393  
    6394                 mColorCode = 1; // 0 = random, 1 = export pvs 
    6395                 // don't visualize render cost 
    6396                 const float maxRenderCost = -1; 
    6397  
     6351                const int colorCode = 0; 
     6352 
     6353                const float maxRenderCost = -1;//UpdateObjectCosts(); 
     6354                const bool exportBounds = false; 
     6355 
     6356                //cout << "maxRenderCost: " << maxRenderCost << endl; 
    63986357                if (1) 
    63996358                mHierarchyManager->ExportObjectSpaceHierarchy(exporter,  
     
    64016360                                                                                                          CLAMP_TO_BOX ? &bbox : NULL,  
    64026361                                                                                                          maxRenderCost,  
    6403                                                                                                           false); 
     6362                                                                                                          exportBounds); 
    64046363                 
    6405  
    6406                 if (1) 
    6407                 { 
    6408                         ExportViewCellsForViz(exporter, NULL, mColorCode, GetClipPlane()); 
    6409                         //ExportViewCellsForViz(exporter, CLAMP_TO_BOX ? &bbox : NULL, mColorCode, GetClipPlane()); 
    6410                 } 
    6411  
     6364                //ExportViewCellsForViz(exporter, CLAMP_TO_BOX ? &bbox : NULL, mColorCode, GetClipPlane()); 
     6365                ExportViewCellsForViz(exporter, NULL, colorCode, GetClipPlane()); 
     6366                 
    64126367                delete exporter; 
    64136368 
    64146369                cout << "finished in " << TimeDiff(starttime, GetTime()) * 1e-3f << " secs" << endl; 
    6415                 mColorCode = savedColorCode; 
    6416         } 
    6417  
    6418         // visualization of the merged view cells 
    6419     if (0)  
    6420         {        
    6421                 ExportMergedViewCells(objects); 
     6370        } 
     6371 
     6372        if (1) 
     6373        { 
     6374                exporter = Exporter::GetExporter("final_object_partition.wrl"); 
     6375 
     6376                if (exporter) 
     6377                { 
     6378                        if (CLAMP_TO_BOX) 
     6379                        {        
     6380                                exporter->mClampToBox = true;    
     6381                        } 
     6382 
     6383                        const long starttime = GetTime(); 
     6384                        cout << "exporting final objects (after initial construction + post process) ... "; 
     6385 
     6386                        // matt: hack for clamping scene 
     6387                        AxisAlignedBox3 bbox = mViewSpaceBox; 
     6388                        bbox.Scale(scale); 
     6389 
     6390                        // hack color code (show pvs size) 
     6391                        const int savedColorCode = mColorCode; 
     6392 
     6393                        EvaluateViewCellsStats(); 
     6394                        mColorCode = 1; // 0 = random, 1 = export pvs 
     6395 
     6396                        // don't visualize render cost 
     6397                        const float maxRenderCost = -1; 
     6398                        //const bool exportBounds = true; 
     6399                        const bool exportBounds = false; 
     6400 
     6401                        if (1) 
     6402                        mHierarchyManager->ExportObjectSpaceHierarchy(exporter,  
     6403                                                                      objects,  
     6404                                                                                                                  CLAMP_TO_BOX ? &bbox : NULL,  
     6405                                                                                                                  maxRenderCost,  
     6406                                                                                                                  exportBounds); 
     6407 
     6408 
     6409                        delete exporter; 
     6410 
     6411                        cout << "finished in " << TimeDiff(starttime, GetTime()) * 1e-3f << " secs" << endl; 
     6412                        mColorCode = savedColorCode; 
     6413                } 
    64226414        } 
    64236415 
     
    64476439                                                                                                   const bool exportRays, 
    64486440                                                                                                   const int maxRays, 
    6449                                                                                                    const string prefix, 
     6441                                                                                                   const string &prefix, 
    64506442                                                                                                   VssRayContainer *visRays) 
    64516443{ 
Note: See TracChangeset for help on using the changeset viewer.