Salome HOME
Merge branch 'BR_HYDRO_IMPS_2016' into pre/IMPS_2016
[modules/hydro.git] / src / HYDROData / HYDROData_QuadtreeNode.hxx
index 9dfe0a07b8fce94b4da5a03198abcb6e81c6e897..6ea6f186d7a390e99734cee3ae590b382bdd03c2 100644 (file)
@@ -35,6 +35,7 @@
 
 #include "HYDROData_Quadtree.hxx"
 #include <gp_Pnt.hxx>
+#include <gp_XYZ.hxx>
 
 #include <list>
 #include <set>
 //forward declaration
 class HYDROData_QuadtreeNode;
 class gp_XY;
-class gp_XYZ;
 
-typedef std::list<gp_XYZ*> Nodes_3D;
+class Standard_EXPORT gpi_XYZ: public gp_XYZ
+{
+public:
+  gpi_XYZ();
+
+  gpi_XYZ(const Standard_Real X, const Standard_Real Y, const Standard_Real Z, int i): gp_XYZ(X, Y, Z), myIndex(i) {}
+
+  int getIndex() const {return myIndex; }
+protected:
+  int myIndex;
+};
+
+typedef std::list<gpi_XYZ*> Nodes_3D;
 
 class Standard_EXPORT HYDROData_QuadtreeNode: public HYDROData_Quadtree
 {
@@ -70,16 +82,16 @@ public:
 
   //! Return in Result a list of Nodes potentials to be near Node
   void NodesAround(const gp_XY& Node,
-                   std::list<const gp_XYZ*>* Result,
+                   std::list<const gpi_XYZ*>* Result,
                    const double precision = 0.);
 
   //! Return in dist2Nodes nodes mapped to their square distance from Node
   bool NodesAround(const gp_XY& node,
-                   std::map<double, const gp_XYZ*>& dist2Nodes,
+                   std::map<double, const gpi_XYZ*>& dist2Nodes,
                    double precision);
 
   //! Update data according to node movement
-  void UpdateByMoveNode(const gp_XYZ* node, const gp_Pnt& toPnt);
+  void UpdateByMoveNode(const gpi_XYZ* node, const gp_Pnt& toPnt);
 
   //! Return nb nodes in a tree
   int NbNodes() const
@@ -93,6 +105,9 @@ public:
   //! tells us if the tree as already bin computed
   bool isEmpty() const { return myChildren == 0; }
 
+  inline double getPrecision() {return myPrecision; }
+  inline void setPrecision(double precision)  {myPrecision = precision; }
+
 protected:
 
   struct Limit: public HYDROData_TreeLimit
@@ -117,6 +132,9 @@ protected:
 
   //! The set of nodes inside the box of the Quadtree (Empty if Quadtree is not a leaf)
   Nodes_3D* myNodes;
+
+  //! distance to look for nearest nodes
+  double myPrecision;
 };
 
 #endif