Salome HOME
Implement Cancel Compute (begin)
[modules/smesh.git] / src / SMESH / SMESH_OctreeNode.hxx
index 7799765d0076a03d48cf88953eb02f34e7659df0..3e837e9483751ba4422bed436f42287e0e914f33 100644 (file)
@@ -1,4 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+//  Copyright (C) 2007-2010  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
 //
 //  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)
+//  Author    : Nicolas Geimer & Aurelien Motteux  (OCC)
 //  Module    : SMESH
-
+//
 #ifndef _SMESH_OCTREENODE_HXX_
 #define _SMESH_OCTREENODE_HXX_
 
 #include "SMESH_Octree.hxx"
+#include <gp_Pnt.hxx>
+#include "SMDS_MeshNode.hxx"
 
 #include <list>
 #include <set>
 class SMDS_MeshNode;
 class SMESH_OctreeNode;
 
-typedef SMDS_Iterator<SMESH_OctreeNode*>            SMESH_OctreeNodeIterator;
-typedef boost::shared_ptr<SMESH_OctreeNodeIterator> SMESH_OctreeNodeIteratorPtr;
+typedef SMDS_Iterator<SMESH_OctreeNode*>              SMESH_OctreeNodeIterator;
+typedef boost::shared_ptr<SMESH_OctreeNodeIterator>   SMESH_OctreeNodeIteratorPtr;
+typedef std::set< const SMDS_MeshNode*, TIDCompare >  TIDSortedNodeSet;
 
 class SMESH_OctreeNode : public SMESH_Octree {
 
 public:
 
   // Constructor
-  SMESH_OctreeNode (const std::set<const SMDS_MeshNode*>& theNodes, const int maxLevel = -1,
+  SMESH_OctreeNode (const TIDSortedNodeSet& theNodes, const int maxLevel = 8,
                     const int maxNbNodes = 5, const double minBoxSize = 0.);
 
 //=============================
@@ -61,27 +64,27 @@ public:
   virtual ~SMESH_OctreeNode () {};
 
   // 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.);
+  virtual const 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,
+  void               NodesAround(const SMDS_MeshNode *            Node,
                                  std::list<const SMDS_MeshNode*>* Result,
-                                 const double precision = 0.);
+                                 const double                     precision = 0.);
 
   // Return in dist2Nodes nodes mapped to their square distance from Node
-  bool               NodesAround(const SMDS_MeshNode *                   Node,
+  bool               NodesAround(const gp_XYZ& node,
                                  std::map<double, const SMDS_MeshNode*>& 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<const SMDS_MeshNode*>* nodes,
+  void               FindCoincidentNodes ( TIDSortedNodeSet*           nodes,
                                            const double                theTolerance,
                                            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 ( std::set<const SMDS_MeshNode*>& nodes,
+  static void        FindCoincidentNodes ( TIDSortedNodeSet&                              nodes,
                                            std::list< std::list< const SMDS_MeshNode*> >* theGroupsOfNodes,
                                            const double theTolerance = 0.00001,
                                            const int maxLevel = -1,
@@ -117,16 +120,16 @@ protected:
   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,
-                                             std::set<const SMDS_MeshNode*>* SetOfNodes,
+  void                  FindCoincidentNodes( const SMDS_MeshNode *            Node,
+                                             TIDSortedNodeSet*                SetOfNodes,
                                              std::list<const SMDS_MeshNode*>* Result,
-                                             const double precision);
+                                             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<const SMDS_MeshNode*>   myNodes;
+  TIDSortedNodeSet   myNodes;
 
 };