From: eap Date: Wed, 28 Feb 2007 09:13:32 +0000 (+0000) Subject: PAL13460 (force the mesh to go through a point) X-Git-Tag: V3_2_6a1~44 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=bc9732c239da7261de6f236b744834d33404fc51;p=modules%2Fsmesh.git PAL13460 (force the mesh to go through a point) add SMDSAbs_ElementType arg to NbInverseNodes() --- diff --git a/src/SMDS/SMDS_MeshNode.cxx b/src/SMDS/SMDS_MeshNode.cxx index e4b551912..b7a1cb117 100644 --- a/src/SMDS/SMDS_MeshNode.cxx +++ b/src/SMDS/SMDS_MeshNode.cxx @@ -240,6 +240,24 @@ bool SMDS_MeshNode::emptyInverseElements() return myInverseElements.IsEmpty() != Standard_False; } +//================================================================================ +/*! + * \brief Count inverse elements of given type + */ +//================================================================================ + +int SMDS_MeshNode::NbInverseNodes(SMDSAbs_ElementType type) const +{ + if ( type == SMDSAbs_All ) + return myInverseElements.Extent(); + int nb = 0; + NCollection_List::Iterator it( myInverseElements ); + for ( ; it.More(); it.Next() ) + if ( it.Value()->GetType() == type ) + nb++; + return nb; +} + /////////////////////////////////////////////////////////////////////////////// /// To be used with STL set /////////////////////////////////////////////////////////////////////////////// diff --git a/src/SMDS/SMDS_MeshNode.hxx b/src/SMDS/SMDS_MeshNode.hxx index 0da589b4d..10c1499cc 100644 --- a/src/SMDS/SMDS_MeshNode.hxx +++ b/src/SMDS/SMDS_MeshNode.hxx @@ -57,7 +57,7 @@ class SMDS_WNT_EXPORT SMDS_MeshNode:public SMDS_MeshElement void ClearInverseElements(); bool emptyInverseElements(); SMDS_ElemIteratorPtr GetInverseElementIterator(SMDSAbs_ElementType type=SMDSAbs_All) const; - int NbInverseNodes() const { return myInverseElements.Extent(); } + int NbInverseNodes(SMDSAbs_ElementType type=SMDSAbs_All) const; void SetPosition(const SMDS_PositionPtr& aPos); const SMDS_PositionPtr& GetPosition() const; SMDSAbs_ElementType GetType() const;