Go to the documentation of this file.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 #include <gp_Pnt.hxx>
00035 #include "SMDS_MeshNode.hxx"
00036
00037 #include <list>
00038 #include <set>
00039 #include <map>
00040
00041 #include "SMDS_ElemIterator.hxx"
00042
00043
00044 class SMDS_MeshNode;
00045 class SMESH_OctreeNode;
00046
00047 typedef SMDS_Iterator<SMESH_OctreeNode*> SMESH_OctreeNodeIterator;
00048 typedef boost::shared_ptr<SMESH_OctreeNodeIterator> SMESH_OctreeNodeIteratorPtr;
00049 typedef std::set< const SMDS_MeshNode*, TIDCompare > TIDSortedNodeSet;
00050
00051 class SMESH_OctreeNode : public SMESH_Octree {
00052
00053 public:
00054
00055
00056 SMESH_OctreeNode (const TIDSortedNodeSet& theNodes, const int maxLevel = 8,
00057 const int maxNbNodes = 5, const double minBoxSize = 0.);
00058
00059
00063
00064 virtual ~SMESH_OctreeNode () {};
00065
00066
00067 virtual const bool isInside(const gp_XYZ& p, const double precision = 0.);
00068
00069
00070 void NodesAround(const SMDS_MeshNode * Node,
00071 std::list<const SMDS_MeshNode*>* Result,
00072 const double precision = 0.);
00073
00074
00075 bool NodesAround(const gp_XYZ& node,
00076 std::map<double, const SMDS_MeshNode*>& dist2Nodes,
00077 double precision);
00078
00079
00080
00081 void FindCoincidentNodes ( TIDSortedNodeSet* nodes,
00082 const double theTolerance,
00083 std::list< std::list< const SMDS_MeshNode*> >* theGroupsOfNodes);
00084
00085
00086
00087 static void FindCoincidentNodes ( TIDSortedNodeSet& nodes,
00088 std::list< std::list< const SMDS_MeshNode*> >* theGroupsOfNodes,
00089 const double theTolerance = 0.00001,
00090 const int maxLevel = -1,
00091 const int maxNbNodes = 5);
00095 void UpdateByMoveNode( const SMDS_MeshNode* node, const gp_Pnt& toPnt );
00099 SMESH_OctreeNodeIteratorPtr GetChildrenIterator();
00103 SMDS_NodeIteratorPtr GetNodeIterator();
00107 int NbNodes() const { return myNodes.size(); }
00108
00109 protected:
00110
00111 SMESH_OctreeNode (int maxNbNodes );
00112
00113
00114 virtual Bnd_B3d* buildRootBox();
00115
00116
00117 virtual void buildChildrenData();
00118
00119
00120 virtual SMESH_Octree* allocateOctreeChild() const;
00121
00122
00123 void FindCoincidentNodes( const SMDS_MeshNode * Node,
00124 TIDSortedNodeSet* SetOfNodes,
00125 std::list<const SMDS_MeshNode*>* Result,
00126 const double precision);
00127
00128
00129 int myMaxNbNodes;
00130
00131
00132 TIDSortedNodeSet myNodes;
00133
00134 };
00135
00136 #endif