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_ABSTRACT_DISPLAYER_H
20 #define HYDROGUI_ABSTRACT_DISPLAYER_H
22 #include <HYDROData_Entity.h>
24 class HYDROGUI_Module;
25 class SUIT_ViewManager;
28 * \class HYDROGUI_DataModel
29 * \brief Class intended to create, display and update the presentations.
31 class HYDROGUI_AbstractDisplayer
36 * \param theModule module object
38 HYDROGUI_AbstractDisplayer( HYDROGUI_Module* theModule );
43 virtual ~HYDROGUI_AbstractDisplayer();
47 * \brief Check if this displayer is applicable to the given view manager.
48 * The view manager method getType is used.
49 * \param theViewerId viewer identifier
51 virtual bool IsApplicable( const int theViewerId ) const;
54 * \brief Check if this displayer is applicable to the given view manager.
55 * The view manager method getType is used.
56 * \param theViewMgr the view manager to check
58 virtual bool IsApplicable( const SUIT_ViewManager* theViewMgr ) const;
61 * \brief Update all objects in the viewer.
62 * \param theViewerId viewer identifier
63 * \param theIsInit flag used for initial update
64 * \param theIsForced flag used to update all objects, including the unchanged ones
66 virtual void UpdateAll( const int theViewerId,
68 const bool theIsForced,
69 const bool theDoFitAll );
72 * \brief Force the specified objects to be updated.
73 * \param theObjs sequence of objects to update
74 * \param theViewerId viewer identifier
76 virtual void SetToUpdate( const HYDROData_SequenceOfObjects& theObjs,
77 const int theViewerId ) = 0;
80 * \brief Get the applicable viewer type.
82 virtual QString GetType() const = 0;
86 * \brief Update and display all objects in the viewer.
87 * \param theViewerId viewer identifier
88 * \param theIsForced flag used to update all objects, including the unchanged ones
90 virtual void DisplayAll( const int theViewerId,
91 const bool theIsForced,
92 const bool theDoFitAll );
95 * \brief Update the specified viewer objects.
96 * \param theObjs sequence of objects to update
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 virtual void Update( const HYDROData_SequenceOfObjects& theObjs,
102 const int theViewerId,
103 const bool theIsForced,
104 const bool theDoFitAll );
107 * \brief Erase all viewer objects.
108 * \param theViewerId viewer identifier
110 virtual void EraseAll( const int theViewerId ) = 0;
113 * \brief Erase the specified viewer objects.
114 * \param theObjs sequence of objects to erase
115 * \param theViewerId viewer identifier
117 virtual void Erase( const HYDROData_SequenceOfObjects& theObjs,
118 const int theViewerId ) = 0;
121 * \brief Display the specified viewer objects.
122 * \param theObjs sequence of objects to display
123 * \param theViewerId viewer identifier
124 * \param theIsForced flag used to update all objects, including the unchanged ones
125 * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default
127 virtual void Display( const HYDROData_SequenceOfObjects& theObjs,
128 const int theViewerId,
129 const bool theIsForced,
130 const bool theDoFitAll ) = 0;
134 * \brief Purge all invalid objects in the viewer.
135 * \param theViewerId viewer identifier
137 virtual void purgeObjects( const int theViewerId ) = 0;
139 HYDROGUI_Module* module() const {return myModule;}
142 HYDROGUI_Module* myModule;