]> SALOME platform Git repositories - modules/shaper.git/blob - src/XGUI/XGUI_Displayer.cpp
Salome HOME
Migration to VC9 and boost::shared_ptr with connection to SALOME
[modules/shaper.git] / src / XGUI / XGUI_Displayer.cpp
1 #include "XGUI_Displayer.h"
2 #include "XGUI_Tools.h"
3 #include "XGUI_Viewer.h"
4
5 #include <ModelAPI_Document.h>
6
7 #include <AIS_InteractiveContext.hxx>
8 #include <AIS_Shape.hxx>
9
10 /*!
11  \brief Constructor
12  */
13 XGUI_Displayer::XGUI_Displayer(XGUI_Viewer* theViewer)
14 : myViewer(theViewer)
15 {
16 }
17
18 /*!
19  \brief Destructor
20  */
21 XGUI_Displayer::~XGUI_Displayer()
22 {
23 }
24
25 /*!
26  * Display the feature
27  * \param theFeature a feature instance
28  */
29 void XGUI_Displayer::Display(boost::shared_ptr<ModelAPI_Feature> theFeature)
30 {
31 }
32
33 /*!
34  * Display the feature and a shape. This shape would be associated to the given feature
35  * \param theFeature a feature instance
36  * \param theFeature a shape
37  */
38 void XGUI_Displayer::Display(boost::shared_ptr<ModelAPI_Feature> theFeature,
39                              const TopoDS_Shape& theShape)
40 {
41   Handle(AIS_InteractiveContext) aContext = myViewer->AISContext();
42
43   Handle(AIS_Shape) anAIS = new AIS_Shape(theShape);
44   aContext->Display(anAIS, Standard_False);
45
46   aContext->UpdateCurrentViewer();
47 }