Changeset 2705 for GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
- Timestamp:
- 05/24/08 11:59:35 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GvsPreprocessor.cpp
r2696 r2705 22 22 #define NOT_ACCOUNTED_OBJECT 0 23 23 #define ACCOUNTED_OBJECT 2 24 #define SHOW_QT_VISUALIZATION 0 24 25 25 26 26 static const float MIN_DIST = 0.001f; … … 174 174 175 175 176 void GvsPreprocessor::CountObject(Intersectable *triObj) 177 { 176 int GvsPreprocessor::CountObject(Intersectable *triObj) 177 { 178 int numObjects = 0; 179 178 180 if ((triObj->mCounter != (NOT_ACCOUNTED_OBJECT + 1)) && 179 181 (triObj->mCounter != (ACCOUNTED_OBJECT + 1))) 180 182 { 181 183 ++ triObj->mCounter; 182 ++ mGenericStats[1]; 183 } 184 ++ numObjects; 185 } 186 187 mGenericStats[1] += numObjects; 188 189 return numObjects; 184 190 } 185 191 … … 187 193 void GvsPreprocessor::UpdateStatsForVisualization(KdIntersectable *kdInt) 188 194 { 189 //mViewCellsManager->UpdateStatsForViewCell(mCurrentViewCell, kdInt);190 191 195 // count new objects in pvs due to kd node conversion 192 196 myobjects.clear(); 193 mKdTree->CollectObjects(kdInt->GetItem(), myobjects); 197 // also gather duplicates to avoid mailing 198 mKdTree->CollectObjectsWithDublicates(kdInt->GetItem(), myobjects); 199 200 int numObj; 194 201 195 202 ObjectContainer::const_iterator oit, oit_end = myobjects.end(); 196 203 197 204 for (oit = myobjects.begin(); oit != oit_end; ++ oit) 198 CountObject(*oit); 205 numObj = CountObject(*oit); 206 207 mViewCellsManager->UpdateStatsForViewCell(mCurrentViewCell, kdInt, numObj); 199 208 } 200 209 … … 240 249 mCurrentViewCell->GetPvs().AddSampleDirty(kdInt, 1.0f); 241 250 242 if ( SHOW_QT_VISUALIZATION) UpdateStatsForVisualization(kdInt);251 if (QT_VISUALIZATION_SHOWN) UpdateStatsForVisualization(kdInt); 243 252 } 244 253 } … … 871 880 872 881 873 void GvsPreprocessor:: IntersectWithViewCell()882 void GvsPreprocessor::ComputeViewCellGeometryIntersection() 874 883 { 875 884 AxisAlignedBox3 box = mCurrentViewCell->GetBox(); … … 915 924 mCurrentViewCell->GetPvs().AddSampleDirty(kdInt, 1.0f); 916 925 //mCurrentViewCell->GetPvs().AddSampleDirtyCheck(kdInt, 1.0f); 917 if ( SHOW_QT_VISUALIZATION) UpdateStatsForVisualization(kdInt);926 if (QT_VISUALIZATION_SHOWN) UpdateStatsForVisualization(kdInt); 918 927 } 919 928 } … … 1296 1305 1297 1306 // at last compute objects that directly intersect view cell 1298 IntersectWithViewCell();1307 ComputeViewCellGeometryIntersection(); 1299 1308 1300 1309
Note: See TracChangeset
for help on using the changeset viewer.