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;
33 * \class HYDROGUI_OCCDisplayer
34 * \brief Class intended to create, display and update the presentations on OCC viewer.
36 class HYDROGUI_OCCDisplayer : public HYDROGUI_AbstractDisplayer
41 * \param theModule module object
43 HYDROGUI_OCCDisplayer( HYDROGUI_Module* theModule );
48 virtual ~HYDROGUI_OCCDisplayer();
52 * \brief Force the specified objects to be updated.
53 * \param theObjs sequence of objects to update
54 * \param theViewerId viewer identifier
56 void SetToUpdate( const HYDROData_SequenceOfObjects& theObjs,
57 const int theViewerId );
60 * \brief Get the applicable viewer type.
62 virtual QString GetType() const;
65 * \brief Add the top z layer and returns its index.
66 * \param theMgr OCC view manager
68 int AddTopZLayer( OCCViewer_ViewManager* theMgr );
71 * \brief Removes the z layer.
72 * \param theMgr OCC view manager
73 * \param theLayer a layer index
75 void RemoveZLayer( OCCViewer_ViewManager* theMgr,
80 * \brief Erase all viewer objects.
81 * \param theViewerId viewer identifier
83 void EraseAll( const int theViewerId );
86 * \brief Erase the specified viewer objects.
87 * \param theObjs sequence of objects to erase
88 * \param theViewerId viewer identifier
90 void Erase( const HYDROData_SequenceOfObjects& theObjs,
91 const int theViewerId );
94 * \brief Display the specified viewer objects.
95 * \param theObjs sequence of objects to display
96 * \param theViewerId viewer identifier
97 * \param theIsForced flag used to update all objects, including the unchanged ones
98 * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default
100 void Display( const HYDROData_SequenceOfObjects& theObjs,
101 const int theViewerId,
102 const bool theIsForced,
103 const bool theDoFitAll );
107 * \brief Purge all invalid objects in the viewer.
108 * \param theViewerId viewer identifier
110 void purgeObjects( const int theViewerId );
114 * \brief Creates new OCC shape.
115 * \param theViewerId viewer identifier
116 * \param theContext context of OCC viwer
117 * \param theObject data model object
118 * \return pointer to new created shape
120 HYDROGUI_Shape* createShape( const int theViewerId,
121 const Handle(AIS_InteractiveContext)& theContext,
122 const Handle(HYDROData_Entity)& theObject );