X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMESHUtils%2FSMESH_OctreeNode.hxx;h=d33285b74411e8af369616053ad25ecdec7409a8;hp=51242bb27f74cec615b4dfc3b1731a43ea146962;hb=a274ade365bd0f0e19d56c577acc4a13aa1972a7;hpb=251f8c052dd12dd29922210dc901b295fe999a0e diff --git a/src/SMESHUtils/SMESH_OctreeNode.hxx b/src/SMESHUtils/SMESH_OctreeNode.hxx index 51242bb27..d33285b74 100644 --- a/src/SMESHUtils/SMESH_OctreeNode.hxx +++ b/src/SMESHUtils/SMESH_OctreeNode.hxx @@ -1,4 +1,4 @@ -// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE +// Copyright (C) 2007-2021 CEA/DEN, EDF R&D, OPEN CASCADE // // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS @@ -30,16 +30,17 @@ #ifndef _SMESH_OCTREENODE_HXX_ #define _SMESH_OCTREENODE_HXX_ -#include "SMESH_Utils.hxx" +#include "SMDS_ElemIterator.hxx" +#include "SMDS_MeshNode.hxx" #include "SMESH_Octree.hxx" +#include "SMESH_Utils.hxx" + #include -#include "SMDS_MeshNode.hxx" #include #include #include - -#include "SMDS_ElemIterator.hxx" +#include //forward declaration class SMDS_MeshNode; @@ -48,52 +49,54 @@ class SMESH_OctreeNode; typedef SMDS_Iterator SMESH_OctreeNodeIterator; typedef boost::shared_ptr SMESH_OctreeNodeIteratorPtr; typedef std::set< const SMDS_MeshNode*, TIDCompare > TIDSortedNodeSet; +typedef std::list< std::list< const SMDS_MeshNode*> > TListOfNodeLists; -class SMESHUtils_EXPORT SMESH_OctreeNode : public SMESH_Octree { - -public: +class SMESHUtils_EXPORT SMESH_OctreeNode : public SMESH_Octree +{ + public: // Constructor SMESH_OctreeNode (const TIDSortedNodeSet& theNodes, const int maxLevel = 8, const int maxNbNodes = 5, const double minBoxSize = 0.); -//============================= -/*! - * \brief Empty destructor - */ -//============================= + // destructor virtual ~SMESH_OctreeNode () {}; // Tells us if Node is inside the current box with the precision "precision" - virtual const bool isInside(const gp_XYZ& p, const double precision = 0.); + virtual bool isInside(const gp_XYZ& p, const double precision = 0.); // Return in Result a list of Nodes potentials to be near Node - void NodesAround(const SMDS_MeshNode * Node, - std::list* Result, - const double precision = 0.); + void AllNodesAround(const SMDS_MeshNode * node, + std::vector* result, + const double precision = 0.); // Return in dist2Nodes nodes mapped to their square distance from Node - bool NodesAround(const gp_XYZ& node, + bool NodesAround(const gp_XYZ& point, std::map& dist2Nodes, double precision); + // Return a list of Nodes close to a point + void NodesAround(const gp_XYZ& point, + std::vector& nodes, + 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 ( TIDSortedNodeSet* nodes, - const double theTolerance, - std::list< std::list< const SMDS_MeshNode*> >* theGroupsOfNodes); + void FindCoincidentNodes ( TIDSortedNodeSet* nodes, + const double theTolerance, + TListOfNodeLists * theGroupsOfNodes); // 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 ( TIDSortedNodeSet& nodes, - std::list< std::list< const SMDS_MeshNode*> >* theGroupsOfNodes, - const double theTolerance = 0.00001, - const int maxLevel = -1, - const int maxNbNodes = 5); + static void FindCoincidentNodes ( TIDSortedNodeSet& nodes, + TListOfNodeLists* theGroupsOfNodes, + 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 ); + void UpdateByMoveNode( const SMDS_MeshNode* node, const gp_Pnt& toPnt ); /*! * \brief Return iterator over children */ @@ -129,14 +132,14 @@ protected: // Construct an empty SMESH_OctreeNode used by SMESH_Octree::buildChildren() virtual SMESH_Octree* newChild() const; - // Return in result a list of nodes closed to Node and remove it from SetOfNodes - void FindCoincidentNodes( const SMDS_MeshNode * Node, - TIDSortedNodeSet* SetOfNodes, - std::list* Result, - const double precision); + // Return in result a list of nodes closed to Node + void findCoincidentNodes( const SMDS_MeshNode * Node, + TIDSortedNodeSet* SetOfNodes, + std::vector* Result, + const double precision); // The set of nodes inside the box of the Octree (Empty if Octree is not a leaf) - TIDSortedNodeSet myNodes; + std::vector< const SMDS_MeshNode* > myNodes; };