Salome HOME
- Bathymethries are colored now
[modules/hydro.git] / src / HYDROGUI / HYDROGUI_VTKPrsDisplayer.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_VTKPRSDISPLAYER_H
24 #define HYDROGUI_VTKPRSDISPLAYER_H
25
26 #include "HYDROGUI_AbstractDisplayer.h"
27
28 class HYDROGUI_VTKPrsDriver;
29
30 /**
31  * \class HYDROGUI_VTKPrsDisplayer
32  * \brief Class intended to create, display and update the presentations in VTK viewer.
33  */
34 class HYDROGUI_VTKPrsDisplayer : public HYDROGUI_AbstractDisplayer
35 {
36 public:
37   /**
38    * \brief Constructor.
39    * \param theModule module object
40    */
41   HYDROGUI_VTKPrsDisplayer( HYDROGUI_Module* theModule );
42
43   /**
44    * \brief Destructor.
45    */
46   virtual ~HYDROGUI_VTKPrsDisplayer();
47
48 public:
49   /**
50    * \brief Force the specified objects to be updated.
51    * \param theObjs sequence of objects to update
52    * \param theViewerId viewer identifier
53    */
54   void             SetToUpdate( const HYDROData_SequenceOfObjects& theObjs,
55                                 const int theViewerId );
56
57   /**
58    * \brief Get the applicable viewer type.
59    */
60   virtual QString  GetType() const;
61
62 protected:
63   /**
64    * \brief Erase all viewer objects.
65    * \param theViewerId viewer identifier
66    */
67   void             EraseAll( const int theViewerId );
68
69   /**
70    * \brief Erase the specified viewer objects.
71    * \param theObjs sequence of objects to erase
72    * \param theViewerId viewer identifier
73    */
74   void             Erase( const HYDROData_SequenceOfObjects& theObjs,
75                           const int theViewerId );
76
77   /**
78    * \brief Display the specified viewer objects.
79    * \param theObjs sequence of objects to display
80    * \param theViewerId viewer identifier
81    * \param theIsForced flag used to update all objects, including the unchanged ones
82    * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default
83    */
84   void             Display( const HYDROData_SequenceOfObjects& theObjs,
85                             const int theViewerId,
86                             const bool theIsForced,
87                             const bool theDoFitAll );
88
89 protected:
90   /**
91    * \brief Purge all invalid objects in the viewer.
92    * \param theViewerId viewer identifier
93    */
94   void             purgeObjects( const int theViewerId );
95
96 private:
97   /**
98    * \brief Get the presentation driver for the specified data object.
99    * \param theObj data object
100    */
101   HYDROGUI_VTKPrsDriver* getDriver( const Handle(HYDROData_Entity)& theObj );
102
103   HYDROGUI_VTKPrsDriver* myDriver;
104 };
105
106 #endif