Changeset 2017 for GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
- Timestamp:
- 01/22/07 23:35:03 (17 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/BvHierarchy.cpp
r2005 r2017 490 490 { 491 491 BvhSubdivisionCandidate *sc = 492 dynamic_cast<BvhSubdivisionCandidate *>(splitCandidate);492 static_cast<BvhSubdivisionCandidate *>(splitCandidate); 493 493 BvhTraversalData &tData = sc->mParentData; 494 494 … … 1994 1994 for (vit = viewCells.begin(); vit != vit_end; ++ vit) 1995 1995 { 1996 VspViewCell *vc = dynamic_cast<VspViewCell *>(*vit);1996 VspViewCell *vc = static_cast<VspViewCell *>(*vit); 1997 1997 VspLeaf *leaf = vc->mLeaves[0]; 1998 1998 … … 2060 2060 if (node->IsLeaf()) 2061 2061 { 2062 leaf = dynamic_cast<BvhLeaf *>(node);2062 leaf = static_cast<BvhLeaf *>(node); 2063 2063 2064 2064 if (IsObjectInLeaf(leaf, object)) … … 2070 2070 { 2071 2071 // find point 2072 BvhInterior *interior = dynamic_cast<BvhInterior *>(node);2072 BvhInterior *interior = static_cast<BvhInterior *>(node); 2073 2073 2074 2074 if (interior->GetBack()->GetBoundingBox().Includes(object->GetBox())) … … 2112 2112 if (node->IsLeaf()) 2113 2113 { 2114 BvhLeaf *leaf = dynamic_cast<BvhLeaf *>(node);2114 BvhLeaf *leaf = static_cast<BvhLeaf *>(node); 2115 2115 const AxisAlignedBox3 box = leaf->GetBoundingBox(); 2116 2116 stream << "<Leaf" … … 2127 2127 else 2128 2128 { 2129 BvhInterior *interior = dynamic_cast<BvhInterior *>(node);2129 BvhInterior *interior = static_cast<BvhInterior *>(node); 2130 2130 const AxisAlignedBox3 box = interior->GetBoundingBox(); 2131 2131 … … 2215 2215 2216 2216 // root and bounding box was already constructed 2217 BvhLeaf *bvhLeaf = dynamic_cast<BvhLeaf *>(mRoot);2217 BvhLeaf *bvhLeaf = static_cast<BvhLeaf *>(mRoot); 2218 2218 2219 2219 // only rays intersecting objects in node are interesting … … 2226 2226 // create bvh traversal data 2227 2227 BvhTraversalData oData(bvhLeaf, 0, prop, nRays); 2228 cout << "here4" << endl; 2229 2228 2230 2229 // create sorted object lists for the first data 2231 2230 if (mUseGlobalSorting) … … 2234 2233 } 2235 2234 2236 cout << "here6" << endl;2237 2235 /////////////////// 2238 2236 //-- add first candidate for object space partition … … 2267 2265 for (cit = candidateContainer.begin(); cit != cit_end; ++ cit) 2268 2266 { 2269 BvhSubdivisionCandidate *sCandidate = dynamic_cast<BvhSubdivisionCandidate *>(*cit);2267 BvhSubdivisionCandidate *sCandidate = static_cast<BvhSubdivisionCandidate *>(*cit); 2270 2268 2271 2269 // reevaluate priority … … 2295 2293 for (int i = 0; i < 3; ++ i) 2296 2294 { 2297 cout << "here2 " << endl;2298 2295 SortableEntryContainer *sortedObjects = new SortableEntryContainer(); 2299 2296 … … 2316 2313 delete sortedObjects; 2317 2314 } 2318 cout << "here102" << endl; 2315 2319 2316 // last sorted list: by size 2320 2317 tData.mSortedObjects[3] = new ObjectContainer(); … … 2390 2387 2391 2388 const int nRays = CountRays(objects); 2392 BvhLeaf *bvhLeaf = dynamic_cast<BvhLeaf *>(mRoot);2389 BvhLeaf *bvhLeaf = static_cast<BvhLeaf *>(mRoot); 2393 2390 2394 2391 // create bvh traversal data … … 2517 2514 { 2518 2515 BvhSubdivisionCandidate *sc = 2519 dynamic_cast<BvhSubdivisionCandidate *>(splitCandidate);2516 static_cast<BvhSubdivisionCandidate *>(splitCandidate); 2520 2517 BvhTraversalData &tData = sc->mParentData; 2521 2518 … … 2531 2528 BvhTraversalData tBackData; 2532 2529 2533 BvhInterior *oldInterior = dynamic_cast<BvhInterior *>(oldNode);2530 BvhInterior *oldInterior = static_cast<BvhInterior *>(oldNode); 2534 2531 2535 2532 sc->mFrontObjects.clear(); … … 2667 2664 2668 2665 BvhSubdivisionCandidate *bsc = 2669 dynamic_cast<BvhSubdivisionCandidate *>(candidate);2666 static_cast<BvhSubdivisionCandidate *>(candidate); 2670 2667 2671 2668 if (!InitialTerminationCriteriaMet(bsc->mParentData)) … … 2767 2764 if (node->IsLeaf()) 2768 2765 { 2769 BvhLeaf *leaf = dynamic_cast<BvhLeaf *>(node);2766 BvhLeaf *leaf = static_cast<BvhLeaf *>(node); 2770 2767 node->mRenderCost = EvalAbsCost(leaf->mObjects); 2771 2768 } 2772 2769 else 2773 2770 { 2774 BvhInterior *interior = dynamic_cast<BvhInterior *>(node);2771 BvhInterior *interior = static_cast<BvhInterior *>(node); 2775 2772 2776 2773 node->mRenderCost = GetRenderCostIncrementially(interior->GetFront()) +
Note: See TracChangeset
for help on using the changeset viewer.