Changeset 1144 for GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp
- Timestamp:
- 07/20/06 09:51:26 (18 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/VspOspTree.cpp
r1143 r1144 947 947 if (obj) 948 948 { 949 // potentially visible kd cells950 949 if (mStoreKdPvs) 951 950 { 951 // potentially visible kd cells 952 952 KdLeaf *leaf = mOspTree->GetLeaf(ray->mTermination, ray->mTerminationNode); 953 953 AddKdLeafToPvs(leaf, vc, ray->mPdf, contribution); … … 1076 1076 // add objects without the objects which are in several kd leaves 1077 1077 pvsSize += (int)(leaf->mObjects.size() - leaf->mMultipleObjects.size()); 1078 //Debug << "here11 " << (int)leaf->mObjects.size() << " " << leaf->mMultipleObjects.size() << endl; 1078 1079 } 1079 1080 else … … 1116 1117 RayInfoContainer::const_iterator ri, ri_end = rays.end(); 1117 1118 1118 //-- set all kd nodes as belonging to the front pvs1119 //-- set all kd nodes / objects as belonging to the front pvs 1119 1120 1120 1121 for (ri = rays.begin(); ri != ri_end; ++ ri) … … 1214 1215 Intersectable *object = *oit; 1215 1216 1216 // object not previously in leftpvs1217 // object not previously in pvs 1217 1218 if (!object->Mailed()) 1218 1219 { … … 1946 1947 nodeStack.push(mRoot); 1947 1948 1948 const AxisAlignedBox3 box = GetB Box(n);1949 const AxisAlignedBox3 box = GetBoundingBox(n); 1949 1950 1950 1951 while (!nodeStack.empty()) … … 2007 2008 VspNode *next; 2008 2009 2009 if (GetB Box(interior->GetBack()).Side(plane) < 0)2010 if (GetBoundingBox(interior->GetBack()).Side(plane) < 0) 2010 2011 { 2011 2012 next = interior->GetFront(); … … 2013 2014 else 2014 2015 { 2015 if (GetB Box(interior->GetFront()).Side(plane) < 0)2016 if (GetBoundingBox(interior->GetFront()).Side(plane) < 0) 2016 2017 { 2017 2018 next = interior->GetBack(); … … 2549 2550 2550 2551 2551 AxisAlignedBox3 VspTree::GetB Box(VspNode *node) const2552 AxisAlignedBox3 VspTree::GetBoundingBox(VspNode *node) const 2552 2553 { 2553 2554 if (!node->GetParent()) … … 2584 2585 nodeStack.pop(); 2585 2586 2586 const AxisAlignedBox3 bbox = GetB Box(node);2587 const AxisAlignedBox3 bbox = GetBoundingBox(node); 2587 2588 2588 2589 if (bbox.Includes(box)) … … 3693 3694 3694 3695 3695 AxisAlignedBox3 OspTree::GetB Box(KdNode *node) const3696 AxisAlignedBox3 OspTree::GetBoundingBox(KdNode *node) const 3696 3697 { 3697 3698 if (!node->mParent) … … 3814 3815 KdLeaf *OspTree::GetLeaf(const Vector3 &pt, KdNode *node) const 3815 3816 { 3817 // start from root of tree 3816 3818 if (node == NULL) 3817 3819 { … … 3835 3837 else 3836 3838 { 3839 // find point 3837 3840 KdInterior *interior = dynamic_cast<KdInterior *>(node); 3838 3841 3839 // random decision 3840 if (interior->mPosition < pt[interior->mAxis]) 3842 if (interior->mPosition > pt[interior->mAxis]) 3841 3843 { 3842 3844 nodeStack.push(interior->mBack); … … 3942 3944 { 3943 3945 // search nodes 3944 std::map<KdNode *, KdIntersectable *>::const_iterator it = mKdIntersectables.find(node); 3946 std::map<KdNode *, KdIntersectable *>:: 3947 const_iterator it = mKdIntersectables.find(node); 3945 3948 3946 3949 if (it != mKdIntersectables.end()) … … 4054 4057 RayInfoContainer &rays) 4055 4058 { 4056 // get clipped rays4057 mOspTree.ProcessRays(sampleRays, rays);4058 4059 4059 // store pointer to this tree 4060 4060 OspTree::OspSplitCandidate::sOspTree = &mOspTree; 4061 4061 mOspTree.mOspStats.nodes = 1; 4062 4062 4063 // compute bounding box from objects 4063 4064 mOspTree.ComputeBoundingBox(objects, forcedObjectSpace); 4064 4065 … … 4066 4067 mGlobalCostMisses = 0; 4067 4068 4069 // get clipped rays 4070 mOspTree.ProcessRays(sampleRays, rays); 4068 4071 4069 4072 // add first candidate for view space partition … … 4086 4089 4087 4090 4088 //mOspTree.ProcessMultipleRefs(NULL, kdleaf, NULL);4089 4090 4091 // compute first split candidate 4091 4092 OspTree::OspSplitCandidate *oSplitCandidate = 4092 4093 new OspTree::OspSplitCandidate(oData); 4094 4093 4095 mOspTree.EvalSplitCandidate(*oSplitCandidate); 4094 4096 … … 4252 4254 ///////////////////////////////////////////////////////////// 4253 4255 4254 4256 Debug << "**************** osp construction **************" << endl; 4255 4257 cout << "starting osp contruction ... " << endl; 4258 4256 4259 startTime = GetTime(); 4257 4260
Note: See TracChangeset
for help on using the changeset viewer.