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