1 // Copyright (C) 2016-2022 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_
24 #include "WidgetPresentationParameters.hxx"
25 #include "PresentationEvent.hxx"
27 #include <SALOMEconfig.h>
28 #include CORBA_SERVER_HEADER(MEDPresentationManager)
30 class WidgetPresentationParameters;
31 class PresentationController;
34 * The widget helper hierarchy is in charge of setting up the WidgetPresentationParameters
35 * to display the Qt widgets relevant to the underlying presentation on the component side.
37 class MEDWidgetHelper : public QObject
42 virtual ~MEDWidgetHelper();
44 virtual void updateWidget(bool connect);
45 virtual void releaseWidget();
47 ///! Returns the string X in the Python command "Update<X>" or "Get<X>Parameters"
48 virtual std::string getPythonTag() const = 0;
51 void presentationUpdateSignal(const PresentationEvent *);
54 // Only child classes to be instantiated:
55 MEDWidgetHelper(const PresentationController* presController,
56 MEDCALC::MEDPresentationManager_ptr presManager, int presId, const std::string & presName,
57 WidgetPresentationParameters * paramWidget);
58 virtual void loadParametersFromEngine();
61 void onComponentChanged(int idx);
62 void onColorMapChanged(int idx);
63 void onScalarBarRangeChanged(int idx);
64 void onScalarBarVisibilityChanged(int idx);
65 void onUseCustomRangeChanged(int idx);
66 void onCustomRangeValueChanged(double min, double max);
67 void onHideDataOutsideCustomRangeChanged(int idx);
71 ///! GUI needs to talk directly to the pres manager to activate a view, get some params, etc ...:
72 MEDCALC::MEDPresentationManager_ptr _presManager;
73 const PresentationController * _presController ;
75 const std::string _presName;
77 WidgetPresentationParameters* _paramWidget;
79 // Component related members
80 int _selectedCompo; // Selected field component
81 int _nbCompos; // Total number of available components
82 std::vector<std::string> _allCompos; // All available components
83 bool _scalarBarVisibility;
84 double _scalarBarRangeArray[2];
85 bool _hideDataOutsideCustomRange;
88 MEDCALC::ColorMapType _colorMap;
91 MEDCALC::ScalarBarRangeType _scalarBarRange;