X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESH%2FSMESH_OctreeNode.hxx;h=7799765d0076a03d48cf88953eb02f34e7659df0;hp=6a3b0cb39a1ec85b2d380995f55ad5f09f26e89e;hb=f31477795020e2cfc50d5b625579285c644a6a96;hpb=c113b9f92eda39a04caed33d839213a3fefc00af diff --git a/src/SMESH/SMESH_OctreeNode.hxx b/src/SMESH/SMESH_OctreeNode.hxx index 6a3b0cb39..7799765d0 100644 --- a/src/SMESH/SMESH_OctreeNode.hxx +++ b/src/SMESH/SMESH_OctreeNode.hxx @@ -34,6 +34,7 @@ #include #include +#include #include "SMDS_ElemIterator.hxx" @@ -44,7 +45,7 @@ class SMESH_OctreeNode; typedef SMDS_Iterator SMESH_OctreeNodeIterator; typedef boost::shared_ptr SMESH_OctreeNodeIteratorPtr; -class SMESH_OctreeNode : public SMESH_Octree{ +class SMESH_OctreeNode : public SMESH_Octree { public: @@ -59,9 +60,6 @@ public: //============================= virtual ~SMESH_OctreeNode () {}; - // Tells us if SMESH_OctreeNode is a leaf or not (-1 = not initialiazed) - virtual const bool isLeaf(); - // Tells us if Node is inside the current box with the precision "precision" virtual const bool isInside(const SMDS_MeshNode * Node, const double precision = 0.); @@ -70,6 +68,11 @@ public: std::list* Result, const double precision = 0.); + // Return in dist2Nodes nodes mapped to their square distance from Node + bool NodesAround(const SMDS_MeshNode * Node, + std::map& dist2Nodes, + double precision); + // Return in theGroupsOfNodes a list of group of nodes close to each other within theTolerance // Search for all the nodes in nodes void FindCoincidentNodes ( std::set* nodes, @@ -78,10 +81,15 @@ public: // Static method that return in theGroupsOfNodes a list of group of nodes close to each other within // theTolerance search for all the nodes in nodes - static void FindCoincidentNodes ( std::set nodes, + static void FindCoincidentNodes ( std::set& nodes, std::list< std::list< const SMDS_MeshNode*> >* theGroupsOfNodes, - const double theTolerance = 0.00001, const int maxLevel = -1, + const double theTolerance = 0.00001, + const int maxLevel = -1, const int maxNbNodes = 5); + /*! + * \brief Update data according to node movement + */ + void UpdateByMoveNode( const SMDS_MeshNode* node, const gp_Pnt& toPnt ); /*! * \brief Return iterator over children */ @@ -93,25 +101,20 @@ public: /*! * \brief Return nb nodes in a tree */ - int NbNodes() const { return myNbNodes; } + int NbNodes() const { return myNodes.size(); } protected: -//============================= -/*! - * \brief Empty constructor - */ -//============================= - SMESH_OctreeNode (){}; + SMESH_OctreeNode (int maxNbNodes ); + + // Compute the bounding box of the whole set of nodes myNodes + virtual Bnd_B3d* buildRootBox(); // Shares the father's data with each of his child virtual void buildChildrenData(); - // Compute the bounding box of the whole set of nodes myNodes (only used for OctreeNode level 0) - void computeBoxForFather(); - // Construct an empty SMESH_OctreeNode used by SMESH_Octree::buildChildren() - virtual SMESH_Octree* allocateOctreeChild(); + virtual SMESH_Octree* allocateOctreeChild() const; // Return in result a list of nodes closed to Node and remove it from SetOfNodes void FindCoincidentNodes( const SMDS_MeshNode * Node, @@ -120,13 +123,11 @@ protected: const double precision); // The max number of nodes a leaf box can contain - int myMaxNbNodes; + int myMaxNbNodes; // The set of nodes inside the box of the Octree (Empty if Octree is not a leaf) std::set myNodes; - // The number of nodes I have inside the box - int myNbNodes; }; #endif