SMESH_OctreeNode Class Reference

#include <SMESH_OctreeNode.hxx>

Classes

struct  Limit
 

Public Member Functions

void FindCoincidentNodes (TIDSortedNodeSet *nodes, const double theTolerance, std::list< std::list< const SMDS_MeshNode * > > *theGroupsOfNodes)
 Return in theGroupsOfNodes a list of group of nodes close to each other within theTolerance Search for all the nodes in theSetOfNodes. More...
 
SMESH_OctreeNodeIteratorPtr GetChildrenIterator ()
 Return iterator over children. More...
 
SMDS_NodeIteratorPtr GetNodeIterator ()
 Return nodes iterator. More...
 
virtual bool isInside (const gp_XYZ &p, const double precision=0.)
 Tells us if Node is inside the current box with the precision "precision". More...
 
int NbNodes () const
 Return nb nodes in a tree. More...
 
bool NodesAround (const gp_XYZ &point, std::map< double, const SMDS_MeshNode * > &dist2Nodes, double precision)
 Return in dist2Nodes nodes mapped to their square distance from Node Tries to find a closest node. More...
 
void NodesAround (const gp_XYZ &point, std::vector< const SMDS_MeshNode * > &nodes, double precision)
 Return a list of nodes close to a point. More...
 
void NodesAround (const SMDS_MeshNode *node, std::list< const SMDS_MeshNode * > *result, const double precision=0.)
 Return in Result a list of Nodes potentials to be near Node. More...
 
 SMESH_OctreeNode (const TIDSortedNodeSet &theNodes, const int maxLevel=8, const int maxNbNodes=5, const double minBoxSize=0.)
 Constructor : Build all the Octree using Compute() More...
 
void UpdateByMoveNode (const SMDS_MeshNode *node, const gp_Pnt &toPnt)
 Update data according to node movement. More...
 
virtual ~SMESH_OctreeNode ()
 
- Public Member Functions inherited from SMESH_Octree
double maxSize () const
 Compute the bigger dimension of my box. More...
 
 SMESH_Octree (SMESH_TreeLimit *limit=0)
 
virtual ~SMESH_Octree ()
 
- Public Member Functions inherited from SMESH_Tree< Bnd_B3d, 8 >
void compute ()
 Compute the Tree. More...
 
const box_typegetBox () const
 
int getHeight (const bool full=true) const
 Return height of the tree, full or from this level to topest leaf. More...
 
bool isLeaf () const
 Tell if Tree is a leaf or not An inheriting class can influence it via myIsLeaf protected field. More...
 
int level () const
 
virtual double maxSize () const=0
 
 SMESH_Tree (SMESH_TreeLimit *limit=0)
 
virtual ~SMESH_Tree ()
 SMESH_Tree Destructor. More...
 

Static Public Member Functions

static void FindCoincidentNodes (TIDSortedNodeSet &nodes, std::list< std::list< const SMDS_MeshNode * > > *theGroupsOfNodes, const double theTolerance=0.00001, const int maxLevel=-1, const int maxNbNodes=5)
 Return in theGroupsOfNodes a list of group of nodes close to each other within theTolerance Search for all the nodes in theSetOfNodes Static Method : no need to create an SMESH_OctreeNode. More...
 
- Static Public Member Functions inherited from SMESH_Octree
static int getChildIndex (double x, double y, double z, const gp_XYZ &boxMiddle)
 Return index of a child the given point is in. More...
 
- Static Public Member Functions inherited from SMESH_Tree< Bnd_B3d, 8 >
static int nbChildren ()
 

Protected Member Functions

virtual void buildChildrenData ()
 Set the data of the children Shares the father's data with each of his child. More...
 
virtual Bnd_B3d * buildRootBox ()
 Compute the first bounding box. More...
 
void FindCoincidentNodes (const SMDS_MeshNode *Node, TIDSortedNodeSet *SetOfNodes, std::list< const SMDS_MeshNode * > *Result, const double precision)
 Return a list of nodes closed to Node and remove it from SetOfNodes. More...
 
int getMaxNbNodes () const
 Return max number of nodes in a tree leaf. More...
 
virtual SMESH_OctreenewChild () const
 Construct an empty SMESH_OctreeNode used by SMESH_Octree::buildChildren() More...
 
 SMESH_OctreeNode ()
 Constructor used to allocate a child. More...
 
- Protected Member Functions inherited from SMESH_Octree
virtual Bnd_B3d * newChildBox (int childIndex) const
 Allocate a bndbox according to childIndex. childIndex is zero based. More...
 
- Protected Member Functions inherited from SMESH_Tree< Bnd_B3d, 8 >
void buildChildren ()
 Build the children boxes and call buildChildrenData() More...
 
virtual void buildChildrenData ()=0
 
virtual box_typebuildRootBox ()=0
 
virtual SMESH_TreenewChild () const=0
 
virtual box_typenewChildBox (int childIndex) const=0
 

Protected Attributes

TIDSortedNodeSet myNodes
 
- Protected Attributes inherited from SMESH_Tree< Bnd_B3d, 8 >
box_typemyBox
 
SMESH_Tree ** myChildren
 
SMESH_TreemyFather
 
bool myIsLeaf
 
int myLevel
 
const SMESH_TreeLimitmyLimit
 

Additional Inherited Members

- Public Types inherited from SMESH_Octree
typedef SMESH_Tree< Bnd_B3d, 8 > TBaseTree
 
- Public Types inherited from SMESH_Tree< Bnd_B3d, 8 >
typedef Bnd_B3d box_type
 

Constructor & Destructor Documentation

◆ SMESH_OctreeNode() [1/2]

SMESH_OctreeNode::SMESH_OctreeNode ( const TIDSortedNodeSet &  theNodes,
const int  maxLevel = 8,
const int  maxNbNodes = 5,
const double  minBoxSize = 0. 
)

Constructor : Build all the Octree using Compute()

Parameters
theNodes- Set of nodes, the Octree is built from this nodes
maxLevel- Maximum level for the leaves
maxNbNodes- Maximum number of nodes, a leaf can contain
minBoxSize- Minimal size of the Octree Box

References SMESH_Tree< Bnd_B3d, 8 >::compute().

◆ ~SMESH_OctreeNode()

virtual SMESH_OctreeNode::~SMESH_OctreeNode ( )
virtual

◆ SMESH_OctreeNode() [2/2]

SMESH_OctreeNode::SMESH_OctreeNode ( )
protected

Constructor used to allocate a child.

Referenced by newChild().

Member Function Documentation

◆ buildChildrenData()

void SMESH_OctreeNode::buildChildrenData ( )
protectedvirtual

◆ buildRootBox()

Bnd_B3d * SMESH_OctreeNode::buildRootBox ( )
protectedvirtual

Compute the first bounding box.

We take the max/min coord of the nodes

Implements SMESH_Tree< Bnd_B3d, 8 >.

References getMaxNbNodes(), SMESH_Tree< Bnd_B3d, 8 >::myIsLeaf, myNodes, SMDS_MeshNode::X(), SMDS_MeshNode::Y(), and SMDS_MeshNode::Z().

◆ FindCoincidentNodes() [1/3]

void SMESH_OctreeNode::FindCoincidentNodes ( const SMDS_MeshNode Node,
TIDSortedNodeSet *  SetOfNodes,
std::list< const SMDS_MeshNode * > *  Result,
const double  precision 
)
protected

Return a list of nodes closed to Node and remove it from SetOfNodes.

Note
The Octree itself is also modified by this method
Parameters
Node- We're searching the nodes next to him.
SetOfNodes- set of nodes in which we erase the found nodes
Result- list of nodes closed to Node
precision- Precision used

References FindCoincidentNodes(), SMDS_MeshElement::GetID(), isInside(), SMESH_Tree< Bnd_B3d, 8 >::isLeaf(), SMESH_Tree< Bnd_B3d, 8 >::myChildren, myNodes, draftgeoutils.general::precision(), SMDS_MeshNode::X(), SMDS_MeshNode::Y(), and SMDS_MeshNode::Z().

◆ FindCoincidentNodes() [2/3]

void SMESH_OctreeNode::FindCoincidentNodes ( TIDSortedNodeSet &  theSetOfNodes,
std::list< std::list< const SMDS_MeshNode * > > *  theGroupsOfNodes,
const double  theTolerance = 0.00001,
const int  maxLevel = -1,
const int  maxNbNodes = 5 
)
static

Return in theGroupsOfNodes a list of group of nodes close to each other within theTolerance Search for all the nodes in theSetOfNodes Static Method : no need to create an SMESH_OctreeNode.

Parameters
theSetOfNodes- set of nodes we look at, modified during research
theGroupsOfNodes- list of nodes closed to each other returned
theTolerance- Precision used, default value is 0.00001
maxLevel- Maximum level for SMESH_OctreeNode constructed, default value is -1 (Infinite)
maxNbNodes- maximum Nodes in a Leaf of the SMESH_OctreeNode constructed, default value is 5

References FindCoincidentNodes().

◆ FindCoincidentNodes() [3/3]

void SMESH_OctreeNode::FindCoincidentNodes ( TIDSortedNodeSet *  theSetOfNodes,
const double  theTolerance,
std::list< std::list< const SMDS_MeshNode * > > *  theGroupsOfNodes 
)

Return in theGroupsOfNodes a list of group of nodes close to each other within theTolerance Search for all the nodes in theSetOfNodes.

Note
The Octree itself is also modified by this method
Parameters
theSetOfNodes- set of nodes we look at, modified during research
theTolerance- Precision used
theGroupsOfNodes- list of nodes closed to each other returned

References FindCoincidentNodes().

Referenced by FindCoincidentNodes(), SMESH_MeshEditor::FindCoincidentNodes(), and SMESH::Controls::CoincidentNodes::SetMesh().

◆ GetChildrenIterator()

SMESH_OctreeNodeIteratorPtr SMESH_OctreeNode::GetChildrenIterator ( )

◆ getMaxNbNodes()

int SMESH_OctreeNode::getMaxNbNodes ( ) const
protected

Return max number of nodes in a tree leaf.

References SMESH_Tree< Bnd_B3d, 8 >::myLimit.

Referenced by buildChildrenData(), and buildRootBox().

◆ GetNodeIterator()

SMDS_NodeIteratorPtr SMESH_OctreeNode::GetNodeIterator ( )

Return nodes iterator.

References myNodes.

Referenced by SMESH_NodeSearcherImpl::FindClosestTo().

◆ isInside()

bool SMESH_OctreeNode::isInside ( const gp_XYZ &  p,
const double  precision = 0. 
)
virtual

Tells us if Node is inside the current box with the precision "precision".

Parameters
Node- Node
precision- The box is enlarged with this precision
Return values
bool- True if Node is in the box within precision

References SMESH_Tree< Bnd_B3d, 8 >::getBox().

Referenced by SMESH_NodeSearcherImpl::FindClosestTo(), FindCoincidentNodes(), NodesAround(), UpdateByMoveNode(), and ArchVRM.Renderer::zOverlaps().

◆ NbNodes()

int SMESH_OctreeNode::NbNodes ( ) const

Return nb nodes in a tree.

Referenced by SMESH_NodeSearcherImpl::FindClosestTo(), and NodesAround().

◆ newChild()

SMESH_Octree * SMESH_OctreeNode::newChild ( ) const
protectedvirtual

◆ NodesAround() [1/3]

bool SMESH_OctreeNode::NodesAround ( const gp_XYZ &  node,
std::map< double, const SMDS_MeshNode * > &  dist2Nodes,
double  precision 
)

Return in dist2Nodes nodes mapped to their square distance from Node Tries to find a closest node.

Parameters
node- node to find nodes closest to
dist2Nodes- map of found nodes and their distances
precision- radius of a sphere to check nodes inside
Return values
bool- true if an exact overlapping found !!!

References SMESH_Tree< Bnd_B3d, 8 >::getBox(), SMESH_Octree::getChildIndex(), isInside(), SMESH_Tree< Bnd_B3d, 8 >::isLeaf(), SMESH_Octree::maxSize(), SMESH_Tree< Bnd_B3d, 8 >::myChildren, myNodes, NbNodes(), NodesAround(), and draftgeoutils.general::precision().

◆ NodesAround() [2/3]

void SMESH_OctreeNode::NodesAround ( const gp_XYZ &  point,
std::vector< const SMDS_MeshNode * > &  nodes,
double  precision 
)

Return a list of nodes close to a point.

Parameters
[in]point- point
[out]nodes- found nodes
[in]precision- allowed distance from point

References isInside(), SMESH_Tree< Bnd_B3d, 8 >::isLeaf(), SMESH_Tree< Bnd_B3d, 8 >::myChildren, myNodes, NbNodes(), NodesAround(), and draftgeoutils.general::precision().

◆ NodesAround() [3/3]

void SMESH_OctreeNode::NodesAround ( const SMDS_MeshNode Node,
std::list< const SMDS_MeshNode * > *  result,
const double  precision = 0. 
)

Return in Result a list of Nodes potentials to be near Node.

Parameters
Node- Node
precision- precision used
Result- list of Nodes potentials to be near Node

References isInside(), SMESH_Tree< Bnd_B3d, 8 >::isLeaf(), SMESH_Tree< Bnd_B3d, 8 >::myChildren, myNodes, and NodesAround().

Referenced by StdMeshers_Import_1D2D::Compute(), SMESH_NodeSearcherImpl::FindClosestTo(), SMESH_NodeSearcherImpl::FindNearPoint(), and NodesAround().

◆ UpdateByMoveNode()

void SMESH_OctreeNode::UpdateByMoveNode ( const SMDS_MeshNode node,
const gp_Pnt &  toPnt 
)

Member Data Documentation

◆ myNodes

TIDSortedNodeSet SMESH_OctreeNode::myNodes
protected

The documentation for this class was generated from the following files: