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;
84 HYDROGUI_Module* module() const {return myModule;}
88 * \brief Update and display all objects in the viewer.
89 * \param theViewerId viewer identifier
90 * \param theIsForced flag used to update all objects, including the unchanged ones
92 virtual void DisplayAll( const int theViewerId,
93 const bool theIsForced,
94 const bool theDoFitAll );
97 * \brief Update the specified viewer objects.
98 * \param theObjs sequence of objects to update
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 virtual void Update( const HYDROData_SequenceOfObjects& theObjs,
104 const int theViewerId,
105 const bool theIsForced,
106 const bool theDoFitAll );
109 * \brief Erase all viewer objects.
110 * \param theViewerId viewer identifier
112 virtual void EraseAll( const int theViewerId ) = 0;
115 * \brief Erase the specified viewer objects.
116 * \param theObjs sequence of objects to erase
117 * \param theViewerId viewer identifier
119 virtual void Erase( const HYDROData_SequenceOfObjects& theObjs,
120 const int theViewerId ) = 0;
123 * \brief Display the specified viewer objects.
124 * \param theObjs sequence of objects to display
125 * \param theViewerId viewer identifier
126 * \param theIsForced flag used to update all objects, including the unchanged ones
127 * \param theDoFitAll flag used to fit the view to all visible objects; do not fit by default
129 virtual void Display( const HYDROData_SequenceOfObjects& theObjs,
130 const int theViewerId,
131 const bool theIsForced,
132 const bool theDoFitAll ) = 0;
136 * \brief Purge all invalid objects in the viewer.
137 * \param theViewerId viewer identifier
139 virtual void purgeObjects( const int theViewerId ) = 0;
141 //HYDROGUI_Module* module() const {return myModule;}
144 HYDROGUI_Module* myModule;