return myPosition;
}
+//=======================================================================
+/*!
+ * \brief Iterator on list of elements
+ */
+//=======================================================================
+
class SMDS_MeshNode_MyInvIterator:public SMDS_ElemIterator
{
NCollection_List<const SMDS_MeshElement*>::Iterator myIterator;
+ SMDSAbs_ElementType myType;
public:
- SMDS_MeshNode_MyInvIterator(const NCollection_List<const SMDS_MeshElement*>& s):
- myIterator(s)
+ SMDS_MeshNode_MyInvIterator(const NCollection_List<const SMDS_MeshElement*>& s,
+ SMDSAbs_ElementType type):
+ myIterator(s), myType(type)
{}
bool more()
{
+ if ( myType != SMDSAbs_All ) {
+ while ( myIterator.More() && myIterator.Value()->GetType() != myType)
+ myIterator.Next();
+ }
return myIterator.More() != Standard_False;
}
};
SMDS_ElemIteratorPtr SMDS_MeshNode::
- GetInverseElementIterator() const
+ GetInverseElementIterator(SMDSAbs_ElementType type) const
{
- return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyInvIterator(myInverseElements));
+ return SMDS_ElemIteratorPtr(new SMDS_MeshNode_MyInvIterator(myInverseElements,type));
}
// Same as GetInverseElementIterator but the create iterator only return
void RemoveInverseElement(const SMDS_MeshElement * parent);
void ClearInverseElements();
bool emptyInverseElements();
- SMDS_ElemIteratorPtr GetInverseElementIterator() const;
+ SMDS_ElemIteratorPtr GetInverseElementIterator(SMDSAbs_ElementType type=SMDSAbs_All) const;
void SetPosition(const SMDS_PositionPtr& aPos);
const SMDS_PositionPtr& GetPosition() const;
SMDSAbs_ElementType GetType() const;