Salome HOME
Updated copyright comment
[modules/med.git] / src / MEDCalc / gui / dialogs / WidgetPresentationParameters.hxx
1 // Copyright (C) 2016-2024  CEA, EDF
2 //
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.
7 //
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.
12 //
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
16 //
17 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
18 //
19
20 #ifndef WIDGET_PRESENTATION_PARAMETERS_HXX
21 #define WIDGET_PRESENTATION_PARAMETERS_HXX
22
23 #include "MEDCALCGUIdialogs.hxx"
24
25 #include "ui_WidgetPresentationParameters.h"
26
27 #include <SALOMEconfig.h>
28 #include CORBA_SERVER_HEADER(MEDPresentationManager)
29
30 #include <QObject>
31 #include <vector>
32 #include <string>
33
34 class MEDCALCGUI_DIALOGS_EXPORT WidgetPresentationParameters : public QWidget
35 {
36   Q_OBJECT
37
38 public:
39   WidgetPresentationParameters(QWidget* parent = 0);
40   virtual ~WidgetPresentationParameters() {}
41
42   std::string getComponent() const;
43   void setComponents(std::vector<std::string> compos, int selecIndex);
44
45   MEDCALC::MeshModeType getMeshMode() const;
46   void setMeshMode(MEDCALC::MeshModeType mode);
47
48   MEDCALC::ScalarBarRangeType getScalarBarRange() const;
49   void setScalarBarRange(MEDCALC::ScalarBarRangeType);
50
51   MEDCALC::IntegrationDirType getIntegrationDir() const;
52   void setIntegrationDir(MEDCALC::IntegrationDirType);
53
54   std::string getContourComponent() const;
55   void setContourComponents(std::vector<std::string> compos, int selecIndex);
56
57   bool getScalarBarVisibility() const;
58   void setScalarBarVisibility(const bool);
59
60   bool getHideDataOutsideCustomRange() const;
61   void setHideDataOutsideCustomRange(const bool);
62
63   void getScalarBarRangeValue( double* ) const;
64   void setScalarBarRangeValue(const double, const double);
65
66   double getScaleFactor() { return _ui.spinScaleFactor->value(); }
67   void setScaleFactor(double);
68
69   bool getScaleFactorFlag() { return _ui.checkBoxScaleFactor->isChecked(); }
70   void setScaleFactorFlag(const bool);
71
72   void getNormal( double * ) const;
73   void setNormal(const double, const double, const double);
74
75   void getCutPoint1( double *) const;
76   void setCutPoint1(const double, const double, const double);
77   void getCutPoint2( double *) const;
78   void setCutPoint2(const double, const double, const double);
79
80   void hidePlot3D();
81   void hideContourComponent();
82
83   double getPlanePosition() const;
84   void setPlanePosition( double );
85
86 //  double getScalarBarTimestep() const;
87 //  double getScalarBarMinVal() const;
88 //  double getScalarBarMaxVal() const;
89   MEDCALC::ColorMapType getColorMap() const;
90   void setColorMap(MEDCALC::ColorMapType);
91
92   void setPresName(const std::string& name);
93
94   int getNbContour() const;
95   void setNbContour(int nbContour);
96
97   int getNbSlices() const;
98   void setNbSlices(int nbSlices);
99
100   MEDCALC::SliceOrientationType getSliceOrientation() const;
101   void setSliceOrientation(MEDCALC::SliceOrientationType orient);
102
103   void toggleWidget(bool show);
104   bool isShown() const;
105
106   void toggleCommonFieldWidget(bool show);
107
108   QComboBox* getRangeComboBox() { return _ui.comboBoxScalarBarRange; }
109   double getMixCustomRange() { return _ui.spinCustomRangeMin->value(); }
110   double getMaxCustomRange() { return _ui.spinCustomRangeMax->value(); }
111
112 signals:
113   void comboScalarBarRangeIndexChanged(int);
114   void comboColorMapIndexChanged(int);
115   void comboCompoIndexChanged(int);
116   void comboOrientIndexChanged(int);
117   void comboMeshIndexChanged(int);
118   void comboIntegrDirIndexChanged(int);
119   void comboContCompIndexChanged(int);
120   void spinBoxValueChanged(int);
121   void spinNormalValuesChanged(double, double, double);
122   void spinCutPoint1ValuesChanged(double, double, double);
123   void spinCutPoint2ValuesChanged(double, double, double);
124   void spinPlanePosValueChanged(double);
125   void checkboxScalarBarVisibilityChanged(int);
126   void checkboxCustomRangeChanged(int);
127   void checkboxScaleFactorChanged(int);
128   void spinboxCustomRangeChanged(double, double);
129   void spinboxScaleFactorChaged(double);
130   void checkboxCustomScaleFactorChanged(int);
131   void checkboxHideDataOutsideCustomRangeChanged(int);
132
133
134 private slots:
135   void onComboScalarBarRangeIndexChanged(int);
136   void onComboColorMapIndexChanged(int);
137   void onComboCompoIndexChanged(int);
138   void onComboOrientIndexChanged(int);
139   void onComboMeshIndexChanged(int);
140   void onComboIntegrDirIndexChanged(int);
141   void onComboContCompIndexChanged(int);
142   void onSpinBoxEditingFinished();
143   void onSpinNormalEditingFinished();
144   void onSpinCutPoint1EditingFinished();
145   void onSpinCutPoint2EditingFinished();
146   void onSpinPlanePosEditingFinished();
147   void onCheckboxScalarBarVisibilityChanged(int);
148   void onCheckboxCustomRangeChanged(int);
149   void onCheckboxScaleFactorChanged(int);
150   void onSpinboxCustomRangeChanged();
151   void onSpinboxScaleFactorChanged();
152   void onCheckboxCustomScaleFactorChanged(int);
153   void onCheckboxHideDataOutsideCustomRangeChanged(int);
154 private:
155   Ui_WidgetPresentationParameters _ui; // instancte of the class defined in ui_WidgetPresentationParameters.h
156   bool _blockSig;
157 };
158
159
160 #endif