- for (int i = 0; i < myCurrentSketch->numberOfSubs(); i++) {
- FeaturePtr aSubFeature = myCurrentSketch->subFeature(i);
- bool aProcessed = false;
- bool aConstraintDisplayed = canDisplayConstraint(aSubFeature, aType, aProcessed);
- if (aProcessed)
- aSubFeature->setDisplayed(aConstraintDisplayed);
+ bool aPrevState = myIsConstraintsShown[theType];
+ myIsConstraintsShown[theType] = theState;
+
+ switch (theType) {
+ case PartSet_Tools::Geometrical:
+ case PartSet_Tools::Dimensional: {
+ if (aPrevState != theState) {
+ ModuleBase_IWorkshop* aWorkshop = myModule->workshop();
+ XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(aWorkshop);
+ for (int i = 0; i < myCurrentSketch->numberOfSubs(); i++) {
+ FeaturePtr aSubFeature = myCurrentSketch->subFeature(i);
+ bool aProcessed = false;
+ bool aConstraintDisplayed = canDisplayConstraint(aSubFeature, theType, aProcessed);
+ if (aProcessed)
+ aSubFeature->setDisplayed(aConstraintDisplayed);
+ }
+ Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_TO_REDISPLAY));
+ }
+ }
+ break;
+ case PartSet_Tools::Expressions: {
+ /// call all sketch features redisplay, the expression state will be corrected in customize
+ /// of distance presentation
+ Events_ID anEventId = Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY);
+ PartSet_Tools::sendSubFeaturesEvent(myCurrentSketch, anEventId);
+ }
+ break;