Events_Loop::loop()->send(aMessage);
}
// container pages, like "case" or "box"
- } else if (isNode(theNode, WDG_SWITCH, WDG_SWITCH_CASE, WDG_SWITCH, WDG_TOOLBOX, NULL)) {
+ } else if (isNode(theNode, WDG_SWITCH, WDG_SWITCH_CASE, WDG_TOOLBOX, WDG_TOOLBOX_BOX, NULL)) {
storeAttribute(theNode, _ID); // save case:caseId (or box:boxId)
}
}
void Config_FeatureReader::cleanup(xmlNodePtr theNode)
{
- if (isNode(theNode, WDG_SWITCH, WDG_SWITCH_CASE, WDG_SWITCH, WDG_TOOLBOX, NULL)) {
+ if (isNode(theNode, WDG_SWITCH, WDG_SWITCH_CASE, WDG_TOOLBOX, WDG_TOOLBOX_BOX, NULL)) {
// cleanup id of cases when leave case node
cleanupAttribute(theNode, _ID);
}
</shape_selector>
</box>
<box id="AxisByCylindricalFaceCase" title="As axis of cylindrical face">
- <shape_selector id="main_object"
+ <shape_selector id="cylindricalFace"
label="Main object"
icon=":icons/circle.png"
tooltip="Select a cylindrical object"
std::shared_ptr<ModelAPI_AttributeSelection> aSel =
std::dynamic_pointer_cast<ModelAPI_AttributeSelection>(*aRefsIter);
if (!aSel->update()) { // this must be done on execution since it may be long operation
- if (!aFactory->isNotObligatory(theFeature->getKind(), theFeature->data()->id(aSel)))
+ if (!aFactory->isNotObligatory(theFeature->getKind(), theFeature->data()->id(aSel)) &&
+ aFactory->isCase(theFeature, theFeature->data()->id(aSel)))
aState = ModelAPI_StateInvalidArgument;
}
}
if (aSelAttr) {
if (!aSelAttr->update()) {
if (!aFactory->isNotObligatory(
- theFeature->getKind(), theFeature->data()->id(aSel)))
+ theFeature->getKind(), theFeature->data()->id(aSel)) &&
+ aFactory->isCase(theFeature, theFeature->data()->id(aSel)))
aState = ModelAPI_StateInvalidArgument;
}
}
#include <Model.h>
#include <ModelAPI_Validator.h>
-#include <ModelAPI_Feature.h>
#include <map>
#include <set>
#define ModelAPI_Validator_H_
#include <ModelAPI.h>
+#include <ModelAPI_Feature.h>
#include <memory>
#include <list>
virtual void registerCase(std::string theFeature, std::string theAttribute,
std::string theSwitchId, std::string theCaseId) = 0;
+ /// Returns true if the attribute must be checked (the case is selected)
+ virtual bool isCase(FeaturePtr theFeature, std::string theAttribute) = 0;
+
protected:
/// Get instance from Session
ModelAPI_ValidatorsFactory()