Salome HOME
eaf8b0234c19123c344682db3f022ac3f001db5f
[modules/paravis.git] / src / Plugins / MEDReader / plugin / ParaViewPlugin / pqMEDReaderTimesFlagsWidget.h
1 // Copyright (C) 2010-2021  CEA/DEN, EDF R&D
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 // Author : Anthony Geay
20
21 #ifndef __pqMEDReaderTimesFlagsWidget_h
22 #define __pqMEDReaderTimesFlagsWidget_h
23
24 #include "pqPropertyWidget.h"
25
26 class VectBoolWidget;
27 class QGridLayout;
28
29 class pqMEDReaderTimesFlagsWidget : public pqPropertyWidget
30 {
31   
32   typedef pqPropertyWidget Superclass;
33   Q_OBJECT
34   // Description
35   // Property Qt used to set/get the times steps with the property link
36   Q_PROPERTY(QList< QList< QVariant> > timeSteps READ getTimeSteps WRITE setTimeSteps)
37   // Description
38   // Property Qt used to set the gorup time steps  domain with the property link
39   Q_PROPERTY(QList< QList< QVariant> > timeStepsDomain READ getTimeSteps WRITE setTimeStepsDomain)
40 public:
41   pqMEDReaderTimesFlagsWidget(
42     vtkSMProxy *smproxy, vtkSMProperty *smproperty, QWidget *parentObject = 0);
43   virtual ~pqMEDReaderTimesFlagsWidget();
44
45 signals:
46   // Description
47   // Signal emited when selected field changed
48   void timeStepsChanged() const;
49
50 protected slots:
51   // Description
52   // Slot called when item is changed
53   virtual void onItemChanged() const;
54
55 protected slots:
56   // Description
57   // bidrectionnal property link setter/getter
58   virtual QList< QList< QVariant> > getTimeSteps() const;
59   virtual void setTimeSteps(QList< QList< QVariant> > timeSteps);
60
61   // Description
62   // Update the domain, eg: reload
63   virtual void setTimeStepsDomain(QList< QList< QVariant> > timeSteps);
64
65
66   // Description
67   // Called when field status changed and reload the time steps
68   void UpdateTimeSteps();
69
70   // Description
71   // Called to create the vect widget, on creation or for a reload
72   void CreateTimesVectWidget();
73
74 protected:
75   // Description
76   // The Vect time widget
77   VectBoolWidget* TimesVectWidget;
78
79   // Description
80   // The grid layout contian the vect times widget
81   QGridLayout* TimesVectLayout;
82
83   // Description
84   // Id of current time step, for caching purpose
85   vtkIdType CachedTsId;
86
87 private:
88   Q_DISABLE_COPY(pqMEDReaderTimesFlagsWidget)
89 };
90
91 #endif