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_ViewPort.h>
30 #include <XGUI_ActionsMgr.h>
31 #include <XGUI_ViewerProxy.h>
32 #include <XGUI_ContextMenuMgr.h>
33 #include <XGUI_PropertyPanel.h>
34 #include <XGUI_ModuleConnector.h>
35 #include <XGUI_Tools.h>
37 #include <SketchPlugin_Line.h>
39 #include <Config_PointerMessage.h>
40 #include <Config_ModuleReader.h>
41 #include <Config_WidgetReader.h>
42 #include <Events_Loop.h>
43 //#include <Events_Message.h>
44 //#include <Events_Error.h>
46 #include <GeomAPI_Shape.h>
47 #include <GeomAPI_AISObject.h>
48 #include <AIS_Shape.hxx>
50 #include <StdSelect_FaceFilter.hxx>
51 #include <StdSelect_TypeOfFace.hxx>
54 #include <QMouseEvent>
57 #include <GeomAlgoAPI_FaceBuilder.h>
58 #include <GeomDataAPI_Dir.h>
64 /*!Create and return new instance of XGUI_Module*/
65 extern "C" PARTSET_EXPORT ModuleBase_IModule* createModule(ModuleBase_IWorkshop* theWshop)
67 return new PartSet_Module(theWshop);
70 PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
71 : ModuleBase_IModule(theWshop)
73 //myWorkshop = theWshop;
74 myListener = new PartSet_Listener(this);
76 connect(myWorkshop, SIGNAL(operationStarted(ModuleBase_Operation*)),
77 this, SLOT(onOperationStarted(ModuleBase_Operation*)));
79 connect(myWorkshop, SIGNAL(operationStopped(ModuleBase_Operation*)), this,
80 SLOT(onOperationStopped(ModuleBase_Operation*)));
82 XGUI_ContextMenuMgr* aContextMenuMgr = xWorkshop()->contextMenuMgr();
83 connect(aContextMenuMgr, SIGNAL(actionTriggered(const QString&, bool)), this,
84 SLOT(onContextMenuCommand(const QString&, bool)));
86 connect(myWorkshop->viewer(), SIGNAL(mousePress(QMouseEvent*)), this,
87 SLOT(onMousePressed(QMouseEvent*)));
88 connect(myWorkshop->viewer(), SIGNAL(mouseRelease(QMouseEvent*)), this,
89 SLOT(onMouseReleased(QMouseEvent*)));
90 connect(myWorkshop->viewer(), SIGNAL(mouseMove(QMouseEvent*)), this,
91 SLOT(onMouseMoved(QMouseEvent*)));
92 connect(myWorkshop->viewer(), SIGNAL(keyRelease(QKeyEvent*)), this,
93 SLOT(onKeyRelease(QKeyEvent*)));
94 connect(myWorkshop->viewer(), SIGNAL(mouseDoubleClick(QMouseEvent*)), this,
95 SLOT(onMouseDoubleClick(QMouseEvent*)));
98 PartSet_Module::~PartSet_Module()
102 void PartSet_Module::createFeatures()
104 //Registering of validators
105 SessionPtr aMgr = ModelAPI_Session::get();
106 ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
107 aFactory->registerValidator("PartSet_DistanceValidator", new PartSet_DistanceValidator);
108 aFactory->registerValidator("PartSet_LengthValidator", new PartSet_LengthValidator);
109 aFactory->registerValidator("PartSet_PerpendicularValidator", new PartSet_PerpendicularValidator);
110 aFactory->registerValidator("PartSet_ParallelValidator", new PartSet_ParallelValidator);
111 aFactory->registerValidator("PartSet_RadiusValidator", new PartSet_RadiusValidator);
113 Config_ModuleReader aXMLReader = Config_ModuleReader();
114 aXMLReader.readAll();
115 myFeaturesInFiles = aXMLReader.featuresInFiles();
118 void PartSet_Module::featureCreated(QAction* theFeature)
120 connect(theFeature, SIGNAL(triggered(bool)), this, SLOT(onFeatureTriggered()));
123 std::string PartSet_Module::featureFile(const std::string& theFeatureId)
125 return myFeaturesInFiles[theFeatureId];
131 void PartSet_Module::onFeatureTriggered()
133 //PartSet_TestOCC::local_selection_change_shape(myWorkshop->viewer()->AISContext(),
134 // myWorkshop->viewer()->activeView());
136 //PartSet_TestOCC::local_selection_erase(myWorkshop->viewer()->AISContext(),
137 // myWorkshop->viewer()->activeView());
138 QAction* aCmd = dynamic_cast<QAction*>(sender());
139 //Do nothing on uncheck
140 if (aCmd->isCheckable() && !aCmd->isChecked())
142 launchOperation(aCmd->data().toString());
145 //void PartSet_Module::launchOperation(const QString& theCmdId)
147 // ModuleBase_Operation* anOperation = createOperation(theCmdId.toStdString());
148 // //PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
149 // //if (aPreviewOp) {
150 // XGUI_Selection* aSelection = myWorkshop->selector()->selection();
151 // // Initialise operation with preliminary selection
152 // std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
153 // std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
154 // anOperation->initSelection(aSelected, aHighlighted);
156 // sendOperation(anOperation);
159 void PartSet_Module::onOperationStarted(ModuleBase_Operation* theOperation)
161 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(theOperation);
163 XGUI_Workshop* aXWshp = xWorkshop();
164 XGUI_PropertyPanel* aPropPanel = aXWshp->propertyPanel();
165 connect(aPropPanel, SIGNAL(storedPoint2D(ObjectPtr, const std::string&)), this,
166 SLOT(onStorePoint2D(ObjectPtr, const std::string&)), Qt::UniqueConnection);
168 XGUI_Displayer* aDisplayer = aXWshp->displayer();
169 aDisplayer->openLocalContext();
170 aDisplayer->deactivateObjectsOutOfContext();
174 void PartSet_Module::onOperationStopped(ModuleBase_Operation* theOperation)
178 XGUI_Workshop* aXWshp = xWorkshop();
179 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(theOperation);
181 XGUI_PropertyPanel* aPropPanel = aXWshp->propertyPanel();
182 //disconnect(aPropPanel, SIGNAL(storedPoint2D(ObjectPtr, const std::string&)),
183 // this, SLOT(onStorePoint2D(ObjectPtr, const std::string&)));
185 // Activate results of current feature for selection
186 FeaturePtr aFeature = theOperation->feature();
187 XGUI_Displayer* aDisplayer = aXWshp->displayer();
188 std::list<ResultPtr> aResults = aFeature->results();
189 std::list<ResultPtr>::const_iterator aIt;
190 for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
191 aDisplayer->activate(*aIt);
196 void PartSet_Module::onContextMenuCommand(const QString& theId, bool isChecked)
198 QList<ObjectPtr> aFeatures = workshop()->selection()->selectedObjects();
199 if (theId == "EDIT_CMD" && (aFeatures.size() > 0)) {
200 FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(aFeatures.first());
202 editFeature(aFeature);
206 void PartSet_Module::onMousePressed(QMouseEvent* theEvent)
208 XGUI_Workshop* aXWshp = xWorkshop();
209 PartSet_OperationSketchBase* aPreviewOp =
210 dynamic_cast<PartSet_OperationSketchBase*>(workshop()->currentOperation());
211 Handle(V3d_View) aView = myWorkshop->viewer()->activeView();
212 if (aPreviewOp && (!aView.IsNull())) {
213 ModuleBase_ISelection* aSelection = workshop()->selection();
214 // Initialise operation with preliminary selection
215 std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
216 std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
218 aPreviewOp->mousePressed(theEvent, aView, aSelected, aHighlighted);
222 void PartSet_Module::onMouseReleased(QMouseEvent* theEvent)
224 PartSet_OperationSketchBase* aPreviewOp =
225 dynamic_cast<PartSet_OperationSketchBase*>(myWorkshop->currentOperation());
226 Handle(V3d_View) aView = myWorkshop->viewer()->activeView();
227 if (aPreviewOp && (!aView.IsNull())) {
228 ModuleBase_ISelection* aSelection = workshop()->selection();
229 // Initialise operation with preliminary selection
230 std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
231 std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
233 aPreviewOp->mouseReleased(theEvent, aView, aSelected, aHighlighted);
237 void PartSet_Module::onMouseMoved(QMouseEvent* theEvent)
239 PartSet_OperationSketchBase* aPreviewOp =
240 dynamic_cast<PartSet_OperationSketchBase*>(myWorkshop->currentOperation());
241 Handle(V3d_View) aView = myWorkshop->viewer()->activeView();
242 if (aPreviewOp && (!aView.IsNull()))
243 aPreviewOp->mouseMoved(theEvent, aView);
246 void PartSet_Module::onKeyRelease(QKeyEvent* theEvent)
248 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
249 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
251 aPreviewOp->keyReleased(theEvent->key());
255 void PartSet_Module::onMouseDoubleClick(QMouseEvent* theEvent)
257 PartSet_OperationSketchBase* aPreviewOp =
258 dynamic_cast<PartSet_OperationSketchBase*>(myWorkshop->currentOperation());
259 Handle(V3d_View) aView = myWorkshop->viewer()->activeView();
260 if (aPreviewOp && (!aView.IsNull())) {
261 ModuleBase_ISelection* aSelection = workshop()->selection();
262 // Initialise operation with preliminary selection
263 std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
264 std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
265 aPreviewOp->mouseDoubleClick(theEvent, aView, aSelected, aHighlighted);
269 void PartSet_Module::onPlaneSelected(double theX, double theY, double theZ)
272 myWorkshop->viewer()->setViewProjection(theX, theY, theZ);
273 xWorkshop()->actionsMgr()->update();
275 //PartSet_TestOCC::testSelection(myWorkshop);
278 void PartSet_Module::onFitAllView()
280 myWorkshop->viewer()->fitAll();
283 void PartSet_Module::onRestartOperation(std::string theName, ObjectPtr theObject)
285 FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
287 std::string aKind = aFeature ? aFeature->getKind() : "";
288 ModuleBase_Operation* anOperation = createOperation(theName, aKind);
290 PartSet_OperationSketchBase* aSketchOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
292 PartSet_OperationFeatureCreate* aCreateOp = dynamic_cast<PartSet_OperationFeatureCreate*>(anOperation);
294 aCreateOp->initFeature(aFeature);
296 anOperation->setFeature(aFeature);
298 ModuleBase_ISelection* aSelection = workshop()->selection();
299 // Initialise operation with preliminary selection
300 std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
301 std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
302 aSketchOp->initSelection(aSelected, aHighlighted);
303 } else if (aFeature) {
304 anOperation->setFeature(aFeature);
305 //Deactivate result of current feature in order to avoid its selection
306 XGUI_Displayer* aDisplayer = xWorkshop()->displayer();
307 std::list<ResultPtr> aResults = aFeature->results();
308 std::list<ResultPtr>::const_iterator aIt;
309 for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
310 aDisplayer->deactivate(*aIt);
313 sendOperation(anOperation);
314 xWorkshop()->actionsMgr()->updateCheckState();
317 void PartSet_Module::onMultiSelectionEnabled(bool theEnabled)
319 ModuleBase_IViewer* aViewer = myWorkshop->viewer();
320 aViewer->enableMultiselection(theEnabled);
323 void PartSet_Module::onStopSelection(const QList<ObjectPtr>& theFeatures, const bool isStop)
325 XGUI_Displayer* aDisplayer = xWorkshop()->displayer();
327 foreach(ObjectPtr aObject, theFeatures)
329 activateFeature(aObject, false);
332 aDisplayer->stopSelection(theFeatures, isStop, false);
334 ModuleBase_IViewer* aViewer = myWorkshop->viewer();
335 aViewer->enableSelection(!isStop);
337 aDisplayer->updateViewer();
340 void PartSet_Module::onSetSelection(const QList<ObjectPtr>& theFeatures)
342 XGUI_Displayer* aDisplayer = xWorkshop()->displayer();
343 aDisplayer->setSelected(theFeatures, false);
344 aDisplayer->updateViewer();
347 void PartSet_Module::onCloseLocalContext()
349 XGUI_Displayer* aDisplayer = xWorkshop()->displayer();
350 aDisplayer->deactivateObjectsOutOfContext();
351 aDisplayer->closeLocalContexts();
354 void PartSet_Module::onFeatureConstructed(ObjectPtr theFeature, int theMode)
356 bool isDisplay = theMode != PartSet_OperationSketchBase::FM_Hide;
357 ModuleBase_Operation* aCurOperation = myWorkshop->currentOperation();
358 PartSet_OperationSketchBase* aPrevOp = dynamic_cast<PartSet_OperationSketchBase*>(aCurOperation);
360 std::list<FeaturePtr> aList = aPrevOp->subFeatures();
361 XGUI_Displayer* aDisplayer = xWorkshop()->displayer();
362 std::list<int> aModes = aPrevOp->getSelectionModes(aPrevOp->feature());
363 std::list<FeaturePtr>::iterator aSFIt;
364 for (aSFIt = aList.begin(); aSFIt != aList.end(); ++aSFIt) {
365 std::list<ResultPtr> aResults = (*aSFIt)->results();
366 std::list<ResultPtr>::iterator aIt;
367 for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
369 aDisplayer->activateInLocalContext((*aIt), aModes, false);
371 aDisplayer->erase((*aIt), false);
374 aDisplayer->erase((*aSFIt), false);
376 aDisplayer->deactivateObjectsOutOfContext();
379 ModelAPI_EventCreator::get()->sendUpdated(
380 theFeature, Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
383 ModuleBase_Operation* PartSet_Module::createOperation(const std::string& theCmdId,
384 const std::string& theFeatureKind)
386 // create the operation
387 ModuleBase_Operation* anOperation = 0;
388 if (theCmdId == PartSet_OperationSketch::Type()) {
389 anOperation = new PartSet_OperationSketch(theCmdId.c_str(), this);
391 ModuleBase_Operation* aCurOperation = myWorkshop->currentOperation();
393 PartSet_OperationSketchBase* aPrevOp = dynamic_cast<PartSet_OperationSketchBase*>(aCurOperation);
395 aSketch = aPrevOp->sketch();
397 if (PartSet_OperationFeatureCreate::canProcessKind(theCmdId)) {
398 anOperation = new PartSet_OperationFeatureCreate(theCmdId.c_str(), this, aSketch);
399 } else if (theCmdId == PartSet_OperationFeatureEditMulti::Type()) {
400 anOperation = new PartSet_OperationFeatureEditMulti(theCmdId.c_str(), this, aSketch);
401 } else if (theCmdId == PartSet_OperationFeatureEdit::Type()) {
402 anOperation = new PartSet_OperationFeatureEdit(theCmdId.c_str(), this, aSketch);
407 anOperation = new ModuleBase_Operation(theCmdId.c_str(), this);
410 // set operation description and list of widgets corresponding to the feature xml definition
411 std::string aFeatureKind = theFeatureKind.empty() ? theCmdId : theFeatureKind;
413 std::string aPluginFileName = featureFile(aFeatureKind);
414 Config_WidgetReader aWdgReader = Config_WidgetReader(aPluginFileName);
415 aWdgReader.readAll();
416 std::string aXmlCfg = aWdgReader.featureWidgetCfg(aFeatureKind);
417 std::string aDescription = aWdgReader.featureDescription(aFeatureKind);
419 anOperation->getDescription()->setDescription(QString::fromStdString(aDescription));
420 anOperation->getDescription()->setXmlRepresentation(QString::fromStdString(aXmlCfg));
422 // connect the operation
423 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
425 connect(aPreviewOp, SIGNAL(featureConstructed(ObjectPtr, int)), this,
426 SLOT(onFeatureConstructed(ObjectPtr, int)));
427 connect(aPreviewOp, SIGNAL(restartRequired(std::string, ObjectPtr)), this,
428 SLOT(onRestartOperation(std::string, ObjectPtr)));
429 connect(aPreviewOp, SIGNAL(multiSelectionEnabled(bool)), this,
430 SLOT(onMultiSelectionEnabled(bool)));
432 connect(aPreviewOp, SIGNAL(stopSelection(const QList<ObjectPtr>&, const bool)), this,
433 SLOT(onStopSelection(const QList<ObjectPtr>&, const bool)));
434 connect(aPreviewOp, SIGNAL(setSelection(const QList<ObjectPtr>&)), this,
435 SLOT(onSetSelection(const QList<ObjectPtr>&)));
437 connect(aPreviewOp, SIGNAL(closeLocalContext()), this, SLOT(onCloseLocalContext()));
439 PartSet_OperationSketch* aSketchOp = dynamic_cast<PartSet_OperationSketch*>(aPreviewOp);
441 connect(aSketchOp, SIGNAL(planeSelected(double, double, double)), this,
442 SLOT(onPlaneSelected(double, double, double)));
443 connect(aSketchOp, SIGNAL(fitAllView()), this, SLOT(onFitAllView()));
450 //void PartSet_Module::sendOperation(ModuleBase_Operation* theOperation)
452 // static Events_ID aModuleEvent = Events_Loop::eventByName(EVENT_OPERATION_LAUNCHED);
453 // boost::shared_ptr<Config_PointerMessage> aMessage =
454 // boost::shared_ptr<Config_PointerMessage>(new Config_PointerMessage(aModuleEvent, this));
455 // aMessage->setPointer(theOperation);
456 // Events_Loop::loop()->send(aMessage);
459 void PartSet_Module::activateFeature(ObjectPtr theFeature, const bool isUpdateViewer)
461 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
462 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
464 XGUI_Displayer* aDisplayer = xWorkshop()->displayer();
465 std::list<int> aModes = aPreviewOp->getSelectionModes(theFeature);
466 aDisplayer->activateInLocalContext(theFeature, aModes, isUpdateViewer);
468 // If this is a Sketcher then activate objects (planar faces) outside of context
469 PartSet_OperationSketch* aSketchOp = dynamic_cast<PartSet_OperationSketch*>(aPreviewOp);
471 Handle(StdSelect_FaceFilter) aFilter = new StdSelect_FaceFilter(StdSelect_Plane);
472 aDisplayer->activateObjectsOutOfContext(aModes, aFilter);
474 aDisplayer->deactivateObjectsOutOfContext();
479 void PartSet_Module::updateCurrentPreview(const std::string& theCmdId)
481 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
485 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
489 FeaturePtr aFeature = aPreviewOp->feature();
490 if (!aFeature || aFeature->getKind() != theCmdId)
493 XGUI_Displayer* aDisplayer = xWorkshop()->displayer();
494 // Hide result of sketch
495 std::list<ResultPtr> aResults = aFeature->results();
496 std::list<ResultPtr>::const_iterator aIt;
497 for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt)
498 aDisplayer->erase(*aIt, false);
500 std::list<FeaturePtr> aList = aPreviewOp->subFeatures();
501 std::list<int> aModes = aPreviewOp->getSelectionModes(aPreviewOp->feature());
503 std::list<FeaturePtr>::const_iterator anIt = aList.begin(), aLast = aList.end();
504 for (; anIt != aLast; anIt++) {
505 boost::shared_ptr<SketchPlugin_Feature> aSPFeature = boost::dynamic_pointer_cast<
506 SketchPlugin_Feature>(*anIt);
509 std::list<ResultPtr> aResults = aSPFeature->results();
510 std::list<ResultPtr>::const_iterator aRIt;
511 for (aRIt = aResults.cbegin(); aRIt != aResults.cend(); ++aRIt) {
512 aDisplayer->display((*aRIt), false);
513 aDisplayer->activateInLocalContext((*aRIt), aModes, false);
515 aDisplayer->display(aSPFeature, false);
516 aDisplayer->activateInLocalContext(aSPFeature, aModes, false);
518 aDisplayer->updateViewer();
521 void PartSet_Module::editFeature(FeaturePtr theFeature)
526 // if (theFeature->getKind() == SKETCH_KIND) {
527 //FeaturePtr aFeature = theFeature;
528 //if (XGUI_Tools::isModelObject(aFeature)) {
529 // ObjectPtr aObject = boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature);
530 // aFeature = aObject->featureRef();
534 onRestartOperation(theFeature->getKind(), theFeature);
535 updateCurrentPreview(theFeature->getKind());
540 void PartSet_Module::onStorePoint2D(ObjectPtr theFeature, const std::string& theAttribute)
542 FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(theFeature);
544 PartSet_OperationSketchBase* aPreviewOp =
545 dynamic_cast<PartSet_OperationSketchBase*>(myWorkshop->currentOperation());
549 boost::shared_ptr<GeomDataAPI_Point2D> aPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(
550 aFeature->data()->attribute(theAttribute));
552 PartSet_Tools::setConstraints(aPreviewOp->sketch(), aFeature, theAttribute, aPoint->x(),
556 QWidget* PartSet_Module::createWidgetByType(const std::string& theType, QWidget* theParent,
557 Config_WidgetAPI* theWidgetApi,
558 QList<ModuleBase_ModelWidget*>& theModelWidgets)
560 if (theType == "sketch-start-label") {
561 PartSet_WidgetSketchLabel* aWgt = new PartSet_WidgetSketchLabel(theParent, theWidgetApi, "");
562 aWgt->setOperationsMgr(xWorkshop()->operationMgr());
563 theModelWidgets.append(aWgt);
564 return aWgt->getControl();
570 XGUI_Workshop* PartSet_Module::xWorkshop() const
572 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
574 return aConnector->workshop();