Salome HOME
Copyright update 2020
[modules/shaper.git] / src / ModuleBase / ModuleBase_Operation.cpp
index b4f4a38b05296e9a20a94d30cabc41198ee4a188..1df6060a6325790e5504ad4e552620c276b537ca 100644 (file)
@@ -1,4 +1,4 @@
-// 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
@@ -40,6 +40,8 @@
 #include <GeomAPI_Pnt2d.h>
 
 #include <Events_Loop.h>
+#include <Config_WidgetAPI.h>
+#include <Config_Keywords.h>
 
 #include <QTimer>
 
@@ -50,7 +52,8 @@
 ModuleBase_Operation::ModuleBase_Operation(const QString& theId, QObject* theParent)
     : QObject(theParent),
       myIsModified(false),
-      myPropertyPanel(NULL)
+      myPropertyPanel(NULL),
+  myHideFacesVisibilityState(false)
 {
   myDescription = new ModuleBase_OperationDescription(theId);
 }
@@ -176,3 +179,17 @@ bool ModuleBase_Operation::isGranted(QString theId) const
 {
   return myGrantedIds.contains(theId);
 }
+
+bool  ModuleBase_Operation::isModified() const
+{
+  if (myDescription->hasXmlRepresentation()) {
+    Config_WidgetAPI aWidgetApi(myDescription->xmlRepresentation().toStdString());
+    if (!aWidgetApi.getBooleanAttribute(ABORT_CONFIRMATION, true))
+      return false;
+  }
+  //if (myPropertyPanel)
+  //  return myPropertyPanel->isModified();
+  //return false;
+  // Most of operation causes creation of a feature
+  return true;
+}