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>
49 #include <AIS_DimensionSelectionMode.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_Workshop* aXWshop = xWorkshop();
83 XGUI_ContextMenuMgr* aContextMenuMgr = aXWshop->contextMenuMgr();
84 connect(aContextMenuMgr, SIGNAL(actionTriggered(const QString&, bool)), this,
85 SLOT(onContextMenuCommand(const QString&, bool)));
87 connect(myWorkshop->viewer(), SIGNAL(mousePress(QMouseEvent*)), this,
88 SLOT(onMousePressed(QMouseEvent*)));
89 connect(myWorkshop->viewer(), SIGNAL(mouseRelease(QMouseEvent*)), this,
90 SLOT(onMouseReleased(QMouseEvent*)));
91 connect(myWorkshop->viewer(), SIGNAL(mouseMove(QMouseEvent*)), this,
92 SLOT(onMouseMoved(QMouseEvent*)));
93 connect(myWorkshop->viewer(), SIGNAL(keyRelease(QKeyEvent*)), this,
94 SLOT(onKeyRelease(QKeyEvent*)));
95 connect(myWorkshop->viewer(), SIGNAL(mouseDoubleClick(QMouseEvent*)), this,
96 SLOT(onMouseDoubleClick(QMouseEvent*)));
99 PartSet_Module::~PartSet_Module()
103 void PartSet_Module::createFeatures()
105 //Registering of validators
106 SessionPtr aMgr = ModelAPI_Session::get();
107 ModelAPI_ValidatorsFactory* aFactory = aMgr->validators();
108 aFactory->registerValidator("PartSet_DistanceValidator", new PartSet_DistanceValidator);
109 aFactory->registerValidator("PartSet_LengthValidator", new PartSet_LengthValidator);
110 aFactory->registerValidator("PartSet_PerpendicularValidator", new PartSet_PerpendicularValidator);
111 aFactory->registerValidator("PartSet_ParallelValidator", new PartSet_ParallelValidator);
112 aFactory->registerValidator("PartSet_RadiusValidator", new PartSet_RadiusValidator);
114 Config_ModuleReader aXMLReader = Config_ModuleReader();
115 aXMLReader.readAll();
116 myFeaturesInFiles = aXMLReader.featuresInFiles();
119 void PartSet_Module::featureCreated(QAction* theFeature)
121 connect(theFeature, SIGNAL(triggered(bool)), this, SLOT(onFeatureTriggered()));
124 std::string PartSet_Module::featureFile(const std::string& theFeatureId)
126 return myFeaturesInFiles[theFeatureId];
132 void PartSet_Module::onFeatureTriggered()
134 QAction* aCmd = dynamic_cast<QAction*>(sender());
135 //Do nothing on uncheck
136 if (aCmd->isCheckable() && !aCmd->isChecked())
138 launchOperation(aCmd->data().toString());
142 void PartSet_Module::onOperationStarted(ModuleBase_Operation* theOperation)
144 XGUI_Workshop* aXWshp = xWorkshop();
145 XGUI_Displayer* aDisplayer = aXWshp->displayer();
146 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(theOperation);
148 XGUI_PropertyPanel* aPropPanel = aXWshp->propertyPanel();
149 connect(aPropPanel, SIGNAL(storedPoint2D(ObjectPtr, const std::string&)), this,
150 SLOT(onStorePoint2D(ObjectPtr, const std::string&)), Qt::UniqueConnection);
152 //aDisplayer->deactivateObjectsOutOfContext();
153 PartSet_OperationSketch* aSketchOp = dynamic_cast<PartSet_OperationSketch*>(aPreviewOp);
155 if (aSketchOp->isEditOperation()) {
158 aDisplayer->openLocalContext();
159 aDisplayer->activateObjectsOutOfContext(QIntList());
160 myPlaneFilter = new StdSelect_FaceFilter(StdSelect_Plane);
161 aDisplayer->addSelectionFilter(myPlaneFilter);
162 QIntList aModes = sketchSelectionModes(aPreviewOp->feature());
163 aDisplayer->setSelectionModes(aModes);
169 void PartSet_Module::onOperationStopped(ModuleBase_Operation* theOperation)
173 XGUI_Workshop* aXWshp = xWorkshop();
174 XGUI_Displayer* aDisplayer = aXWshp->displayer();
175 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(theOperation);
177 XGUI_PropertyPanel* aPropPanel = aXWshp->propertyPanel();
179 PartSet_OperationSketch* aSketchOp = dynamic_cast<PartSet_OperationSketch*>(aPreviewOp);
181 aDisplayer->closeLocalContexts();
183 PartSet_OperationFeatureCreate* aCreationOp =
184 dynamic_cast<PartSet_OperationFeatureCreate*>(aPreviewOp);
186 // Activate just created object for selection
187 FeaturePtr aFeature = aCreationOp->feature();
188 QIntList aModes = sketchSelectionModes(aFeature);
189 const std::list<ResultPtr>& aResults = aFeature->results();
190 std::list<ResultPtr>::const_iterator anIt, aLast = aResults.end();
191 for (anIt = aResults.begin(); anIt != aLast; anIt++) {
192 aDisplayer->activate(*anIt, aModes);
194 aDisplayer->activate(aFeature, aModes);
198 // Activate results of current feature for selection
199 //FeaturePtr aFeature = theOperation->feature();
200 //XGUI_Displayer* aDisplayer = aXWshp->displayer();
201 //std::list<ResultPtr> aResults = aFeature->results();
202 //std::list<ResultPtr>::const_iterator aIt;
203 //for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
204 // aDisplayer->activate(*aIt);
210 // Clear selection done during operation
211 aDisplayer->clearSelected();
214 void PartSet_Module::onContextMenuCommand(const QString& theId, bool isChecked)
216 QList<ObjectPtr> aFeatures = workshop()->selection()->selectedObjects();
217 if (theId == "EDIT_CMD" && (aFeatures.size() > 0)) {
218 FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(aFeatures.first());
220 editFeature(aFeature);
224 void PartSet_Module::onMousePressed(QMouseEvent* theEvent)
226 XGUI_Workshop* aXWshp = xWorkshop();
227 PartSet_OperationSketchBase* aPreviewOp =
228 dynamic_cast<PartSet_OperationSketchBase*>(workshop()->currentOperation());
229 Handle(V3d_View) aView = myWorkshop->viewer()->activeView();
230 if (aPreviewOp && (!aView.IsNull())) {
231 ModuleBase_ISelection* aSelection = workshop()->selection();
232 // Initialise operation with preliminary selection
233 std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
234 std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
236 aPreviewOp->mousePressed(theEvent, aView, aSelected, aHighlighted);
240 void PartSet_Module::onMouseReleased(QMouseEvent* theEvent)
242 PartSet_OperationSketchBase* aPreviewOp =
243 dynamic_cast<PartSet_OperationSketchBase*>(myWorkshop->currentOperation());
244 Handle(V3d_View) aView = myWorkshop->viewer()->activeView();
245 if (aPreviewOp && (!aView.IsNull())) {
246 ModuleBase_ISelection* aSelection = workshop()->selection();
247 // Initialise operation with preliminary selection
248 std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
249 std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
251 aPreviewOp->mouseReleased(theEvent, aView, aSelected, aHighlighted);
255 void PartSet_Module::onMouseMoved(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 aPreviewOp->mouseMoved(theEvent, aView);
264 void PartSet_Module::onKeyRelease(QKeyEvent* theEvent)
266 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
267 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
269 aPreviewOp->keyReleased(theEvent->key());
273 void PartSet_Module::onMouseDoubleClick(QMouseEvent* theEvent)
275 PartSet_OperationSketchBase* aPreviewOp =
276 dynamic_cast<PartSet_OperationSketchBase*>(myWorkshop->currentOperation());
277 Handle(V3d_View) aView = myWorkshop->viewer()->activeView();
278 if (aPreviewOp && (!aView.IsNull())) {
279 ModuleBase_ISelection* aSelection = workshop()->selection();
280 // Initialise operation with preliminary selection
281 std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
282 std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
283 aPreviewOp->mouseDoubleClick(theEvent, aView, aSelected, aHighlighted);
287 void PartSet_Module::onPlaneSelected(double theX, double theY, double theZ)
289 myWorkshop->viewer()->setViewProjection(theX, theY, theZ);
290 xWorkshop()->actionsMgr()->update();
294 void PartSet_Module::onFitAllView()
296 myWorkshop->viewer()->fitAll();
299 void PartSet_Module::onRestartOperation(std::string theName, ObjectPtr theObject)
301 FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
303 std::string aKind = aFeature ? aFeature->getKind() : "";
304 ModuleBase_Operation* anOperation = createOperation(theName, aKind);
306 PartSet_OperationSketchBase* aSketchOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
308 PartSet_OperationFeatureCreate* aCreateOp = dynamic_cast<PartSet_OperationFeatureCreate*>(anOperation);
310 aCreateOp->initFeature(aFeature);
312 anOperation->setFeature(aFeature);
314 ModuleBase_ISelection* aSelection = workshop()->selection();
315 // Initialise operation with preliminary selection
316 std::list<ModuleBase_ViewerPrs> aSelected = aSelection->getSelected();
317 std::list<ModuleBase_ViewerPrs> aHighlighted = aSelection->getHighlighted();
318 aSketchOp->initSelection(aSelected, aHighlighted);
319 } //else if (aFeature) {
320 //anOperation->setFeature(aFeature);
321 ////Deactivate result of current feature in order to avoid its selection
322 //XGUI_Displayer* aDisplayer = xWorkshop()->displayer();
323 //std::list<ResultPtr> aResults = aFeature->results();
324 //std::list<ResultPtr>::const_iterator aIt;
325 //for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt) {
326 // aDisplayer->deactivate(*aIt);
329 sendOperation(anOperation);
330 xWorkshop()->actionsMgr()->updateCheckState();
333 void PartSet_Module::onMultiSelectionEnabled(bool theEnabled)
335 ModuleBase_IViewer* aViewer = myWorkshop->viewer();
336 aViewer->enableMultiselection(theEnabled);
339 void PartSet_Module::onStopSelection(const QList<ObjectPtr>& theFeatures, const bool isStop)
341 XGUI_Displayer* aDisplayer = xWorkshop()->displayer();
343 // foreach(ObjectPtr aObject, theFeatures) {
344 // activateFeature(aObject);
347 aDisplayer->stopSelection(theFeatures, isStop, false);
349 ModuleBase_IViewer* aViewer = myWorkshop->viewer();
350 aViewer->enableSelection(!isStop);
352 aDisplayer->updateViewer();
355 void PartSet_Module::onSetSelection(const QList<ObjectPtr>& theFeatures)
357 XGUI_Displayer* aDisplayer = xWorkshop()->displayer();
358 aDisplayer->setSelected(theFeatures, false);
359 aDisplayer->updateViewer();
362 void PartSet_Module::setSketchingMode()
364 XGUI_Displayer* aDisplayer = xWorkshop()->displayer();
365 if (!myPlaneFilter.IsNull()) {
366 aDisplayer->removeSelectionFilter(myPlaneFilter);
367 myPlaneFilter.Nullify();
370 //aModes << TopAbs_VERTEX << TopAbs_EDGE;
371 //aModes << AIS_DSM_Text << AIS_DSM_Line;
372 aDisplayer->setSelectionModes(aModes);
373 aDisplayer->openLocalContext();
374 // Get default selection modes
375 aModes = sketchSelectionModes(ObjectPtr());
376 aDisplayer->activateObjectsOutOfContext(aModes);
379 void PartSet_Module::onFeatureConstructed(ObjectPtr theFeature, int theMode)
381 bool isDisplay = theMode != PartSet_OperationSketchBase::FM_Hide;
382 ModuleBase_Operation* aCurOperation = myWorkshop->currentOperation();
383 PartSet_OperationSketchBase* aPrevOp = dynamic_cast<PartSet_OperationSketchBase*>(aCurOperation);
385 std::list<FeaturePtr> aList = aPrevOp->subFeatures();
386 XGUI_Displayer* aDisplayer = xWorkshop()->displayer();
387 QIntList aModes = sketchSelectionModes(aPrevOp->feature());
388 std::list<FeaturePtr>::iterator aSFIt;
389 for (aSFIt = aList.begin(); aSFIt != aList.end(); ++aSFIt) {
390 std::list<ResultPtr> aResults = (*aSFIt)->results();
391 std::list<ResultPtr>::iterator aIt;
392 for (aIt = aResults.begin(); aIt != aResults.end(); ++aIt) {
394 aDisplayer->erase((*aIt), false);
397 aDisplayer->erase((*aSFIt), false);
399 //aDisplayer->deactivateObjectsOutOfContext();
402 ModelAPI_EventCreator::get()->sendUpdated(
403 theFeature, Events_Loop::loop()->eventByName(EVENT_OBJECT_TO_REDISPLAY));
406 ModuleBase_Operation* PartSet_Module::createOperation(const std::string& theCmdId,
407 const std::string& theFeatureKind)
409 // create the operation
410 ModuleBase_Operation* anOperation = 0;
411 if (theCmdId == PartSet_OperationSketch::Type()) {
412 anOperation = new PartSet_OperationSketch(theCmdId.c_str(), this);
414 ModuleBase_Operation* aCurOperation = myWorkshop->currentOperation();
416 PartSet_OperationSketchBase* aPrevOp = dynamic_cast<PartSet_OperationSketchBase*>(aCurOperation);
418 aSketch = aPrevOp->sketch();
420 if (PartSet_OperationFeatureCreate::canProcessKind(theCmdId)) {
421 anOperation = new PartSet_OperationFeatureCreate(theCmdId.c_str(), this, aSketch);
422 } else if (theCmdId == PartSet_OperationFeatureEditMulti::Type()) {
423 anOperation = new PartSet_OperationFeatureEditMulti(theCmdId.c_str(), this, aSketch);
424 } else if (theCmdId == PartSet_OperationFeatureEdit::Type()) {
425 anOperation = new PartSet_OperationFeatureEdit(theCmdId.c_str(), this, aSketch);
430 anOperation = new ModuleBase_Operation(theCmdId.c_str(), this);
433 // set operation description and list of widgets corresponding to the feature xml definition
434 std::string aFeatureKind = theFeatureKind.empty() ? theCmdId : theFeatureKind;
436 std::string aPluginFileName = featureFile(aFeatureKind);
437 Config_WidgetReader aWdgReader = Config_WidgetReader(aPluginFileName);
438 aWdgReader.readAll();
439 std::string aXmlCfg = aWdgReader.featureWidgetCfg(aFeatureKind);
440 std::string aDescription = aWdgReader.featureDescription(aFeatureKind);
442 anOperation->getDescription()->setDescription(QString::fromStdString(aDescription));
443 anOperation->getDescription()->setXmlRepresentation(QString::fromStdString(aXmlCfg));
445 // connect the operation
446 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
448 connect(aPreviewOp, SIGNAL(featureConstructed(ObjectPtr, int)), this,
449 SLOT(onFeatureConstructed(ObjectPtr, int)));
450 connect(aPreviewOp, SIGNAL(restartRequired(std::string, ObjectPtr)), this,
451 SLOT(onRestartOperation(std::string, ObjectPtr)));
452 connect(aPreviewOp, SIGNAL(multiSelectionEnabled(bool)), this,
453 SLOT(onMultiSelectionEnabled(bool)));
455 connect(aPreviewOp, SIGNAL(stopSelection(const QList<ObjectPtr>&, const bool)), this,
456 SLOT(onStopSelection(const QList<ObjectPtr>&, const bool)));
457 connect(aPreviewOp, SIGNAL(setSelection(const QList<ObjectPtr>&)), this,
458 SLOT(onSetSelection(const QList<ObjectPtr>&)));
460 PartSet_OperationSketch* aSketchOp = dynamic_cast<PartSet_OperationSketch*>(aPreviewOp);
462 connect(aSketchOp, SIGNAL(planeSelected(double, double, double)), this,
463 SLOT(onPlaneSelected(double, double, double)));
464 connect(aSketchOp, SIGNAL(fitAllView()), this, SLOT(onFitAllView()));
472 void PartSet_Module::updateCurrentPreview(const std::string& theCmdId)
474 ModuleBase_Operation* anOperation = myWorkshop->currentOperation();
478 PartSet_OperationSketchBase* aPreviewOp = dynamic_cast<PartSet_OperationSketchBase*>(anOperation);
482 FeaturePtr aFeature = aPreviewOp->feature();
483 if (!aFeature || aFeature->getKind() != theCmdId)
486 XGUI_Displayer* aDisplayer = xWorkshop()->displayer();
487 // Hide result of sketch
488 std::list<ResultPtr> aResults = aFeature->results();
489 std::list<ResultPtr>::const_iterator aIt;
490 for (aIt = aResults.cbegin(); aIt != aResults.cend(); ++aIt)
491 aDisplayer->erase(*aIt, false);
493 std::list<FeaturePtr> aList = aPreviewOp->subFeatures();
495 std::list<FeaturePtr>::const_iterator anIt = aList.begin(), aLast = aList.end();
496 for (; anIt != aLast; anIt++) {
497 boost::shared_ptr<SketchPlugin_Feature> aSPFeature = boost::dynamic_pointer_cast<
498 SketchPlugin_Feature>(*anIt);
501 std::list<ResultPtr> aResults = aSPFeature->results();
502 std::list<ResultPtr>::const_iterator aRIt;
503 for (aRIt = aResults.cbegin(); aRIt != aResults.cend(); ++aRIt) {
504 aDisplayer->display((*aRIt), false);
505 aDisplayer->activate((*aRIt), sketchSelectionModes((*aRIt)));
507 aDisplayer->display(aSPFeature, false);
508 aDisplayer->activate(aSPFeature, sketchSelectionModes(aSPFeature));
510 aDisplayer->updateViewer();
513 void PartSet_Module::editFeature(FeaturePtr theFeature)
518 // if (theFeature->getKind() == SKETCH_KIND) {
519 //FeaturePtr aFeature = theFeature;
520 //if (XGUI_Tools::isModelObject(aFeature)) {
521 // ObjectPtr aObject = boost::dynamic_pointer_cast<ModelAPI_Object>(aFeature);
522 // aFeature = aObject->featureRef();
526 onRestartOperation(theFeature->getKind(), theFeature);
527 updateCurrentPreview(theFeature->getKind());
532 void PartSet_Module::onStorePoint2D(ObjectPtr theFeature, const std::string& theAttribute)
534 FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(theFeature);
536 PartSet_OperationSketchBase* aPreviewOp =
537 dynamic_cast<PartSet_OperationSketchBase*>(myWorkshop->currentOperation());
541 boost::shared_ptr<GeomDataAPI_Point2D> aPoint = boost::dynamic_pointer_cast<GeomDataAPI_Point2D>(
542 aFeature->data()->attribute(theAttribute));
544 PartSet_Tools::setConstraints(aPreviewOp->sketch(), aFeature, theAttribute, aPoint->x(),
548 QWidget* PartSet_Module::createWidgetByType(const std::string& theType, QWidget* theParent,
549 Config_WidgetAPI* theWidgetApi,
550 QList<ModuleBase_ModelWidget*>& theModelWidgets)
552 if (theType == "sketch-start-label") {
553 PartSet_WidgetSketchLabel* aWgt = new PartSet_WidgetSketchLabel(theParent, theWidgetApi, "");
554 aWgt->setOperationsMgr(xWorkshop()->operationMgr());
555 theModelWidgets.append(aWgt);
556 return aWgt->getControl();
562 XGUI_Workshop* PartSet_Module::xWorkshop() const
564 XGUI_ModuleConnector* aConnector = dynamic_cast<XGUI_ModuleConnector*>(workshop());
566 return aConnector->workshop();
572 QIntList PartSet_Module::sketchSelectionModes(ObjectPtr theFeature)
575 FeaturePtr aFeature = boost::dynamic_pointer_cast<ModelAPI_Feature>(theFeature);
577 if (aFeature->getKind() == SketchPlugin_Sketch::ID()) {
578 aModes.append(TopAbs_FACE);
580 } else if (PartSet_Tools::isConstraintFeature(aFeature->getKind())) {
581 aModes.append(AIS_DSM_Text);
582 aModes.append(AIS_DSM_Line);
586 aModes.append(AIS_Shape::SelectionMode((TopAbs_ShapeEnum) TopAbs_VERTEX));
587 aModes.append(AIS_Shape::SelectionMode((TopAbs_ShapeEnum) TopAbs_EDGE));