-
- if (!anOperation) {
- anOperation = new ModuleBase_Operation(theCmdId.c_str(), this);
- }
-
- // set operation description and list of widgets corresponding to the feature xml definition
- std::string aFeatureKind = theFeatureKind.empty() ? theCmdId : theFeatureKind;
-
- std::string aPluginFileName = featureFile(aFeatureKind);
- Config_WidgetReader aWdgReader = Config_WidgetReader(aPluginFileName);
- aWdgReader.readAll();
- std::string aXmlCfg = aWdgReader.featureWidgetCfg(aFeatureKind);
- std::string aDescription = aWdgReader.featureDescription(aFeatureKind);
-
- anOperation->getDescription()->setDescription(QString::fromStdString(aDescription));
- anOperation->getDescription()->setXmlRepresentation(QString::fromStdString(aXmlCfg));
-
- // connect the operation
- PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
- if (aPreviewOp) {
- connect(aPreviewOp, SIGNAL(featureConstructed(ObjectPtr, int)), this,
- SLOT(onFeatureConstructed(ObjectPtr, int)));
- connect(aPreviewOp, SIGNAL(restartRequired(std::string, ObjectPtr)), this,
- SLOT(onRestartOperation(std::string, ObjectPtr)));
- // If manage multi selection the it will be impossible to select more then one
- // object under operation Edit
-// connect(aPreviewOp, SIGNAL(multiSelectionEnabled(bool)), this,
-// SLOT(onMultiSelectionEnabled(bool)));
-
- connect(aPreviewOp, SIGNAL(stopSelection(const QList<ObjectPtr>&, const bool)), this,
- SLOT(onStopSelection(const QList<ObjectPtr>&, const bool)));
- connect(aPreviewOp, SIGNAL(setSelection(const QList<ObjectPtr>&)), this,
- SLOT(onSetSelection(const QList<ObjectPtr>&)));
-
- PartSet_OperationSketch* aSketchOp = dynamic_cast<PartSet_OperationSketch*>(aPreviewOp);
- if (aSketchOp) {
- connect(aSketchOp, SIGNAL(planeSelected(double, double, double)), this,
- SLOT(onPlaneSelected(double, double, double)));
- connect(aSketchOp, SIGNAL(fitAllView()), this, SLOT(onFitAllView()));
- connect(aSketchOp, SIGNAL(launchSketch()), this, SLOT(onSketchLaunched()));
- }
- }
-
- return anOperation;