1 // File: XGUI_Displayer.cpp
2 // Created: 20 Apr 2014
3 // Author: Natalia ERMOLAEVA
5 #include "XGUI_Displayer.h"
6 #include "XGUI_Viewer.h"
8 #include <ModelAPI_Document.h>
10 #include <AIS_InteractiveContext.hxx>
11 #include <AIS_ListOfInteractive.hxx>
13 #include <AIS_Shape.hxx>
15 XGUI_Displayer::XGUI_Displayer(XGUI_Viewer* theViewer)
20 XGUI_Displayer::~XGUI_Displayer()
24 void XGUI_Displayer::Display(boost::shared_ptr<ModelAPI_Feature> theFeature,
25 const bool isUpdateViewer)
29 void XGUI_Displayer::Display(boost::shared_ptr<ModelAPI_Feature> theFeature,
30 const TopoDS_Shape& theShape, const bool isUpdateViewer)
32 Handle(AIS_InteractiveContext) aContext = myViewer->AISContext();
34 Handle(AIS_Shape) anAIS = new AIS_Shape(theShape);
35 aContext->Display(anAIS, Standard_False);
38 aContext->UpdateCurrentViewer();
41 void XGUI_Displayer::Erase(boost::shared_ptr<ModelAPI_Feature> theFeature,
42 const TopoDS_Shape& theShape, const bool isUpdateViewer)
44 Handle(AIS_InteractiveContext) aContext = myViewer->AISContext();
47 aContext->UpdateCurrentViewer();
50 void XGUI_Displayer::LocalSelection(boost::shared_ptr<ModelAPI_Feature> theFeature,
51 const TopoDS_Shape& theShape,
52 const int theMode, const bool isUpdateViewer)
54 Handle(AIS_InteractiveContext) aContext = myViewer->AISContext();
56 Handle(AIS_Shape) anAIS = new AIS_Shape(theShape);
57 aContext->Display(anAIS, Standard_False);
58 AIS_ListOfInteractive anAISList;
59 anAISList.Append(anAIS);
60 myViewer->setLocalSelection(anAISList, theMode, true);
63 void XGUI_Displayer::GlobalSelection(const bool isUpdateViewer)
65 myViewer->setGlobalSelection(true);