- XminChild = (i%2==0)?min.X():mid.X();
- YminChild = ((i%4)/2==0)?min.Y():mid.Y();
- ZminChild = (i<4)?min.Z():mid.Z();
- minChild.SetCoord(XminChild, YminChild, ZminChild);
-
- // The child is of the same type than its father (For instance, a SMESH_OctreeNode)
- // We allocate the memory we need for the child
- myChildren[i] = allocateOctreeChild();
- // and we assign to him its box.
- myChildren[i]->myFather = this;
- myChildren[i]->myLimit = myLimit;
- myChildren[i]->myLevel = myLevel + 1;
- myChildren[i]->myBox = new Bnd_B3d(minChild+childHsize,childHsize);
- myChildren[i]->myBox->Enlarge( rootSize * 1e-10 );
- if ( myLimit->myMinBoxSize > 0. && myChildren[i]->maxSize() <= myLimit->myMinBoxSize )
- myChildren[i]->myIsLeaf = true;
- }
-
- // After building the 8 boxes, we put the data into the children.
- buildChildrenData();
-
- //After we pass to the next level of the Octree
- for (int i = 0; i<8; i++)
- myChildren[i]->buildChildren();
-}
-
-//================================================================================
-/*!
- * \brief Tell if Octree is a leaf or not
- * An inheriting class can influence it via myIsLeaf protected field
- */
-//================================================================================
-
-bool SMESH_Octree::isLeaf() const
-{
- return myIsLeaf || ((myLimit->myMaxLevel > 0) ? (level() >= myLimit->myMaxLevel) : false );