1 #include "PartSet_Module.h"
2 #include <PartSet_OperationSketch.h>
3 #include <PartSet_WidgetSketchLabel.h>
4 #include <PartSet_Validators.h>
5 #include <PartSet_Tools.h>
6 #include <PartSet_WidgetPoint2D.h>
7 #include <PartSet_WidgetPoint2dDistance.h>
8 #include <PartSet_WidgetShapeSelector.h>
10 #include <ModuleBase_Operation.h>
11 #include <ModuleBase_IViewer.h>
12 #include <ModuleBase_IViewWindow.h>
13 #include <ModuleBase_IPropertyPanel.h>
15 #include <ModelAPI_Object.h>
16 #include <ModelAPI_Events.h>
17 #include <ModelAPI_Validator.h>
18 #include <ModelAPI_Data.h>
19 #include <ModelAPI_Session.h>
21 #include <GeomDataAPI_Point2D.h>
22 #include <GeomDataAPI_Point.h>
23 #include <GeomDataAPI_Dir.h>
25 #include <XGUI_MainWindow.h>
26 #include <XGUI_Displayer.h>
27 #include <XGUI_Viewer.h>
28 #include <XGUI_Workshop.h>
29 #include <XGUI_OperationMgr.h>
30 #include <XGUI_ViewPort.h>
31 #include <XGUI_ActionsMgr.h>
32 #include <XGUI_ViewerProxy.h>
33 #include <XGUI_ContextMenuMgr.h>
34 #include <XGUI_PropertyPanel.h>
35 #include <XGUI_ModuleConnector.h>
36 #include <XGUI_Tools.h>
38 #include <SketchPlugin_Line.h>
39 #include <SketchPlugin_Sketch.h>
40 #include <SketchPlugin_Point.h>
41 #include <SketchPlugin_Arc.h>
42 #include <SketchPlugin_Circle.h>
43 #include <SketchPlugin_ConstraintLength.h>
44 #include <SketchPlugin_ConstraintDistance.h>
45 #include <SketchPlugin_ConstraintParallel.h>
46 #include <SketchPlugin_ConstraintPerpendicular.h>
47 #include <SketchPlugin_ConstraintRadius.h>
48 #include <SketchPlugin_ConstraintRigid.h>
50 #include <Events_Loop.h>
52 #include <StdSelect_TypeOfFace.hxx>
53 #include <TopoDS_Vertex.hxx>
55 #include <TopoDS_Shape.hxx>
56 #include <BRep_Tool.hxx>
59 #include <QMouseEvent>
62 #include <QApplication>
64 #include <GeomAlgoAPI_FaceBuilder.h>
65 #include <GeomDataAPI_Dir.h>
72 /// Returns list of unique objects by sum of objects from List1 and List2
73 QList<ObjectPtr> getSumList(const QList<ModuleBase_ViewerPrs>& theList1,
74 const QList<ModuleBase_ViewerPrs>& theList2)
76 QList<ObjectPtr> aRes;
77 foreach (ModuleBase_ViewerPrs aPrs, theList1) {
78 if (!aRes.contains(aPrs.object()))
79 aRes.append(aPrs.object());
81 foreach (ModuleBase_ViewerPrs aPrs, theList2) {
82 if (!aRes.contains(aPrs.object()))
83 aRes.append(aPrs.object());
88 /*!Create and return new instance of XGUI_Module*/
89 extern "C" PARTSET_EXPORT ModuleBase_IModule* createModule(ModuleBase_IWorkshop* theWshop)
91 return new PartSet_Module(theWshop);
94 PartSet_Module::PartSet_Module(ModuleBase_IWorkshop* theWshop)
95 : ModuleBase_IModule(theWshop),
96 myIsDragging(false), myRestartingMode(RM_LastFeatureUse), myDragDone(false)
98 //myWorkshop = dynamic_cast<XGUI_Workshop*>(theWshop);
99 ModuleBase_IViewer* aViewer = aViewer = theWshop->viewer();
100 connect(aViewer, SIGNAL(mousePress(ModuleBase_IViewWindow*, QMouseEvent*)),
101 this, SLOT(onMousePressed(ModuleBase_IViewWindow*, QMouseEvent*)));
103 connect(aViewer, SIGNAL(mouseRelease(ModuleBase_IViewWindow*, QMouseEvent*)),
104 this, SLOT(onMouseReleased(ModuleBase_IViewWindow*, QMouseEvent*)));
106 connect(aViewer, SIGNAL(mouseMove(ModuleBase_IViewWindow*, QMouseEvent*)),
107 this, SLOT(onMouseMoved(ModuleBase_IViewWindow*, QMouseEvent*)));
109 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(theWshop);
110 XGUI_Workshop* aWorkshop = aConnector->workshop();
112 XGUI_OperationMgr* anOpMgr = aWorkshop->operationMgr();
113 connect(anOpMgr, SIGNAL(keyEnterReleased()), this, SLOT(onEnterReleased()));
115 connect(aViewer, SIGNAL(keyRelease(ModuleBase_IViewWindow*, QKeyEvent*)),
116 this, SLOT(onKeyRelease(ModuleBase_IViewWindow*, QKeyEvent*)));
119 PartSet_Module::~PartSet_Module()
121 if (!myDocumentShapeFilter.IsNull())
122 myDocumentShapeFilter.Nullify();
123 if (!myPlaneFilter.IsNull())
124 myPlaneFilter.Nullify();
127 void PartSet_Module::registerValidators()
129 //Registering of validators
130 SessionPtr aMgr = ModelAPI_Session::get();
131 ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
132 aFactory->registerValidator("PartSet_DistanceValidator", new PartSet_DistanceValidator);
133 aFactory->registerValidator("PartSet_LengthValidator", new PartSet_LengthValidator);
134 aFactory->registerValidator("PartSet_PerpendicularValidator", new PartSet_PerpendicularValidator);
135 aFactory->registerValidator("PartSet_ParallelValidator", new PartSet_ParallelValidator);
136 aFactory->registerValidator("PartSet_RadiusValidator", new PartSet_RadiusValidator);
140 void PartSet_Module::onOperationComitted(ModuleBase_Operation* theOperation)
142 if (theOperation->isEditOperation())
144 /// Restart sketcher operations automatically
145 FeaturePtr aFeature = theOperation->feature();
146 std::shared_ptr<SketchPlugin_Feature> aSPFeature =
147 std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
148 if (aSPFeature && (myRestartingMode != RM_None)) {
149 myLastOperationId = theOperation->id();
150 myLastFeature = myRestartingMode == RM_LastFeatureUse ? theOperation->feature() : FeaturePtr();
151 launchOperation(myLastOperationId);
153 breakOperationSequence();
157 void PartSet_Module::breakOperationSequence()
159 myLastOperationId = "";
160 myLastFeature = FeaturePtr();
161 myRestartingMode = RM_None;
165 void PartSet_Module::onOperationAborted(ModuleBase_Operation* theOperation)
167 breakOperationSequence();
170 void PartSet_Module::onOperationStarted(ModuleBase_Operation* theOperation)
172 myRestartingMode = RM_LastFeatureUse;
173 if (theOperation->id().toStdString() == SketchPlugin_Sketch::ID()) {
174 // Display all sketcher sub-Objects
175 myCurrentSketch = std::dynamic_pointer_cast<ModelAPI_CompositeFeature>(theOperation->feature());
176 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
177 XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
179 for (int i = 0; i < myCurrentSketch->numberOfSubs(); i++) {
180 FeaturePtr aFeature = myCurrentSketch->subFeature(i);
181 std::list<ResultPtr> aResults = aFeature->results();
182 std::list<ResultPtr>::const_iterator aIt;
183 for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
184 aDisplayer->display((*aIt), false);
186 aDisplayer->display(aFeature);
188 // Hide sketcher result
189 std::list<ResultPtr> aResults = myCurrentSketch->results();
190 std::list<ResultPtr>::const_iterator aIt;
191 for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
192 aDisplayer->erase((*aIt), false);
194 aDisplayer->erase(myCurrentSketch);
197 if (myPlaneFilter.IsNull())
198 myPlaneFilter = new ModuleBase_ShapeInPlaneFilter();
199 myWorkshop->viewer()->addSelectionFilter(myPlaneFilter);
200 if (theOperation->isEditOperation()) {
201 // If it is editing of sketch then it means that plane is already defined
202 std::shared_ptr<GeomAPI_Pln> aPln = PartSet_Tools::sketchPlane(myCurrentSketch);
203 myPlaneFilter->setPlane(aPln->impl<gp_Pln>());
206 if (myDocumentShapeFilter.IsNull())
207 myDocumentShapeFilter = new ModuleBase_ShapeDocumentFilter(myWorkshop);
208 myWorkshop->viewer()->addSelectionFilter(myDocumentShapeFilter);
211 void PartSet_Module::onOperationStopped(ModuleBase_Operation* theOperation)
213 if (theOperation->id().toStdString() == SketchPlugin_Sketch::ID()) {
214 DataPtr aData = myCurrentSketch->data();
215 if ((!aData) || (!aData->isValid())) {
216 // The sketch was aborted
217 myCurrentSketch = CompositeFeaturePtr();
220 // Hide all sketcher sub-Objects
221 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
222 XGUI_Displayer* aDisplayer = aConnector->workshop()->displayer();
223 for (int i = 0; i < myCurrentSketch->numberOfSubs(); i++) {
224 FeaturePtr aFeature = myCurrentSketch->subFeature(i);
225 std::list<ResultPtr> aResults = aFeature->results();
226 std::list<ResultPtr>::const_iterator aIt;
227 for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
228 aDisplayer->erase((*aIt), false);
230 aDisplayer->erase(aFeature, false);
232 // Display sketcher result
233 std::list<ResultPtr> aResults = myCurrentSketch->results();
234 std::list<ResultPtr>::const_iterator aIt;
235 for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
236 aDisplayer->display((*aIt), false);
238 aDisplayer->display(myCurrentSketch);
240 myCurrentSketch = CompositeFeaturePtr();
241 myWorkshop->viewer()->removeSelectionFilter(myPlaneFilter);
243 myWorkshop->viewer()->removeSelectionFilter(myDocumentShapeFilter);
246 void PartSet_Module::onPlaneSelected(const std::shared_ptr<GeomAPI_Pln>& thePln)
248 myPlaneFilter->setPlane(thePln->impl<gp_Pln>());
252 void PartSet_Module::propertyPanelDefined(ModuleBase_Operation* theOperation)
254 ModuleBase_IPropertyPanel* aPanel = theOperation->propertyPanel();
255 // Restart last operation type
256 if ((theOperation->id() == myLastOperationId) && myLastFeature) {
257 ModuleBase_ModelWidget* aWgt = aPanel->activeWidget();
258 if (theOperation->id().toStdString() == SketchPlugin_Line::ID()) {
259 // Initialise new line with first point equal to end of previous
260 PartSet_WidgetPoint2D* aPnt2dWgt = dynamic_cast<PartSet_WidgetPoint2D*>(aWgt);
262 std::shared_ptr<ModelAPI_Data> aData = myLastFeature->data();
263 std::shared_ptr<GeomDataAPI_Point2D> aPoint =
264 std::dynamic_pointer_cast<GeomDataAPI_Point2D>(aData->attribute(SketchPlugin_Line::END_ID()));
266 aPnt2dWgt->setPoint(aPoint->x(), aPoint->y());
267 PartSet_Tools::setConstraints(myCurrentSketch, theOperation->feature(),
268 aWgt->attributeID(), aPoint->x(), aPoint->y());
269 theOperation->propertyPanel()->activateNextWidget(aPnt2dWgt);
274 // Start editing constraint
275 if (theOperation->isEditOperation()) {
276 std::string aId = theOperation->id().toStdString();
277 if (sketchOperationIdList().contains(QString(aId.c_str()))) {
278 if ((aId == SketchPlugin_ConstraintRadius::ID()) ||
279 (aId == SketchPlugin_ConstraintLength::ID()) ||
280 (aId == SketchPlugin_ConstraintDistance::ID())) {
281 // Find and activate widget for management of point for dimension line position
282 QList<ModuleBase_ModelWidget*> aWidgets = aPanel->modelWidgets();
283 foreach (ModuleBase_ModelWidget* aWgt, aWidgets) {
284 PartSet_WidgetPoint2D* aPntWgt = dynamic_cast<PartSet_WidgetPoint2D*>(aWgt);
286 aPanel->activateWidget(aPntWgt);
297 void PartSet_Module::onSelectionChanged()
299 // Editing of constraints can be done on selection
300 ModuleBase_ISelection* aSelect = myWorkshop->selection();
301 QList<ModuleBase_ViewerPrs> aSelected = aSelect->getSelected();
302 if (aSelected.size() == 1) {
303 ModuleBase_ViewerPrs aPrs = aSelected.first();
304 ObjectPtr aObject = aPrs.object();
305 FeaturePtr aFeature = ModelAPI_Feature::feature(aObject);
307 std::string aId = aFeature->getKind();
308 if ((aId == SketchPlugin_ConstraintRadius::ID()) ||
309 (aId == SketchPlugin_ConstraintLength::ID()) ||
310 (aId == SketchPlugin_ConstraintDistance::ID())) {
311 editFeature(aFeature);
317 void PartSet_Module::onMousePressed(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
319 if (!(theEvent->buttons() & Qt::LeftButton))
322 ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
323 // Use only for sketch operations
324 if (aOperation && myCurrentSketch) {
325 if (!PartSet_Tools::sketchPlane(myCurrentSketch))
328 bool isSketcher = (aOperation->id().toStdString() == SketchPlugin_Sketch::ID());
329 bool isSketchOpe = sketchOperationIdList().contains(aOperation->id());
331 // Avoid non-sketch operations
332 if ((!isSketchOpe) && (!isSketcher))
335 bool isEditing = aOperation->isEditOperation();
337 // Ignore creation sketch operation
338 if ((!isSketcher) && (!isEditing))
341 if (theEvent->modifiers()) {
342 // If user performs multiselection
343 if (isSketchOpe && (!isSketcher))
344 if (!aOperation->commit())
348 // Remember highlighted objects for editing
349 ModuleBase_ISelection* aSelect = myWorkshop->selection();
350 QList<ModuleBase_ViewerPrs> aHighlighted = aSelect->getHighlighted();
351 QList<ModuleBase_ViewerPrs> aSelected = aSelect->getSelected();
352 myEditingFeatures.clear();
353 myEditingAttr.clear();
354 if ((aHighlighted.size() == 0) && (aSelected.size() == 0)) {
355 if (isSketchOpe && (!isSketcher))
356 // commit previous operation
357 if (!aOperation->commit())
362 QObjectPtrList aSelObjects = getSumList(aHighlighted, aSelected);
363 if ((aHighlighted.size() == 1) && (aSelected.size() == 0)) {
364 // Move by selected shape (vertex). Can be used only for single selection
365 foreach(ModuleBase_ViewerPrs aPrs, aHighlighted) {
366 FeaturePtr aFeature = ModelAPI_Feature::feature(aHighlighted.first().object());
368 myEditingFeatures.append(aFeature);
369 TopoDS_Shape aShape = aPrs.shape();
370 if (!aShape.IsNull()) {
371 if (aShape.ShapeType() == TopAbs_VERTEX) {
372 AttributePtr aAttr = PartSet_Tools::findAttributeBy2dPoint(myEditingFeatures.first(),
373 aShape, myCurrentSketch);
375 myEditingAttr.append(aAttr);
381 // Provide multi-selection. Can be used only for features
382 foreach (ObjectPtr aObj, aSelObjects) {
383 FeaturePtr aFeature = ModelAPI_Feature::feature(aObj);
384 if (aFeature && (!myEditingFeatures.contains(aFeature)))
385 myEditingFeatures.append(aFeature);
389 // If nothing highlighted - return
390 if (myEditingFeatures.size() == 0)
395 get2dPoint(theWnd, theEvent, myCurX, myCurY);
397 myWorkshop->viewer()->enableSelection(false);
400 } else if (isSketchOpe && isEditing) {
401 // If selected another object
405 get2dPoint(theWnd, theEvent, myCurX, myCurY);
407 myWorkshop->viewer()->enableSelection(false);
409 // This is necessary in order to finalize previous operation
410 QApplication::processEvents();
417 void PartSet_Module::get2dPoint(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent,
418 double& theX, double& theY)
420 Handle(V3d_View) aView = theWnd->v3dView();
421 gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), aView);
422 PartSet_Tools::convertTo2D(aPoint, myCurrentSketch, aView, theX, theY);
426 void PartSet_Module::launchEditing()
428 if (myEditingFeatures.size() > 0) {
429 FeaturePtr aFeature = myEditingFeatures.first();
430 std::shared_ptr<SketchPlugin_Feature> aSPFeature =
431 std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
433 editFeature(aSPFeature);
438 /// Returns new instance of operation object (used in createOperation for customization)
439 ModuleBase_Operation* PartSet_Module::getNewOperation(const std::string& theFeatureId)
441 if (theFeatureId == PartSet_OperationSketch::Type()) {
442 return new PartSet_OperationSketch(theFeatureId.c_str(), this);
444 return ModuleBase_IModule::getNewOperation(theFeatureId);
448 void PartSet_Module::onMouseReleased(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
450 myWorkshop->viewer()->enableSelection(true);
452 myIsDragging = false;
454 myWorkshop->currentOperation()->commit();
455 myEditingFeatures.clear();
456 myEditingAttr.clear();
462 void PartSet_Module::onMouseMoved(ModuleBase_IViewWindow* theWnd, QMouseEvent* theEvent)
465 ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
466 if (aOperation->id().toStdString() == SketchPlugin_Sketch::ID())
467 return; // No edit operation activated
469 static Events_ID anEvent = Events_Loop::eventByName(EVENT_OBJECT_MOVED);
470 Handle(V3d_View) aView = theWnd->v3dView();
471 gp_Pnt aPoint = PartSet_Tools::convertClickToPoint(theEvent->pos(), aView);
473 PartSet_Tools::convertTo2D(aPoint, myCurrentSketch, aView, aX, aY);
474 double dX = aX - myCurX;
475 double dY = aY - myCurY;
477 if ((aOperation->id().toStdString() == SketchPlugin_Line::ID()) &&
478 (myEditingAttr.size() == 1) &&
479 myEditingAttr.first()) {
480 // probably we have prehighlighted point
481 AttributePtr aAttr = myEditingAttr.first();
482 std::string aAttrId = aAttr->id();
483 ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
484 QList<ModuleBase_ModelWidget*> aWidgets = aPanel->modelWidgets();
485 // Find corresponded widget to provide dragging
486 foreach (ModuleBase_ModelWidget* aWgt, aWidgets) {
487 if (aWgt->attributeID() == aAttrId) {
488 PartSet_WidgetPoint2D* aWgt2d = dynamic_cast<PartSet_WidgetPoint2D*>(aWgt);
490 aWgt2d->setPoint(aWgt2d->x() + dX, aWgt2d->y() + dY);
496 foreach(FeaturePtr aFeature, myEditingFeatures) {
497 std::shared_ptr<SketchPlugin_Feature> aSketchFeature =
498 std::dynamic_pointer_cast<SketchPlugin_Feature>(aFeature);
499 if (aSketchFeature) {
500 aSketchFeature->move(dX, dY);
501 ModelAPI_EventCreator::get()->sendUpdated(aSketchFeature, anEvent);
504 Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_MOVED));
505 Events_Loop::loop()->flush(Events_Loop::eventByName(EVENT_OBJECT_UPDATED));
513 void PartSet_Module::onKeyRelease(ModuleBase_IViewWindow* theWnd, QKeyEvent* theEvent)
515 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
516 XGUI_OperationMgr* anOpMgr = aConnector->workshop()->operationMgr();
517 anOpMgr->onKeyReleased(theEvent);
520 void PartSet_Module::onEnterReleased()
522 myRestartingMode = RM_LastFeatureEmpty;
525 QStringList PartSet_Module::sketchOperationIdList() const
528 aIds << SketchPlugin_Line::ID().c_str();
529 aIds << SketchPlugin_Point::ID().c_str();
530 aIds << SketchPlugin_Arc::ID().c_str();
531 aIds << SketchPlugin_Circle::ID().c_str();
532 aIds << SketchPlugin_ConstraintLength::ID().c_str();
533 aIds << SketchPlugin_ConstraintDistance::ID().c_str();
534 aIds << SketchPlugin_ConstraintRigid::ID().c_str();
535 aIds << SketchPlugin_ConstraintRadius::ID().c_str();
536 aIds << SketchPlugin_ConstraintPerpendicular::ID().c_str();
537 aIds << SketchPlugin_ConstraintParallel::ID().c_str();
541 void PartSet_Module::onVertexSelected(ObjectPtr theObject, const TopoDS_Shape& theShape)
543 ModuleBase_Operation* aOperation = myWorkshop->currentOperation();
544 if (aOperation->id().toStdString() == SketchPlugin_Line::ID()) {
545 /// If last line finished on vertex the lines creation sequence has to be break
546 ModuleBase_IPropertyPanel* aPanel = aOperation->propertyPanel();
547 const QList<ModuleBase_ModelWidget*>& aWidgets = aPanel->modelWidgets();
548 if (aWidgets.last() == aPanel->activeWidget()) {
549 breakOperationSequence();
554 QWidget* PartSet_Module::createWidgetByType(const std::string& theType, QWidget* theParent,
555 Config_WidgetAPI* theWidgetApi, std::string theParentId,
556 QList<ModuleBase_ModelWidget*>& theModelWidgets)
558 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
559 XGUI_Workshop* aWorkshop = aConnector->workshop();
560 if (theType == "sketch-start-label") {
561 PartSet_WidgetSketchLabel* aWgt = new PartSet_WidgetSketchLabel(theParent, theWidgetApi, theParentId);
562 aWgt->setWorkshop(aWorkshop);
563 connect(aWgt, SIGNAL(planeSelected(const std::shared_ptr<GeomAPI_Pln>&)),
564 this, SLOT(onPlaneSelected(const std::shared_ptr<GeomAPI_Pln>&)));
565 theModelWidgets.append(aWgt);
566 return aWgt->getControl();
568 } else if (theType == "sketch-2dpoint_selector") {
569 PartSet_WidgetPoint2D* aWgt = new PartSet_WidgetPoint2D(theParent, theWidgetApi, theParentId);
570 aWgt->setWorkshop(aWorkshop);
571 aWgt->setSketch(myCurrentSketch);
573 connect(aWgt, SIGNAL(vertexSelected(ObjectPtr, const TopoDS_Shape&)),
574 this, SLOT(onVertexSelected(ObjectPtr, const TopoDS_Shape&)));
576 theModelWidgets.append(aWgt);
577 return aWgt->getControl();
579 } if (theType == "point2ddistance") {
580 PartSet_WidgetPoint2dDistance* aWgt = new PartSet_WidgetPoint2dDistance(theParent, theWidgetApi, theParentId);
581 aWgt->setWorkshop(aWorkshop);
582 aWgt->setSketch(myCurrentSketch);
584 theModelWidgets.append(aWgt);
585 return aWgt->getControl();
587 } if (theType == "sketch_shape_selector") {
588 PartSet_WidgetShapeSelector* aWgt =
589 new PartSet_WidgetShapeSelector(theParent, workshop(), theWidgetApi, theParentId);
590 aWgt->setSketcher(myCurrentSketch);
592 theModelWidgets.append(aWgt);
593 return aWgt->getControl();
595 } if (theType == "sketch_constraint_shape_selector") {
596 PartSet_WidgetConstraintShapeSelector* aWgt =
597 new PartSet_WidgetConstraintShapeSelector(theParent, workshop(), theWidgetApi, theParentId);
598 aWgt->setSketcher(myCurrentSketch);
600 theModelWidgets.append(aWgt);
601 return aWgt->getControl();