X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FSALOMEDS%2FSALOMEDS_SComponent_i.cxx;h=53cfc55503879957f78cf02c81b6dc2a6baddbd8;hb=bd0aa83cc3573de6b62b2a56e168dd372097bd45;hp=ee89975662afd00cd7372111b4d40724f009ec58;hpb=b9d614a9b0642314cda41b09f92912483034922f;p=modules%2Fkernel.git diff --git a/src/SALOMEDS/SALOMEDS_SComponent_i.cxx b/src/SALOMEDS/SALOMEDS_SComponent_i.cxx index ee8997566..53cfc5550 100644 --- a/src/SALOMEDS/SALOMEDS_SComponent_i.cxx +++ b/src/SALOMEDS/SALOMEDS_SComponent_i.cxx @@ -27,17 +27,38 @@ // $Header$ #include "SALOMEDS_SComponent_i.hxx" +#include "SALOMEDS_Study_i.hxx" + #include "utilities.h" + using namespace std; +SALOMEDS_SComponent_i* SALOMEDS_SComponent_i::New(SALOMEDS_Study_i* theStudy, + const TDF_Label& theLabel) +{ + SALOMEDS_SComponent_i* aSComponent = NULL; + SALOMEDS_Study_i::TSObjectMap& anSObjectMap = theStudy->GetSObjectMap(); + SALOMEDS_Study_i::TSObjectMap::const_iterator anIter = anSObjectMap.find(theLabel); + //cout<<"SALOMEDS_SComponent_i::New - "<second; + aSComponent = dynamic_cast(aSObject); + } + if(aSComponent == NULL){ + aSComponent = new SALOMEDS_SComponent_i(theStudy,theLabel); + anSObjectMap[theLabel] = aSComponent; + } + return aSComponent; +} //============================================================================ /*! Function : constructor * Purpose : */ //============================================================================ -SALOMEDS_SComponent_i::SALOMEDS_SComponent_i(const TDF_Label lab, CORBA::ORB_ptr orb) - :SALOMEDS_SObject_i(lab,orb) +SALOMEDS_SComponent_i::SALOMEDS_SComponent_i(SALOMEDS_Study_i* theStudy, + const TDF_Label& theLabel): + SALOMEDS_SObject_i(theStudy,theLabel) { } @@ -97,7 +118,7 @@ CORBA::Boolean SALOMEDS_SComponent_i::ComponentIOR(CORBA::String_out IOR) * Purpose : */ //============================================================================ -Standard_Boolean SALOMEDS_SComponent_i::IsA(const TDF_Label Lab) +Standard_Boolean SALOMEDS_SComponent_i::IsA(const TDF_Label& Lab) { Handle(TDF_Attribute) Att; // scomponent must contain comment and belong to the 2th depth label