Salome HOME
Copyright update 2022
[modules/paravis.git] / src / Plugins / MEDReader / plugin / ParaViewPlugin / pqMEDReaderTimeModeWidget.cxx
1 // Copyright (C) 2010-2022  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 #include "ui_MEDReaderTimeModeWidget.h"
22 #include "pqMEDReaderTimeModeWidget.h"
23
24 #include "pqCoreUtilities.h"
25 //-----------------------------------------------------------------------------
26 // Internals
27 class pqMEDReaderTimeModeWidget::pqInternals : public Ui::MEDReaderTimeModeWidget
28 {
29 public:
30   pqInternals(pqMEDReaderTimeModeWidget* self)
31     {
32     this->setupUi(self);
33     }
34 };
35
36 //-----------------------------------------------------------------------------
37 pqMEDReaderTimeModeWidget::pqMEDReaderTimeModeWidget(
38   vtkSMProxy *smproxy, vtkSMProperty *smproperty, QWidget *parentObject)
39 : Superclass(smproxy, parentObject), Internals(new pqMEDReaderTimeModeWidget::pqInternals(this))
40 {
41   this->setShowLabel(false);
42   this->ModeEnabled = false;
43
44   this->addPropertyLink(this, "ModeEnabled" , SIGNAL(modeEnabled(bool)), smproperty);
45   QObject::connect(this->Internals->modeMode, SIGNAL(toggled(bool)),
46                    this, SLOT(setModeEnabled(bool)));
47 }
48
49 //-----------------------------------------------------------------------------
50 pqMEDReaderTimeModeWidget::~pqMEDReaderTimeModeWidget()
51 {
52 }
53
54 //-----------------------------------------------------------------------------
55 bool pqMEDReaderTimeModeWidget::isModeEnabled() const
56 {
57   return this->ModeEnabled;
58 }
59
60 //-----------------------------------------------------------------------------
61 void pqMEDReaderTimeModeWidget::setModeEnabled(bool enable)
62 {
63   this->ModeEnabled = enable;
64   this->Internals->modeMode->setChecked(enable);
65   this->Internals->stdMode->setChecked(!enable);
66   emit modeEnabled(enable);
67 }