From 2a3744d4d8830b125f7540c924e3109922c7179e Mon Sep 17 00:00:00 2001 From: dibenedetto Date: Wed, 5 Oct 2005 01:43:28 +0000 Subject: [PATCH] Removed "parent" pointer class member in Node class. --- vcg/space/index/aabb_binary_tree/base.h | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/vcg/space/index/aabb_binary_tree/base.h b/vcg/space/index/aabb_binary_tree/base.h index 88d55da9..cf749a45 100644 --- a/vcg/space/index/aabb_binary_tree/base.h +++ b/vcg/space/index/aabb_binary_tree/base.h @@ -25,6 +25,9 @@ History $Log: not supported by cvs2svn $ +Revision 1.1 2005/09/28 19:44:49 m_di_benedetto +First Commit. + ****************************************************************************/ @@ -62,16 +65,15 @@ class AABBBinaryTree { public: class AABBBinaryTreeNode { public: - AABBBinaryTreeNode * parent; - AABBBinaryTreeNode * children[2]; CoordType boxCenter; CoordType boxHalfDims; ObjPtrVectorIterator oBegin; ObjPtrVectorIterator oEnd; + AABBBinaryTreeNode * children[2]; unsigned char splitAxis; NodeAuxDataType auxData; - inline AABBBinaryTreeNode(AABBBinaryTreeNode * pParent = 0); + inline AABBBinaryTreeNode(void); inline ~AABBBinaryTreeNode(void); inline void Clear(void); @@ -120,7 +122,7 @@ class AABBBinaryTree { protected: template - inline static NodeType * BoundObjects(NodeType * parent, const ObjPtrVectorIterator & oBegin, const ObjPtrVectorIterator & oEnd, const unsigned int size, const unsigned int maxElemsPerLeaf, const ScalarType & leafBoxMaxVolume, const bool useVariance, OBJBOXFUNCT & getBox, OBJBARYCENTERFUNCT & getBarycenter); + inline static NodeType * BoundObjects(const ObjPtrVectorIterator & oBegin, const ObjPtrVectorIterator & oEnd, const unsigned int size, const unsigned int maxElemsPerLeaf, const ScalarType & leafBoxMaxVolume, const bool useVariance, OBJBOXFUNCT & getBox, OBJBARYCENTERFUNCT & getBarycenter); template inline static int BalanceMedian(const ObjPtrVectorIterator & oBegin, const ObjPtrVectorIterator & oEnd, const int size, const int splitAxis, OBJBARYCENTERFUNCT & getBarycenter, ObjPtrVectorIterator & medianIter); @@ -170,12 +172,12 @@ bool AABBBinaryTree::Set(const OBJITERATOR template template -typename AABBBinaryTree::NodeType * AABBBinaryTree::BoundObjects(NodeType * parent, const ObjPtrVectorIterator & oBegin, const ObjPtrVectorIterator & oEnd, const unsigned int size, const unsigned int maxElemsPerLeaf, const ScalarType & leafBoxMaxVolume, const bool useVariance, OBJBOXFUNCT & getBox, OBJBARYCENTERFUNCT & getBarycenter) { +typename AABBBinaryTree::NodeType * AABBBinaryTree::BoundObjects(const ObjPtrVectorIterator & oBegin, const ObjPtrVectorIterator & oEnd, const unsigned int size, const unsigned int maxElemsPerLeaf, const ScalarType & leafBoxMaxVolume, const bool useVariance, OBJBOXFUNCT & getBox, OBJBARYCENTERFUNCT & getBarycenter) { if (size <= 0) { return (0); } - NodeType * pNode = new NodeType(parent); + NodeType * pNode = new NodeType(); if (pNode == 0) { return (0); } @@ -322,8 +324,7 @@ int AABBBinaryTree::BalanceMedian(const Ob } template -AABBBinaryTree::AABBBinaryTreeNode::AABBBinaryTreeNode(NodeType * pParent) { - this->parent = pParent; +AABBBinaryTree::AABBBinaryTreeNode::AABBBinaryTreeNode(void) { this->children[0] = 0; this->children[1] = 0; }