- boost::shared_ptr<GeomDataAPI_Point2D> aPoint =
- boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(theFeature->data()->attribute(theAttribute));
-
- PartSet_Tools::setConstraints(aPreviewOp->sketch(), theFeature, theAttribute,
- aPoint->x(), aPoint->y());
+ boost::shared_ptr<GeomDataAPI_Point2D> aPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(
+ aFeature->data()->attribute(theAttribute));
+
+ PartSet_Tools::setConstraints(aPreviewOp->sketch(), aFeature, theAttribute, aPoint->x(),
+ aPoint->y());
+}
+
+/*bool PartSet_Module::isFeatureEnabled(const QString& theCmdId) const
+ {
+ XGUI_OperationMgr* aOpMgr = myWorkshop->operationMgr();
+ XGUI_ActionsMgr* aActMgr = myWorkshop->actionsMgr();
+
+ ModuleBase_Operation* aOperation = aOpMgr->currentOperation();
+ if (!aOperation)
+ return !aActMgr->isNested(theCmdId);
+
+ PartSet_OperationFeatureEdit* aSketchEdtOp = dynamic_cast<PartSet_OperationFeatureEdit*>(aOperation);
+ if (aSketchEdtOp) {
+ QStringList aConstraintList;
+ aConstraintList<<"SketchConstraintDistance"<<"SketchConstraintLength"
+ <<"SketchConstraintRadius"<<"SketchConstraintParallel"<<"SketchConstraintPerpendicular";
+ return aConstraintList.contains(theCmdId);
+ }
+ QStringList aList = aActMgr->nestedCommands(aOperation->id());
+ return aList.contains(theCmdId);
+ }*/
+
+QWidget* PartSet_Module::createWidgetByType(const std::string& theType, QWidget* theParent,
+ Config_WidgetAPI* theWidgetApi,
+ QList<ModuleBase_ModelWidget*>& theModelWidgets)
+{
+ if (theType == "sketch-start-label") {
+ PartSet_WidgetSketchLabel* aWgt = new PartSet_WidgetSketchLabel(theParent, theWidgetApi, "");
+ aWgt->setOperationsMgr(myWorkshop->operationMgr());
+ theModelWidgets.append(aWgt);
+ return aWgt->getControl();
+ } else
+ return 0;