1 #include <PartSet_Module.h>
2 #include <PartSet_OperationSketch.h>
3 #include <PartSet_OperationFeatureCreate.h>
4 #include <PartSet_OperationFeatureEditMulti.h>
5 #include <PartSet_OperationFeatureEdit.h>
6 #include <PartSet_Listener.h>
7 #include <PartSet_TestOCC.h>
8 #include <PartSet_WidgetSketchLabel.h>
9 #include <PartSet_Validators.h>
10 #include <PartSet_Tools.h>
12 #include <ModuleBase_Operation.h>
13 #include <ModuleBase_OperationDescription.h>
14 #include <ModuleBase_WidgetFactory.h>
15 #include <ModuleBase_Operation.h>
17 #include <ModelAPI_Object.h>
18 #include <ModelAPI_Events.h>
19 #include <ModelAPI_Validator.h>
20 #include <ModelAPI_Data.h>
22 #include <GeomDataAPI_Point2D.h>
24 #include <XGUI_MainWindow.h>
25 #include <XGUI_Displayer.h>
26 #include <XGUI_Viewer.h>
27 #include <XGUI_Workshop.h>
28 #include <XGUI_OperationMgr.h>
29 #include <XGUI_SelectionMgr.h>
30 #include <XGUI_Selection.h>
31 #include <XGUI_ViewPort.h>
32 #include <XGUI_ActionsMgr.h>
33 #include <XGUI_ViewerProxy.h>
34 #include <XGUI_ContextMenuMgr.h>
35 #include <XGUI_PropertyPanel.h>
36 #include <XGUI_ModuleConnector.h>
37 #include <XGUI_Tools.h>
39 #include <SketchPlugin_Line.h>
41 #include <Config_PointerMessage.h>
42 #include <Config_ModuleReader.h>
43 #include <Config_WidgetReader.h>
44 #include <Events_Loop.h>
45 #include <Events_Message.h>
46 #include <Events_Error.h>
48 #include <GeomAPI_Shape.h>
49 #include <GeomAPI_AISObject.h>
50 #include <AIS_Shape.hxx>
52 #include <StdSelect_FaceFilter.hxx>
53 #include <StdSelect_TypeOfFace.hxx>
56 #include <QMouseEvent>
59 #include <GeomAlgoAPI_FaceBuilder.h>
60 #include <GeomDataAPI_Dir.h>
66 /*!Create and return new instance of XGUI_Module*/
67 extern "C" PARTSET_EXPORT ModuleBase_IModule* createModule(XGUI_Workshop* theWshop)
69 return new PartSet_Module(theWshop);
72 PartSet_Module::PartSet_Module(XGUI_Workshop* theWshop)
74 myWorkshop = theWshop;
75 myListener = new PartSet_Listener(this);
77 XGUI_OperationMgr* anOperationMgr = myWorkshop->operationMgr();
79 connect(anOperationMgr, SIGNAL(operationStarted()), this, SLOT(onOperationStarted()));
81 connect(anOperationMgr, SIGNAL(operationStopped(ModuleBase_Operation*)), this,
82 SLOT(onOperationStopped(ModuleBase_Operation*)));
84 XGUI_ContextMenuMgr* aContextMenuMgr = myWorkshop->contextMenuMgr();
85 connect(aContextMenuMgr, SIGNAL(actionTriggered(const QString&, bool)), this,
86 SLOT(onContextMenuCommand(const QString&, bool)));
88 connect(myWorkshop->viewer(), SIGNAL(mousePress(QMouseEvent*)), this,
89 SLOT(onMousePressed(QMouseEvent*)));
90 connect(myWorkshop->viewer(), SIGNAL(mouseRelease(QMouseEvent*)), this,
91 SLOT(onMouseReleased(QMouseEvent*)));
92 connect(myWorkshop->viewer(), SIGNAL(mouseMove(QMouseEvent*)), this,
93 SLOT(onMouseMoved(QMouseEvent*)));
94 connect(myWorkshop->viewer(), SIGNAL(keyRelease(QKeyEvent*)), this,
95 SLOT(onKeyRelease(QKeyEvent*)));
96 connect(myWorkshop->viewer(), SIGNAL(mouseDoubleClick(QMouseEvent*)), this,
97 SLOT(onMouseDoubleClick(QMouseEvent*)));
100 PartSet_Module::~PartSet_Module()
104 XGUI_Workshop* PartSet_Module::workshop() const
109 void PartSet_Module::createFeatures()
111 //Registering of validators
112 SessionPtr aMgr = ModelAPI_Session::get();
113 ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
114 aFactory->registerValidator("PartSet_DistanceValidator", new PartSet_DistanceValidator);
115 aFactory->registerValidator("PartSet_LengthValidator", new PartSet_LengthValidator);
116 aFactory->registerValidator("PartSet_PerpendicularValidator", new PartSet_PerpendicularValidator);
117 aFactory->registerValidator("PartSet_ParallelValidator", new PartSet_ParallelValidator);
118 aFactory->registerValidator("PartSet_RadiusValidator", new PartSet_RadiusValidator);
120 Config_ModuleReader aXMLReader = Config_ModuleReader();
121 aXMLReader.readAll();
122 myFeaturesInFiles = aXMLReader.featuresInFiles();
125 void PartSet_Module::featureCreated(QAction* theFeature)
127 connect(theFeature, SIGNAL(triggered(bool)), this, SLOT(onFeatureTriggered()));
130 std::string PartSet_Module::featureFile(const std::string& theFeatureId)
132 return myFeaturesInFiles[theFeatureId];
138 void PartSet_Module::onFeatureTriggered()
140 //PartSet_TestOCC::local_selection_change_shape(myWorkshop->viewer()->AISContext(),
141 // myWorkshop->viewer()->activeView());
143 //PartSet_TestOCC::local_selection_erase(myWorkshop->viewer()->AISContext(),
144 // myWorkshop->viewer()->activeView());
145 QAction* aCmd = dynamic_cast<QAction*>(sender());
146 //Do nothing on uncheck
147 if (aCmd->isCheckable() && !aCmd->isChecked())
149 launchOperation(aCmd->data().toString());
152 void PartSet_Module::launchOperation(const QString& theCmdId)
154 ModuleBase_Operation* anOperation = createOperation(theCmdId.toStdString());
155 //PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
157 XGUI_Selection* aSelection = myWorkshop->selector()->selection();
158 // Initialise operation with preliminary selection
159 std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
160 std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
161 anOperation->initSelection(aSelected, aHighlighted);
163 sendOperation(anOperation);
166 void PartSet_Module::onOperationStarted()
168 ModuleBase_Operation* aOperation = myWorkshop->operationMgr()->currentOperation();
170 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(aOperation);
172 XGUI_PropertyPanel* aPropPanel = myWorkshop->propertyPanel();
173 connect(aPropPanel, SIGNAL(storedPoint2D(ObjectPtr, const std::string&)), this,
174 SLOT(onStorePoint2D(ObjectPtr, const std::string&)), Qt::UniqueConnection);
176 XGUI_Displayer* aDisplayer = myWorkshop->displayer();
177 aDisplayer->openLocalContext();
178 aDisplayer->deactivateObjectsOutOfContext();
182 void PartSet_Module::onOperationStopped(ModuleBase_Operation* theOperation)
186 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(theOperation);
188 XGUI_PropertyPanel* aPropPanel = myWorkshop->propertyPanel();
189 //disconnect(aPropPanel, SIGNAL(storedPoint2D(ObjectPtr, const std::string&)),
190 // this, SLOT(onStorePoint2D(ObjectPtr, const std::string&)));
192 // Activate results of current feature for selection
193 FeaturePtr aFeature = theOperation->feature();
194 XGUI_Displayer* aDisplayer = myWorkshop->displayer();
195 std::list<ResultPtr> aResults = aFeature->results();
196 std::list<ResultPtr>::const_iterator aIt;
197 for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
198 aDisplayer->activate(*aIt);
203 void PartSet_Module::onContextMenuCommand(const QString& theId, bool isChecked)
205 QList<ObjectPtr> aFeatures = myWorkshop->selector()->selection()->selectedObjects();
206 if (theId == "EDIT_CMD" && (aFeatures.size() > 0)) {
207 FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(aFeatures.first());
209 editFeature(aFeature);
213 void PartSet_Module::onMousePressed(QMouseEvent* theEvent)
216 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(myWorkshop
217 ->operationMgr()->currentOperation());
218 Handle(V3d_View) aView = myWorkshop->viewer()->activeView();
219 if (aPreviewOp && (!aView.IsNull())) {
220 XGUI_Selection* aSelection = myWorkshop->selector()->selection();
221 // Initialise operation with preliminary selection
222 std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
223 std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
225 aPreviewOp->mousePressed(theEvent, aView, aSelected, aHighlighted);
229 void PartSet_Module::onMouseReleased(QMouseEvent* theEvent)
231 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(myWorkshop
232 ->operationMgr()->currentOperation());
233 Handle(V3d_View) aView = myWorkshop->viewer()->activeView();
234 if (aPreviewOp && (!aView.IsNull())) {
235 XGUI_Selection* aSelection = myWorkshop->selector()->selection();
236 // Initialise operation with preliminary selection
237 std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
238 std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
240 aPreviewOp->mouseReleased(theEvent, aView, aSelected, aHighlighted);
244 void PartSet_Module::onMouseMoved(QMouseEvent* theEvent)
246 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(myWorkshop
247 ->operationMgr()->currentOperation());
248 Handle(V3d_View) aView = myWorkshop->viewer()->activeView();
249 if (aPreviewOp && (!aView.IsNull()))
250 aPreviewOp->mouseMoved(theEvent, aView);
253 void PartSet_Module::onKeyRelease(QKeyEvent* theEvent)
255 ModuleBase_Operation* anOperation = myWorkshop->operationMgr()->currentOperation();
256 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
258 aPreviewOp->keyReleased(theEvent->key());
262 void PartSet_Module::onMouseDoubleClick(QMouseEvent* theEvent)
264 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(myWorkshop
265 ->operationMgr()->currentOperation());
266 Handle(V3d_View) aView = myWorkshop->viewer()->activeView();
267 if (aPreviewOp && (!aView.IsNull())) {
268 XGUI_Selection* aSelection = myWorkshop->selector()->selection();
269 // Initialise operation with preliminary selection
270 std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
271 std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
272 aPreviewOp->mouseDoubleClick(theEvent, aView, aSelected, aHighlighted);
276 void PartSet_Module::onPlaneSelected(double theX, double theY, double theZ)
279 myWorkshop->viewer()->setViewProjection(theX, theY, theZ);
280 myWorkshop->actionsMgr()->update();
282 //PartSet_TestOCC::testSelection(myWorkshop);
285 void PartSet_Module::onFitAllView()
287 myWorkshop->viewer()->fitAll();
290 void PartSet_Module::onRestartOperation(std::string theName, ObjectPtr theObject)
292 FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
294 std::string aKind = aFeature ? aFeature->getKind() : "";
295 ModuleBase_Operation* anOperation = createOperation(theName, aKind);
297 PartSet_OperationSketchBase* aSketchOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
299 PartSet_OperationFeatureCreate* aCreateOp = dynamic_cast<PartSet_OperationFeatureCreate*>(anOperation);
301 aCreateOp->initFeature(aFeature);
303 anOperation->setFeature(aFeature);
305 XGUI_Selection* aSelection = myWorkshop->selector()->selection();
306 // Initialise operation with preliminary selection
307 std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
308 std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
309 aSketchOp->initSelection(aSelected, aHighlighted);
310 } else if (aFeature) {
311 anOperation->setFeature(aFeature);
312 //Deactivate result of current feature in order to avoid its selection
313 XGUI_Displayer* aDisplayer = myWorkshop->displayer();
314 std::list<ResultPtr> aResults = aFeature->results();
315 std::list<ResultPtr>::const_iterator aIt;
316 for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
317 aDisplayer->deactivate(*aIt);
320 sendOperation(anOperation);
321 myWorkshop->actionsMgr()->updateCheckState();
324 void PartSet_Module::onMultiSelectionEnabled(bool theEnabled)
326 XGUI_ViewerProxy* aViewer = myWorkshop->viewer();
327 aViewer->enableMultiselection(theEnabled);
330 void PartSet_Module::onStopSelection(const QList<ObjectPtr>& theFeatures, const bool isStop)
332 XGUI_Displayer* aDisplayer = myWorkshop->displayer();
334 foreach(ObjectPtr aObject, theFeatures)
336 activateFeature(aObject, false);
339 aDisplayer->stopSelection(theFeatures, isStop, false);
341 XGUI_ViewerProxy* aViewer = myWorkshop->viewer();
342 aViewer->enableSelection(!isStop);
344 aDisplayer->updateViewer();
347 void PartSet_Module::onSetSelection(const QList<ObjectPtr>& theFeatures)
349 XGUI_Displayer* aDisplayer = myWorkshop->displayer();
350 aDisplayer->setSelected(theFeatures, false);
351 aDisplayer->updateViewer();
354 void PartSet_Module::onCloseLocalContext()
356 XGUI_Displayer* aDisplayer = myWorkshop->displayer();
357 aDisplayer->deactivateObjectsOutOfContext();
358 aDisplayer->closeLocalContexts();
361 void PartSet_Module::onFeatureConstructed(ObjectPtr theFeature, int theMode)
363 bool isDisplay = theMode != PartSet_OperationSketchBase::FM_Hide;
364 ModuleBase_Operation* aCurOperation = myWorkshop->operationMgr()->currentOperation();
365 PartSet_OperationSketchBase* aPrevOp = dynamic_cast<PartSet_OperationSketchBase*>(aCurOperation);
367 std::list<FeaturePtr> aList = aPrevOp->subFeatures();
368 XGUI_Displayer* aDisplayer = myWorkshop->displayer();
369 std::list<int> aModes = aPrevOp->getSelectionModes(aPrevOp->feature());
370 std::list<FeaturePtr>::iterator aSFIt;
371 for (aSFIt = aList.begin(); aSFIt != aList.end(); ++aSFIt) {
372 std::list<ResultPtr> aResults = (*aSFIt)->results();
373 std::list<ResultPtr>::iterator aIt;
374 for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
376 aDisplayer->activateInLocalContext((*aIt), aModes, false);
378 aDisplayer->erase((*aIt), false);
381 aDisplayer->erase((*aSFIt), false);
383 aDisplayer->deactivateObjectsOutOfContext();
386 ModelAPI_EventCreator::get()->sendUpdated(
387 theFeature, Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
390 ModuleBase_Operation* PartSet_Module::createOperation(const std::string& theCmdId,
391 const std::string& theFeatureKind)
393 // create the operation
394 ModuleBase_Operation* anOperation = 0;
395 if (theCmdId == PartSet_OperationSketch::Type()) {
396 anOperation = new PartSet_OperationSketch(theCmdId.c_str(), this);
398 ModuleBase_Operation* aCurOperation = myWorkshop->operationMgr()->currentOperation();
400 PartSet_OperationSketchBase* aPrevOp = dynamic_cast<PartSet_OperationSketchBase*>(aCurOperation);
402 aSketch = aPrevOp->sketch();
404 if (PartSet_OperationFeatureCreate::canProcessKind(theCmdId)) {
405 anOperation = new PartSet_OperationFeatureCreate(theCmdId.c_str(), this, aSketch);
406 } else if (theCmdId == PartSet_OperationFeatureEditMulti::Type()) {
407 anOperation = new PartSet_OperationFeatureEditMulti(theCmdId.c_str(), this, aSketch);
408 } else if (theCmdId == PartSet_OperationFeatureEdit::Type()) {
409 anOperation = new PartSet_OperationFeatureEdit(theCmdId.c_str(), this, aSketch);
414 anOperation = new ModuleBase_Operation(theCmdId.c_str(), this);
417 // set operation description and list of widgets corresponding to the feature xml definition
418 std::string aFeatureKind = theFeatureKind.empty() ? theCmdId : theFeatureKind;
420 std::string aPluginFileName = featureFile(aFeatureKind);
421 Config_WidgetReader aWdgReader = Config_WidgetReader(aPluginFileName);
422 aWdgReader.readAll();
423 std::string aXmlCfg = aWdgReader.featureWidgetCfg(aFeatureKind);
424 std::string aDescription = aWdgReader.featureDescription(aFeatureKind);
426 //QString aXmlRepr = QString::fromStdString(aXmlCfg);
427 //ModuleBase_WidgetFactory aFactory = ModuleBase_WidgetFactory(aXmlRepr.toStdString(),
428 // myWorkshop->moduleConnector());
429 //QWidget* aContent = myWorkshop->propertyPanel()->contentWidget();
430 //qDeleteAll(aContent->children());
431 //aFactory.createWidget(aContent);
433 anOperation->getDescription()->setDescription(QString::fromStdString(aDescription));
434 anOperation->getDescription()->setXmlRepresentation(QString::fromStdString(aXmlCfg));
436 //anOperation->setModelWidgets(aXmlRepr.toStdString(), aFactory.getModelWidgets());
438 // connect the operation
439 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
441 connect(aPreviewOp, SIGNAL(featureConstructed(ObjectPtr, int)), this,
442 SLOT(onFeatureConstructed(ObjectPtr, int)));
443 connect(aPreviewOp, SIGNAL(restartRequired(std::string, ObjectPtr)), this,
444 SLOT(onRestartOperation(std::string, ObjectPtr)));
445 connect(aPreviewOp, SIGNAL(multiSelectionEnabled(bool)), this,
446 SLOT(onMultiSelectionEnabled(bool)));
448 connect(aPreviewOp, SIGNAL(stopSelection(const QList<ObjectPtr>&, const bool)), this,
449 SLOT(onStopSelection(const QList<ObjectPtr>&, const bool)));
450 connect(aPreviewOp, SIGNAL(setSelection(const QList<ObjectPtr>&)), this,
451 SLOT(onSetSelection(const QList<ObjectPtr>&)));
453 connect(aPreviewOp, SIGNAL(closeLocalContext()), this, SLOT(onCloseLocalContext()));
455 PartSet_OperationSketch* aSketchOp = dynamic_cast<PartSet_OperationSketch*>(aPreviewOp);
457 connect(aSketchOp, SIGNAL(planeSelected(double, double, double)), this,
458 SLOT(onPlaneSelected(double, double, double)));
459 connect(aSketchOp, SIGNAL(fitAllView()), this, SLOT(onFitAllView()));
466 void PartSet_Module::sendOperation(ModuleBase_Operation* theOperation)
468 static Events_ID aModuleEvent = Events_Loop::eventByName(EVENT_OPERATION_LAUNCHED);
469 boost::shared_ptr<Config_PointerMessage> aMessage =
470 boost::shared_ptr<Config_PointerMessage>(new Config_PointerMessage(aModuleEvent, this));
471 aMessage->setPointer(theOperation);
472 Events_Loop::loop()->send(aMessage);
475 void PartSet_Module::activateFeature(ObjectPtr theFeature, const bool isUpdateViewer)
477 ModuleBase_Operation* anOperation = myWorkshop->operationMgr()->currentOperation();
478 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
480 XGUI_Displayer* aDisplayer = myWorkshop->displayer();
481 std::list<int> aModes = aPreviewOp->getSelectionModes(theFeature);
482 aDisplayer->activateInLocalContext(theFeature, aModes, isUpdateViewer);
484 // If this is a Sketcher then activate objects (planar faces) outside of context
485 PartSet_OperationSketch* aSketchOp = dynamic_cast<PartSet_OperationSketch*>(aPreviewOp);
487 Handle(StdSelect_FaceFilter) aFilter = new StdSelect_FaceFilter(StdSelect_Plane);
488 aDisplayer->activateObjectsOutOfContext(aModes, aFilter);
490 aDisplayer->deactivateObjectsOutOfContext();
495 void PartSet_Module::updateCurrentPreview(const std::string& theCmdId)
497 ModuleBase_Operation* anOperation = myWorkshop->operationMgr()->currentOperation();
501 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
505 FeaturePtr aFeature = aPreviewOp->feature();
506 if (!aFeature || aFeature->getKind() != theCmdId)
509 XGUI_Displayer* aDisplayer = myWorkshop->displayer();
510 // Hide result of sketch
511 std::list<ResultPtr> aResults = aFeature->results();
512 std::list<ResultPtr>::const_iterator aIt;
513 for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt)
514 aDisplayer->erase(*aIt, false);
516 std::list<FeaturePtr> aList = aPreviewOp->subFeatures();
517 std::list<int> aModes = aPreviewOp->getSelectionModes(aPreviewOp->feature());
519 std::list<FeaturePtr>::const_iterator anIt = aList.begin(), aLast = aList.end();
520 for (; anIt != aLast; anIt++) {
521 boost::shared_ptr<SketchPlugin_Feature> aSPFeature = boost::dynamic_pointer_cast<
522 SketchPlugin_Feature>(*anIt);
525 std::list<ResultPtr> aResults = aSPFeature->results();
526 std::list<ResultPtr>::const_iterator aRIt;
527 for (aRIt = aResults.cbegin(); aRIt != aResults.cend(); ++aRIt) {
528 aDisplayer->display((*aRIt), false);
529 aDisplayer->activateInLocalContext((*aRIt), aModes, false);
531 aDisplayer->display(aSPFeature, false);
532 aDisplayer->activateInLocalContext(aSPFeature, aModes, false);
534 aDisplayer->updateViewer();
537 void PartSet_Module::editFeature(FeaturePtr theFeature)
542 // if (theFeature->getKind() == SKETCH_KIND) {
543 //FeaturePtr aFeature = theFeature;
544 //if (XGUI_Tools::isModelObject(aFeature)) {
545 // ObjectPtr aObject = boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature);
546 // aFeature = aObject->featureRef();
550 onRestartOperation(theFeature->getKind(), theFeature);
551 updateCurrentPreview(theFeature->getKind());
556 void PartSet_Module::onStorePoint2D(ObjectPtr theFeature, const std::string& theAttribute)
558 FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(theFeature);
560 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(myWorkshop
561 ->operationMgr()->currentOperation());
565 boost::shared_ptr<GeomDataAPI_Point2D> aPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(
566 aFeature->data()->attribute(theAttribute));
568 PartSet_Tools::setConstraints(aPreviewOp->sketch(), aFeature, theAttribute, aPoint->x(),
572 QWidget* PartSet_Module::createWidgetByType(const std::string& theType, QWidget* theParent,
573 Config_WidgetAPI* theWidgetApi,
574 QList<ModuleBase_ModelWidget*>& theModelWidgets)
576 if (theType == "sketch-start-label") {
577 PartSet_WidgetSketchLabel* aWgt = new PartSet_WidgetSketchLabel(theParent, theWidgetApi, "");
578 aWgt->setOperationsMgr(myWorkshop->operationMgr());
579 theModelWidgets.append(aWgt);
580 return aWgt->getControl();