Ignore:
Timestamp:
05/08/07 13:04:43 (17 years ago)
Author:
mattausch
Message:

cleaned up project files

File:
1 edited

Legend:

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

    r2351 r2353  
    66526652        stream << "</ViewCells>" << endl; 
    66536653 
     6654 
    66546655        ////////////////////// 
    66556656        //-- export the view space hierarchy 
     
    68086809} 
    68096810 
    6810  
    6811 #if 1 
    68126811 
    68136812void VspOspViewCellsManager::EvalViewCellPartition() 
     
    68986897                        Debug << "statistics computed in " << timeDiff * 1e-3 << " secs" << endl; 
    68996898 
    6900 #if 0 
    6901                         ////////////// 
    6902                         // filtered stats 
    6903  
    6904                         sprintf(suffix, "-%09d-eval-filter.log", castSamples); 
    6905                         const string filename2 = string(statsPrefix) + string(suffix); 
    6906  
    6907                         startTime = GetTime(); 
    6908                          
    6909                         cout << "compute new statistics for filtered pvs ... " << endl; 
    6910  
    6911                         ofstream ofstr2(filename2.c_str()); 
    6912                         mHierarchyManager->EvaluateSubdivision2(ofstr2, splitsStepSize, true); 
    6913  
    6914                         timeDiff = TimeDiff(startTime, GetTime()); 
    6915                         cout << "finished in " << timeDiff * 1e-3 << " secs" << endl; 
    6916                         cout << "*************************************" << endl; 
    6917                         Debug << "filtered statistics computed in " << timeDiff * 1e-3 << " secs" << endl; 
    6918 #endif 
    6919  
    6920                         // only for debugging purpose 
    6921                         if (0) 
    6922                         { 
    6923                                 ViewCellContainer viewCells; 
    6924                                 mViewCellsTree->CollectLeaves(mViewCellsTree->GetRoot(), viewCells); 
    6925  
    6926                                 ViewCellContainer::const_iterator vit, vit_end = viewCells.end(); 
    6927                                 int pvsSize = 0; 
    6928  
    6929                                 for (vit = viewCells.begin(); vit != vit_end; ++ vit) 
    6930                                 { 
    6931                                         pvsSize += (*vit)->GetPvs().GetSize(); 
    6932                                 } 
    6933  
    6934                                 cout << "debug entries: " << pvsSize << ", memcost: "  
    6935                                          << (float)pvsSize * ObjectPvs::GetEntrySize() << endl; 
    6936                         } 
    69376899                        ++ pass; 
    69386900                } 
     
    69596921 
    69606922                //for (int pass = histoStepSize; pass <= numLeaves; pass += histoStepSize) 
    6961                 if (1) 
    6962                 { 
    6963                         string filename; 
    6964  
    6965                         cout << "computing histogram for " << pass << " view cells" << endl; 
    6966  
    6967                         ////////////////////////////////////////// 
    6968             //-- evaluate histogram for pvs size 
    6969  
    6970                         cout << "computing pvs histogram for " << pass << " view cells" << endl; 
    6971  
    6972                         sprintf(str, "-%09d-histo-pvs2.log", pass); 
    6973                         filename = string(statsPrefix) + string(str); 
    6974  
    6975                         EvalViewCellHistogramForPvsSize(filename, pass); 
    6976                 } 
    6977         } 
    6978 } 
    6979  
    6980 #endif 
     6923 
     6924                string filename; 
     6925 
     6926                cout << "computing histogram for " << pass << " view cells" << endl; 
     6927 
     6928                ///////////////////////////// 
     6929                //-- evaluate histogram for pvs size 
     6930 
     6931                cout << "computing pvs histogram for " << pass << " view cells" << endl; 
     6932 
     6933                sprintf(str, "-%09d-histo-pvs2.log", pass); 
     6934                filename = string(statsPrefix) + string(str); 
     6935 
     6936                EvalViewCellHistogramForPvsSize(filename, pass); 
     6937        } 
     6938} 
     6939 
    69816940 
    69826941void VspOspViewCellsManager::FinalizeViewCells(const bool createMesh) 
     
    69936952 
    69946953#if TEST_PACKETS 
    6995 #ifdef USE_SSE 
    6996  
    6997 float ViewCellsManager::ComputeSampleContributions(const VssRayContainer &rays, 
    6998                                                                                                    const bool addContributions, 
    6999                                                                                                    const bool storeViewCells, 
    7000                                                                                                    const bool useHitObjects) 
    7001 { 
     6954 
     6955float VspOspViewCellsManager::ComputeSampleContributions(const VssRayContainer &rays, 
     6956                                                                                                                 const bool addContributions, 
     6957                                                                                                                 const bool storeViewCells, 
     6958                                                                                                                 const bool useHitObjects) 
     6959{ 
     6960        if (!ViewCellsConstructed())  
     6961                return 0; 
     6962         
    70026963        float sum = 0.0f; 
    7003  
    70046964        VssRayContainer::const_iterator it, it_end = rays.end(); 
    70056965 
    70066966        VssRayContainer tmpRays;         
    7007         RayPacket packet; 
    70086967 
    70096968        for (it = rays.begin(); it != it_end; ++ it)  
    70106969        { 
    7011                 if (!ViewCellsConstructed())  
    7012                 { 
    7013                         // view cells not yet constructed 
    7014                         // just take the lenghts of the rays as contributions 
    7015                         if ((*it)->mTerminationObject) 
     6970                sum += ComputeSampleContribution(*(*it), addContributions, storeViewCells, useHitObjects); 
     6971 
     6972                tmpRays.push_back(new VssRay(*(*it))); 
     6973                 
     6974                if (tmpRays.size() == 4) 
     6975                { 
     6976                        // cast packets of 4 rays 
     6977                        RayPacket packet(tmpRays); 
     6978                        mHierarchyManager->CastLineSegment(packet); 
     6979                 
     6980                        for (int i = 0; i < 4; ++ i) 
    70166981                        { 
    7017                                 sum += (*it)->Length(); 
     6982                                ComputeSampleContribution(*tmpRays[i], addContributions, true, useHitObjects); 
     6983 
     6984                                ////////// 
     6985                                // compare results 
     6986 
     6987                                cout << "ray " << i << ": " << (int)tmpRays[i]->mViewCells.size() << " " << (int)packet.mViewCells[i].size() << endl; 
    70186988                        } 
    7019                 }  
    7020                 else  
    7021                 { 
    7022                         sum += ComputeSampleContribution(*(*it), addContributions, storeViewCells, useHitObjects); 
    7023  
    7024                         tmpRays.push_back(new VssRay(*it)); 
     6989 
    70256990                         
    7026                         if (tmpRays.size() == 4) 
    7027                         { 
    7028                                 // cast packets of 4 rays 
    7029                                 RayPacket packet(tmpRays); 
    7030                                 mHierarchyManager->CastLineSegment(packet); 
    7031  
    7032                                 for (int i = 0; i < 4; ++ i) 
    7033                                 { 
    7034                                         ComputeSampleContribution(tmpRays[i], addContributions, true, useHitObjects); 
    7035                                 } 
    7036  
    7037                                 // compare results 
    7038                                 ////////// 
    7039  
    7040                                 CLEAR_CONTAINER(tmpRays); 
    7041                         } 
    7042                 } 
    7043         } 
     6991                         
     6992                        CLEAR_CONTAINER(tmpRays); 
     6993                } 
     6994        } 
     6995cout << "=================\nhere6"<<endl; 
     6996        CLEAR_CONTAINER(tmpRays); 
    70446997 
    70456998        cout << "view cell cast time: " << viewCellCastTimer.TotalTime() << " s" << endl; 
     
    70537006 
    70547007#endif 
    7055 #endif 
    7056  
    7057 } 
     7008 
     7009 
     7010} 
Note: See TracChangeset for help on using the changeset viewer.