PAL13460 (force the mesh to go through a point)

add SMDSAbs_ElementType arg to NbInverseNodes()
This commit is contained in:
eap 2007-02-28 09:13:32 +00:00
parent e406de3c30
commit bc9732c239
2 changed files with 19 additions and 1 deletions

View File

@ -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<const SMDS_MeshElement*>::Iterator it( myInverseElements );
for ( ; it.More(); it.Next() )
if ( it.Value()->GetType() == type )
nb++;
return nb;
}
///////////////////////////////////////////////////////////////////////////////
/// To be used with STL set
///////////////////////////////////////////////////////////////////////////////

View File

@ -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;