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_DISPLAYER_H
24 #define HYDROGUI_DISPLAYER_H
26 #include "HYDROGUI_AbstractDisplayer.h"
32 class HYDROGUI_PrsDriver;
33 class SUIT_ViewWindow;
34 class vtkWorldPointPicker;
37 * \class HYDROGUI_Displayer
38 * \brief Class intended to create, display and update the presentations in 2D graphics viewer.
40 class HYDROGUI_Displayer : public HYDROGUI_AbstractDisplayer
45 * \param theModule module object
47 HYDROGUI_Displayer( HYDROGUI_Module* theModule );
52 virtual ~HYDROGUI_Displayer();
56 * \brief Force the specified objects to be updated.
57 * \param theObjs sequence of objects to update
58 * \param theViewerId viewer identifier
60 void SetToUpdate( const HYDROData_SequenceOfObjects& theObjs,
61 const int theViewerId );
64 * \brief Get the applicable viewer type.
66 virtual QString GetType() const;
69 * \brief Get the coodinates from the view window, projected on XOY plane
70 * \param theViewWindow a view window
71 * \param theCursorPos a cursor position point
72 * \param theXCoordinate a X coordinate
73 * \param theXCoordinate an Y coordinate
74 * \param theXCoordinate a Z coordinate, has a zero value because of the plane
75 * \return true if the coordinates are got
77 bool GetCursorViewCoordinates( SUIT_ViewWindow* theViewWindow,
78 const QPoint& theCursorPos,
79 double& theXCoordinate,
80 double& theYCoordinate,
81 double& theZCoordinate );
84 * \brief Erase all viewer objects.
85 * \param theViewerId viewer identifier
87 void EraseAll( const int theViewerId );
90 * \brief Erase the specified viewer objects.
91 * \param theObjs sequence of objects to erase
92 * \param theViewerId viewer identifier
94 void Erase( const HYDROData_SequenceOfObjects& theObjs,
95 const int theViewerId );
98 * \brief Display the specified viewer objects.
99 * \param theObjs sequence of objects to display
100 * \param theViewerId viewer identifier
101 * \param theIsForced flag used to update all objects, including the unchanged ones
102 * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default
104 void Display( const HYDROData_SequenceOfObjects& theObjs,
105 const int theViewerId,
106 const bool theIsForced,
107 const bool theDoFitAll );
111 * \brief Purge all invalid objects in the viewer.
112 * \param theViewerId viewer identifier
114 void purgeObjects( const int theViewerId );
118 * \brief Get the presentation driver for the specified data object.
119 * \param theObj data object
121 HYDROGUI_PrsDriver* getDriver( const Handle(HYDROData_Entity)& theObj );
124 typedef QMap< ObjectKind, HYDROGUI_PrsDriver* > PrsDriversMap;
125 PrsDriversMap myPrsDriversMap;
126 vtkNew<vtkWorldPointPicker> myPicker;