Salome HOME
Merge branch 'master' of newgeom:newgeom.git
[modules/shaper.git] / src / XGUI / XGUI_Displayer.h
1 // File:        XGUI_Displayer.h
2 // Created:     20 Apr 2014
3 // Author:      Natalia ERMOLAEVA
4
5 #ifndef XGUI_Displayer_H
6 #define XGUI_Displayer_H
7
8 #include "XGUI.h"
9
10 #include <QString>
11 #include <boost/shared_ptr.hpp>
12
13 #include <TopoDS_Shape.hxx>
14
15 class XGUI_Viewer;
16 class ModelAPI_Feature;
17
18 /**\class XGUI_Displayer
19  * \ingroup GUI
20  * \brief Displayer. Provides mechanizm of display/erase of objects in the viewer
21  */
22 class XGUI_EXPORT XGUI_Displayer
23 {
24 public:
25   /// Constructor
26   /// \param theViewer the viewer
27   XGUI_Displayer(XGUI_Viewer* theViewer);
28   /// Destructor
29   virtual ~XGUI_Displayer();
30
31   /// Display the feature. Obtain the visualized object from the feature.
32   /// \param theFeature a feature instance
33   /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
34   void Display(boost::shared_ptr<ModelAPI_Feature> theFeature, const bool isUpdateViewer = true);
35
36   /// Display the feature and a shape. This shape would be associated to the given feature
37   /// \param theFeature a feature instance
38   /// \param theShape a shape
39   /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
40   void Display(boost::shared_ptr<ModelAPI_Feature> theFeature, const TopoDS_Shape& theShape,
41                const bool isUpdateViewer = true);
42   
43   /// Display the shape and activate selection of sub-shapes
44   /// \param theFeature a feature instance
45   /// \param theShape a shape
46   /// \param theMode a local selection mode
47   /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
48   void LocalSelection(boost::shared_ptr<ModelAPI_Feature> theFeature, const TopoDS_Shape& theShape,
49                       const int theMode, const bool isUpdateViewer = true);
50
51   /// Erase the feature and a shape.
52   /// \param theFeature a feature instance
53   /// \param theFeature a shape
54   /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
55   void Erase(boost::shared_ptr<ModelAPI_Feature> theFeature, const TopoDS_Shape& theShape,
56              const bool isUpdateViewer = true);
57
58   /// Deactivates selection of sub-shapes
59   /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
60   void GlobalSelection(const bool isUpdateViewer = true);
61
62 protected:
63   XGUI_Viewer* myViewer; ///< the viewer where the objects should be visualized
64 };
65
66 #endif