X-Git-Url: http://git.salome-platform.org/gitweb/?p=modules%2Fsmesh.git;a=blobdiff_plain;f=src%2FSMDS%2FSMDS_MeshElementIDFactory.cxx;h=d635b0110c15ea89c0360c75d87946aaa202f336;hp=5413533ea1cc5bef0879ffd391e4c4e03abdfafa;hb=ef932e4d05a45b9a3034423e30519d15e664f2bc;hpb=4791f5b30ea7a9c1247aa551750dc71cb83b99aa diff --git a/src/SMDS/SMDS_MeshElementIDFactory.cxx b/src/SMDS/SMDS_MeshElementIDFactory.cxx index 5413533ea..d635b0110 100644 --- a/src/SMDS/SMDS_MeshElementIDFactory.cxx +++ b/src/SMDS/SMDS_MeshElementIDFactory.cxx @@ -25,15 +25,36 @@ // Author : Jean-Michel BOULCOURT // Module : SMESH -using namespace std; -#include "SMDS_MeshElementIDFactory.ixx" + +#include "SMDS_MeshElementIDFactory.hxx" +#include "SMDS_MeshElement.hxx" //======================================================================= //function : SMDS_MeshElementIDFactory //purpose : //======================================================================= +SMDS_MeshElementIDFactory::SMDS_MeshElementIDFactory():SMDS_MeshIDFactory() +{ +} -SMDS_MeshElementIDFactory::SMDS_MeshElementIDFactory() : SMDS_MeshIDFactory() +//======================================================================= +//function : BindID +//purpose : +//======================================================================= +bool SMDS_MeshElementIDFactory::BindID(int ID, SMDS_MeshElement * elem) { + bool bound=myIDElements.insert( + map::value_type(ID,elem)).second; + if(bound) elem->myID=ID; + return bound; } +//======================================================================= +//function : MeshElement +//purpose : +//======================================================================= +SMDS_MeshElement* SMDS_MeshElementIDFactory::MeshElement(int ID) +{ + map::iterator it=myIDElements.find(ID); + if(it==myIDElements.end()) return NULL; else return (*it).second; +}