1 // Copyright (C) 2014-20xx CEA/DEN, EDF R&D -->
3 // File: XGUI_Displayer.cpp
4 // Created: 20 Apr 2014
5 // Author: Natalia ERMOLAEVA
7 #include "XGUI_Displayer.h"
8 #include "XGUI_Workshop.h"
9 #include "XGUI_ViewerProxy.h"
10 #include "XGUI_SelectionMgr.h"
11 #include "XGUI_Selection.h"
13 #include <AppElements_Viewer.h>
15 #include <ModelAPI_Document.h>
16 #include <ModelAPI_Data.h>
17 #include <ModelAPI_Object.h>
18 #include <ModelAPI_Tools.h>
20 #include <ModuleBase_ResultPrs.h>
22 #include <GeomAPI_Shape.h>
23 #include <GeomAPI_IPresentable.h>
24 #include <GeomAPI_ICustomPrs.h>
26 #include <AIS_InteractiveContext.hxx>
27 #include <AIS_LocalContext.hxx>
28 #include <AIS_ListOfInteractive.hxx>
29 #include <AIS_ListIteratorOfListOfInteractive.hxx>
30 #include <AIS_DimensionSelectionMode.hxx>
31 #include <AIS_Shape.hxx>
32 #include <AIS_Dimension.hxx>
33 #include <TColStd_ListIteratorOfListOfInteger.hxx>
34 #include <SelectMgr_ListOfFilter.hxx>
35 #include <SelectMgr_ListIteratorOfListOfFilter.hxx>
37 #include <TColStd_MapOfTransient.hxx>
38 #include <TColStd_MapIteratorOfMapOfTransient.hxx>
42 const int MOUSE_SENSITIVITY_IN_PIXEL = 10; ///< defines the local context mouse selection sensitivity
44 //#ifdef DEBUG_DISPLAY
46 // Workaround for bug #25637
47 void displayedObjects(const Handle(AIS_InteractiveContext)& theAIS, AIS_ListOfInteractive& theList)
49 // Get from null point
50 theAIS->DisplayedObjects(theList, true);
51 if (theAIS->HasOpenedContext()) {
52 // get from local context
53 const Handle(AIS_LocalContext)& aLC = theAIS->LocalContext();
54 TColStd_MapOfTransient aMap;
55 int NbDisp = aLC->DisplayedObjects(aMap);
56 TColStd_MapIteratorOfMapOfTransient aIt(aMap);
58 Handle(AIS_InteractiveObject) curIO;
59 Handle(Standard_Transient) Tr;
60 for(; aIt.More(); aIt.Next()){
62 curIO = *((Handle(AIS_InteractiveObject)*) &Tr);
63 theList.Append(curIO);
69 XGUI_Displayer::XGUI_Displayer(XGUI_Workshop* theWorkshop)
70 : myWorkshop(theWorkshop)
72 enableUpdateViewer(true);
75 XGUI_Displayer::~XGUI_Displayer()
79 bool XGUI_Displayer::isVisible(ObjectPtr theObject) const
81 return myResult2AISObjectMap.contains(theObject);
84 void XGUI_Displayer::display(ObjectPtr theObject, bool isUpdateViewer)
86 if (isVisible(theObject)) {
87 redisplay(theObject, isUpdateViewer);
90 FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
91 if (aFeature.get() != NULL) {
92 qDebug(QString("display feature: %1, displayed: %2").
93 arg(aFeature->data()->name().c_str()).
94 arg(displayedObjects().size()).toStdString().c_str());
99 GeomPresentablePtr aPrs = std::dynamic_pointer_cast<GeomAPI_IPresentable>(theObject);
100 bool isShading = false;
101 if (aPrs.get() != NULL) {
102 anAIS = aPrs->getAISObject(AISObjectPtr());
104 ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
105 if (aResult.get() != NULL) {
106 std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(aResult);
107 if (aShapePtr.get() != NULL) {
108 anAIS = AISObjectPtr(new GeomAPI_AISObject());
109 anAIS->setImpl(new Handle(AIS_InteractiveObject)(new ModuleBase_ResultPrs(aResult)));
110 //anAIS->createShape(aShapePtr);
116 display(theObject, anAIS, isShading, isUpdateViewer);
120 bool canBeShaded(Handle(AIS_InteractiveObject) theAIS)
122 Handle(AIS_Shape) aShapePrs = Handle(AIS_Shape)::DownCast(theAIS);
123 if (!aShapePrs.IsNull()) {
124 TopoDS_Shape aShape = aShapePrs->Shape();
125 TopAbs_ShapeEnum aType = aShape.ShapeType();
126 if ((aType == TopAbs_VERTEX) || (aType == TopAbs_EDGE) || (aType == TopAbs_WIRE))
129 // Check that the presentation is not a sketch
130 Handle(ModuleBase_ResultPrs) aPrs = Handle(ModuleBase_ResultPrs)::DownCast(theAIS);
132 return !aPrs->isSketchMode();
139 void XGUI_Displayer::display(ObjectPtr theObject, AISObjectPtr theAIS,
140 bool isShading, bool isUpdateViewer)
142 Handle(AIS_InteractiveContext) aContext = AISContext();
143 if (aContext.IsNull())
146 Handle(AIS_InteractiveObject) anAISIO = theAIS->impl<Handle(AIS_InteractiveObject)>();
147 if (!anAISIO.IsNull()) {
148 myResult2AISObjectMap[theObject] = theAIS;
149 bool aCanBeShaded = ::canBeShaded(anAISIO);
150 // In order to avoid extra closing/opening context
151 SelectMgr_IndexedMapOfOwner aSelectedOwners;
153 myWorkshop->selector()->selection()->selectedOwners(aSelectedOwners);
154 closeLocalContexts(false);
156 aContext->Display(anAISIO, false);
158 aContext->SetDisplayMode(anAISIO, isShading? Shading : Wireframe, false);
159 // Customization of presentation
160 FeaturePtr aFeature = ModelAPI_Feature::feature(theObject);
161 if (aFeature.get() != NULL) {
162 GeomCustomPrsPtr aCustPrs = std::dynamic_pointer_cast<GeomAPI_ICustomPrs>(aFeature);
163 if (aCustPrs.get() != NULL)
164 aCustPrs->customisePresentation(theAIS);
168 activateObjects(myActiveSelectionModes);
169 myWorkshop->selector()->setSelectedOwners(aSelectedOwners, false);
176 void XGUI_Displayer::erase(ObjectPtr theObject, const bool isUpdateViewer)
178 if (!isVisible(theObject))
181 Handle(AIS_InteractiveContext) aContext = AISContext();
182 if (aContext.IsNull())
184 AISObjectPtr anObject = myResult2AISObjectMap[theObject];
186 Handle(AIS_InteractiveObject) anAIS = anObject->impl<Handle(AIS_InteractiveObject)>();
187 if (!anAIS.IsNull()) {
188 aContext->Remove(anAIS, isUpdateViewer);
191 myResult2AISObjectMap.remove(theObject);
194 void XGUI_Displayer::redisplay(ObjectPtr theObject, bool isUpdateViewer)
196 if (!isVisible(theObject))
199 AISObjectPtr aAISObj = getAISObject(theObject);
200 Handle(AIS_InteractiveObject) aAISIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
202 GeomPresentablePtr aPrs = std::dynamic_pointer_cast<GeomAPI_IPresentable>(theObject);
204 AISObjectPtr aAIS_Obj = aPrs->getAISObject(aAISObj);
206 erase(theObject, isUpdateViewer);
209 if (aAIS_Obj != aAISObj) {
210 myResult2AISObjectMap[theObject] = aAIS_Obj;
212 aAISIO = aAIS_Obj->impl<Handle(AIS_InteractiveObject)>();
215 if (!aAISIO.IsNull()) {
216 Handle(AIS_InteractiveContext) aContext = AISContext();
217 if (aContext.IsNull())
219 // Check that the visualized shape is the same and the redisplay is not necessary
220 // Redisplay of AIS object leads to this object selection compute and the selection
221 // in the browser is lost
223 ResultPtr aResult = std::dynamic_pointer_cast<ModelAPI_Result>(theObject);
224 if (aResult.get() != NULL) {
225 Handle(AIS_Shape) aShapePrs = Handle(AIS_Shape)::DownCast(aAISIO);
226 if (!aShapePrs.IsNull()) {
227 std::shared_ptr<GeomAPI_Shape> aShapePtr = ModelAPI_Tools::shape(aResult);
228 if (aShapePtr.get()) {
229 const TopoDS_Shape& aShape = aShapePrs->Shape();
230 std::shared_ptr<GeomAPI_Shape> anAISShapePtr(new GeomAPI_Shape());
231 anAISShapePtr->setImpl(new TopoDS_Shape(aShape));
233 if (aShapePtr->isEqual(anAISShapePtr))
238 aContext->Redisplay(aAISIO, false);
244 void XGUI_Displayer::deactivate(ObjectPtr theObject)
246 if (isVisible(theObject)) {
247 Handle(AIS_InteractiveContext) aContext = AISContext();
248 if (aContext.IsNull())
251 AISObjectPtr anObj = myResult2AISObjectMap[theObject];
252 Handle(AIS_InteractiveObject) anAIS = anObj->impl<Handle(AIS_InteractiveObject)>();
253 aContext->Deactivate(anAIS);
257 void XGUI_Displayer::activate(ObjectPtr theFeature)
259 activate(theFeature, myActiveSelectionModes);
262 void XGUI_Displayer::activate(ObjectPtr theObject, const QIntList& theModes)
264 if (isVisible(theObject)) {
265 Handle(AIS_InteractiveContext) aContext = AISContext();
266 if (aContext.IsNull())
269 AISObjectPtr anObj = myResult2AISObjectMap[theObject];
270 Handle(AIS_InteractiveObject) anAIS = anObj->impl<Handle(AIS_InteractiveObject)>();
271 aContext->Deactivate(anAIS);
272 aContext->Load(anAIS, -1, true);
273 // In order to clear active modes list
274 if (theModes.size() > 0) {
275 foreach(int aMode, theModes) {
276 //aContext->Load(anAIS, aMode, true);
277 aContext->Activate(anAIS, aMode);
280 //aContext->Load(anAIS, 0, true);
281 aContext->Activate(anAIS);
286 void XGUI_Displayer::getModesOfActivation(ObjectPtr theObject, QIntList& theModes)
288 if (!isVisible(theObject))
291 Handle(AIS_InteractiveContext) aContext = AISContext();
292 if (aContext.IsNull())
295 AISObjectPtr aAISObj = getAISObject(theObject);
297 if (aAISObj.get() != NULL) {
298 Handle(AIS_InteractiveObject) anAISIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
299 TColStd_ListOfInteger aTColModes;
300 aContext->ActivatedModes(anAISIO, aTColModes);
301 TColStd_ListIteratorOfListOfInteger itr( aTColModes );
302 for (; itr.More(); itr.Next() ) {
303 theModes.append(itr.Value());
308 void XGUI_Displayer::activateObjects(const QIntList& theModes)
310 // In order to avoid doblications of selection modes
312 foreach (int aMode, theModes) {
313 if (!aNewModes.contains(aMode))
314 aNewModes.append(aMode);
316 myActiveSelectionModes = aNewModes;
317 Handle(AIS_InteractiveContext) aContext = AISContext();
318 if (aContext.IsNull())
320 // Open local context if there is no one
321 if (!aContext->HasOpenedContext())
324 //aContext->UseDisplayedObjects();
325 //myUseExternalObjects = true;
327 AIS_ListOfInteractive aPrsList;
328 ::displayedObjects(aContext, aPrsList);
330 Handle(AIS_Trihedron) aTrihedron;
331 AIS_ListIteratorOfListOfInteractive aLIt(aPrsList);
332 Handle(AIS_InteractiveObject) anAISIO;
333 for(aLIt.Initialize(aPrsList); aLIt.More(); aLIt.Next()){
334 anAISIO = aLIt.Value();
335 aContext->Load(anAISIO, -1, true);
336 aContext->Deactivate(anAISIO);
337 aTrihedron = Handle(AIS_Trihedron)::DownCast(anAISIO);
338 //Deactivate trihedron which can be activated in local selector
339 if (aTrihedron.IsNull()) {
340 //aContext->Load(anAISIO, -1, true);
341 // In order to clear active modes list
342 if (myActiveSelectionModes.size() == 0) {
343 //aContext->Load(anAISIO, 0, true);
344 aContext->Activate(anAISIO);
346 foreach(int aMode, myActiveSelectionModes) {
347 //aContext->Load(anAISIO, aMode, true);
348 aContext->Activate(anAISIO, aMode);
356 void XGUI_Displayer::deactivateObjects()
358 myActiveSelectionModes.clear();
359 Handle(AIS_InteractiveContext) aContext = AISContext();
360 // Open local context if there is no one
361 if (!aContext->HasOpenedContext())
364 //aContext->NotUseDisplayedObjects();
365 AIS_ListOfInteractive aPrsList;
366 ::displayedObjects(aContext, aPrsList);
368 AIS_ListIteratorOfListOfInteractive aLIt;
369 //Handle(AIS_Trihedron) aTrihedron;
370 Handle(AIS_InteractiveObject) anAISIO;
371 for(aLIt.Initialize(aPrsList); aLIt.More(); aLIt.Next()){
372 anAISIO = aLIt.Value();
373 aContext->Deactivate(anAISIO);
377 bool XGUI_Displayer::isActive(ObjectPtr theObject) const
379 Handle(AIS_InteractiveContext) aContext = AISContext();
380 if (aContext.IsNull())
382 if (!isVisible(theObject))
385 AISObjectPtr anObj = myResult2AISObjectMap[theObject];
386 Handle(AIS_InteractiveObject) anAIS = anObj->impl<Handle(AIS_InteractiveObject)>();
388 TColStd_ListOfInteger aModes;
389 aContext->ActivatedModes(anAIS, aModes);
390 return aModes.Extent() > 0;
393 void XGUI_Displayer::setSelected(const QObjectPtrList& theResults, const bool isUpdateViewer)
395 Handle(AIS_InteractiveContext) aContext = AISContext();
396 if (aContext.IsNull())
398 if (aContext->HasOpenedContext()) {
399 aContext->UnhilightSelected();
400 aContext->ClearSelected();
401 foreach(ObjectPtr aResult, theResults) {
402 if (isVisible(aResult)) {
403 AISObjectPtr anObj = myResult2AISObjectMap[aResult];
404 Handle(AIS_InteractiveObject) anAIS = anObj->impl<Handle(AIS_InteractiveObject)>();
406 aContext->SetSelected(anAIS, false);
410 aContext->UnhilightCurrents();
411 aContext->ClearCurrents();
412 foreach(ObjectPtr aResult, theResults) {
413 if (isVisible(aResult)) {
414 AISObjectPtr anObj = myResult2AISObjectMap[aResult];
415 Handle(AIS_InteractiveObject) anAIS = anObj->impl<Handle(AIS_InteractiveObject)>();
417 aContext->SetCurrentObject(anAIS, false);
426 void XGUI_Displayer::clearSelected()
428 Handle(AIS_InteractiveContext) aContext = AISContext();
430 aContext->UnhilightCurrents(false);
431 aContext->ClearSelected();
435 void XGUI_Displayer::eraseAll(const bool isUpdateViewer)
437 Handle(AIS_InteractiveContext) aContext = AISContext();
438 if (!aContext.IsNull()) {
439 foreach (AISObjectPtr aAISObj, myResult2AISObjectMap) {
441 Handle(AIS_InteractiveObject) anIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
443 aContext->Remove(anIO, false);
448 myResult2AISObjectMap.clear();
451 void XGUI_Displayer::openLocalContext()
453 Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
454 if (aContext.IsNull())
456 // Open local context if there is no one
457 if (!aContext->HasOpenedContext()) {
458 // Preserve selected objects
459 //AIS_ListOfInteractive aAisList;
460 //for (aContext->InitCurrent(); aContext->MoreCurrent(); aContext->NextCurrent())
461 // aAisList.Append(aContext->Current());
463 // get the filters from the global context and append them to the local context
464 // a list of filters in the global context is not cleared and should be cleared here
465 SelectMgr_ListOfFilter aFilters;
466 aFilters.Assign(aContext->Filters());
467 // it is important to remove the filters in the global context, because there is a code
468 // in the closeLocalContex, which restore the global context filters
469 aContext->RemoveFilters();
471 //aContext->ClearCurrents();
472 aContext->OpenLocalContext();
473 //aContext->NotUseDisplayedObjects();
475 //myUseExternalObjects = false;
477 SelectMgr_ListIteratorOfListOfFilter aIt(aFilters);
478 for (;aIt.More(); aIt.Next()) {
479 aContext->AddFilter(aIt.Value());
482 //AIS_ListIteratorOfListOfInteractive aIt2(aAisList);
483 //for(; aIt2.More(); aIt2.Next()) {
484 // aContext->SetSelected(aIt2.Value(), false);
489 void XGUI_Displayer::closeLocalContexts(const bool isUpdateViewer)
491 Handle(AIS_InteractiveContext) aContext = AISContext();
492 if ( (!aContext.IsNull()) && (aContext->HasOpenedContext()) ) {
493 // Preserve selected objects
494 //AIS_ListOfInteractive aAisList;
495 //for (aContext->InitSelected(); aContext->MoreSelected(); aContext->NextSelected())
496 // aAisList.Append(aContext->SelectedInteractive());
498 // get the filters from the local context and append them to the global context
499 // a list of filters in the local context is cleared
500 SelectMgr_ListOfFilter aFilters;
501 aFilters.Assign(aContext->Filters());
503 //aContext->ClearSelected();
504 aContext->CloseAllContexts(false);
506 // Redisplay all object if they were displayed in localContext
507 Handle(AIS_InteractiveObject) aAISIO;
508 foreach (AISObjectPtr aAIS, myResult2AISObjectMap) {
509 aAISIO = aAIS->impl<Handle(AIS_InteractiveObject)>();
510 if (aContext->DisplayStatus(aAISIO) != AIS_DS_Displayed) {
511 aContext->Display(aAISIO, false);
512 aContext->SetDisplayMode(aAISIO, Shading, false);
516 // Append the filters from the local selection in the global selection context
517 SelectMgr_ListIteratorOfListOfFilter aIt(aFilters);
518 for (;aIt.More(); aIt.Next()) {
519 Handle(SelectMgr_Filter) aFilter = aIt.Value();
520 aContext->AddFilter(aFilter);
525 //myUseExternalObjects = false;
528 //AIS_ListIteratorOfListOfInteractive aIt2(aAisList);
529 //for(; aIt2.More(); aIt2.Next()) {
530 // if (aContext->IsDisplayed(aIt2.Value()))
531 // aContext->SetCurrentObject(aIt2.Value(), false);
536 AISObjectPtr XGUI_Displayer::getAISObject(ObjectPtr theObject) const
539 if (myResult2AISObjectMap.contains(theObject))
540 anIO = myResult2AISObjectMap[theObject];
544 ObjectPtr XGUI_Displayer::getObject(const AISObjectPtr& theIO) const
546 Handle(AIS_InteractiveObject) aRefAIS = theIO->impl<Handle(AIS_InteractiveObject)>();
547 return getObject(aRefAIS);
550 ObjectPtr XGUI_Displayer::getObject(const Handle(AIS_InteractiveObject)& theIO) const
553 foreach (ObjectPtr anObj, myResult2AISObjectMap.keys()) {
554 AISObjectPtr aAIS = myResult2AISObjectMap[anObj];
555 Handle(AIS_InteractiveObject) anAIS = aAIS->impl<Handle(AIS_InteractiveObject)>();
562 bool XGUI_Displayer::enableUpdateViewer(const bool isEnabled)
564 bool aWasEnabled = myEnableUpdateViewer;
566 myEnableUpdateViewer = isEnabled;
571 void XGUI_Displayer::updateViewer()
573 Handle(AIS_InteractiveContext) aContext = AISContext();
574 if (!aContext.IsNull() && myEnableUpdateViewer)
575 aContext->UpdateCurrentViewer();
578 Handle(AIS_InteractiveContext) XGUI_Displayer::AISContext() const
580 Handle(AIS_InteractiveContext) aContext = myWorkshop->viewer()->AISContext();
581 if ((!aContext.IsNull()) && (!aContext->HasOpenedContext())) {
582 aContext->OpenLocalContext();
587 Handle(SelectMgr_AndFilter) XGUI_Displayer::GetFilter()
589 Handle(AIS_InteractiveContext) aContext = AISContext();
590 if (myAndFilter.IsNull() && !aContext.IsNull()) {
591 myAndFilter = new SelectMgr_AndFilter();
592 aContext->AddFilter(myAndFilter);
597 void XGUI_Displayer::displayAIS(AISObjectPtr theAIS, bool isUpdate)
599 Handle(AIS_InteractiveContext) aContext = AISContext();
600 if (aContext.IsNull())
602 Handle(AIS_InteractiveObject) anAISIO = theAIS->impl<Handle(AIS_InteractiveObject)>();
603 if (!anAISIO.IsNull()) {
604 aContext->Display(anAISIO, isUpdate);
605 if (aContext->HasOpenedContext()) {
606 //if (myUseExternalObjects) {
607 if (myActiveSelectionModes.size() == 0)
608 aContext->Activate(anAISIO);
610 foreach(int aMode, myActiveSelectionModes) {
611 aContext->Activate(anAISIO, aMode);
619 void XGUI_Displayer::eraseAIS(AISObjectPtr theAIS, const bool isUpdate)
621 Handle(AIS_InteractiveContext) aContext = AISContext();
622 if (aContext.IsNull())
624 Handle(AIS_InteractiveObject) anAISIO = theAIS->impl<Handle(AIS_InteractiveObject)>();
625 if (!anAISIO.IsNull()) {
626 aContext->Remove(anAISIO, isUpdate);
631 void XGUI_Displayer::setDisplayMode(ObjectPtr theObject, DisplayMode theMode, bool toUpdate)
633 if (theMode == NoMode)
636 Handle(AIS_InteractiveContext) aContext = AISContext();
637 if (aContext.IsNull())
640 AISObjectPtr aAISObj = getAISObject(theObject);
644 Handle(AIS_InteractiveObject) aAISIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
645 bool aCanBeShaded = ::canBeShaded(aAISIO);
646 // In order to avoid extra closing/opening context
647 SelectMgr_IndexedMapOfOwner aSelectedOwners;
649 myWorkshop->selector()->selection()->selectedOwners(aSelectedOwners);
650 closeLocalContexts(false);
652 aContext->SetDisplayMode(aAISIO, theMode, false);
655 activateObjects(myActiveSelectionModes);
656 myWorkshop->selector()->setSelectedOwners(aSelectedOwners, false);
662 XGUI_Displayer::DisplayMode XGUI_Displayer::displayMode(ObjectPtr theObject) const
664 Handle(AIS_InteractiveContext) aContext = AISContext();
665 if (aContext.IsNull())
668 AISObjectPtr aAISObj = getAISObject(theObject);
672 Handle(AIS_InteractiveObject) aAISIO = aAISObj->impl<Handle(AIS_InteractiveObject)>();
673 return (XGUI_Displayer::DisplayMode) aAISIO->DisplayMode();
676 void XGUI_Displayer::addSelectionFilter(const Handle(SelectMgr_Filter)& theFilter)
678 Handle(AIS_InteractiveContext) aContext = AISContext();
679 if (aContext.IsNull())
681 const SelectMgr_ListOfFilter& aFilters = aContext->Filters();
682 SelectMgr_ListIteratorOfListOfFilter aIt(aFilters);
683 for (; aIt.More(); aIt.Next()) {
684 if (theFilter.Access() == aIt.Value().Access())
687 GetFilter()->Add(theFilter);
690 void XGUI_Displayer::removeSelectionFilter(const Handle(SelectMgr_Filter)& theFilter)
692 Handle(AIS_InteractiveContext) aContext = AISContext();
693 if (aContext.IsNull())
695 GetFilter()->Remove(theFilter);
698 void XGUI_Displayer::removeFilters()
700 Handle(AIS_InteractiveContext) aContext = AISContext();
701 if (aContext.IsNull())
703 GetFilter()->Clear();
706 void XGUI_Displayer::showOnly(const QObjectPtrList& theList)
708 QObjectPtrList aDispList = myResult2AISObjectMap.keys();
709 foreach(ObjectPtr aObj, aDispList) {
710 if (!theList.contains(aObj))
713 foreach(ObjectPtr aObj, theList) {
714 if (!isVisible(aObj))
715 display(aObj, false);
720 bool XGUI_Displayer::canBeShaded(ObjectPtr theObject) const
722 if (!isVisible(theObject))
725 AISObjectPtr aAISObj = getAISObject(theObject);
726 if (aAISObj.get() == NULL)
729 Handle(AIS_InteractiveObject) anAIS = aAISObj->impl<Handle(AIS_InteractiveObject)>();
730 return ::canBeShaded(anAIS);