1 // Copyright (C) 2014-2015 EDF-R&D
2 // This library is free software; you can redistribute it and/or
3 // modify it under the terms of the GNU Lesser General Public
4 // License as published by the Free Software Foundation; either
5 // version 2.1 of the License, or (at your option) any later version.
7 // This library is distributed in the hope that it will be useful,
8 // but WITHOUT ANY WARRANTY; without even the implied warranty of
9 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
10 // Lesser General Public License for more details.
12 // You should have received a copy of the GNU Lesser General Public
13 // License along with this library; if not, write to the Free Software
14 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
16 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
19 #ifndef HYDROGUI_VTKPRSDISPLAYER_H
20 #define HYDROGUI_VTKPRSDISPLAYER_H
22 #include "HYDROGUI_AbstractDisplayer.h"
23 #include <vtkSmartPointer.h>
24 #include <vtkScalarBarActor.h>
27 class HYDROGUI_VTKPrsDriver;
30 * \class HYDROGUI_VTKPrsDisplayer
31 * \brief Class intended to create, display and update the presentations in VTK viewer.
33 class HYDROGUI_VTKPrsDisplayer : public HYDROGUI_AbstractDisplayer
38 * \param theModule module object
40 HYDROGUI_VTKPrsDisplayer( HYDROGUI_Module* theModule );
45 virtual ~HYDROGUI_VTKPrsDisplayer();
48 * \brief Force the specified objects to be updated.
49 * \param theObjs sequence of objects to update
50 * \param theViewerId viewer identifier
52 void SetToUpdate( const HYDROData_SequenceOfObjects& theObjs,
53 const int theViewerId );
56 * \brief Get the applicable viewer type.
58 virtual QString GetType() const;
61 * \brief Set the range of Z values for the color legend bar.
63 void SetZRange( const int theViewerId, double theRange[] );
66 * \brief Get the range of Z values for the color legend bar.
68 double* GetZRange( const int theViewerId ) const;
71 * \brief Delete scalar bar for the given viewer id.
72 * \param theViewerId viewer identifier
74 void EraseScalarBar( const int theViewerId, const bool theIsDelete = false );
78 virtual void DisplayAll( const int theViewerId,
79 const bool theIsForced,
80 const bool theDoFitAll );
83 * \brief Erase all viewer objects.
84 * \param theViewerId viewer identifier
86 void EraseAll( const int theViewerId );
89 * \brief Erase the specified viewer objects.
90 * \param theObjs sequence of objects to erase
91 * \param theViewerId viewer identifier
93 void Erase( const HYDROData_SequenceOfObjects& theObjs,
94 const int theViewerId );
97 * \brief Display the specified viewer objects.
98 * \param theObjs sequence of objects to display
99 * \param theViewerId viewer identifier
100 * \param theIsForced flag used to update all objects, including the unchanged ones
101 * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default
103 void Display( const HYDROData_SequenceOfObjects& theObjs,
104 const int theViewerId,
105 const bool theIsForced,
106 const bool theDoFitAll );
110 * \brief Purge all invalid objects in the viewer.
111 * \param theViewerId viewer identifier
113 void purgeObjects( const int theViewerId );
118 * \brief Create a new scalar bar for the given view id.
119 * \param theViewId view identifier
121 void createScalarBar( const int theViewId );
124 * \brief Get the presentation driver for the specified data object.
125 * \param theObj data object
127 HYDROGUI_VTKPrsDriver* getDriver( const int theViewId, const Handle(HYDROData_Entity)& theObj );
129 HYDROGUI_VTKPrsDriver* myDriver;
130 HYDROGUI_VTKPrsDriver* myShapeDriver;
132 QMap<int, vtkSmartPointer<vtkScalarBarActor> > myScalarBars; //!< Colors legend presentations