Nodes_3D::iterator it = myNodes->begin();
for (; it != myNodes->end(); it++)
{
- const gp_XYZ* n1 = *it;
+ const gpi_XYZ* n1 = *it;
gp_XY p1(n1->X(), n1->Y());
box->Add(p1);
}
Nodes_3D::iterator it = myNodes->begin();
while (it != myNodes->end())
{
- gp_XYZ* n1 = *it;
+ gpi_XYZ* n1 = *it;
int ChildBoxNum = getChildIndex(n1->X(), n1->Y(), mid);
HYDROData_QuadtreeNode* myChild = dynamic_cast<HYDROData_QuadtreeNode*>(myChildren[ChildBoxNum]);
myChild->myNodes->push_back(n1);
* \param Result - list of Nodes potentials to be near Node
*/
void HYDROData_QuadtreeNode::NodesAround(const gp_XY& Node,
- list<const gp_XYZ*>* Result,
+ list<const gpi_XYZ*>* Result,
const double precision)
{
gp_XY p(Node);
* \retval bool - true if an exact overlapping found !!!
*/
bool HYDROData_QuadtreeNode::NodesAround(const gp_XY& node,
- map<double, const gp_XYZ*>& dist2Nodes,
+ map<double, const gpi_XYZ*>& dist2Nodes,
double precision)
{
if (!dist2Nodes.empty())
Nodes_3D::iterator nIt = myNodes->begin();
for (; nIt != myNodes->end(); ++nIt)
{
- const gp_XYZ* p = *nIt;
+ const gpi_XYZ* p = *nIt;
gp_XY p2(p->X(), p->Y());
double dist2 = (node - p2).SquareModulus();
if (dist2 < minDist)
#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
{
//! 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