+// Copyright (C) 2014-20xx CEA/DEN, EDF R&D
+
// File: ModelAPI_ResultPart.cpp
// Created: 07 Jul 2014
// Author: Mikhail PONIKAROV
{
ModelAPI_Result::setData(theData);
if (theData) {
- data()->addAttribute(DOC_REF(), ModelAPI_AttributeDocRef::type());
+ data()->addAttribute(DOC_REF(), ModelAPI_AttributeDocRef::typeId());
}
}
{
std::shared_ptr<ModelAPI_AttributeDocRef> aDocRef = data()->document(DOC_REF());
- if (!aDocRef->value()) { // create (or open) a document if it is not yet created
+ if (!aDocRef->value().get()) { // create (or open) a document if it is not yet created
std::shared_ptr<ModelAPI_Document> 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<ModelAPI_AttributeDocRef> aDocRef = data()->document(DOC_REF());
+ return aDocRef->value().get();
}