-// Copyright (C) 2014-2019 CEA/DEN, EDF R&D
+// Copyright (C) 2014-2020 CEA/DEN, EDF R&D
//
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
data()->addAttribute(BASE_REF_ID(), ModelAPI_AttributeReference::typeId());
data()->addAttribute(DEFLECTION_ID(), ModelAPI_AttributeDouble::typeId());
data()->addAttribute(TRANSPARENCY_ID(), ModelAPI_AttributeDouble::typeId());
+ data()->addAttribute(ISO_LINES_ID(), ModelAPI_AttributeIntArray::typeId());
if (aDocRef->isInitialized() && // initialized immediately means already exist and will be loaded
!Model_Application::getApplication()->hasDocument(aDocRef->docId()))
SessionPtr aMgr = ModelAPI_Session::get();
if (!aMgr->isOperation()) {
// open transaction even document is not created to set current docs in setActiveDocument
- aMgr->startOperation("Activation");
+ std::string aMsg = "Activation " + data()->name();
+ aMgr->startOperation(aMsg);
isNewTransaction = true;
}
if (!aDocRef->value().get()) { // create (or open) a document if it is not yet created
}
}
+
+void Model_ResultPart::loadPart()
+{
+ std::shared_ptr<ModelAPI_AttributeDocRef> aDocRef = data()->document(DOC_REF());
+ if (!aDocRef->value().get()) { // create (or open) a document if it is not yet created
+ Handle(Model_Application) anApp = Model_Application::getApplication();
+ if (anApp->isLoadByDemand(data()->name(), aDocRef->docId())) {
+ anApp->loadDocument(data()->name(), aDocRef->docId()); // if it is just new part, load fails
+ }
+ else {
+ anApp->createDocument(aDocRef->docId());
+ }
+ }
+}
+
+
std::shared_ptr<ModelAPI_ResultPart> Model_ResultPart::original()
{
if (myTrsf.get() && baseRef().get()) { // the second condition is due to #2035
static Events_ID EVENT_DISP = aLoop->eventByName(EVENT_OBJECT_TO_REDISPLAY);
ModelAPI_EventCreator::get()->sendUpdated(theThis, EVENT_DISP); // flush is in preview-update
}
+
+std::shared_ptr<GeomAPI_Trsf> Model_ResultPart::summaryTrsf()
+{
+ GeomTrsfPtr aResult(new GeomAPI_Trsf);
+ aResult->setImpl<gp_Trsf>(new gp_Trsf(sumTrsf()));
+ return aResult;
+}