X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSMESH%2FSMESH_OctreeNode.hxx;h=54ab75cc8b90099568156e68eebab2bdd24540d4;hb=167a4d4243de3f9e93d4e66b78d23d284b338a85;hp=ce8bfde26566f2fc490d26dd47250144b465bbd1;hpb=984c4ffdd7df62aeaedc544cd0b8e64ff8f53f1a;p=modules%2Fsmesh.git diff --git a/src/SMESH/SMESH_OctreeNode.hxx b/src/SMESH/SMESH_OctreeNode.hxx index ce8bfde26..54ab75cc8 100644 --- a/src/SMESH/SMESH_OctreeNode.hxx +++ b/src/SMESH/SMESH_OctreeNode.hxx @@ -1,7 +1,6 @@ -// SMESH SMESH_OctreeNode : Octree with Nodes set -// inherites global class SMESH_Octree +// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE // -// Copyright (C) 2003 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, +// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN, // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS // // This library is free software; you can redistribute it and/or @@ -18,32 +17,38 @@ // License along with this library; if not, write to the Free Software // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA // -// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com -// -// +// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com // +// SMESH SMESH_OctreeNode : Octree with Nodes set +// inherites global class SMESH_Octree // File : SMESH_OctreeNode.hxx // Created : Tue Jan 16 16:00:00 2007 // Author : Nicolas Geimer & Aurélien Motteux (OCC) // Module : SMESH - +// #ifndef _SMESH_OCTREENODE_HXX_ #define _SMESH_OCTREENODE_HXX_ #include "SMESH_Octree.hxx" +#include +#include + +#include "SMDS_ElemIterator.hxx" + //forward declaration class SMDS_MeshNode; +class SMESH_OctreeNode; -#include -#include +typedef SMDS_Iterator SMESH_OctreeNodeIterator; +typedef boost::shared_ptr SMESH_OctreeNodeIteratorPtr; class SMESH_OctreeNode : public SMESH_Octree{ public: // Constructor - SMESH_OctreeNode (set theNodes, const int maxLevel = -1, + SMESH_OctreeNode (const std::set& theNodes, const int maxLevel = -1, const int maxNbNodes = 5 , const double minBoxSize = 0.); //============================= @@ -60,23 +65,35 @@ public: virtual const bool isInside(const SMDS_MeshNode * Node, const double precision = 0. ); // Return in Result a list of Nodes potentials to be near Node - void NodesAround( const SMDS_MeshNode * Node , list* Result, + void NodesAround( const SMDS_MeshNode * Node , std::list* Result, const double precision = 0. ); // Return in theGroupsOfNodes a list of group of nodes close to each other within theTolerance // Search for all the nodes in nodes - void FindCoincidentNodes ( set* nodes, + void FindCoincidentNodes ( std::set* nodes, const double theTolerance, - list< list< const SMDS_MeshNode*> >* theGroupsOfNodes); + std::list< std::list< const SMDS_MeshNode*> >* 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 ( set nodes, - list< list< const SMDS_MeshNode*> >* theGroupsOfNodes, + static void FindCoincidentNodes ( std::set nodes, + std::list< std::list< const SMDS_MeshNode*> >* theGroupsOfNodes, const double theTolerance = 0.00001, const int maxLevel = -1, const int maxNbNodes = 5); - - protected: + /*! + * \brief Return iterator over children + */ + SMESH_OctreeNodeIteratorPtr GetChildrenIterator(); + /*! + * \brief Return nodes iterator + */ + SMDS_NodeIteratorPtr GetNodeIterator(); + /*! + * \brief Return nb nodes in a tree + */ + int NbNodes() const { return myNbNodes; } + +protected: //============================= /*! @@ -96,15 +113,15 @@ public: // Return in result a list of nodes closed to Node and remove it from SetOfNodes void FindCoincidentNodes( const SMDS_MeshNode * Node, - set* SetOfNodes, - list* Result, + std::set* SetOfNodes, + std::list* Result, const double precision); // The max number of nodes a leaf box can contain int myMaxNbNodes; // The set of nodes inside the box of the Octree (Empty if Octree is not a leaf) - set myNodes; + std::set myNodes; // The number of nodes I have inside the box int myNbNodes;