X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;ds=sidebyside;f=src%2FSALOMEDS%2FSALOMEDS_IParameters.cxx;h=8439c8b0d31c71dec506c44045bacfdf895dd246;hb=074699f122e9bfd758dc805ca0023d355ce25ec5;hp=8329a78ef93074330c02e6d50523aea18261f2a4;hpb=9fb8191f29e6888f8e23f474d9a3b87e190c1ec1;p=modules%2Fkernel.git diff --git a/src/SALOMEDS/SALOMEDS_IParameters.cxx b/src/SALOMEDS/SALOMEDS_IParameters.cxx index 8329a78ef..8439c8b0d 100644 --- a/src/SALOMEDS/SALOMEDS_IParameters.cxx +++ b/src/SALOMEDS/SALOMEDS_IParameters.cxx @@ -21,6 +21,8 @@ // #include "SALOMEDS_IParameters.hxx" +#include +#include #include #define PT_INTEGER 0 @@ -46,8 +48,6 @@ SALOMEDS_IParameters::SALOMEDS_IParameters(const _PTR(AttributeParameter)& ap) { if(!ap) return; _ap = ap; - _PTR(SObject) so = _ap->GetSObject(); - _study = so->GetStudy(); } SALOMEDS_IParameters::~SALOMEDS_IParameters() @@ -258,14 +258,13 @@ std::string SALOMEDS_IParameters::encodeEntry(const std::string& entry, const st std::string SALOMEDS_IParameters::decodeEntry(const std::string& entry) { - if(!_study) return entry; int pos = entry.rfind("_"); if(pos < 0 || pos >= entry.length()) return entry; std::string compName(entry, 0, pos), compID, tail(entry, pos+1, entry.length()-1); if(_compNames.find(compName) == _compNames.end()) { - _PTR(SObject) so = _study->FindComponent(compName); + _PTR(SObject) so = ClientFactory::Study(KERNEL::getStudy())->FindComponent(compName); if(!so) return entry; compID = so->GetID(); _compNames[compName] = compID; @@ -278,23 +277,23 @@ std::string SALOMEDS_IParameters::decodeEntry(const std::string& entry) return newEntry; } -void SALOMEDS_IParameters::setDumpPython(_PTR(Study) study, const std::string& theID) +void SALOMEDS_IParameters::setDumpPython(const std::string& theID) { std::string anID; if(theID == "") anID = getDefaultVisualComponent(); else anID = theID; - _PTR(AttributeParameter) ap = study->GetCommonParameters(anID, 0); - ap->SetBool(_AP_DUMP_PYTHON_, !isDumpPython(study, theID)); + _PTR(AttributeParameter) ap = ClientFactory::Study(KERNEL::getStudy())->GetCommonParameters(anID, 0); + ap->SetBool(_AP_DUMP_PYTHON_, !isDumpPython(theID)); } -bool SALOMEDS_IParameters::isDumpPython(_PTR(Study) study, const std::string& theID) +bool SALOMEDS_IParameters::isDumpPython(const std::string& theID) { std::string anID; if(theID == "") anID = getDefaultVisualComponent(); else anID = theID; - _PTR(AttributeParameter) ap = study->GetCommonParameters(anID, 0); + _PTR(AttributeParameter) ap = ClientFactory::Study(KERNEL::getStudy())->GetCommonParameters(anID, 0); if(!ap) return false; if(!ap->IsSet(_AP_DUMP_PYTHON_, PT_BOOLEAN)) return false; return (bool)ap->GetBool(_AP_DUMP_PYTHON_);