1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
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.
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.
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
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #ifndef HYDROGUI_OCCDISPLAYER_H
24 #define HYDROGUI_OCCDISPLAYER_H
26 #include "HYDROGUI_AbstractDisplayer.h"
29 class Handle(AIS_InteractiveContext);
30 class OCCViewer_ViewManager;
31 class OCCViewer_Viewer;
34 * \class HYDROGUI_OCCDisplayer
35 * \brief Class intended to create, display and update the presentations on OCC viewer.
37 class HYDROGUI_OCCDisplayer : public HYDROGUI_AbstractDisplayer
42 * \param theModule module object
44 HYDROGUI_OCCDisplayer( HYDROGUI_Module* theModule );
49 virtual ~HYDROGUI_OCCDisplayer();
53 * \brief Force the specified objects to be updated.
54 * \param theObjs sequence of objects to update
55 * \param theViewerId viewer identifier
57 void SetToUpdate( const HYDROData_SequenceOfObjects& theObjs,
58 const int theViewerId );
61 * \brief Get the applicable viewer type.
63 virtual QString GetType() const;
66 * \brief Add the z layer for preview and returns its index.
67 * \param theMgr OCC view manager
69 int AddPreviewZLayer( OCCViewer_ViewManager* theMgr );
72 * \brief Removes the z layer.
73 * \param theMgr OCC view manager
74 * \param theLayer a layer index
76 void RemoveZLayer( OCCViewer_ViewManager* theMgr,
81 * \brief Erase all viewer objects.
82 * \param theViewerId viewer identifier
84 void EraseAll( const int theViewerId );
87 * \brief Erase the specified viewer objects.
88 * \param theObjs sequence of objects to erase
89 * \param theViewerId viewer identifier
91 void Erase( const HYDROData_SequenceOfObjects& theObjs,
92 const int theViewerId );
95 * \brief Display the specified viewer objects.
96 * \param theObjs sequence of objects to display
97 * \param theViewerId viewer identifier
98 * \param theIsForced flag used to update all objects, including the unchanged ones
99 * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default
101 void Display( const HYDROData_SequenceOfObjects& theObjs,
102 const int theViewerId,
103 const bool theIsForced,
104 const bool theDoFitAll );
108 * \brief Purge all invalid objects in the viewer.
109 * \param theViewerId viewer identifier
111 void purgeObjects( const int theViewerId );
115 * \brief Creates new OCC shape.
116 * \param theViewerId viewer identifier
117 * \param theContext context of OCC viewer
118 * \param theObject data model object
119 * \return pointer to new created shape
121 HYDROGUI_Shape* createShape( const int theViewerId,
122 const Handle(AIS_InteractiveContext)& theContext,
123 const Handle(HYDROData_Entity)& theObject );
126 * \brief Display the specified object.
127 * \param theObject the object to display
128 * \param theViewer the viewer for displaying
129 * \param theIsForced the flag used to update the object shape
130 * \return true in case of success
132 bool Display( const Handle(HYDROData_Entity)& theObject,
133 const OCCViewer_Viewer* theViewer,
134 const bool theIsForced );
137 * \brief Set Z layer to the shape corresponding to the HYDRO data object.
138 * \param theViewer the viewer for Z layer setting
139 * \param theObject the HYDRO object
140 * \param theZLayerId the Z layer ID
142 void SetZLayer( const OCCViewer_Viewer* theViewer,
143 const Handle(HYDROData_Entity)& theObject,
144 const int theZLayerId );