mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2025-01-19 03:50:33 +05:00
0021542: EDF 1699 SMESH: Reorient a group of faces
+ // Return height of the tree, full or from this level to topest leaf + int getHeight(const bool full=true) const;
This commit is contained in:
parent
b998225160
commit
dbf098c68f
@ -175,7 +175,7 @@ bool SMESH_Octree::isLeaf() const
|
||||
|
||||
double SMESH_Octree::maxSize() const
|
||||
{
|
||||
if ( myBox )
|
||||
if ( myBox && !myBox->IsVoid() )
|
||||
{
|
||||
gp_XYZ min = myBox->CornerMin();
|
||||
gp_XYZ max = myBox->CornerMax();
|
||||
@ -185,3 +185,27 @@ double SMESH_Octree::maxSize() const
|
||||
}
|
||||
return 0.;
|
||||
}
|
||||
|
||||
//================================================================================
|
||||
/*!
|
||||
* \brief Return height of the tree, full or from this level to topest leaf
|
||||
*/
|
||||
//================================================================================
|
||||
|
||||
int SMESH_Octree::getHeight(const bool full) const
|
||||
{
|
||||
if ( full && myFather )
|
||||
return myFather->getHeight( true );
|
||||
|
||||
if ( isLeaf() )
|
||||
return 1;
|
||||
|
||||
int heigth = 0;
|
||||
for (int i = 0; i<8; i++)
|
||||
{
|
||||
int h = myChildren[i]->getHeight( false );
|
||||
if ( h > heigth )
|
||||
heigth = h;
|
||||
}
|
||||
return heigth + 1;
|
||||
}
|
||||
|
@ -76,6 +76,9 @@ public:
|
||||
// Return index of a child the given point is in
|
||||
inline int getChildIndex(double x, double y, double z, const gp_XYZ& boxMiddle)const;
|
||||
|
||||
// Return height of the tree, full or from this level to topest leaf
|
||||
int getHeight(const bool full=true) const;
|
||||
|
||||
protected:
|
||||
// Return box of the whole tree
|
||||
virtual Bnd_B3d* buildRootBox() = 0;
|
||||
|
Loading…
Reference in New Issue
Block a user