1 // Copyright (C) 2007-2015 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, or (at your option) any later version.
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
24 #ifndef HYDROGUI_DISPLAYER_H
25 #define HYDROGUI_DISPLAYER_H
27 #include "HYDROGUI_AbstractDisplayer.h"
33 class HYDROGUI_PrsDriver;
34 class SUIT_ViewWindow;
35 class vtkWorldPointPicker;
38 * \class HYDROGUI_Displayer
39 * \brief Class intended to create, display and update the presentations in 2D graphics viewer.
41 class HYDROGUI_Displayer : public HYDROGUI_AbstractDisplayer
46 * \param theModule module object
48 HYDROGUI_Displayer( HYDROGUI_Module* theModule );
53 virtual ~HYDROGUI_Displayer();
57 * \brief Force the specified objects to be updated.
58 * \param theObjs sequence of objects to update
59 * \param theViewerId viewer identifier
61 void SetToUpdate( const HYDROData_SequenceOfObjects& theObjs,
62 const int theViewerId );
65 * \brief Get the applicable viewer type.
67 virtual QString GetType() const;
70 * Get the current cursor view position and save it in the displayer
71 * to be used in the obtaining the view coordinates of the cursor.
72 * \param theViewWindow a view window. If a view window is null, an active view is used
73 * only OCC and VTK views are processed
75 void SaveCursorViewPosition( SUIT_ViewWindow* theViewWindow = 0 );
77 * \brief Get the coodinates from the view window, projected on XOY plane
78 * \param theViewWindow a view window
79 * \param theXCoordinate a X coordinate
80 * \param theXCoordinate an Y coordinate
81 * \param theXCoordinate a Z coordinate, has a zero value because of the plane
82 * \return true if the coordinates are got
84 bool GetCursorViewCoordinates( SUIT_ViewWindow* theViewWindow,
85 double& theXCoordinate,
86 double& theYCoordinate,
87 double& theZCoordinate );
90 * \brief Erase all viewer objects.
91 * \param theViewerId viewer identifier
93 void EraseAll( const int theViewerId );
96 * \brief Erase the specified viewer objects.
97 * \param theObjs sequence of objects to erase
98 * \param theViewerId viewer identifier
100 void Erase( const HYDROData_SequenceOfObjects& theObjs,
101 const int theViewerId );
104 * \brief Display the specified viewer objects.
105 * \param theObjs sequence of objects to display
106 * \param theViewerId viewer identifier
107 * \param theIsForced flag used to update all objects, including the unchanged ones
108 * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default
110 void Display( const HYDROData_SequenceOfObjects& theObjs,
111 const int theViewerId,
112 const bool theIsForced,
113 const bool theDoFitAll );
117 * \brief Purge all invalid objects in the viewer.
118 * \param theViewerId viewer identifier
120 void purgeObjects( const int theViewerId );
124 * \brief Get the presentation driver for the specified data object.
125 * \param theObj data object
127 HYDROGUI_PrsDriver* getDriver( const Handle(HYDROData_Entity)& theObj );
130 typedef QMap< ObjectKind, HYDROGUI_PrsDriver* > PrsDriversMap;
131 PrsDriversMap myPrsDriversMap;
132 vtkNew<vtkWorldPointPicker> myPicker;
135 bool myIsPositionSaved;