X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FModel%2FModel_ResultPart.cpp;h=a54ca670999c64d005f81c59f45d2a4712baf07e;hb=baa32d4d231be0ed859fc32f1736afcbcfaa1f73;hp=a1fb09b010ff87b8cbbc935e96201ebcbb7d1dfe;hpb=d9db5498b576854aae37ddf8c0bb6fceb264712e;p=modules%2Fshaper.git diff --git a/src/Model/Model_ResultPart.cpp b/src/Model/Model_ResultPart.cpp index a1fb09b01..a54ca6709 100644 --- a/src/Model/Model_ResultPart.cpp +++ b/src/Model/Model_ResultPart.cpp @@ -1,3 +1,5 @@ +// Copyright (C) 2014-20xx CEA/DEN, EDF R&D + // File: ModelAPI_ResultPart.cpp // Created: 07 Jul 2014 // Author: Mikhail PONIKAROV @@ -7,14 +9,14 @@ #include #include -boost::shared_ptr Model_ResultPart::partDoc() +std::shared_ptr Model_ResultPart::partDoc() { return data()->document("PartDocument")->value(); } -boost::shared_ptr Model_ResultPart::owner() +std::shared_ptr Model_ResultPart::owner() { - return boost::shared_ptr(); // return empty pointer + return std::shared_ptr(); // return empty pointer } Model_ResultPart::Model_ResultPart() @@ -22,24 +24,31 @@ Model_ResultPart::Model_ResultPart() setIsConcealed(false); } -void Model_ResultPart::setData(boost::shared_ptr theData) +void Model_ResultPart::setData(std::shared_ptr theData) { ModelAPI_Result::setData(theData); if (theData) { - data()->addAttribute(DOC_REF(), ModelAPI_AttributeDocRef::type()); + data()->addAttribute(DOC_REF(), ModelAPI_AttributeDocRef::typeId()); } } void Model_ResultPart::activate() { - boost::shared_ptr aDocRef = data()->document(DOC_REF()); + std::shared_ptr aDocRef = data()->document(DOC_REF()); - if (!aDocRef->value()) { // create (or open) a document if it is not yet created - boost::shared_ptr aDoc = document()->subDocument(data()->name()); + if (!aDocRef->value().get()) { // create (or open) a document if it is not yet created + std::shared_ptr aDoc = document()->subDocument(data()->name()); if (aDoc) { aDocRef->setValue(aDoc); } } - if (aDocRef->value()) + if (aDocRef->value().get()) { ModelAPI_Session::get()->setActiveDocument(aDocRef->value()); + } +} + +bool Model_ResultPart::isActivated() +{ + std::shared_ptr aDocRef = data()->document(DOC_REF()); + return aDocRef->value().get(); }