#include <ModelAPI_ResultBody.h>
#include <ModelAPI_Tools.h>
#include <ModelAPI_AttributeString.h>
+#include <ModelAPI_Events.h>
#include <ModuleBase_Operation.h>
#include <ModuleBase_ViewerPrs.h>
myShowDOFBtn->hide();
} else {
myDoFLabel->setText(tr("DoF (degrees of freedom) = ") + aVal);
- myShowDOFBtn->show();
+ CompositeFeaturePtr aCompFeature = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(myFeature);
+ if (aCompFeature.get() && aCompFeature->numberOfSubs() > 1)
+ myShowDOFBtn->show();
}
}
}
void PartSet_WidgetSketchLabel::onShowDOF()
{
-
-}
\ No newline at end of file
+ CompositeFeaturePtr aCompFeature = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(myFeature);
+ if (aCompFeature.get() && aCompFeature->numberOfSubs() > 1) {
+ static const Events_ID anEvent = Events_Loop::eventByName(EVENT_GET_DOF_OBJECTS);
+ ModelAPI_EventCreator::get()->sendUpdated(aCompFeature->subFeature(0), anEvent);
+ Events_Loop::loop()->flush(anEvent);
+ }
+}