1 // File: XGUI_Displayer.h
2 // Created: 20 Apr 2014
3 // Author: Natalia ERMOLAEVA
5 #ifndef XGUI_Displayer_H
6 #define XGUI_Displayer_H
11 #include <boost/shared_ptr.hpp>
13 #include <TopoDS_Shape.hxx>
14 #include <AIS_InteractiveObject.hxx>
20 class ModelAPI_Feature;
23 /**\class XGUI_Displayer
25 * \brief Displayer. Provides mechanizm of display/erase of objects in the viewer
27 class XGUI_EXPORT XGUI_Displayer
31 /// \param theViewer the viewer
32 XGUI_Displayer(XGUI_Viewer* theViewer);
34 virtual ~XGUI_Displayer();
36 /// Display the feature. Obtain the visualized object from the feature.
37 /// \param theFeature a feature instance
38 /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
39 void Display(boost::shared_ptr<ModelAPI_Feature> theFeature, const bool isUpdateViewer = true);
41 /// Display the feature and a shape. This shape would be associated to the given feature
42 /// \param theFeature a feature instance
43 /// \param theShape a shape
44 /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
45 void Display(boost::shared_ptr<ModelAPI_Feature> theFeature, const TopoDS_Shape& theShape,
46 const bool isUpdateViewer = true);
48 /// Display the shape and activate selection of sub-shapes
49 /// \param theFeature a feature instance
50 /// \param theShape a shape
51 /// \param theMode a local selection mode
52 /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
53 void LocalSelection(boost::shared_ptr<ModelAPI_Feature> theFeature, const TopoDS_Shape& theShape,
54 const int theMode, const bool isUpdateViewer = true);
56 /// Erase the feature and a shape.
57 /// \param theFeature a feature instance
58 /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
59 void Erase(boost::shared_ptr<ModelAPI_Feature> theFeature, const bool isUpdateViewer = true);
61 /// Deactivates selection of sub-shapes
62 /// \param isUpdateViewer the parameter whether the viewer should be update immediatelly
63 void GlobalSelection(const bool isUpdateViewer = true);
66 XGUI_Viewer* myViewer; ///< the viewer where the objects should be visualized
67 std::map<boost::shared_ptr<ModelAPI_Feature>, std::vector<Handle(AIS_InteractiveObject)> > myFeature2AISObjectMap;