Changeset 2116 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
- Timestamp:
- 02/15/07 00:35:41 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellsManager.cpp
r2115 r2116 28 28 29 29 30 30 31 #define USE_RAY_LENGTH_AS_CONTRIBUTION 0 31 32 #define DIST_WEIGHTED_CONTRIBUTION 0 … … 170 171 } 171 172 172 Debug << "casting initial strategies: "; 173 173 Debug << "casting strategies: "; 174 174 for (int i = 0; i < (int)mStrategies.size(); ++ i) 175 175 Debug << mStrategies[i] << " "; … … 730 730 { 731 731 long startTime = GetTime(); 732 732 733 733 SimpleRayContainer simpleRays; 734 734 … … 1018 1018 1019 1019 1020 ViewCellsManager *ViewCellsManager::LoadViewCells(const string &filename,1021 ObjectContainer &pvsObjects,1022 bool finalizeViewCells,1023 BoundingBoxConverter *bconverter)1024 1025 {1026 ObjectContainer dummys;1027 1028 return LoadViewCells(filename,1029 pvsObjects,1030 dummys,1031 finalizeViewCells,1032 bconverter);1033 }1034 1020 1035 1021 … … 1059 1045 } 1060 1046 1047 //cout << "viewcells parsed " <<endl; 1048 1061 1049 if (0) 1062 1050 { … … 1127 1115 if (mUseKdPvs) 1128 1116 { 1129 vector<KdIntersectable *>::iterator kit, kit_end = 1130 GetPreprocessor()->mKdTree->mKdIntersectables.end(); 1117 vector<KdIntersectable *>::iterator kit, kit_end = GetPreprocessor()->mKdTree->mKdIntersectables.end(); 1131 1118 1132 1119 int id = 0; … … 1138 1125 obj->SetId(id); 1139 1126 1140 stream << "<BoundingBox" << " id=\"" << id<< "\""1141 << " min=\"" 1142 << " max=\"" 1127 stream << "<BoundingBox" << " id=\"" << id << "\"" 1128 << " min=\"" << box.Min().x << " " << box.Min().y << " " << box.Min().z << "\"" 1129 << " max=\"" << box.Max().x << " " << box.Max().y << " " << box.Max().z << "\" />" << endl; 1143 1130 } 1144 1131 } … … 1154 1141 //-- the bounding boxes 1155 1142 1156 stream << "<BoundingBox" << " id=\"" << (*oit)->GetId()<< "\""1157 << " min=\"" 1158 << " max=\"" 1143 stream << "<BoundingBox" << " id=\"" << (*oit)->GetId() << "\"" 1144 << " min=\"" << box.Min().x << " " << box.Min().y << " " << box.Min().z << "\"" 1145 << " max=\"" << box.Max().x << " " << box.Max().y << " " << box.Max().z << "\" />" << endl; 1159 1146 } 1160 1147 } … … 1560 1547 1561 1548 castSamples += samplesPerPass; 1562 //HashPvs<int> dummy;1563 1549 1564 1550 Real timeDiff = TimeDiff(startTime, GetTime()); … … 2070 2056 const bool useHitObjects) 2071 2057 { 2072 float sum = 0.0f; 2073 2074 VssRayContainer::const_iterator it, it_end = rays.end(); 2075 2076 for (it = rays.begin(); it != it_end; ++ it) 2077 { 2078 if (!ViewCellsConstructed()) { 2079 // view cells not yet constructed 2080 // just take the lenghts of the rays as contributions 2081 if ((*it)->mTerminationObject) 2082 sum += (*it)->Length(); 2083 } else { 2084 sum += ComputeSampleContribution(*(*it), addRays, storeViewCells, useHitObjects); 2085 } 2086 } 2087 2088 //cout<<"view cell cast time:"<<viewCellCastTimer.TotalTime()<<" s"<<endl; 2089 // cout<<"pvs time:"<<pvsTimer.TotalTime()<<" s"<<endl; 2090 2091 return sum; 2058 float sum = 0.0f; 2059 2060 VssRayContainer::const_iterator it, it_end = rays.end(); 2061 2062 for (it = rays.begin(); it != it_end; ++ it) 2063 { 2064 if (!ViewCellsConstructed()) 2065 { 2066 // view cells not yet constructed 2067 // just take the lenghts of the rays as contributions 2068 if ((*it)->mTerminationObject) 2069 { 2070 sum += (*it)->Length(); 2071 } 2072 } 2073 else 2074 { 2075 sum += ComputeSampleContribution(*(*it), addRays, storeViewCells, useHitObjects); 2076 } 2077 } 2078 2079 cout << "view cell cast time: " << viewCellCastTimer.TotalTime() << " s" << endl; 2080 Debug << "view cell cast time: " << viewCellCastTimer.TotalTime() << " s" << endl; 2081 2082 cout << "pvs time: " << pvsTimer.TotalTime() << " s" << endl; 2083 Debug << "pvs time: " << pvsTimer.TotalTime() << " s" << endl; 2084 2085 return sum; 2092 2086 } 2093 2087
Note: See TracChangeset
for help on using the changeset viewer.