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