// 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>
}
//********************************************************************
-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);
// 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.
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();
// 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()) {
}
}
#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;
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);
}