Salome HOME
Fix for the bug #56: Show, Show only, Hide for Region and Zone under Region.
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_Displayer.h
1 // Copyright (C) 2007-2013  CEA/DEN, EDF R&D, OPEN CASCADE
2 //
3 // Copyright (C) 2003-2007  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
5 //
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
10 //
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
14 // Lesser General Public License for more details.
15 //
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
19 //
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
21 //
22
23 #ifndef HYDROGUI_DISPLAYER_H
24 #define HYDROGUI_DISPLAYER_H
25
26 #include "HYDROGUI_AbstractDisplayer.h"
27
28 #include <QMap>
29
30 class HYDROGUI_PrsDriver;
31
32 class GraphicsView_Viewer;
33
34 /**
35  * \class HYDROGUI_DataModel
36  * \brief Class intended to create, display and update the presentations.
37  */
38 class HYDROGUI_Displayer : public HYDROGUI_AbstractDisplayer
39 {
40 public:
41   /**
42    * \brief Constructor.
43    * \param theModule module object
44    */
45   HYDROGUI_Displayer( HYDROGUI_Module* theModule );
46
47   /**
48    * \brief Destructor.
49    */
50   virtual ~HYDROGUI_Displayer();
51
52 public:
53   /**
54    * \brief Force the specified objects to be updated.
55    * \param theObjs sequence of objects to update
56    * \param theViewerId viewer identifier
57    */
58   void                            SetToUpdate( const HYDROData_SequenceOfObjects& theObjs,
59                                                const int theViewerId );
60
61 protected:
62   /**
63    * \brief Erase all viewer objects.
64    * \param theViewerId viewer identifier
65    */
66   void                            EraseAll( const int theViewerId );
67
68   /**
69    * \brief Erase the specified viewer objects.
70    * \param theObjs sequence of objects to erase
71    * \param theViewerId viewer identifier
72    */
73   void                            Erase( const HYDROData_SequenceOfObjects& theObjs,
74                                          const int theViewerId );
75
76   /**
77    * \brief Display the specified viewer objects.
78    * \param theObjs sequence of objects to display
79    * \param theViewerId viewer identifier
80    * \param theIsForced flag used to update all objects, including the unchanged ones
81    * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default
82    */
83   void                            Display( const HYDROData_SequenceOfObjects& theObjs,
84                                            const int theViewerId,
85                                            const bool theIsForced,
86                                            const bool theDoFitAll );
87
88   /**
89    * \brief Purge all invalid objects in the viewer.
90    * \param theViewerId viewer identifier
91    */
92   void                            purgeObjects( const int theViewerId );
93
94 private:
95   /**
96    * \brief Get the presentation driver for the specified data object.
97    * \param theObj data object
98    */
99   HYDROGUI_PrsDriver*             getDriver( const Handle(HYDROData_Entity)& theObj );
100
101 private:
102   typedef QMap< ObjectKind, HYDROGUI_PrsDriver* > PrsDriversMap;
103   PrsDriversMap                   myPrsDriversMap;
104 };
105
106 #endif