Salome HOME
Remove unnecessary method
[modules/shaper.git] / src / Model / Model_ResultPart.cpp
index c01d714f4e4ac5e4048e64b87c47fc31ad71151a..bb12b10756fffa3c95096e4eda37a3d8ca10f63d 100644 (file)
@@ -50,9 +50,7 @@ std::shared_ptr<ModelAPI_Document> Model_ResultPart::partDoc()
 
 Model_ResultPart::Model_ResultPart()
 {
-  myIsDisabled = true; // by default it is not initialized and false to be after created
   myIsInLoad = false;
-  setIsConcealed(false);
 }
 
 void Model_ResultPart::activate()
@@ -69,6 +67,7 @@ void Model_ResultPart::activate()
     std::shared_ptr<ModelAPI_Document> aDoc = document()->subDocument(data()->name());
     myIsInLoad = false;
     if (aDoc) {
+      aDoc->synchronizeTransactions();
       aDocRef->setValue(aDoc);
     }
   }
@@ -111,9 +110,9 @@ bool Model_ResultPart::setDisabled(std::shared_ptr<ModelAPI_Result> theThis,
     if (!myTrsf.get()) { // disable of base result part
       DocumentPtr aDoc = Model_ResultPart::partDoc();
       if (aDoc.get() && aDoc->isOpened()) {
+        std::shared_ptr<Model_Document> anIntDoc = std::dynamic_pointer_cast<Model_Document>(aDoc);
         // make the current feature the last in any case: to update shapes defore deactivation too
-        FeaturePtr aLastFeature = std::dynamic_pointer_cast<ModelAPI_Feature>(aDoc->object(
-          ModelAPI_Feature::group(), aDoc->size(ModelAPI_Feature::group()) - 1));
+        FeaturePtr aLastFeature = anIntDoc->lastFeature();
         aDoc->setCurrentFeature(aLastFeature, false);
         if (theFlag) { // disable, so make all features disabled too
           // update the shape just before the deactivation: it will be used outside of part