Changeset 2353 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
- Timestamp:
- 05/08/07 13:04:43 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2351 r2353 6652 6652 stream << "</ViewCells>" << endl; 6653 6653 6654 6654 6655 ////////////////////// 6655 6656 //-- export the view space hierarchy … … 6808 6809 } 6809 6810 6810 6811 #if 16812 6811 6813 6812 void VspOspViewCellsManager::EvalViewCellPartition() … … 6898 6897 Debug << "statistics computed in " << timeDiff * 1e-3 << " secs" << endl; 6899 6898 6900 #if 06901 //////////////6902 // filtered stats6903 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 #endif6919 6920 // only for debugging purpose6921 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 }6937 6899 ++ pass; 6938 6900 } … … 6959 6921 6960 6922 //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 6981 6940 6982 6941 void VspOspViewCellsManager::FinalizeViewCells(const bool createMesh) … … 6993 6952 6994 6953 #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 6955 float 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 7002 6963 float sum = 0.0f; 7003 7004 6964 VssRayContainer::const_iterator it, it_end = rays.end(); 7005 6965 7006 6966 VssRayContainer tmpRays; 7007 RayPacket packet;7008 6967 7009 6968 for (it = rays.begin(); it != it_end; ++ it) 7010 6969 { 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) 7016 6981 { 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; 7018 6988 } 7019 } 7020 else 7021 { 7022 sum += ComputeSampleContribution(*(*it), addContributions, storeViewCells, useHitObjects); 7023 7024 tmpRays.push_back(new VssRay(*it)); 6989 7025 6990 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 } 6995 cout << "=================\nhere6"<<endl; 6996 CLEAR_CONTAINER(tmpRays); 7044 6997 7045 6998 cout << "view cell cast time: " << viewCellCastTimer.TotalTime() << " s" << endl; … … 7053 7006 7054 7007 #endif 7055 #endif 7056 7057 } 7008 7009 7010 }
Note: See TracChangeset
for help on using the changeset viewer.