#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_type * | getBox () 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_Octree * | newChild () 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_type * | buildRootBox ()=0 |
virtual SMESH_Tree * | newChild () const=0 |
virtual box_type * | newChildBox (int childIndex) const=0 |
Protected Attributes | |
TIDSortedNodeSet | myNodes |
Protected Attributes inherited from SMESH_Tree< Bnd_B3d, 8 > | |
box_type * | myBox |
SMESH_Tree ** | myChildren |
SMESH_Tree * | myFather |
bool | myIsLeaf |
int | myLevel |
const SMESH_TreeLimit * | myLimit |
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 |
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()
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().
|
virtual |
|
protected |
Constructor used to allocate a child.
Referenced by newChild().
|
protectedvirtual |
Set the data of the children Shares the father's data with each of his child.
Implements SMESH_Tree< Bnd_B3d, 8 >.
References SMESH_Tree< Bnd_B3d, 8 >::getBox(), SMESH_Octree::getChildIndex(), getMaxNbNodes(), SMESH_Tree< Bnd_B3d, 8 >::myChildren, SMESH_Tree< BND_BOX, NB_CHILDREN >::myIsLeaf, myNodes, SMDS_MeshNode::X(), SMDS_MeshNode::Y(), and SMDS_MeshNode::Z().
|
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().
|
protected |
Return a list of nodes closed to Node and remove it from SetOfNodes.
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().
|
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.
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().
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.
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().
SMESH_OctreeNodeIteratorPtr SMESH_OctreeNode::GetChildrenIterator | ( | ) |
Return iterator over children.
References SMESH_Tree< Bnd_B3d, 8 >::isLeaf(), and SMESH_Tree< Bnd_B3d, 8 >::myChildren.
Referenced by SMESH_NodeSearcherImpl::FindClosestTo(), and SMESH_NodeSearcherImpl::SMESH_NodeSearcherImpl().
|
protected |
Return max number of nodes in a tree leaf.
References SMESH_Tree< Bnd_B3d, 8 >::myLimit.
Referenced by buildChildrenData(), and buildRootBox().
SMDS_NodeIteratorPtr SMESH_OctreeNode::GetNodeIterator | ( | ) |
|
virtual |
Tells us if Node is inside the current box with the precision "precision".
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().
int SMESH_OctreeNode::NbNodes | ( | ) | const |
Return nb nodes in a tree.
Referenced by SMESH_NodeSearcherImpl::FindClosestTo(), and NodesAround().
|
protectedvirtual |
Construct an empty SMESH_OctreeNode used by SMESH_Octree::buildChildren()
Implements SMESH_Tree< Bnd_B3d, 8 >.
References SMESH_OctreeNode().
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.
node | - node to find nodes closest to |
dist2Nodes | - map of found nodes and their distances |
precision | - radius of a sphere to check nodes inside |
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().
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.
[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().
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.
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().
void SMESH_OctreeNode::UpdateByMoveNode | ( | const SMDS_MeshNode * | node, |
const gp_Pnt & | toPnt | ||
) |
Update data according to node movement.
References SMESH_Tree< Bnd_B3d, 8 >::getBox(), SMESH_Octree::getChildIndex(), isInside(), SMESH_Tree< Bnd_B3d, 8 >::isLeaf(), SMESH_Tree< Bnd_B3d, 8 >::myChildren, myNodes, SMDS_MeshNode::X(), SMDS_MeshNode::Y(), and SMDS_MeshNode::Z().
Referenced by SMESH_NodeSearcherImpl::MoveNode().
|
protected |
Referenced by buildChildrenData(), buildRootBox(), FindCoincidentNodes(), GetNodeIterator(), NodesAround(), and UpdateByMoveNode().