00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030 #ifndef _SMESH_OCTREENODE_HXX_
00031 #define _SMESH_OCTREENODE_HXX_
00032
00033 #include "SMESH_Octree.hxx"
00034
00035 #include <list>
00036 #include <set>
00037 #include <map>
00038
00039 #include "SMDS_ElemIterator.hxx"
00040
00041
00042 class SMDS_MeshNode;
00043 class SMESH_OctreeNode;
00044
00045 typedef SMDS_Iterator<SMESH_OctreeNode*> SMESH_OctreeNodeIterator;
00046 typedef boost::shared_ptr<SMESH_OctreeNodeIterator> SMESH_OctreeNodeIteratorPtr;
00047
00048 class SMESH_OctreeNode : public SMESH_Octree {
00049
00050 public:
00051
00052
00053 SMESH_OctreeNode (const std::set<const SMDS_MeshNode*>& theNodes, const int maxLevel = -1,
00054 const int maxNbNodes = 5, const double minBoxSize = 0.);
00055
00056
00060
00061 virtual ~SMESH_OctreeNode () {};
00062
00063
00064 virtual const bool isInside(const SMDS_MeshNode * Node, const double precision = 0.);
00065
00066
00067 void NodesAround(const SMDS_MeshNode * Node,
00068 std::list<const SMDS_MeshNode*>* Result,
00069 const double precision = 0.);
00070
00071
00072 bool NodesAround(const SMDS_MeshNode * Node,
00073 std::map<double, const SMDS_MeshNode*>& dist2Nodes,
00074 double precision);
00075
00076
00077
00078 void FindCoincidentNodes ( std::set<const SMDS_MeshNode*>* nodes,
00079 const double theTolerance,
00080 std::list< std::list< const SMDS_MeshNode*> >* theGroupsOfNodes);
00081
00082
00083
00084 static void FindCoincidentNodes ( std::set<const SMDS_MeshNode*>& nodes,
00085 std::list< std::list< const SMDS_MeshNode*> >* theGroupsOfNodes,
00086 const double theTolerance = 0.00001,
00087 const int maxLevel = -1,
00088 const int maxNbNodes = 5);
00092 void UpdateByMoveNode( const SMDS_MeshNode* node, const gp_Pnt& toPnt );
00096 SMESH_OctreeNodeIteratorPtr GetChildrenIterator();
00100 SMDS_NodeIteratorPtr GetNodeIterator();
00104 int NbNodes() const { return myNodes.size(); }
00105
00106 protected:
00107
00108 SMESH_OctreeNode (int maxNbNodes );
00109
00110
00111 virtual Bnd_B3d* buildRootBox();
00112
00113
00114 virtual void buildChildrenData();
00115
00116
00117 virtual SMESH_Octree* allocateOctreeChild() const;
00118
00119
00120 void FindCoincidentNodes( const SMDS_MeshNode * Node,
00121 std::set<const SMDS_MeshNode*>* SetOfNodes,
00122 std::list<const SMDS_MeshNode*>* Result,
00123 const double precision);
00124
00125
00126 int myMaxNbNodes;
00127
00128
00129 std::set<const SMDS_MeshNode*> myNodes;
00130
00131 };
00132
00133 #endif