Salome HOME
ec3f9ed4039579538c929f75fc5a1d050089df80
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_AbstractDisplayer.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_ABSTRACT_DISPLAYER_H
24 #define HYDROGUI_ABSTRACT_DISPLAYER_H
25
26 #include <HYDROData_Entity.h>
27
28 class HYDROGUI_Module;
29
30 /**
31  * \class HYDROGUI_DataModel
32  * \brief Class intended to create, display and update the presentations.
33  */
34 class HYDROGUI_AbstractDisplayer
35 {
36 public:
37   /**
38    * \brief Constructor.
39    * \param theModule module object
40    */
41   HYDROGUI_AbstractDisplayer( HYDROGUI_Module* theModule );
42
43   /**
44    * \brief Destructor.
45    */
46   virtual ~HYDROGUI_AbstractDisplayer();
47
48 public:
49   /**
50    * \brief Update all objects in the viewer.
51    * \param theViewerId viewer identifier
52    * \param theIsInit flag used for initial update
53    * \param theIsForced flag used to update all objects, including the unchanged ones
54    */
55   virtual void     UpdateAll( const int theViewerId,
56                               const bool theIsInit,
57                               const bool theIsForced,
58                               const bool theDoFitAll );
59
60   /**
61    * \brief Force the specified objects to be updated.
62    * \param theObjs sequence of objects to update
63    * \param theViewerId viewer identifier
64    */
65   virtual void     SetToUpdate( const HYDROData_SequenceOfObjects& theObjs,
66                                 const int theViewerId ) = 0;
67
68 protected:
69   /**
70    * \brief Update and display all objects in the viewer.
71    * \param theViewerId viewer identifier
72    * \param theIsForced flag used to update all objects, including the unchanged ones
73    */
74   virtual void     DisplayAll( const int theViewerId,
75                                const bool theIsForced,
76                                const bool theDoFitAll );
77
78   /**
79    * \brief Update the specified viewer objects.
80    * \param theObjs sequence of objects to update
81    * \param theViewerId viewer identifier
82    * \param theIsForced flag used to update all objects, including the unchanged ones
83    * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default
84    */
85   virtual void     Update( const HYDROData_SequenceOfObjects& theObjs,
86                            const int theViewerId,
87                            const bool theIsForced,
88                            const bool theDoFitAll );
89
90   /**
91    * \brief Erase all viewer objects.
92    * \param theViewerId viewer identifier
93    */
94   virtual void     EraseAll( const int theViewerId ) = 0;
95
96   /**
97    * \brief Erase the specified viewer objects.
98    * \param theObjs sequence of objects to erase
99    * \param theViewerId viewer identifier
100    */
101   virtual void     Erase( const HYDROData_SequenceOfObjects& theObjs,
102                           const int theViewerId ) = 0;
103
104   /**
105    * \brief Display the specified viewer objects.
106    * \param theObjs sequence of objects to display
107    * \param theViewerId viewer identifier
108    * \param theIsForced flag used to update all objects, including the unchanged ones
109    * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default
110    */
111   virtual void     Display( const HYDROData_SequenceOfObjects& theObjs,
112                             const int theViewerId,
113                             const bool theIsForced,
114                             const bool theDoFitAll ) = 0;
115
116   /**
117    * \brief Purge all invalid objects in the viewer.
118    * \param theViewerId viewer identifier
119    */
120   virtual void     purgeObjects( const int theViewerId ) = 0;
121
122   HYDROGUI_Module* module() const {return myModule;}
123
124 private:
125   HYDROGUI_Module* myModule;
126 };
127
128 #endif