Changeset 1008 for GTP/trunk/Lib/Vis
- Timestamp:
- 06/09/06 09:07:40 (19 years ago)
- Location:
- GTP/trunk/Lib/Vis
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/GlRenderer.h
r1006 r1008 259 259 public: 260 260 signals: 261 UpdatePvsErrorItem(int i, 262 GlRendererBuffer::PvsErrorEntry &); 261 void UpdatePvsErrorItem(int i, GlRendererBuffer::PvsErrorEntry &); 263 262 }; 264 263 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCell.h
r1006 r1008 8 8 #include "Material.h" 9 9 #include "gzstream.h" 10 10 #include "VspOspTree.h" 11 11 12 12 namespace GtpVisibilityPreprocessor { … … 17 17 class BspPvs; 18 18 class BspLeaf; 19 class Vsp KdLeaf;19 class VspLeaf; 20 20 class KdLeaf; 21 21 class ViewCellInterior; … … 97 97 friend class ViewCellsTree; 98 98 friend class ViewCellsManager; 99 //friend class VspBspViewCellsManager;100 //friend class BspViewCellsManager;101 //friend class VspBspTree;102 //friend class FromPointVisibilityTree;103 //friend class BspTree;104 105 99 106 100 public: … … 380 374 381 375 376 //typedef HierarchyLeafViewCell<VspLeaf *> VspViewCell; 382 377 typedef HierarchyLeafViewCell<BspLeaf *> BspViewCell; 383 378 typedef HierarchyLeafViewCell<KdLeaf *> KdViewCell; 384 typedef HierarchyLeafViewCell<VspKdLeaf *> VspKdViewCell; 379 385 380 386 381 -
GTP/trunk/Lib/Vis/Preprocessing/src/ViewCellBsp.h
r1006 r1008 410 410 }; 411 411 412 412 413 /** Implementation of the view cell BSP tree. 413 414 */ -
GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp
r1006 r1008 46 46 47 47 48 int VspNode::sMailId = 1; 49 50 51 /******************************************************************/ 52 /* class VspNode implementation */ 53 /******************************************************************/ 54 55 56 VspNode::VspNode(): 57 mParent(NULL), mTreeValid(true), mTimeStamp(0) 58 {} 59 60 61 VspNode::VspNode(VspInterior *parent): 62 mParent(parent), mTreeValid(true) 63 {} 64 65 66 bool VspNode::IsRoot() const 67 { 68 return mParent == NULL; 69 } 70 71 72 VspInterior *VspNode::GetParent() 73 { 74 return mParent; 75 } 76 77 78 void VspNode::SetParent(VspInterior *parent) 79 { 80 mParent = parent; 81 } 82 83 84 bool VspNode::IsSibling(VspNode *n) const 85 { 86 return ((this != n) && mParent && 87 (mParent->GetFront() == n) || (mParent->GetBack() == n)); 88 } 89 90 91 int VspNode::GetDepth() const 92 { 93 int depth = 0; 94 VspNode *p = mParent; 95 96 while (p) 97 { 98 p = p->mParent; 99 ++ depth; 100 } 101 102 return depth; 103 } 104 105 106 bool VspNode::TreeValid() const 107 { 108 return mTreeValid; 109 } 110 111 112 void VspNode::SetTreeValid(const bool v) 113 { 114 mTreeValid = v; 115 } 116 117 118 /****************************************************************/ 119 /* class VspInterior implementation */ 120 /****************************************************************/ 121 122 123 VspInterior::VspInterior(const AxisAlignedPlane &plane): 124 mPlane(plane), mFront(NULL), mBack(NULL) 125 {} 126 127 VspInterior::~VspInterior() 128 { 129 DEL_PTR(mFront); 130 DEL_PTR(mBack); 131 } 132 133 bool VspInterior::IsLeaf() const 134 { 135 return false; 136 } 137 138 VspNode *VspInterior::GetBack() 139 { 140 return mBack; 141 } 142 143 VspNode *VspInterior::GetFront() 144 { 145 return mFront; 146 } 147 148 AxisAlignedPlane VspInterior::GetPlane() const 149 { 150 return mPlane; 151 } 152 153 void VspInterior::ReplaceChildLink(VspNode *oldChild, VspNode *newChild) 154 { 155 if (mBack == oldChild) 156 mBack = newChild; 157 else 158 mFront = newChild; 159 } 160 161 void VspInterior::SetupChildLinks(VspNode *b, VspNode *f) 162 { 163 mBack = b; 164 mFront = f; 165 } 166 167 168 /****************************************************************/ 169 /* class VspLeaf implementation */ 170 /****************************************************************/ 171 172 173 VspLeaf::VspLeaf(): mViewCell(NULL), mPvs(NULL) 174 { 175 } 176 177 178 VspLeaf::~VspLeaf() 179 { 180 DEL_PTR(mPvs); 181 } 182 183 184 VspLeaf::VspLeaf(ViewCellLeaf *viewCell): 185 mViewCell(viewCell) 186 { 187 } 188 189 190 VspLeaf::VspLeaf(VspInterior *parent): 191 VspNode(parent), mViewCell(NULL), mPvs(NULL) 192 {} 193 194 195 196 VspLeaf::VspLeaf(VspInterior *parent, ViewCellLeaf *viewCell): 197 VspNode(parent), mViewCell(viewCell), mPvs(NULL) 198 { 199 } 200 201 ViewCellLeaf *VspLeaf::GetViewCell() const 202 { 203 return mViewCell; 204 } 205 206 void VspLeaf::SetViewCell(ViewCellLeaf *viewCell) 207 { 208 mViewCell = viewCell; 209 } 210 211 212 bool VspLeaf::IsLeaf() const 213 { 214 return true; 215 } 48 216 49 217 … … 140 308 141 309 142 BspViewCell *VspOspTree::GetOutOfBoundsCell()310 VspViewCell *VspOspTree::GetOutOfBoundsCell() 143 311 { 144 312 return mOutOfBoundsCell; … … 146 314 147 315 148 BspViewCell *VspOspTree::GetOrCreateOutOfBoundsCell()316 VspViewCell *VspOspTree::GetOrCreateOutOfBoundsCell() 149 317 { 150 318 if (!mOutOfBoundsCell) 151 319 { 152 mOutOfBoundsCell = new BspViewCell();320 mOutOfBoundsCell = new VspViewCell(); 153 321 mOutOfBoundsCell->SetId(-1); 154 322 mOutOfBoundsCell->SetValid(false); … … 159 327 160 328 161 const BspTreeStatistics &VspOspTree::GetStatistics() const162 { 163 return m BspStats;329 const VspTreeStatistics &VspOspTree::GetStatistics() const 330 { 331 return mVspStats; 164 332 } 165 333 … … 171 339 } 172 340 341 173 342 void VspOspTree::Construct(const VssRayContainer &sampleRays, 174 343 AxisAlignedBox3 *forcedBoundingBox) 175 344 { 176 m BspStats.nodes = 1;345 mVspStats.nodes = 1; 177 346 mBox.Initialize(); // initialise BSP tree bounding box 178 347 … … 231 400 return (float) 232 401 (sizeof(VspOspTree) + 233 m BspStats.Leaves() * sizeof(BspLeaf) +402 mVspStats.Leaves() * sizeof(VspLeaf) + 234 403 mCreatedViewCells * sizeof(BspViewCell) + 235 m BspStats.pvs * sizeof(ObjectPvsData) +236 m BspStats.Interior() * sizeof(BspInterior) +237 m BspStats.accumRays * sizeof(RayInfo)) / (1024.0f * 1024.0f);404 mVspStats.pvs * sizeof(ObjectPvsData) + 405 mVspStats.Interior() * sizeof(VspInterior) + 406 mVspStats.accumRays * sizeof(RayInfo)) / (1024.0f * 1024.0f); 238 407 } 239 408 … … 243 412 VspOspSplitQueue tQueue; 244 413 245 mRoot = new BspLeaf();414 mRoot = new VspLeaf(); 246 415 247 416 const float prop = mBox.GetVolume(); … … 274 443 275 444 276 m BspStats.Start();445 mVspStats.Start(); 277 446 cout << "Constructing vsp bsp tree ... \n"; 278 447 … … 313 482 314 483 // subdivide leaf node 315 BspNode *r = Subdivide(tQueue, splitCandidate);484 VspNode *r = Subdivide(tQueue, splitCandidate); 316 485 317 486 if (r == mRoot) … … 319 488 << TimeDiff(startTime, GetTime())*1e-3 << "s" << endl; 320 489 321 if (m BspStats.Leaves() >= nLeaves)490 if (mVspStats.Leaves() >= nLeaves) 322 491 { 323 492 nLeaves += 500; 324 493 325 cout << "leaves=" << m BspStats.Leaves() << endl;494 cout << "leaves=" << mVspStats.Leaves() << endl; 326 495 Debug << "needed " 327 496 << TimeDiff(interTime, GetTime())*1e-3 … … 341 510 cout << "finished\n"; 342 511 343 m BspStats.Stop();512 mVspStats.Stop(); 344 513 } 345 514 … … 360 529 return 361 530 (mOutOfMemory 362 || (m BspStats.Leaves() >= mMaxViewCells)531 || (mVspStats.Leaves() >= mMaxViewCells) 363 532 || (mGlobalCostMisses >= mTermGlobalCostMissTolerance) 364 533 ); … … 367 536 368 537 // subdivide using a split plane queue 369 BspNode *VspOspTree::Subdivide(VspOspSplitQueue &tQueue,538 VspNode *VspOspTree::Subdivide(VspOspSplitQueue &tQueue, 370 539 VspOspSplitCandidate &splitCandidate) 371 540 { 372 541 VspOspTraversalData &tData = splitCandidate.mParentData; 373 542 374 BspNode *newNode = tData.mNode;543 VspNode *newNode = tData.mNode; 375 544 376 545 if (!LocalTerminationCriteriaMet(tData) && !GlobalTerminationCriteriaMet(tData)) … … 382 551 383 552 // create new interior node and two leaf node 384 //TODO 385 const Plane3 splitPlane;// = splitCandidate.mSplitPlane; 386 553 const AxisAlignedPlane splitPlane = splitCandidate.mSplitPlane; 554 387 555 newNode = SubdivideNode(splitPlane, tData, tFrontData, tBackData); 388 556 … … 409 577 410 578 mSubdivisionStats 411 << "#ViewCells\n" << m BspStats.Leaves() << endl579 << "#ViewCells\n" << mVspStats.Leaves() << endl 412 580 << "#RenderCostDecrease\n" << -costDecr << endl 413 581 << "#SplitCandidateCost\n" << splitCandidate.GetCost() << endl 414 582 << "#TotalRenderCost\n" << mTotalCost << endl 415 << "#AvgRenderCost\n" << (float)mTotalPvsSize / (float)m BspStats.Leaves() << endl;583 << "#AvgRenderCost\n" << (float)mTotalPvsSize / (float)mVspStats.Leaves() << endl; 416 584 } 417 585 … … 435 603 if (newNode->IsLeaf()) 436 604 { 437 BspLeaf *leaf = dynamic_cast<BspLeaf *>(newNode);605 VspLeaf *leaf = dynamic_cast<VspLeaf *>(newNode); 438 606 BspViewCell *viewCell = new BspViewCell(); 439 607 … … 448 616 mViewCellsManager->SetScalarPvsSize(viewCell, viewCell->GetPvs().GetSize()); 449 617 450 m BspStats.contributingSamples += conSamp;451 m BspStats.sampleContributions +=(int) sampCon;618 mVspStats.contributingSamples += conSamp; 619 mVspStats.sampleContributions +=(int) sampCon; 452 620 453 621 //-- store additional info … … 484 652 VspOspTraversalData backData; 485 653 486 BspLeaf *leaf = dynamic_cast<BspLeaf *>(tData.mNode);654 VspLeaf *leaf = dynamic_cast<VspLeaf *>(tData.mNode); 487 655 488 656 // compute locally best split plane 489 // TODO 490 const bool success =0;/// SelectPlane(splitData.mSplitPlane, tData, 491 // frontData, backData); 657 const bool success = 658 SelectPlane(tData, splitData.mSplitPlane, 659 frontData.mProbability, backData.mProbability); 660 492 661 //TODO 493 662 // compute global decrease in render cost 494 splitData.mRenderCost = 0;//EvalRenderCostDecrease(splitData.mSplitPlane, tData);663 splitData.mRenderCost = EvalRenderCostDecrease(splitData.mSplitPlane, tData); 495 664 splitData.mParentData = tData; 496 665 splitData.mMaxCostMisses = success ? tData.mMaxCostMisses : tData.mMaxCostMisses + 1; … … 498 667 499 668 500 BspInterior *VspOspTree::SubdivideNode(const Plane3&splitPlane,669 VspInterior *VspOspTree::SubdivideNode(const AxisAlignedPlane &splitPlane, 501 670 VspOspTraversalData &tData, 502 671 VspOspTraversalData &frontData, 503 672 VspOspTraversalData &backData) 504 673 { 505 BspLeaf *leaf = dynamic_cast<BspLeaf *>(tData.mNode);674 VspLeaf *leaf = dynamic_cast<VspLeaf *>(tData.mNode); 506 675 507 676 //-- the front and back traversal data is filled with the new values … … 514 683 515 684 //-- subdivide rays 685 #if TODO 516 686 SplitRays(splitPlane, 517 687 *tData.mRays, 518 688 *frontData.mRays, 519 689 *backData.mRays); 520 690 #endif 521 691 522 692 // compute pvs … … 543 713 544 714 // store maximal and minimal depth 545 if (tData.mDepth > m BspStats.maxDepth)546 { 547 Debug << "max depth increases to " << tData.mDepth << " at " << m BspStats.Leaves() << " leaves" << endl;548 m BspStats.maxDepth = tData.mDepth;549 } 550 551 m BspStats.nodes += 2;715 if (tData.mDepth > mVspStats.maxDepth) 716 { 717 Debug << "max depth increases to " << tData.mDepth << " at " << mVspStats.Leaves() << " leaves" << endl; 718 mVspStats.maxDepth = tData.mDepth; 719 } 720 721 mVspStats.nodes += 2; 552 722 553 723 554 BspInterior *interior = new BspInterior(splitPlane);724 VspInterior *interior = new VspInterior(splitPlane); 555 725 556 726 #ifdef _DEBUG … … 561 731 //-- create front and back leaf 562 732 563 BspInterior *parent = leaf->GetParent();733 VspInterior *parent = leaf->GetParent(); 564 734 565 735 // replace a link from node's parent … … 575 745 576 746 // and setup child links 577 interior->SetupChildLinks(new BspLeaf(interior), new BspLeaf(interior));747 interior->SetupChildLinks(new VspLeaf(interior), new VspLeaf(interior)); 578 748 579 749 frontData.mNode = interior->GetFront(); … … 586 756 587 757 588 void VspOspTree::AddToPvs( BspLeaf *leaf,758 void VspOspTree::AddToPvs(VspLeaf *leaf, 589 759 const RayInfoContainer &rays, 590 760 float &sampleContributions, … … 946 1116 947 1117 948 float VspOspTree::EvalRenderCostDecrease(const Plane3&candidatePlane,1118 float VspOspTree::EvalRenderCostDecrease(const AxisAlignedPlane &candidatePlane, 949 1119 const VspOspTraversalData &data) const 950 1120 { … … 968 1138 float t; 969 1139 VssRay *ray = rayInf.mRay; 970 const int cf = rayInf.ComputeRayIntersection(candidatePlane, t); 1140 const int cf = 1141 rayInf.ComputeRayIntersection(candidatePlane.mAxis, 1142 candidatePlane.mPosition, t); 971 1143 972 1144 // find front and back pvs for origing and termination object … … 1116 1288 1117 1289 1118 void VspOspTree::CollectLeaves(vector< BspLeaf *> &leaves,1290 void VspOspTree::CollectLeaves(vector<VspLeaf *> &leaves, 1119 1291 const bool onlyUnmailed, 1120 1292 const int maxPvsSize) const 1121 1293 { 1122 stack< BspNode *> nodeStack;1294 stack<VspNode *> nodeStack; 1123 1295 nodeStack.push(mRoot); 1124 1296 1125 1297 while (!nodeStack.empty()) 1126 1298 { 1127 BspNode *node = nodeStack.top();1299 VspNode *node = nodeStack.top(); 1128 1300 nodeStack.pop(); 1129 1301 … … 1131 1303 { 1132 1304 // test if this leaf is in valid view space 1133 BspLeaf *leaf = dynamic_cast<BspLeaf *>(node);1305 VspLeaf *leaf = dynamic_cast<VspLeaf *>(node); 1134 1306 if (leaf->TreeValid() && 1135 1307 (!onlyUnmailed || !leaf->Mailed()) && … … 1141 1313 else 1142 1314 { 1143 BspInterior *interior = dynamic_cast<BspInterior *>(node);1315 VspInterior *interior = dynamic_cast<VspInterior *>(node); 1144 1316 1145 1317 nodeStack.push(interior->GetBack()); … … 1156 1328 1157 1329 1158 BspNode *VspOspTree::GetRoot() const1330 VspNode *VspOspTree::GetRoot() const 1159 1331 { 1160 1332 return mRoot; … … 1165 1337 { 1166 1338 // the node became a leaf -> evaluate stats for leafs 1167 BspLeaf *leaf = dynamic_cast<BspLeaf *>(data.mNode);1168 1169 1170 if (data.mPvs > m BspStats.maxPvs)1171 { 1172 m BspStats.maxPvs = data.mPvs;1173 } 1174 1175 m BspStats.pvs += data.mPvs;1176 1177 if (data.mDepth < m BspStats.minDepth)1178 { 1179 m BspStats.minDepth = data.mDepth;1339 VspLeaf *leaf = dynamic_cast<VspLeaf *>(data.mNode); 1340 1341 1342 if (data.mPvs > mVspStats.maxPvs) 1343 { 1344 mVspStats.maxPvs = data.mPvs; 1345 } 1346 1347 mVspStats.pvs += data.mPvs; 1348 1349 if (data.mDepth < mVspStats.minDepth) 1350 { 1351 mVspStats.minDepth = data.mDepth; 1180 1352 } 1181 1353 1182 1354 if (data.mDepth >= mTermMaxDepth) 1183 1355 { 1184 ++ m BspStats.maxDepthNodes;1185 //Debug << "new max depth: " << m BspStats.maxDepthNodes << endl;1356 ++ mVspStats.maxDepthNodes; 1357 //Debug << "new max depth: " << mVspStats.maxDepthNodes << endl; 1186 1358 } 1187 1359 1188 1360 // accumulate rays to compute rays / leaf 1189 m BspStats.accumRays += (int)data.mRays->size();1361 mVspStats.accumRays += (int)data.mRays->size(); 1190 1362 1191 1363 if (data.mPvs < mTermMinPvs) 1192 ++ m BspStats.minPvsNodes;1364 ++ mVspStats.minPvsNodes; 1193 1365 1194 1366 if ((int)data.mRays->size() < mTermMinRays) 1195 ++ m BspStats.minRaysNodes;1367 ++ mVspStats.minRaysNodes; 1196 1368 1197 1369 if (data.GetAvgRayContribution() > mTermMaxRayContribution) 1198 ++ m BspStats.maxRayContribNodes;1370 ++ mVspStats.maxRayContribNodes; 1199 1371 1200 1372 if (data.mProbability <= mTermMinProbability) 1201 ++ m BspStats.minProbabilityNodes;1373 ++ mVspStats.minProbabilityNodes; 1202 1374 1203 1375 // accumulate depth to compute average depth 1204 m BspStats.accumDepth += data.mDepth;1376 mVspStats.accumDepth += data.mDepth; 1205 1377 1206 1378 ++ mCreatedViewCells; … … 1221 1393 { 1222 1394 int hits = 0; 1223 1395 #if TODO 1224 1396 stack<BspRayTraversalData> tQueue; 1225 1397 … … 1234 1406 Vector3 extp = ray.Extrap(maxt); 1235 1407 1236 BspNode *node = mRoot;1237 BspNode *farChild = NULL;1408 VspNode *node = mRoot; 1409 VspNode *farChild = NULL; 1238 1410 1239 1411 while (1) … … 1241 1413 if (!node->IsLeaf()) 1242 1414 { 1243 BspInterior *in = dynamic_cast<BspInterior *>(node);1415 VspInterior *in = dynamic_cast<VspInterior *>(node); 1244 1416 1245 1417 Plane3 splitPlane = in->GetPlane(); … … 1274 1446 1275 1447 // push data for far child 1276 tQueue.push( BspRayTraversalData(farChild, extp, maxt));1448 tQueue.push(VspRayTraversalData(farChild, extp, maxt)); 1277 1449 1278 1450 // find intersection of ray segment with plane … … 1283 1455 } else // reached leaf => intersection with view cell 1284 1456 { 1285 BspLeaf *leaf = dynamic_cast<BspLeaf *>(node);1457 VspLeaf *leaf = dynamic_cast<VspLeaf *>(node); 1286 1458 1287 1459 if (!leaf->GetViewCell()->Mailed()) … … 1311 1483 } 1312 1484 } 1313 1485 #endif 1314 1486 return hits; 1315 1487 } … … 1328 1500 // TODO 1329 1501 #if HAS_TO_BE_REDONE 1330 stack< BspNode *> nodeStack;1502 stack<VspNode *> nodeStack; 1331 1503 1332 1504 if (!mRoot) … … 1337 1509 while (!nodeStack.empty()) 1338 1510 { 1339 BspNode *node = nodeStack.top();1511 VspNode *node = nodeStack.top(); 1340 1512 nodeStack.pop(); 1341 1513 1342 1514 if (node->IsLeaf()) 1343 1515 { 1344 BspViewCell *viewCell = dynamic_cast< BspLeaf *>(node)->GetViewCell();1516 BspViewCell *viewCell = dynamic_cast<VspLeaf *>(node)->GetViewCell(); 1345 1517 1346 1518 if (!viewCell->GetValid()) 1347 1519 { 1348 BspViewCell *viewCell = dynamic_cast< BspLeaf *>(node)->GetViewCell();1520 BspViewCell *viewCell = dynamic_cast<VspLeaf *>(node)->GetViewCell(); 1349 1521 1350 1522 ViewCellContainer leaves; … … 1355 1527 for (it = leaves.begin(); it != it_end; ++ it) 1356 1528 { 1357 BspLeaf *l = dynamic_cast<BspViewCell *>(*it)->mLeaf;1529 VspLeaf *l = dynamic_cast<BspViewCell *>(*it)->mLeaf; 1358 1530 l->SetViewCell(GetOrCreateOutOfBoundsCell()); 1359 ++ m BspStats.invalidLeaves;1531 ++ mVspStats.invalidLeaves; 1360 1532 } 1361 1533 … … 1367 1539 else 1368 1540 { 1369 BspInterior *interior = dynamic_cast<BspInterior *>(node);1541 VspInterior *interior = dynamic_cast<VspInterior *>(node); 1370 1542 1371 1543 nodeStack.push(interior->GetFront()); … … 1374 1546 } 1375 1547 1376 Debug << "invalid leaves: " << m BspStats.invalidLeaves << endl;1548 Debug << "invalid leaves: " << mVspStats.invalidLeaves << endl; 1377 1549 #endif 1378 1550 } … … 1381 1553 void VspOspTree::CollectRays(VssRayContainer &rays) 1382 1554 { 1383 vector< BspLeaf *> leaves;1384 1385 vector< BspLeaf *>::const_iterator lit, lit_end = leaves.end();1555 vector<VspLeaf *> leaves; 1556 1557 vector<VspLeaf *>::const_iterator lit, lit_end = leaves.end(); 1386 1558 1387 1559 for (lit = leaves.begin(); lit != lit_end; ++ lit) 1388 1560 { 1389 BspLeaf *leaf = *lit;1561 VspLeaf *leaf = *lit; 1390 1562 VssRayContainer::const_iterator rit, rit_end = leaf->mVssRays.end(); 1391 1563 … … 1398 1570 void VspOspTree::ValidateTree() 1399 1571 { 1400 stack< BspNode *> nodeStack;1572 stack<VspNode *> nodeStack; 1401 1573 1402 1574 if (!mRoot) … … 1405 1577 nodeStack.push(mRoot); 1406 1578 1407 m BspStats.invalidLeaves = 0;1579 mVspStats.invalidLeaves = 0; 1408 1580 while (!nodeStack.empty()) 1409 1581 { 1410 BspNode *node = nodeStack.top();1582 VspNode *node = nodeStack.top(); 1411 1583 nodeStack.pop(); 1412 1584 1413 1585 if (node->IsLeaf()) 1414 1586 { 1415 BspLeaf *leaf = dynamic_cast<BspLeaf *>(node);1587 VspLeaf *leaf = dynamic_cast<VspLeaf *>(node); 1416 1588 1417 1589 if (!leaf->GetViewCell()->GetValid()) 1418 ++ m BspStats.invalidLeaves;1590 ++ mVspStats.invalidLeaves; 1419 1591 1420 1592 // validity flags don't match => repair … … 1427 1599 else 1428 1600 { 1429 BspInterior *interior = dynamic_cast<BspInterior *>(node);1601 VspInterior *interior = dynamic_cast<VspInterior *>(node); 1430 1602 1431 1603 nodeStack.push(interior->GetFront()); … … 1434 1606 } 1435 1607 1436 Debug << "invalid leaves: " << m BspStats.invalidLeaves << endl;1437 } 1438 1439 1440 1441 void VspOspTree::CollectViewCells( BspNode *root,1608 Debug << "invalid leaves: " << mVspStats.invalidLeaves << endl; 1609 } 1610 1611 1612 1613 void VspOspTree::CollectViewCells(VspNode *root, 1442 1614 bool onlyValid, 1443 1615 ViewCellContainer &viewCells, 1444 1616 bool onlyUnmailed) const 1445 1617 { 1446 stack< BspNode *> nodeStack;1618 stack<VspNode *> nodeStack; 1447 1619 1448 1620 if (!root) … … 1453 1625 while (!nodeStack.empty()) 1454 1626 { 1455 BspNode *node = nodeStack.top();1627 VspNode *node = nodeStack.top(); 1456 1628 nodeStack.pop(); 1457 1629 … … 1460 1632 if (!onlyValid || node->TreeValid()) 1461 1633 { 1462 ViewCellLeaf *leafVc = dynamic_cast< BspLeaf *>(node)->GetViewCell();1634 ViewCellLeaf *leafVc = dynamic_cast<VspLeaf *>(node)->GetViewCell(); 1463 1635 1464 1636 ViewCell *viewCell = mViewCellsTree->GetActiveViewCell(leafVc); … … 1473 1645 else 1474 1646 { 1475 BspInterior *interior = dynamic_cast<BspInterior *>(node);1647 VspInterior *interior = dynamic_cast<VspInterior *>(node); 1476 1648 1477 1649 nodeStack.push(interior->GetFront()); … … 1538 1710 1539 1711 1540 int VspOspTree::FindNeighbors( BspNode *n, vector<BspLeaf *> &neighbors,1712 int VspOspTree::FindNeighbors(VspNode *n, vector<VspLeaf *> &neighbors, 1541 1713 const bool onlyUnmailed) const 1542 1714 { … … 1546 1718 1547 1719 1548 BspLeaf *VspOspTree::GetRandomLeaf(const Plane3 &halfspace)1720 VspLeaf *VspOspTree::GetRandomLeaf(const Plane3 &halfspace) 1549 1721 { 1550 1722 #if TODO 1551 stack< BspNode *> nodeStack;1723 stack<VspNode *> nodeStack; 1552 1724 nodeStack.push(mRoot); 1553 1725 … … 1556 1728 while (!nodeStack.empty()) 1557 1729 { 1558 BspNode *node = nodeStack.top();1730 VspNode *node = nodeStack.top(); 1559 1731 nodeStack.pop(); 1560 1732 1561 1733 if (node->IsLeaf()) 1562 1734 { 1563 return dynamic_cast< BspLeaf *>(node);1735 return dynamic_cast<VspLeaf *>(node); 1564 1736 } 1565 1737 else 1566 1738 { 1567 BspInterior *interior = dynamic_cast<BspInterior *>(node);1568 BspNode *next;1739 VspInterior *interior = dynamic_cast<VspInterior *>(node); 1740 VspNode *next; 1569 1741 BspNodeGeometry geom; 1570 1742 … … 1598 1770 1599 1771 1600 BspLeaf *VspOspTree::GetRandomLeaf(const bool onlyUnmailed)1601 { 1602 stack< BspNode *> nodeStack;1772 VspLeaf *VspOspTree::GetRandomLeaf(const bool onlyUnmailed) 1773 { 1774 stack<VspNode *> nodeStack; 1603 1775 1604 1776 nodeStack.push(mRoot); … … 1608 1780 while (!nodeStack.empty()) 1609 1781 { 1610 BspNode *node = nodeStack.top();1782 VspNode *node = nodeStack.top(); 1611 1783 nodeStack.pop(); 1612 1784 … … 1614 1786 { 1615 1787 if ( (!onlyUnmailed || !node->Mailed()) ) 1616 return dynamic_cast< BspLeaf *>(node);1788 return dynamic_cast<VspLeaf *>(node); 1617 1789 } 1618 1790 else 1619 1791 { 1620 BspInterior *interior = dynamic_cast<BspInterior *>(node);1792 VspInterior *interior = dynamic_cast<VspInterior *>(node); 1621 1793 1622 1794 // random decision … … 1680 1852 { 1681 1853 int hits = 0; 1854 #if TODO 1682 1855 stack<BspRayTraversalData> tStack; 1683 1856 … … 1690 1863 Vector3 extp = termination; 1691 1864 1692 BspNode *node = mRoot;1693 BspNode *farChild = NULL;1865 VspNode *node = mRoot; 1866 VspNode *farChild = NULL; 1694 1867 1695 1868 float t; … … 1700 1873 if (!node->IsLeaf()) 1701 1874 { 1702 BspInterior *in = dynamic_cast<BspInterior *>(node);1875 VspInterior *in = dynamic_cast<VspInterior *>(node); 1703 1876 1704 1877 Plane3 splitPlane = in->GetPlane(); … … 1738 1911 1739 1912 // push data for far child 1740 tStack.push( BspRayTraversalData(farChild, extp));1913 tStack.push(VspRayTraversalData(farChild, extp)); 1741 1914 1742 1915 // find intersection of ray segment with plane … … 1746 1919 { 1747 1920 // reached leaf => intersection with view cell 1748 BspLeaf *leaf = dynamic_cast<BspLeaf *>(node);1921 VspLeaf *leaf = dynamic_cast<VspLeaf *>(node); 1749 1922 ViewCell *viewCell; 1750 1923 … … 1775 1948 } 1776 1949 } 1777 1950 #endif 1778 1951 return hits; 1779 1952 } … … 1781 1954 1782 1955 1783 BspNode *VspOspTree::CollapseTree(BspNode *node, int &collapsed)1956 VspNode *VspOspTree::CollapseTree(VspNode *node, int &collapsed) 1784 1957 { 1785 1958 // TODO … … 1788 1961 return node; 1789 1962 1790 BspInterior *interior = dynamic_cast<BspInterior *>(node);1791 1792 BspNode *front = CollapseTree(interior->GetFront(), collapsed);1793 BspNode *back = CollapseTree(interior->GetBack(), collapsed);1963 VspInterior *interior = dynamic_cast<VspInterior *>(node); 1964 1965 VspNode *front = CollapseTree(interior->GetFront(), collapsed); 1966 VspNode *back = CollapseTree(interior->GetBack(), collapsed); 1794 1967 1795 1968 if (front->IsLeaf() && back->IsLeaf()) 1796 1969 { 1797 BspLeaf *frontLeaf = dynamic_cast<BspLeaf *>(front);1798 BspLeaf *backLeaf = dynamic_cast<BspLeaf *>(back);1970 VspLeaf *frontLeaf = dynamic_cast<VspLeaf *>(front); 1971 VspLeaf *backLeaf = dynamic_cast<VspLeaf *>(back); 1799 1972 1800 1973 //-- collapse tree … … 1803 1976 BspViewCell *vc = frontLeaf->GetViewCell(); 1804 1977 1805 BspLeaf *leaf = new BspLeaf(interior->GetParent(), vc);1978 VspLeaf *leaf = new VspLeaf(interior->GetParent(), vc); 1806 1979 leaf->SetTreeValid(frontLeaf->TreeValid()); 1807 1980 … … 1842 2015 #if HAS_TO_BE_REDONE 1843 2016 // list not valid anymore => clear 1844 stack< BspNode *> nodeStack;2017 stack<VspNode *> nodeStack; 1845 2018 nodeStack.push(mRoot); 1846 2019 … … 1849 2022 while (!nodeStack.empty()) 1850 2023 { 1851 BspNode *node = nodeStack.top();2024 VspNode *node = nodeStack.top(); 1852 2025 nodeStack.pop(); 1853 2026 1854 2027 if (node->IsLeaf()) 1855 2028 { 1856 BspLeaf *leaf = dynamic_cast<BspLeaf *>(node);2029 VspLeaf *leaf = dynamic_cast<VspLeaf *>(node); 1857 2030 1858 2031 BspViewCell *viewCell = leaf->GetViewCell(); … … 1869 2042 else 1870 2043 { 1871 BspInterior *interior = dynamic_cast<BspInterior *>(node);2044 VspInterior *interior = dynamic_cast<VspInterior *>(node); 1872 2045 1873 2046 nodeStack.push(interior->GetFront()); … … 1883 2056 ViewCell *VspOspTree::GetViewCell(const Vector3 &point, const bool active) 1884 2057 { 2058 #if TODO 1885 2059 if (mRoot == NULL) 1886 2060 return NULL; 1887 2061 1888 stack< BspNode *> nodeStack;2062 stack<VspNode *> nodeStack; 1889 2063 nodeStack.push(mRoot); 1890 2064 … … 1893 2067 while (!nodeStack.empty()) 1894 2068 { 1895 BspNode *node = nodeStack.top();2069 VspNode *node = nodeStack.top(); 1896 2070 nodeStack.pop(); 1897 2071 1898 2072 if (node->IsLeaf()) 1899 2073 { 1900 viewcell = dynamic_cast< BspLeaf *>(node)->GetViewCell();2074 viewcell = dynamic_cast<VspLeaf *>(node)->GetViewCell(); 1901 2075 break; 1902 2076 } 1903 2077 else 1904 2078 { 1905 BspInterior *interior = dynamic_cast<BspInterior *>(node);2079 VspInterior *interior = dynamic_cast<VspInterior *>(node); 1906 2080 1907 2081 // random decision … … 1917 2091 else 1918 2092 return viewcell; 2093 #endif 1919 2094 } 1920 2095 … … 1922 2097 bool VspOspTree::ViewPointValid(const Vector3 &viewPoint) const 1923 2098 { 1924 BspNode *node = mRoot; 2099 #if TODO 2100 VspNode *node = mRoot; 1925 2101 1926 2102 while (1) … … 1933 2109 return false; 1934 2110 1935 BspInterior *in = dynamic_cast<BspInterior *>(node);2111 VspInterior *in = dynamic_cast<VspInterior *>(node); 1936 2112 1937 2113 if (in->GetPlane().Side(viewPoint) <= 0) … … 1944 2120 } 1945 2121 } 1946 2122 #endif 1947 2123 // should never come here 1948 2124 return false; … … 1950 2126 1951 2127 1952 void VspOspTree::PropagateUpValidity( BspNode *node)2128 void VspOspTree::PropagateUpValidity(VspNode *node) 1953 2129 { 1954 2130 const bool isValid = node->TreeValid(); … … 1969 2145 { 1970 2146 node = node->GetParent(); 1971 BspInterior *interior = dynamic_cast<BspInterior *>(node);2147 VspInterior *interior = dynamic_cast<VspInterior *>(node); 1972 2148 1973 2149 // the parent is valid iff both leaves are valid … … 1991 2167 1992 2168 #if ZIPPED_VIEWCELLS 1993 void VspOspTree::ExportNode( BspNode *node, ogzstream &stream)2169 void VspOspTree::ExportNode(VspNode *node, ogzstream &stream) 1994 2170 #else 1995 void VspOspTree::ExportNode( BspNode *node, ofstream &stream)2171 void VspOspTree::ExportNode(VspNode *node, ofstream &stream) 1996 2172 #endif 1997 2173 { 1998 2174 if (node->IsLeaf()) 1999 2175 { 2000 BspLeaf *leaf = dynamic_cast<BspLeaf *>(node);2176 VspLeaf *leaf = dynamic_cast<VspLeaf *>(node); 2001 2177 ViewCell *viewCell = mViewCellsTree->GetActiveViewCell(leaf->GetViewCell()); 2002 2178 … … 2009 2185 else 2010 2186 { 2011 BspInterior *interior = dynamic_cast<BspInterior *>(node); 2187 #if TODO 2188 VspInterior *interior = dynamic_cast<VspInterior *>(node); 2012 2189 2013 2190 Plane3 plane = interior->GetPlane(); … … 2018 2195 ExportNode(interior->GetBack(), stream); 2019 2196 ExportNode(interior->GetFront(), stream); 2020 2197 #endif 2021 2198 stream << "</Interior>" << endl; 2022 2199 } -
GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.h
r1006 r1008 9 9 #include "VssRay.h" 10 10 #include "RayInfo.h" 11 #include "ViewCellBsp.h" 12 11 #include "gzstream.h" 13 12 14 13 … … 16 15 17 16 class ViewCellLeaf; 18 //class BspViewCell;17 class VspViewCell; 19 18 class Plane3; 20 class VspBspTree;21 class BspInterior;22 class BspNode;23 19 class AxisAlignedBox3; 24 20 class Ray; … … 29 25 class ViewCellsTree; 30 26 class Environment; 27 class VspInterior; 28 class VspLeaf; 29 class VspNode; 30 31 32 /** A definition for an axis aligned plane. 33 */ 34 struct AxisAlignedPlane 35 { 36 public: 37 int mAxis; 38 float mPosition; 39 }; 40 41 42 class VspTreeStatistics: public StatisticsBase 43 { 44 public: 45 // total number of nodes 46 int nodes; 47 // number of splits 48 int splits[3]; 49 50 // totals number of rays 51 int rays; 52 // maximal reached depth 53 int maxDepth; 54 // minimal depth 55 int minDepth; 56 57 // max depth nodes 58 int maxDepthNodes; 59 // minimum depth nodes 60 int minDepthNodes; 61 // max depth nodes 62 int minPvsNodes; 63 // nodes with minimum PVS 64 int minRaysNodes; 65 // max ray contribution nodes 66 int maxRayContribNodes; 67 // minimum area nodes 68 int minProbabilityNodes; 69 /// nodes termination because of max cost ratio; 70 int maxCostNodes; 71 // max number of rays per node 72 int maxObjectRefs; 73 /// samples contributing to pvs 74 int contributingSamples; 75 /// sample contributions to pvs 76 int sampleContributions; 77 /// largest pvs 78 int maxPvs; 79 /// number of invalid leaves 80 int invalidLeaves; 81 /// accumulated number of rays refs 82 int accumRays; 83 int pvs; 84 // accumulated depth (used to compute average) 85 int accumDepth; 86 87 // Constructor 88 VspTreeStatistics() 89 { 90 Reset(); 91 } 92 93 int Nodes() const {return nodes;} 94 int Interior() const { return nodes / 2; } 95 int Leaves() const { return (nodes / 2) + 1; } 96 97 // TODO: computation wrong 98 double AvgDepth() const { return accumDepth / (double)Leaves();}; 99 double AvgRays() const { return accumRays / (double)Leaves();}; 100 101 void Reset() 102 { 103 nodes = 0; 104 for (int i = 0; i < 3; ++ i) 105 splits[i] = 0; 106 107 maxDepth = 0; 108 minDepth = 99999; 109 accumDepth = 0; 110 pvs = 0; 111 maxDepthNodes = 0; 112 minPvsNodes = 0; 113 minRaysNodes = 0; 114 maxRayContribNodes = 0; 115 minProbabilityNodes = 0; 116 maxCostNodes = 0; 117 118 contributingSamples = 0; 119 sampleContributions = 0; 120 121 maxPvs = 0; 122 invalidLeaves = 0; 123 accumRays = 0; 124 } 125 126 void Print(ostream &app) const; 127 128 friend ostream &operator<<(ostream &s, const VspTreeStatistics &stat) 129 { 130 stat.Print(s); 131 return s; 132 } 133 }; 134 135 /** 136 VspNode abstract class serving for interior and leaf node implementation 137 */ 138 class VspNode 139 { 140 141 public: 142 VspNode(); 143 virtual ~VspNode(){}; 144 VspNode(VspInterior *parent); 145 146 /** Determines whether this node is a leaf or not 147 @return true if leaf 148 */ 149 virtual bool IsLeaf() const = 0; 150 151 /** Determines whether this node is a root 152 @return true if root 153 */ 154 virtual bool IsRoot() const; 155 156 /** Returns parent node. 157 */ 158 VspInterior *GetParent(); 159 160 /** Sets parent node. 161 */ 162 void SetParent(VspInterior *parent); 163 164 /** Returns true if this node is a sibling of node n. 165 */ 166 bool IsSibling(VspNode *n) const; 167 168 /** returns depth of the node. 169 */ 170 int GetDepth() const; 171 172 /** returns true if the whole subtree is valid 173 */ 174 bool TreeValid() const; 175 176 void SetTreeValid(const bool v); 177 178 //-- mailing options 179 180 void Mail() { mMailbox = sMailId; } 181 static void NewMail() { ++ sMailId; } 182 bool Mailed() const { return mMailbox == sMailId; } 183 184 static int sMailId; 185 int mMailbox; 186 187 int mTimeStamp; 188 189 protected: 190 191 /// if this sub tree is a completely valid view space region 192 bool mTreeValid; 193 /// parent of this node 194 VspInterior *mParent; 195 }; 196 197 198 /** BSP interior node implementation 199 */ 200 class VspInterior: public VspNode 201 { 202 public: 203 /** Standard contructor taking split plane as argument. 204 */ 205 VspInterior(const AxisAlignedPlane &plane); 206 ~VspInterior(); 207 /** @return false since it is an interior node 208 */ 209 bool IsLeaf() const; 210 211 VspNode *GetBack(); 212 VspNode *GetFront(); 213 214 /** Returns split plane. 215 */ 216 AxisAlignedPlane GetPlane() const; 217 218 /** Replace front or back child with new child. 219 */ 220 void ReplaceChildLink(VspNode *oldChild, VspNode *newChild); 221 /** Replace front and back child. 222 */ 223 void SetupChildLinks(VspNode *b, VspNode *f); 224 225 friend ostream &operator<<(ostream &s, const VspInterior &A) 226 { 227 return s << A.mPlane.mAxis << " " << A.mPlane.mPosition; 228 } 229 230 protected: 231 232 /// Splitting plane corresponding to this node 233 AxisAlignedPlane mPlane; 234 235 /// back node 236 VspNode *mBack; 237 /// front node 238 VspNode *mFront; 239 }; 240 241 242 /** BSP leaf node implementation. 243 */ 244 class VspLeaf: public VspNode 245 { 246 247 public: 248 VspLeaf(); 249 VspLeaf(ViewCellLeaf *viewCell); 250 VspLeaf(VspInterior *parent); 251 VspLeaf(VspInterior *parent, ViewCellLeaf *viewCell); 252 253 ~VspLeaf(); 254 255 /** @return true since it is an interior node 256 */ 257 bool IsLeaf() const; 258 259 /** Returns pointer of view cell. 260 */ 261 ViewCellLeaf *GetViewCell() const; 262 263 /** Sets pointer to view cell. 264 */ 265 void SetViewCell(ViewCellLeaf *viewCell); 266 267 /// Rays piercing this leaf. 268 VssRayContainer mVssRays; 269 270 /// leaf pvs 271 ObjectPvs *mPvs; 272 273 /// Probability that the view point lies in this leaf 274 float mProbability; 275 276 protected: 277 278 /// if NULL this does not correspond to feasible viewcell 279 ViewCellLeaf *mViewCell; 280 }; 281 31 282 32 283 /** … … 57 308 { 58 309 friend class ViewCellsParseHandlers; 59 friend class Vsp BspViewCellsManager;310 friend class VspVspViewCellsManager; 60 311 61 312 public: 62 313 63 /** A definition for an axis aligned plane.64 */65 struct AxisAlignedPlane66 {67 public:68 int mAxis;69 float mPosition;70 };71 72 314 /** Additional data which is passed down the BSP tree during traversal. 73 315 */ … … 76 318 public: 77 319 /// the current node 78 BspNode *mNode;320 VspNode *mNode; 79 321 /// current depth 80 322 int mDepth; … … 114 356 {} 115 357 116 VspOspTraversalData( BspNode *node,358 VspOspTraversalData(VspNode *node, 117 359 const int depth, 118 360 RayInfoContainer *rays, … … 193 435 #if 1 194 436 return mRenderCost; 195 #endif 196 #if 0 437 #else 197 438 return (float) (-mDepth); // for kd tree 198 439 #endif … … 217 458 /** Returns BSP Tree statistics. 218 459 */ 219 const BspTreeStatistics &GetStatistics() const;460 const VspTreeStatistics &GetStatistics() const; 220 461 221 462 … … 233 474 @param maxPvs the maximal pvs (-1 means unlimited) 234 475 */ 235 void CollectLeaves(vector< BspLeaf *> &leaves,476 void CollectLeaves(vector<VspLeaf *> &leaves, 236 477 const bool onlyUnmailed = false, 237 478 const int maxPvs = -1) const; … … 241 482 AxisAlignedBox3 GetBoundingBox()const; 242 483 243 /** Returns root of BSPtree.244 */ 245 BspNode *GetRoot() const;484 /** Returns root of the view space partitioning tree. 485 */ 486 VspNode *GetRoot() const; 246 487 247 488 /** Collects the leaf view cells of the tree … … 259 500 /** finds neighbouring leaves of this tree node. 260 501 */ 261 int FindNeighbors( BspNode *n,262 vector< BspLeaf *> &neighbors,502 int FindNeighbors(VspNode *n, 503 vector<VspLeaf *> &neighbors, 263 504 const bool onlyUnmailed) const; 264 505 … … 266 507 @param halfspace defines the halfspace from which the leaf is taken. 267 508 */ 268 BspLeaf *GetRandomLeaf(const Plane3 &halfspace);509 VspLeaf *GetRandomLeaf(const Plane3 &halfspace); 269 510 270 511 /** Returns random leaf of BSP tree. 271 512 @param onlyUnmailed if only unmailed leaves should be returned. 272 513 */ 273 BspLeaf *GetRandomLeaf(const bool onlyUnmailed = false);514 VspLeaf *GetRandomLeaf(const bool onlyUnmailed = false); 274 515 275 516 /** Returns epsilon of this tree. … … 291 532 void SetViewCellsManager(ViewCellsManager *vcm); 292 533 293 /** Returns distance from node 1 to node 2.294 */295 int TreeDistance(BspNode *n1, BspNode *n2) const;296 534 297 535 /** Collapses the tree with respect to the view cell partition. … … 316 554 the invalid view space. 317 555 */ 318 BspViewCell *GetOutOfBoundsCell();556 VspViewCell *GetOutOfBoundsCell(); 319 557 320 558 /** Writes tree to output stream … … 332 570 int CastBeam(Beam &beam); 333 571 334 /** Finds approximate neighbours, i.e., finds correct neighbors335 in most cases but sometimes more.336 */337 int FindApproximateNeighbors(BspNode *n,338 vector<BspLeaf *> &neighbors,339 const bool onlyUnmailed) const;340 572 341 573 /** Checks if tree validity-flags are right … … 410 642 /** Evaluates render cost decrease of next split. 411 643 */ 412 float EvalRenderCostDecrease(const Plane3&candidatePlane,644 float EvalRenderCostDecrease(const AxisAlignedPlane &candidatePlane, 413 645 const VspOspTraversalData &data) const; 414 646 … … 419 651 /** Collects view cells in the subtree under root. 420 652 */ 421 void CollectViewCells( BspNode *root,653 void CollectViewCells(VspNode *root, 422 654 bool onlyValid, 423 655 ViewCellContainer &viewCells, … … 427 659 the invalid view space. If it does not exist, it is created. 428 660 */ 429 BspViewCell *GetOrCreateOutOfBoundsCell();661 VspViewCell *GetOrCreateOutOfBoundsCell(); 430 662 431 663 /** Collapses the tree with respect to the view cell partition, … … 436 668 this node otherwise 437 669 */ 438 BspNode *CollapseTree(BspNode *node, int &collapsed);670 VspNode *CollapseTree(VspNode *node, int &collapsed); 439 671 440 672 /** Helper function revalidating the view cell leaf list after merge. … … 451 683 @returns new root of the subtree 452 684 */ 453 BspNode *Subdivide(VspOspSplitQueue &tQueue,685 VspNode *Subdivide(VspOspSplitQueue &tQueue, 454 686 VspOspSplitCandidate &splitCandidate); 455 687 … … 469 701 */ 470 702 471 BspInterior *SubdivideNode(const Plane3&splitPlane,703 VspInterior *SubdivideNode(const AxisAlignedPlane &splitPlane, 472 704 VspOspTraversalData &tData, 473 705 VspOspTraversalData &frontData, … … 546 778 547 779 */ 548 void AddToPvs( BspLeaf *leaf,780 void AddToPvs(VspLeaf *leaf, 549 781 const RayInfoContainer &rays, 550 782 float &sampleContributions, … … 553 785 /** Propagates valid flag up the tree. 554 786 */ 555 void PropagateUpValidity( BspNode *node);787 void PropagateUpValidity(VspNode *node); 556 788 557 789 /** Writes the node to disk … … 559 791 */ 560 792 #if ZIPPED_VIEWCELLS 561 void ExportNode( BspNode *node, ogzstream &stream);793 void ExportNode(VspNode *node, ogzstream &stream); 562 794 #else 563 void ExportNode( BspNode *node, ofstream &stream);795 void ExportNode(VspNode *node, ofstream &stream); 564 796 #endif 565 797 … … 575 807 576 808 /// Pointer to the root of the tree 577 BspNode *mRoot;578 579 BspTreeStatistics mBspStats;809 VspNode *mRoot; 810 811 VspTreeStatistics mVspStats; 580 812 581 813 /// View cell corresponding to the space outside the valid view space 582 BspViewCell *mOutOfBoundsCell;814 VspViewCell *mOutOfBoundsCell; 583 815 584 816 /// box around the whole view domain
Note: See TracChangeset
for help on using the changeset viewer.