+SMDS_Position *SMDS_MeshNode::GetPosition()
+{
+ return myPosition;
+}
+
+const SMDS_Position *SMDS_MeshNode::GetPosition() const
+{
+ return myPosition;
+}
+/**
+*/
+SMDS_Iterator<const SMDS_MeshElement*> * SMDS_MeshNode::
+ GetInverseElementIterator() const
+{
+ class SMDS_InverseElementIterator:public SMDS_Iterator<const SMDS_MeshElement*>
+ {
+ const set<const SMDS_MeshElement*>& mySet;
+ set<const SMDS_MeshElement*>::iterator myIterator;
+ public:
+ SMDS_InverseElementIterator(const set<const SMDS_MeshElement*>& s):mySet(s)
+ {
+ myIterator=mySet.begin();
+ }
+
+ bool more()
+ {
+ myIterator!=mySet.end();
+ }
+
+ const SMDS_MeshElement* next()
+ {
+ const SMDS_MeshElement* current=*myIterator;
+ myIterator++;
+ return current;
+ }
+ };
+ return new SMDS_InverseElementIterator(myInverseElements);
+}
+
+SMDS_Iterator<const SMDS_MeshElement *> * SMDS_MeshNode::
+ elementsIterator(SMDSAbs_ElementType type) const
+{
+ // Same as GetInverseElementIterator but the create iterator only return
+ // wanted type elements.
+ class MyIterator:public SMDS_Iterator<const SMDS_MeshElement*>
+ {
+ set<const SMDS_MeshElement*> mySet;
+ set<const SMDS_MeshElement*>::iterator myIterator;
+ public:
+ MyIterator(SMDSAbs_ElementType type,
+ const set<const SMDS_MeshElement*>& s)
+ {
+ const SMDS_MeshElement * e;
+ bool toInsert;
+ set<const SMDS_MeshElement*>::iterator it=s.begin();
+ while(it!=s.end())
+ {
+ e=*it;
+ switch(type)
+ {
+ case SMDSAbs_Edge: toInsert=true; break;
+ case SMDSAbs_Face: toInsert=(e->GetType()!=SMDSAbs_Edge); break;
+ case SMDSAbs_Volume: toInsert=(e->GetType()==SMDSAbs_Volume); break;
+ }
+ if(toInsert) mySet.insert(e);
+ it++;
+ }
+ myIterator=mySet.begin();
+ }
+
+ bool more()
+ {
+ myIterator!=mySet.end();
+ }
+
+ const SMDS_MeshElement* next()
+ {
+ const SMDS_MeshElement* current=*myIterator;
+ myIterator++;
+ return current;
+ }
+ };
+
+ if(type==SMDSAbs_Node)
+ return SMDS_MeshElement::elementsIterator(SMDSAbs_Node);
+ else
+ return new SMDS_IteratorOfElements(this,type,
+ new MyIterator(type, myInverseElements));
+}
+
+int SMDS_MeshNode::NbNodes() const
+{
+ return 1;
+}
+
+double SMDS_MeshNode::X() const
+{
+ return myX;
+}
+
+double SMDS_MeshNode::Y() const
+{
+ return myY;
+}
+
+double SMDS_MeshNode::Z() const
+{
+ return myZ;
+}
+
+void SMDS_MeshNode::setXYZ(double x, double y, double z)
+{
+ myX=x;
+ myY=y;
+ myZ=z;
+}
+
+SMDSAbs_ElementType SMDS_MeshNode::GetType() const
+{
+ return SMDSAbs_Node;
+}
+
+//=======================================================================
+//function : AddInverseElement
+//purpose :
+//=======================================================================
+void SMDS_MeshNode::AddInverseElement(const SMDS_MeshElement* ME)
+{
+ myInverseElements.insert(ME);
+}
+
+//=======================================================================
+//function : ClearInverseElements
+//purpose :
+//=======================================================================
+void SMDS_MeshNode::ClearInverseElements()
+{
+ myInverseElements.clear();
+}
+
+bool SMDS_MeshNode::emptyInverseElements()
+{
+ return myInverseElements.empty();
+}
+
+///////////////////////////////////////////////////////////////////////////////
+/// To be used with STL set
+///////////////////////////////////////////////////////////////////////////////
+bool operator<(const SMDS_MeshNode& e1, const SMDS_MeshNode& e2)