+//=======================================================================
+//function : elementsIterator
+//purpose : Return an iterator on elements of the factory
+//=======================================================================
+
+class SMDS_Fact_MyElemIterator:public SMDS_ElemIterator
+{
+ SMDS_IdElementMap::Iterator myIterator;
+ public:
+ SMDS_Fact_MyElemIterator(const SMDS_IdElementMap& s):myIterator(s)
+ {}
+
+ bool more()
+ {
+ return myIterator.More() != Standard_False;
+ }
+
+ const SMDS_MeshElement* next()
+ {
+ const SMDS_MeshElement* current = myIterator.Value();
+ myIterator.Next();
+ return current;
+ }
+};
+
+SMDS_ElemIteratorPtr SMDS_MeshElementIDFactory::elementsIterator() const
+{
+ return SMDS_ElemIteratorPtr
+ (new SMDS_Fact_MyElemIterator(myIDElements));
+}