Salome HOME
Warnings correction for moc files generation
[modules/shaper.git] / src / ModuleBase / ModuleBase_WidgetValidated.cpp
index daecef19f35de242812527ed9bbc41ff5ed22cdf..2b18811d70987cf8898e9196f084c3e4db3247a7 100644 (file)
@@ -1,8 +1,8 @@
 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D
 
 #include <ModuleBase_WidgetValidated.h>
-#include <ModuleBase_FilterFactory.h>
 #include <ModuleBase_IViewer.h>
+#include <ModuleBase_IWorkshop.h>
 #include <ModuleBase_ISelection.h>
 #include <ModuleBase_WidgetSelectorStore.h>
 #include <ModuleBase_ViewerPrs.h>
@@ -143,15 +143,17 @@ bool ModuleBase_WidgetValidated::isValidSelection(const ModuleBase_ViewerPrsPtr&
 }
 
 //********************************************************************
-bool ModuleBase_WidgetValidated::isValidSelectionForAttribute(const ModuleBase_ViewerPrsPtr& theValue,
-                                                              const AttributePtr& theAttribute)
+bool ModuleBase_WidgetValidated::isValidSelectionForAttribute(
+                                            const ModuleBase_ViewerPrsPtr& theValue,
+                                            const AttributePtr& theAttribute)
 {
   bool aValid = false;
 
   // stores the current values of the widget attribute
-  bool isFlushesActived, isAttributeSetInitializedBlocked;
+  bool isFlushesActived, isAttributeSetInitializedBlocked, isAttributeSendUpdatedBlocked;
 
-  blockAttribute(theAttribute, true, isFlushesActived, isAttributeSetInitializedBlocked);
+  blockAttribute(theAttribute, true, isFlushesActived, isAttributeSetInitializedBlocked,
+                 isAttributeSendUpdatedBlocked);
 
   storeAttributeValue(theAttribute);
 
@@ -164,7 +166,8 @@ bool ModuleBase_WidgetValidated::isValidSelectionForAttribute(const ModuleBase_V
   // restores the current values of the widget attribute
   restoreAttributeValue(theAttribute, aValid);
 
-  blockAttribute(theAttribute, false, isFlushesActived, isAttributeSetInitializedBlocked);
+  blockAttribute(theAttribute, false, isFlushesActived, isAttributeSetInitializedBlocked,
+                 isAttributeSendUpdatedBlocked);
   /// NDS: The following rows are commented for issue #1452 (to be removed after debug)
   /// This is not correct to perform it here because it might cause update selection and
   /// the selection mechanizm will be circled: use the scenario of the bug with preselected point.
@@ -228,7 +231,8 @@ bool ModuleBase_WidgetValidated::activateFilters(const bool toActivate)
 void ModuleBase_WidgetValidated::blockAttribute(const AttributePtr& theAttribute,
                                                 const bool& theToBlock,
                                                 bool& isFlushesActived,
-                                                bool& isAttributeSetInitializedBlocked)
+                                                bool& isAttributeSetInitializedBlocked,
+                                                bool& isAttributeSendUpdatedBlocked)
 {
   Events_Loop* aLoop = Events_Loop::loop();
   DataPtr aData = myFeature->data();
@@ -237,18 +241,19 @@ void ModuleBase_WidgetValidated::blockAttribute(const AttributePtr& theAttribute
     // they should not be shown in order to do not lose highlight by erasing them
     isFlushesActived = aLoop->activateFlushes(false);
 
-    aData->blockSendAttributeUpdated(true);
+    isAttributeSendUpdatedBlocked = aData->blockSendAttributeUpdated(true);
     isAttributeSetInitializedBlocked = theAttribute->blockSetInitialized(true);
   }
   else {
-    aData->blockSendAttributeUpdated(false, false);
+    aData->blockSendAttributeUpdated(isAttributeSendUpdatedBlocked, false);
     theAttribute->blockSetInitialized(isAttributeSetInitializedBlocked);
     aLoop->activateFlushes(isFlushesActived);
   }
 }
 
 //********************************************************************
-void ModuleBase_WidgetValidated::storeValidState(const ModuleBase_ViewerPrsPtr& theValue, const bool theValid)
+void ModuleBase_WidgetValidated::storeValidState(const ModuleBase_ViewerPrsPtr& theValue,
+                                                 const bool theValid)
 {
   GeomShapePtr aShape = theValue.get() ? theValue->shape() : GeomShapePtr();
   if (aShape.get()) {
@@ -286,13 +291,15 @@ void ModuleBase_WidgetValidated::storeValidState(const ModuleBase_ViewerPrsPtr&
     }
   }
   #ifdef DEBUG_VALID_STATE
-    qDebug(QString("storeValidState: myValidPrs.size() = %1, myInvalidPrs.size() = %2").arg(myValidPrs.count())
+    qDebug(QString("storeValidState: myValidPrs.size() = %1, myInvalidPrs.size() = %2")
+                   .arg(myValidPrs.count())
                    .arg(myInvalidPrs.count()).toStdString().c_str());
   #endif
 }
 
 //********************************************************************
-bool ModuleBase_WidgetValidated::getValidState(const ModuleBase_ViewerPrsPtr& theValue, bool& theValid)
+bool ModuleBase_WidgetValidated::getValidState(const ModuleBase_ViewerPrsPtr& theValue,
+                                               bool& theValid)
 {
   if (!theValue.get())
     return false;
@@ -378,7 +385,8 @@ void ModuleBase_WidgetValidated::filterCompSolids(QList<ModuleBase_ViewerPrsPtr>
   for (; anIt != aLast; anIt++) {
     const ModuleBase_ViewerPrsPtr& aViewerPrs = *anIt;
     ObjectPtr anObject = aViewerPrs->object();
-    ResultCompSolidPtr aResultCompSolid = std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(anObject);
+    ResultCompSolidPtr aResultCompSolid =
+      std::dynamic_pointer_cast<ModelAPI_ResultCompSolid>(anObject);
     if(aResultCompSolid.get()) {
       aCompSolids.insert(aResultCompSolid);
     }