mirror of
https://git.salome-platform.org/gitpub/modules/smesh.git
synced 2024-12-28 18:30:35 +05:00
PAL13460 (force the mesh to go through a point)
+ SMESH_OctreeNodeIteratorPtr GetChildrenIterator(); + SMDS_NodeIteratorPtr GetNodeIterator(); + int NbNodes() const { return myNbNodes; }
This commit is contained in:
parent
f79cff562c
commit
ed1963a82e
@ -28,8 +28,10 @@
|
|||||||
// Module : SMESH
|
// Module : SMESH
|
||||||
|
|
||||||
#include "SMESH_OctreeNode.hxx"
|
#include "SMESH_OctreeNode.hxx"
|
||||||
|
|
||||||
|
#include "SMDS_MeshNode.hxx"
|
||||||
|
#include "SMDS_SetIterator.hxx"
|
||||||
#include <gp_Pnt.hxx>
|
#include <gp_Pnt.hxx>
|
||||||
#include <SMDS_MeshNode.hxx>
|
|
||||||
|
|
||||||
using namespace std;
|
using namespace std;
|
||||||
|
|
||||||
@ -42,7 +44,7 @@ using namespace std;
|
|||||||
* \param minBoxSize - Minimal size of the Octree Box
|
* \param minBoxSize - Minimal size of the Octree Box
|
||||||
*/
|
*/
|
||||||
//================================================================
|
//================================================================
|
||||||
SMESH_OctreeNode::SMESH_OctreeNode (set<const SMDS_MeshNode*> theNodes, const int maxLevel,
|
SMESH_OctreeNode::SMESH_OctreeNode (const set<const SMDS_MeshNode*> & theNodes, const int maxLevel,
|
||||||
const int maxNbNodes , const double minBoxSize )
|
const int maxNbNodes , const double minBoxSize )
|
||||||
:SMESH_Octree(maxLevel,minBoxSize),
|
:SMESH_Octree(maxLevel,minBoxSize),
|
||||||
myMaxNbNodes(maxNbNodes),
|
myMaxNbNodes(maxNbNodes),
|
||||||
@ -119,11 +121,10 @@ const bool SMESH_OctreeNode::isInside(const SMDS_MeshNode * Node, const double p
|
|||||||
bool Out = 1 ;
|
bool Out = 1 ;
|
||||||
if (precision<=0.)
|
if (precision<=0.)
|
||||||
return !(myBox->IsOut(gp_XYZ(X,Y,Z)));
|
return !(myBox->IsOut(gp_XYZ(X,Y,Z)));
|
||||||
Bnd_B3d * BoxWithPrecision = new Bnd_B3d();
|
Bnd_B3d BoxWithPrecision;
|
||||||
getBox(BoxWithPrecision);
|
getBox(BoxWithPrecision);
|
||||||
BoxWithPrecision->Enlarge(precision);
|
BoxWithPrecision.Enlarge(precision);
|
||||||
Out=BoxWithPrecision->IsOut(gp_XYZ(X,Y,Z));
|
Out=BoxWithPrecision.IsOut(gp_XYZ(X,Y,Z));
|
||||||
delete BoxWithPrecision;
|
|
||||||
return !(Out);
|
return !(Out);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -325,3 +326,28 @@ void SMESH_OctreeNode::FindCoincidentNodes( const SMDS_MeshNode * Node,
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Return iterator over children
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
SMESH_OctreeNodeIteratorPtr SMESH_OctreeNode::GetChildrenIterator()
|
||||||
|
{
|
||||||
|
return SMESH_OctreeNodeIteratorPtr
|
||||||
|
( new SMDS_SetIterator< SMESH_OctreeNode*, SMESH_Octree** >
|
||||||
|
( myChildren, ( isLeaf() ? myChildren : &myChildren[ 8 ] )));
|
||||||
|
}
|
||||||
|
|
||||||
|
//================================================================================
|
||||||
|
/*!
|
||||||
|
* \brief Return nodes iterator
|
||||||
|
*/
|
||||||
|
//================================================================================
|
||||||
|
|
||||||
|
SMDS_NodeIteratorPtr SMESH_OctreeNode::GetNodeIterator()
|
||||||
|
{
|
||||||
|
return SMDS_NodeIteratorPtr
|
||||||
|
( new SMDS_SetIterator< SMDS_pNode, set< SMDS_pNode >::const_iterator >
|
||||||
|
( myNodes.begin(), myNodes.end() ));
|
||||||
|
}
|
||||||
|
@ -32,18 +32,24 @@
|
|||||||
|
|
||||||
#include "SMESH_Octree.hxx"
|
#include "SMESH_Octree.hxx"
|
||||||
|
|
||||||
//forward declaration
|
|
||||||
class SMDS_MeshNode;
|
|
||||||
|
|
||||||
#include <list>
|
#include <list>
|
||||||
#include <set>
|
#include <set>
|
||||||
|
|
||||||
|
#include "SMDS_ElemIterator.hxx"
|
||||||
|
|
||||||
|
//forward declaration
|
||||||
|
class SMDS_MeshNode;
|
||||||
|
class SMESH_OctreeNode;
|
||||||
|
|
||||||
|
typedef SMDS_Iterator<SMESH_OctreeNode*> SMESH_OctreeNodeIterator;
|
||||||
|
typedef boost::shared_ptr<SMESH_OctreeNodeIterator> SMESH_OctreeNodeIteratorPtr;
|
||||||
|
|
||||||
class SMESH_OctreeNode : public SMESH_Octree{
|
class SMESH_OctreeNode : public SMESH_Octree{
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
// Constructor
|
// Constructor
|
||||||
SMESH_OctreeNode (set<const SMDS_MeshNode*> theNodes, const int maxLevel = -1,
|
SMESH_OctreeNode (const set<const SMDS_MeshNode*>& theNodes, const int maxLevel = -1,
|
||||||
const int maxNbNodes = 5 , const double minBoxSize = 0.);
|
const int maxNbNodes = 5 , const double minBoxSize = 0.);
|
||||||
|
|
||||||
//=============================
|
//=============================
|
||||||
@ -75,8 +81,20 @@ public:
|
|||||||
list< list< const SMDS_MeshNode*> >* theGroupsOfNodes,
|
list< list< const SMDS_MeshNode*> >* theGroupsOfNodes,
|
||||||
const double theTolerance = 0.00001, const int maxLevel = -1,
|
const double theTolerance = 0.00001, const int maxLevel = -1,
|
||||||
const int maxNbNodes = 5);
|
const int maxNbNodes = 5);
|
||||||
|
/*!
|
||||||
|
* \brief Return iterator over children
|
||||||
|
*/
|
||||||
|
SMESH_OctreeNodeIteratorPtr GetChildrenIterator();
|
||||||
|
/*!
|
||||||
|
* \brief Return nodes iterator
|
||||||
|
*/
|
||||||
|
SMDS_NodeIteratorPtr GetNodeIterator();
|
||||||
|
/*!
|
||||||
|
* \brief Return nb nodes in a tree
|
||||||
|
*/
|
||||||
|
int NbNodes() const { return myNbNodes; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
|
|
||||||
//=============================
|
//=============================
|
||||||
/*!
|
/*!
|
||||||
|
Loading…
Reference in New Issue
Block a user