1 // Copyright (C) 2016 CEA/DEN, EDF R&D
3 // This library is free software; you can redistribute it and/or
4 // modify it under the terms of the GNU Lesser General Public
5 // License as published by the Free Software Foundation; either
6 // version 2.1 of the License, or (at your option) any later version.
8 // This library is distributed in the hope that it will be useful,
9 // but WITHOUT ANY WARRANTY; without even the implied warranty of
10 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11 // Lesser General Public License for more details.
13 // You should have received a copy of the GNU Lesser General Public
14 // License along with this library; if not, write to the Free Software
15 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
20 #ifndef SRC_MEDCALC_GUI_MEDWIDGETHELPER_HXX_
21 #define SRC_MEDCALC_GUI_MEDWIDGETHELPER_HXX_
23 #include "WidgetPresentationParameters.hxx"
24 #include "PresentationEvent.hxx"
26 #include <SALOMEconfig.h>
27 #include CORBA_SERVER_HEADER(MEDPresentationManager)
29 class WidgetPresentationParameters;
30 class PresentationController;
33 * The widget helper hierarchy is in charge of seting up the WidgetPresentationParameters
34 * to display the Qt widgets relevant to the underlying presentation on the component side.
36 class MEDWidgetHelper : public QObject
41 virtual ~MEDWidgetHelper();
43 virtual void updateWidget(bool connect);
44 virtual void releaseWidget();
46 ///! Returns the string X in the Python command "Update<X>" or "Get<X>Parameters"
47 virtual std::string getPythonTag() const = 0;
50 void presentationUpdateSignal(const PresentationEvent *);
53 // Only child classes to be instantiated:
54 MEDWidgetHelper(const PresentationController* presController,
55 MEDCALC::MEDPresentationManager_ptr presManager, int presId, const std::string & presName,
56 WidgetPresentationParameters * paramWidget);
57 virtual void loadParametersFromEngine();
60 void onComponentChanged(int idx);
61 void onColorMapChanged(int idx);
62 void onScalarBarRangeChanged(int idx);
65 ///! GUI needs to talk directly to the pres manager to activate a view, get some params, etc ...:
66 MEDCALC::MEDPresentationManager_ptr _presManager;
67 const PresentationController * _presController ;
69 const std::string _presName;
71 WidgetPresentationParameters* _paramWidget;
73 // Component related members
74 int _selectedCompo; // Selected field component
75 int _nbCompos; // Total number of available components
76 std::vector<std::string> _allCompos; // All available components
79 MEDCALC::ColorMapType _colorMap;
82 MEDCALC::ScalarBarRangeType _scalarBarRange;