X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROData%2FHYDROData_QuadtreeNode.hxx;h=6ea6f186d7a390e99734cee3ae590b382bdd03c2;hb=9082efb75ca2505f8b4c5096d37e8d87491cd5d9;hp=9dfe0a07b8fce94b4da5a03198abcb6e81c6e897;hpb=ba748cd3dd1769f019d6b4da525afebcb4794e99;p=modules%2Fhydro.git diff --git a/src/HYDROData/HYDROData_QuadtreeNode.hxx b/src/HYDROData/HYDROData_QuadtreeNode.hxx index 9dfe0a07..6ea6f186 100644 --- a/src/HYDROData/HYDROData_QuadtreeNode.hxx +++ b/src/HYDROData/HYDROData_QuadtreeNode.hxx @@ -35,6 +35,7 @@ #include "HYDROData_Quadtree.hxx" #include +#include #include #include @@ -44,9 +45,20 @@ //forward declaration class HYDROData_QuadtreeNode; class gp_XY; -class gp_XYZ; -typedef std::list 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 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* Result, + std::list* Result, const double precision = 0.); //! Return in dist2Nodes nodes mapped to their square distance from Node bool NodesAround(const gp_XY& node, - std::map& dist2Nodes, + std::map& 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