Changeset 2691 for GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
- Timestamp:
- 05/21/08 01:18:40 (16 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GTP/trunk/Lib/Vis/Preprocessing/src/KdTree.cpp
r2690 r2691 1077 1077 KdInterior *interior = (KdInterior *)node; 1078 1078 1079 if ( box.Max()[interior->mAxis] > interior->mPosition )1079 if ( box.Max()[interior->mAxis] >= interior->mPosition ) 1080 1080 nodeStack.push(interior->mFront); 1081 1081 1082 if (box.Min()[interior->mAxis] < interior->mPosition)1082 if (box.Min()[interior->mAxis] <= interior->mPosition) 1083 1083 nodeStack.push(interior->mBack); 1084 1084 } … … 1155 1155 1156 1156 1157 void KdTree::CollectObjectsWithDublicates(KdNode *n, ObjectContainer &objects) 1157 void KdTree::CollectObjectsWithDublicates(KdNode *n, ObjectContainer &objects) const 1158 1158 { 1159 1159 stack<KdNode *> nodeStack; … … 1778 1778 } 1779 1779 1780 1781 KdNode * 1782 KdTree::GetPvsNodeCheck(const Vector3 &point, Intersectable *obj) const 1783 { 1784 KdNode *node = mRoot; 1785 1786 while (node->mPvsTermination == 0 ) { 1787 KdInterior *inter = (KdInterior *)node; 1788 if (point[inter->mAxis] < inter->mPosition) 1789 node = inter->mBack; 1790 else 1791 node = inter->mFront; 1792 } 1793 1794 ObjectContainer objects; 1795 CollectObjectsWithDublicates(node, objects); 1796 1797 ObjectContainer::const_iterator oit, oit_end = objects.end(); 1798 1799 bool found = false; 1800 for (oit = objects.begin(); oit != oit_end; ++ oit) 1801 { 1802 if ((*oit)->GetId() == obj->GetId()) 1803 found = true; 1804 } 1805 1806 if (!found) return NULL; 1807 1808 return node; 1809 } 1810 1780 1811 KdNode * 1781 1812 KdTree::GetNode(const Vector3 &point,
Note: See TracChangeset
for help on using the changeset viewer.