Changeset 1557 for GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp
- Timestamp:
- 10/03/06 10:10:01 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.cpp
r1553 r1557 174 174 { 175 175 Randomize(); // initialise random generator for heuristics 176 mOutOfBoundsCell = new BspViewCell();177 mOutOfBoundsCell->SetId(-1); 176 mOutOfBoundsCell = GetOrCreateOutOfBoundsCell(); 177 178 178 ///////// 179 179 //-- termination criteria for autopartition … … 277 277 278 278 279 BspViewCell *BspTree::GetOrCreateOutOfBoundsCell() 280 { 281 if (!mOutOfBoundsCell) 282 { 283 mOutOfBoundsCell = new BspViewCell(); 284 mOutOfBoundsCell->SetId(OUT_OF_BOUNDS_ID); 285 mOutOfBoundsCell->SetValid(false); 286 } 287 288 return mOutOfBoundsCell; 289 } 290 279 291 int BspTree::SplitPolygons(const Plane3 &plane, 280 292 PolygonContainer &polys, … … 420 432 if (mOutOfBoundsCellPartOfTree) 421 433 { 422 cout << "here223 " << mOutOfBoundsCell << endl;423 434 // out of bounds cell not part of tree => 424 435 // delete manually 425 436 DEL_PTR(mOutOfBoundsCell); 426 } else cout << "here991 " << endl;437 } 427 438 } 428 439 … … 999 1010 // add predefined view cell to leaf 1000 1011 viewCell = dynamic_cast<BspViewCell *>(tData.mViewCell); 1001 1002 /// out of bounds cell can be handled as any other cell 1012 1013 // from now on out of bounds cell can be handled as any other cell, 1014 // responsibility for deleting has been shifted 1003 1015 if (viewCell == mOutOfBoundsCell) 1016 { 1004 1017 mOutOfBoundsCellPartOfTree = true; 1018 } 1005 1019 } 1006 1020 … … 2364 2378 2365 2379 2366 2367 2380 void BspTree::ConstructGeometry(ViewCell *vc, 2368 2381 BspNodeGeometry &vcGeom) const … … 2379 2392 for (it = leaves.begin(); it != it_end; ++ it) 2380 2393 { 2394 // per definition out of bounds cell has zero volume 2395 if ((*it) == mOutOfBoundsCell) 2396 continue; 2397 2381 2398 BspViewCell *bspVc = dynamic_cast<BspViewCell *>(*it); 2382 2399 vector<BspLeaf *>::const_iterator bit, bit_end = bspVc->mLeaves.end();
Note: See TracChangeset
for help on using the changeset viewer.