]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_SelectionActivate.cpp
Salome HOME
Issue #2352 - Undo list is disabled when change focus from multi-selection to ordinar...
[modules/shaper.git] / src / XGUI / XGUI_SelectionActivate.cpp
1 // Copyright (C) 2014-2017  CEA/DEN, EDF R&D
2 //
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
7 //
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
11 // Lesser General Public License for more details.
12 //
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 //
17 // See http://www.salome-platform.org/ or
18 // email : webmaster.salome@opencascade.com<mailto:webmaster.salome@opencascade.com>
19 //
20
21 #include "XGUI_SelectionActivate.h"
22
23 #include "ModelAPI_Object.h"
24
25 #include "ModuleBase_IModule.h"
26 #include "ModuleBase_IViewer.h"
27 #include "ModuleBase_ModelWidget.h"
28 #include "ModuleBase_Preferences.h"
29
30 #include "XGUI_ActiveControlMgr.h"
31 #include "XGUI_ActiveControlSelector.h"
32 #include "XGUI_Displayer.h"
33 #include "XGUI_FacesPanel.h"
34 #include "XGUI_FacesPanelSelector.h"
35 #include "XGUI_SelectionMgr.h"
36 #include "XGUI_Tools.h"
37 #include "XGUI_Workshop.h"
38
39 #include <SUIT_ResourceMgr.h>
40
41 #include <AIS_InteractiveContext.hxx>
42 #include <AIS_Shape.hxx>
43 #include <AIS_Trihedron.hxx>
44
45 #include <SelectMgr_SelectionManager.hxx>
46
47 //#define DEBUG_ACTIVATE_OBJECTS
48 //#define DEBUG_DEACTIVATE
49 //#define DEBUG_ACTIVATE_AIS
50 //#define DEBUG_DEACTIVATE_AIS
51
52 #define CLEAR_OUTDATED_SELECTION_BEFORE_REDISPLAY
53
54 //**************************************************************
55 XGUI_SelectionActivate::XGUI_SelectionActivate(ModuleBase_IWorkshop* theWorkshop)
56  : ModuleBase_ISelectionActivate(theWorkshop), myIsTrihedronActive(true)
57 {
58 }
59
60 //**************************************************************
61 XGUI_SelectionActivate::SelectionPlace XGUI_SelectionActivate::activeSelectionPlace() const
62 {
63   XGUI_Workshop* aWorkshop = XGUI_Tools::workshop(myWorkshop);
64   XGUI_ActiveControlSelector* anActiveSelector = aWorkshop->activeControlMgr()->activeSelector();
65   if (!anActiveSelector)
66     return Workshop;
67
68   if (anActiveSelector->getType() == XGUI_FacesPanelSelector::Type())
69     return FacesPanel;
70   else
71     return PropertyPanel;
72 }
73
74 //**************************************************************
75 void XGUI_SelectionActivate::updateSelectionModes()
76 {
77   QIntList aModes;
78   switch (activeSelectionPlace()) {
79   case Workshop:
80     myWorkshop->module()->activeSelectionModes(aModes);
81     break;
82     case PropertyPanel: {
83       ModuleBase_ModelWidget* anActiveWidget = myWorkshop->module()->activeWidget();
84       if (anActiveWidget)
85         getSelectionModes(anActiveWidget, aModes);
86       else
87         myWorkshop->module()->activeSelectionModes(aModes); //using module modes
88     }
89     break;
90     case FacesPanel: {
91       XGUI_Tools::workshop(myWorkshop)->facesPanel()->selectionModes(aModes);
92       myWorkshop->module()->moduleSelectionModes(-1/*all modes*/, aModes);
93     }
94     break;
95     default: break;
96   }
97   activateObjects(aModes, getDisplayer()->displayedObjects(), true);
98 }
99
100 //**************************************************************
101 void XGUI_SelectionActivate::updateSelectionFilters()
102 {
103   SelectMgr_ListOfFilter aSelectionFilters;
104   switch (activeSelectionPlace()) {
105     case Workshop: {
106       QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
107       myWorkshop->module()->moduleSelectionFilters(aModuleSelectionFilters, aSelectionFilters);
108     }
109     break;
110     case PropertyPanel: {
111       QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
112
113       ModuleBase_ModelWidget* anActiveWidget = myWorkshop->module()->activeWidget();
114       if (anActiveWidget)
115         anActiveWidget->selectionFilters(aModuleSelectionFilters, aSelectionFilters);
116       myWorkshop->module()->moduleSelectionFilters(aModuleSelectionFilters, aSelectionFilters);
117     }
118     break;
119     case FacesPanel: {
120       XGUI_Tools::workshop(myWorkshop)->facesPanel()->selectionFilters(aSelectionFilters);
121       //QIntList aModuleSelectionFilters = myWorkshop->module()->selectionFilters();
122       //myWorkshop->module()->moduleSelectionFilters(aModuleSelectionFilters, aSelectionFilters);
123     }
124     break;
125     default: break;
126   }
127   activateSelectionFilters(aSelectionFilters);
128 }
129
130 //**************************************************************
131 void XGUI_SelectionActivate::activateSelectionFilters
132   (const SelectMgr_ListOfFilter& theSelectionFilters)
133 {
134   XGUI_Displayer* aDisplayer = getDisplayer();
135   aDisplayer->deactivateSelectionFilters(false);
136
137   SelectMgr_ListIteratorOfListOfFilter aIt(theSelectionFilters);
138   for (; aIt.More(); aIt.Next()) {
139     Handle(SelectMgr_Filter) aFilter = aIt.Value();
140     if (aFilter.IsNull())
141       continue;
142     aDisplayer->addSelectionFilter(aFilter);
143   }
144 }
145
146 //**************************************************************
147 void XGUI_SelectionActivate::getSelectionModes(ModuleBase_ModelWidget* theWidget,
148                                                QIntList& theModes)
149 {
150   if (!theWidget)
151     return;
152
153   int aModuleSelectionModes = -1;
154   theWidget->selectionModes(aModuleSelectionModes, theModes);
155   myWorkshop->module()->moduleSelectionModes(aModuleSelectionModes, theModes);
156 }
157
158 //**************************************************************
159 QIntList XGUI_SelectionActivate::activeSelectionModes() const
160 {
161   QIntList aModes;
162   foreach (int aMode, myActiveSelectionModes) {
163     // aMode < 9 is a Shape Enum values
164     aModes << ((aMode < 9)? AIS_Shape::SelectionType(aMode) : aMode);
165   }
166   return aModes;
167 }
168
169 //**************************************************************
170 bool XGUI_SelectionActivate::isActive(ObjectPtr theObject) const
171 {
172   Handle(AIS_InteractiveContext) aContext = AISContext();
173   if (aContext.IsNull() || !getDisplayer()->isVisible(theObject))
174     return false;
175
176   AISObjectPtr anObj = getDisplayedAISObject(theObject);
177   Handle(AIS_InteractiveObject) anAIS = anObj->impl<Handle(AIS_InteractiveObject)>();
178
179   TColStd_ListOfInteger aModes;
180   aContext->ActivatedModes(anAIS, aModes);
181
182   return aModes.Extent() > 0;
183 }
184
185 //**************************************************************
186 void XGUI_SelectionActivate::activateObjects(const QIntList& theModes,
187   const QObjectPtrList& theObjList, const bool theUpdateViewer)
188 {
189   setSelectionModes(theModes);
190
191   Handle(AIS_InteractiveContext) aContext = AISContext();
192   // Open local context if there is no one
193   if (aContext.IsNull())
194     return;
195
196   //aContext->UseDisplayedObjects();
197   //myUseExternalObjects = true;
198
199   Handle(AIS_InteractiveObject) anAISIO;
200   AIS_ListOfInteractive aPrsList;
201   AIS_ListOfInteractive aPrsListToBeDeactivated;
202   //if (aObjList.isEmpty())
203   //  return;
204   //else {
205   foreach(ObjectPtr anObject, theObjList) {
206     AISObjectPtr anAISObject = getDisplayedAISObject(anObject);
207     if (!anAISObject.get())
208       continue;
209
210     Handle(AIS_InteractiveObject) aPrs = anAISObject->impl<Handle(AIS_InteractiveObject)>();
211     if (myWorkshop->module()->canActivateSelection(anObject))
212       aPrsList.Append(aPrs);
213     else
214       aPrsListToBeDeactivated.Append(aPrs);
215   }
216   //}
217
218   // Add trihedron because it has to partisipate in selection
219   Handle(AIS_InteractiveObject) aTrihedron;
220   if (isTrihedronActive()) {
221     aTrihedron = getTrihedron();
222     if (!aTrihedron.IsNull() && aContext->IsDisplayed(aTrihedron))
223       aPrsList.Append(aTrihedron);
224   }
225   if (aPrsList.Extent() == 0 && aPrsListToBeDeactivated.Extent() == 0)
226     return;
227
228   AIS_ListIteratorOfListOfInteractive aLIt;
229   bool isActivationChanged = false;
230   for(aLIt.Initialize(aPrsList); aLIt.More(); aLIt.Next()) {
231     anAISIO = aLIt.Value();
232     if (activate(anAISIO, false))
233       isActivationChanged = true;
234   }
235
236   for(aLIt.Initialize(aPrsListToBeDeactivated); aLIt.More(); aLIt.Next()) {
237     anAISIO = aLIt.Value();
238     deactivateAIS(anAISIO);
239     isActivationChanged = true;
240   }
241 }
242
243 #ifdef DEBUG_ACTIVATE_OBJECTS
244 //**************************************************************
245 QString getModeInfo(const int theMode)
246 {
247   QString anInfo = "Undefined";
248   switch(theMode) {
249     case 0: anInfo = "SHAPE(0)"; break;
250     case 1: anInfo = "VERTEX(1)"; break;
251     case 2: anInfo = "EDGE(2)"; break;
252     case 3: anInfo = "WIRE(3)"; break;
253     case 4: anInfo = "FACE(4)"; break;
254     case 5: anInfo = "SHELL(5)"; break;
255     case 6: anInfo = "SOLID(6)"; break;
256     case 7: anInfo = "COMPSOLID(7)"; break;
257     case 8: anInfo = "COMPOUND(8)"; break;
258     case 100: anInfo = "Sel_Mode_First(100)"; break; //SketcherPrs_Tools
259     case 101: anInfo = "Sel_Constraint(101)"; break;
260     case 102: anInfo = "Sel_Dimension_All(102)"; break;
261     case 103: anInfo = "Sel_Dimension_Line(103)"; break;
262     case 104: anInfo = "Sel_Dimension_Text(104)"; break;
263     default: break;
264   }
265   return anInfo;
266 }
267
268 //**************************************************************
269 QString getModesInfo(const QIntList& theModes)
270 {
271   QStringList aModesInfo;
272   for (int i = 0, aSize = theModes.size(); i < aSize; i++)
273     aModesInfo.append(getModeInfo(theModes[i]));
274   return QString("[%1] = %2").arg(aModesInfo.size()).arg(aModesInfo.join(", "));
275 }
276 #endif
277
278 //**************************************************************
279 void XGUI_SelectionActivate::setSelectionModes(const QIntList& theModes)
280 {
281   // Convert shape types to selection types
282   QIntList aModes;
283   foreach(int aType, theModes) {
284     aModes.append(getSelectionMode(aType));
285   }
286
287 #ifdef DEBUG_ACTIVATE_OBJECTS
288   QStringList anInfo;
289   QObjectPtrList::const_iterator anIt = theObjList.begin(), aLast = theObjList.end();
290   for (; anIt != aLast; ++anIt) {
291     anInfo.append(ModuleBase_Tools::objectInfo((*anIt)));
292   }
293   QString anInfoStr = anInfo.join(", ");
294
295   qDebug(QString("activateObjects: new modes%1, active modes%2, objects[%3] = %4").
296     arg(getModesInfo(aModes)).
297     arg(getModesInfo(myActiveSelectionModes)).
298     arg(theObjList.size()).
299     arg(anInfoStr).
300     toStdString().c_str());
301 #endif
302   // In order to avoid doblications of selection modes
303   QIntList aNewModes;
304   foreach (int aMode, aModes) {
305     if (!aNewModes.contains(aMode))
306       aNewModes.append(aMode);
307   }
308   myActiveSelectionModes = aNewModes;
309 }
310
311 //**************************************************************
312 void XGUI_SelectionActivate::activateOnDisplay(const Handle(AIS_InteractiveObject)& theIO,
313                                                const bool theUpdateViewer)
314 {
315   if (myActiveSelectionModes.size() == 0)
316     activateAIS(theIO, 0, theUpdateViewer);
317   else {
318     foreach(int aMode, myActiveSelectionModes) {
319       activateAIS(theIO, aMode, theUpdateViewer);
320     }
321   }
322 }
323
324 //**************************************************************
325 void XGUI_SelectionActivate::activateAIS(const Handle(AIS_InteractiveObject)& theIO,
326                                          const int theMode, const bool theUpdateViewer) const
327 {
328   Handle(AIS_InteractiveContext) aContext = AISContext();
329   if (!theIO.IsNull() && theIO == getTrihedron()) {
330     if (theMode != AIS_Shape::SelectionType(TopAbs_EDGE) &&
331         theMode != AIS_Shape::SelectionType(TopAbs_VERTEX))
332       return;
333   }
334   if (!aContext.IsNull()) {
335     if (myWorkshop->module()) {
336       int aMode = (theMode > 8)? theMode : AIS_Shape::SelectionType(theMode);
337       aContext->Activate(theIO, theMode, false);
338     } else
339       aContext->Activate(theIO, theMode, false);
340
341     // the fix from VPA for more suitable selection of sketcher lines
342     if (theIO->Width() > 1) {
343       double aPrecision = theIO->Width() + 2;
344       if (theMode == getSelectionMode(TopAbs_VERTEX))
345         aPrecision = ModuleBase_Preferences::resourceMgr()->doubleValue("Viewer",
346         "point-selection-sensitivity", 12);
347       else if ((theMode == getSelectionMode(TopAbs_EDGE)) ||
348                (theMode == getSelectionMode(TopAbs_WIRE)))
349         aPrecision = theIO->Width() + ModuleBase_Preferences::resourceMgr()->doubleValue("Viewer",
350            "edge-selection-sensitivity", 2);
351       aContext->SetSelectionSensitivity(theIO, theMode, aPrecision);
352     }
353
354 #ifdef DEBUG_ACTIVATE_AIS
355     ObjectPtr anObject = getObject(theIO);
356     anInfo.append(ModuleBase_Tools::objectInfo((*anIt)));
357     qDebug(QString("activateAIS: theMode = %1, object = %2").arg(theMode)
358       .arg(anInfo).toStdString().c_str());
359 #endif
360     if (theUpdateViewer)
361       getDisplayer()->updateViewer();
362   }
363 }
364
365 //**************************************************************
366 void XGUI_SelectionActivate::deactivateAIS(const Handle(AIS_InteractiveObject)& theIO,
367                                            const int theMode) const
368 {
369   Handle(AIS_InteractiveContext) aContext = AISContext();
370   if (!aContext.IsNull()) {
371     if (theMode == -1)
372       aContext->Deactivate(theIO);
373     else
374       aContext->Deactivate(theIO, theMode);
375
376 #ifdef DEBUG_DEACTIVATE_AIS
377     ObjectPtr anObject = getObject(theIO);
378     anInfo.append(ModuleBase_Tools::objectInfo((*anIt)));
379     qDebug(QString("deactivateAIS: theMode = %1, object = %2").arg(theMode)
380       .arg(anInfo).toStdString().c_str());
381 #endif
382   }
383 }
384
385 //**************************************************************
386 bool XGUI_SelectionActivate::activate(const Handle(AIS_InteractiveObject)& theIO,
387                                       const bool theUpdateViewer) const
388 {
389   Handle(AIS_InteractiveContext) aContext = AISContext();
390   if (aContext.IsNull() || theIO.IsNull())
391     return false;
392
393   bool isActivationChanged = false;
394   // deactivate object in all modes, which are not in the list of activation
395   // It seems that after the IO deactivation the selected state of the IO's owners
396   // is modified in OCC(version: 6.8.0) and the selection of the object later is lost.
397   // By this reason, the number of the IO deactivate is decreased and the object is deactivated
398   // only if there is a difference in the current modes and the parameters modes.
399   // If the selection problem happens again, it is possible to write a test scenario and create
400   // a bug. The bug steps are the following:
401   // Create two IO, activate them in 5 modes, select the first IO, deactivate 3 modes for both,
402   // with clicked SHIFT select the second object.
403   // The result is the selection of the first IO is lost.
404   TColStd_ListOfInteger aTColModes;
405   aContext->ActivatedModes(theIO, aTColModes);
406   TColStd_ListIteratorOfListOfInteger itr( aTColModes );
407   QIntList aModesActivatedForIO;
408   bool isDeactivated = false;
409   bool aHasValidMode = false;
410   for (; itr.More(); itr.Next() ) {
411     Standard_Integer aMode = itr.Value();
412     aHasValidMode = aHasValidMode || aMode != -1;
413     int aShapeMode = (aMode > 8)? aMode : AIS_Shape::SelectionType(aMode);
414     if (!myActiveSelectionModes.contains(aMode)) {
415       deactivateAIS(theIO, aMode);
416       isDeactivated = true;
417     }
418     else {
419       aModesActivatedForIO.append(aMode);
420     }
421   }
422   if (isDeactivated) {
423     // the selection from the previous activation modes should be cleared manually (#26172)
424     //theIO->ClearSelected();
425 #ifndef CLEAR_OUTDATED_SELECTION_BEFORE_REDISPLAY
426     XGUI_Tools::workshop(myWorkshop)->selector()->deselectPresentation(theIO);
427 #endif
428     // For performance issues
429     //if (theUpdateViewer)
430     //  getDisplayer()->updateViewer();
431     isActivationChanged = true;
432   }
433
434   // loading the interactive object allowing the decomposition
435   if (aTColModes.IsEmpty() || !aHasValidMode) {
436     aContext->Load(theIO, -1, true);
437     Handle(AIS_Trihedron) aTrihedron = Handle(AIS_Trihedron)::DownCast(theIO);
438     if (!aTrihedron.IsNull()) {
439       // Workaround for Trihedron. It should be loaded using the next Load method to
440       // add this object to myGlobal map of selection manager
441       // it is important to activate trihedron in two selection modes: edges and vertices
442       aContext->SelectionManager()->Load(theIO);
443     }
444   }
445
446   // trihedron AIS check should be after the AIS loading.
447   // If it is not loaded, it is steel selectable in the viewer.
448   Handle(AIS_Trihedron) aTrihedron;
449   if (!isTrihedronActive())
450     aTrihedron = Handle(AIS_Trihedron)::DownCast(theIO);
451   if (aTrihedron.IsNull()) {
452       // In order to clear active modes list
453     if (myActiveSelectionModes.size() == 0) {
454       activateAIS(theIO, 0, theUpdateViewer);
455     } else {
456       foreach(int aMode, myActiveSelectionModes) {
457         if (!aModesActivatedForIO.contains(aMode)) {
458           activateAIS(theIO, aMode, theUpdateViewer);
459           isActivationChanged = true;
460         }
461       }
462     }
463   }
464   return isActivationChanged;
465 }
466
467 //**************************************************************
468 void XGUI_SelectionActivate::deactivate(const ObjectPtr& theObject, const bool theUpdateViewer)
469 {
470 #ifdef DEBUG_DEACTIVATE
471   QString anInfoStr = ModuleBase_Tools::objectInfo(theObject);
472   qDebug(QString("deactivate: myActiveSelectionModes[%1]: %2, objects = ").
473     arg(myActiveSelectionModes.size()).arg(qIntListInfo(myActiveSelectionModes)).
474     arg(anInfoStr).
475     toStdString().c_str());
476 #endif
477   Handle(AIS_InteractiveContext) aContext = AISContext();
478   if (!aContext.IsNull() && getDisplayer()->isVisible(theObject)) {
479     AISObjectPtr anObj = getDisplayedAISObject(theObject);
480     Handle(AIS_InteractiveObject) anAIS = anObj->impl<Handle(AIS_InteractiveObject)>();
481
482     deactivateAIS(anAIS);
483     // the selection from the previous activation modes should be cleared manually (#26172)
484 #ifndef CLEAR_OUTDATED_SELECTION_BEFORE_REDISPLAY
485     XGUI_Tools::workshop(myWorkshop)->selector()->deselectPresentation(anAIS);
486 #endif
487     if (theUpdateViewer)
488       getDisplayer()->updateViewer();
489   }
490 }
491
492 /// #1136 hidden axis are selected in sketch
493 #ifdef BEFORE_TRIHEDRON_PATCH
494 //**************************************************************
495 void deactivateObject(Handle(AIS_InteractiveContext) theContext,
496                       Handle(AIS_InteractiveObject) theObject)
497 {
498   if (!theObject.IsNull())
499     theContext->Deactivate(theObject);
500 }
501 #endif
502
503 //**************************************************************
504 void XGUI_SelectionActivate::activateTrihedron(bool theIsActive)
505 {
506   myIsTrihedronActive = theIsActive;
507   if (!myIsTrihedronActive)
508     deactivateTrihedron(true);
509 }
510
511 //**************************************************************
512 void XGUI_SelectionActivate::deactivateTrihedron(const bool theUpdateViewer) const
513 {
514   Handle(AIS_InteractiveObject) aTrihedron = getTrihedron();
515   Handle(AIS_InteractiveContext) aContext = AISContext();
516   if (!aTrihedron.IsNull() && aContext->IsDisplayed(aTrihedron)) {
517     Handle(AIS_Trihedron) aTrie = Handle(AIS_Trihedron)::DownCast(aTrihedron);
518     if (!aTrie.IsNull())
519       aContext->Deactivate(aTrie);
520
521     /// #1136 hidden axis are selected in sketch
522 #ifdef BEFORE_TRIHEDRON_PATCH
523     deactivateObject(aContext, aTrie->XAxis());
524     deactivateObject(aContext, aTrie->YAxis());
525     deactivateObject(aContext, aTrie->Axis());
526     deactivateObject(aContext, aTrie->Position());
527
528     deactivateObject(aContext, aTrie->XYPlane());
529     deactivateObject(aContext, aTrie->XZPlane());
530     deactivateObject(aContext, aTrie->YZPlane());
531 #endif
532     if (theUpdateViewer)
533       getDisplayer()->updateViewer();
534   }
535 }
536
537 //**************************************************************
538 void XGUI_SelectionActivate::deactivateTrihedronInSelectionModes()
539 {
540   Handle(AIS_InteractiveContext) aContext = AISContext();
541   Handle(AIS_Trihedron) aTrihedron = Handle(AIS_Trihedron)::DownCast(getTrihedron());
542   /// deactivate trihedron in selection modes
543   TColStd_ListOfInteger aTColModes;
544   aContext->ActivatedModes(aTrihedron, aTColModes);
545   TColStd_ListIteratorOfListOfInteger itr( aTColModes );
546   for (; itr.More(); itr.Next() ) {
547     Standard_Integer aMode = itr.Value();
548     aContext->Deactivate(aTrihedron, aMode);
549   }
550 }
551
552 //**************************************************************
553 Handle(AIS_InteractiveContext) XGUI_SelectionActivate::AISContext() const
554 {
555   return myWorkshop->viewer()->AISContext();
556 }
557
558 //**************************************************************
559 XGUI_Displayer* XGUI_SelectionActivate::getDisplayer() const
560 {
561   return XGUI_Tools::workshop(myWorkshop)->displayer();
562 }
563
564 //**************************************************************
565 Handle(AIS_InteractiveObject) XGUI_SelectionActivate::getTrihedron() const
566 {
567   return myWorkshop->viewer()->trihedron();
568 }
569
570 //**************************************************************
571 AISObjectPtr XGUI_SelectionActivate::getDisplayedAISObject(ObjectPtr theObject) const
572 {
573   return getDisplayer()->getAISObject(theObject);
574 }
575
576 //**************************************************************
577 int XGUI_SelectionActivate::getSelectionMode(int theShapeType)
578 {
579   return (theShapeType > TopAbs_SHAPE) ? theShapeType :
580                                          AIS_Shape::SelectionMode((TopAbs_ShapeEnum)theShapeType);
581 }