// inherites global class SMESH_Octree
// File : SMESH_OctreeNode.cxx
// Created : Tue Jan 16 16:00:00 2007
-// Author : Nicolas Geimer & Aurélien Motteux (OCC)
+// Author : Nicolas Geimer & Aurelien Motteux (OCC)
// Module : SMESH
//
#include "SMESH_OctreeNode.hxx"
*/
//====================================================================================
-const bool SMESH_OctreeNode::isInside (const SMDS_MeshNode * Node, const double precision)
+const bool SMESH_OctreeNode::isInside (const gp_XYZ& p, const double precision)
{
- gp_XYZ p (Node->X(),Node->Y(),Node->Z());
if (precision <= 0.)
return !(getBox().IsOut(p));
Bnd_B3d BoxWithPrecision = getBox();
list<const SMDS_MeshNode*>* Result,
const double precision)
{
- if (isInside(Node,precision))
+ gp_XYZ p(Node->X(), Node->Y(), Node->Z());
+ if (isInside(p, precision))
{
if (isLeaf())
{
*/
//================================================================================
-bool SMESH_OctreeNode::NodesAround(const SMDS_MeshNode * node,
+bool SMESH_OctreeNode::NodesAround(const gp_XYZ &node,
map<double, const SMDS_MeshNode*>& dist2Nodes,
double precision)
{
else if ( precision == 0. )
precision = maxSize() / 2;
- if (isInside(node,precision))
+ //gp_XYZ p(node->X(), node->Y(), node->Z());
+ if (isInside(node, precision))
{
if (!isLeaf())
{
// first check a child containing node
gp_XYZ mid = (getBox().CornerMin() + getBox().CornerMax()) / 2.;
- int nodeChild = getChildIndex( node->X(), node->Y(), node->Z(), mid );
+ int nodeChild = getChildIndex( node.X(), node.Y(), node.Z(), mid );
if ( ((SMESH_OctreeNode*) myChildren[nodeChild])->NodesAround(node, dist2Nodes, precision))
return true;
else if ( NbNodes() > 0 )
{
double minDist = precision * precision;
- gp_Pnt p1 ( node->X(), node->Y(), node->Z() );
- TIDSortedNodeSet::iterator nIt = myNodes.begin();
+ gp_Pnt p1 ( node.X(), node.Y(), node.Z() );
+ set<const SMDS_MeshNode*>::iterator nIt = myNodes.begin();
for ( ; nIt != myNodes.end(); ++nIt )
{
gp_Pnt p2 ( (*nIt)->X(), (*nIt)->Y(), (*nIt)->Z() );
list<const SMDS_MeshNode*>* Result,
const double precision)
{
- bool isInsideBool = isInside(Node,precision);
+ gp_XYZ p(Node->X(), Node->Y(), Node->Z());
+ bool isInsideBool = isInside(p, precision);
if (isInsideBool)
{
TIDSortedNodeSet::iterator pNode = myNodes.find( node );
bool nodeInMe = ( pNode != myNodes.end() );
- SMDS_MeshNode pointNode( toPnt.X(), toPnt.Y(), toPnt.Z() );
- bool pointInMe = isInside( &pointNode, 1e-10 );
+ bool pointInMe = isInside( toPnt.Coord(), 1e-10 );
if ( pointInMe != nodeInMe )
{