Salome HOME
d4ae6d5027f297a4579b557e6a812596d3a96cb0
[modules/shaper.git] / src / XGUI / XGUI_Displayer.cpp
1 // File:        XGUI_Displayer.cxx
2 // Created:     20 Apr 2014
3 // Author:      Natalia ERMOLAEVA
4
5 #include "XGUI_Displayer.h"
6 #include "XGUI_Viewer.h"
7
8 #include <ModelAPI_Document.h>
9
10 #include <AIS_InteractiveContext.hxx>
11 #include <AIS_Shape.hxx>
12
13 XGUI_Displayer::XGUI_Displayer(XGUI_Viewer* theViewer)
14 : myViewer(theViewer)
15 {
16 }
17
18 XGUI_Displayer::~XGUI_Displayer()
19 {
20 }
21
22 void XGUI_Displayer::Display(boost::shared_ptr<ModelAPI_Feature> theFeature)
23 {
24 }
25
26 void XGUI_Displayer::Display(boost::shared_ptr<ModelAPI_Feature> theFeature,
27                              const TopoDS_Shape& theShape)
28 {
29   Handle(AIS_InteractiveContext) aContext = myViewer->AISContext();
30
31   Handle(AIS_Shape) anAIS = new AIS_Shape(theShape);
32   aContext->Display(anAIS, Standard_False);
33
34   aContext->UpdateCurrentViewer();
35 }
36
37 void XGUI_Displayer::Erase(boost::shared_ptr<ModelAPI_Feature> theFeature,
38                            const TopoDS_Shape& theShape)
39 {
40   Handle(AIS_InteractiveContext) aContext = myViewer->AISContext();
41   aContext->EraseAll();
42 }