29 #ifndef _SMESH_Tree_HXX_
30 #define _SMESH_Tree_HXX_
55 template<
class BND_BOX,
84 int getHeight(
const bool full=
true)
const;
89 virtual double maxSize()
const = 0;
138 template<
class BND_BOX,
int NB_CHILDREN>
156 template<
class BND_BOX,
int NB_CHILDREN>
162 myBox = buildRootBox();
163 if ( myLimit->myMinBoxSize > 0. && maxSize() <= myLimit->myMinBoxSize )
176 template<
class BND_BOX,
int NB_CHILDREN>
183 for(
int i = 0; i<NB_CHILDREN; i++)
184 delete myChildren[i];
203 template<
class BND_BOX,
int NB_CHILDREN>
206 if ( isLeaf() )
return;
218 for (
int i = 0; i < NB_CHILDREN; i++)
222 myChildren[i] = newChild();
224 myChildren[i]->myFather =
this;
225 if (myChildren[i]->myLimit)
226 delete myChildren[i]->myLimit;
227 myChildren[i]->myLimit = myLimit;
228 myChildren[i]->myLevel = myLevel + 1;
229 myChildren[i]->myBox = newChildBox( i );
230 enlargeByFactor( myChildren[i]->myBox, 1. + 1e-10 );
231 if ( myLimit->myMinBoxSize > 0. && myChildren[i]->maxSize() <= myLimit->myMinBoxSize )
232 myChildren[i]->myIsLeaf =
true;
239 for (
int i = 0; i<NB_CHILDREN; i++)
240 myChildren[i]->buildChildren();
250 template<
class BND_BOX,
int NB_CHILDREN>
253 return myIsLeaf || ((myLimit->myMaxLevel > 0) ? (level() >= myLimit->myMaxLevel) :
false );
262 template<
class BND_BOX,
int NB_CHILDREN>
265 if ( full && myFather )
266 return myFather->getHeight(
true );
272 for (
int i = 0; i<NB_CHILDREN; i++)
274 int h = myChildren[i]->getHeight(
false );