Back to index

salome-paravis  6.5.0
pqTableTo3DPanel.cxx
Go to the documentation of this file.
00001 // Copyright (C) 2010-2012  CEA/DEN, EDF R&D
00002 //
00003 // This library is free software; you can redistribute it and/or
00004 // modify it under the terms of the GNU Lesser General Public
00005 // License as published by the Free Software Foundation; either
00006 // version 2.1 of the License.
00007 //
00008 // This library is distributed in the hope that it will be useful,
00009 // but WITHOUT ANY WARRANTY; without even the implied warranty of
00010 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00011 // Lesser General Public License for more details.
00012 //
00013 // You should have received a copy of the GNU Lesser General Public
00014 // License along with this library; if not, write to the Free Software
00015 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
00016 //
00017 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
00018 //
00019 
00020 #include "pqTableTo3DPanel.h"
00021 
00022 #include <QLineEdit>
00023 #include <QCheckBox>
00024 #include <QComboBox>
00025 
00026 pqTableTo3DPanel::pqTableTo3DPanel(pqProxy* proxy, QWidget* p) :
00027   Superclass(proxy, p)
00028 {
00029   QLineEdit* scaleFactor = this->findChild<QLineEdit*>("ScaleFactor");
00030   QCheckBox* useOptimusScale = this->findChild<QCheckBox*>("UseOptimusScale");
00031   QComboBox* presentationType = this->findChild<QComboBox*>("PresentationType");
00032   QWidget* numberContours = this->findChild<QWidget*>("NumberOfContours");
00033   
00034   if (scaleFactor && useOptimusScale)
00035     {
00036       this->connect(useOptimusScale, SIGNAL(toggled(bool)),
00037                   this, SLOT(onScaleModeChanged(bool)));
00038       onScaleModeChanged(useOptimusScale->isChecked());
00039     }
00040 
00041   if (presentationType && numberContours)
00042     {
00043       this->connect(presentationType, SIGNAL(currentIndexChanged(const QString &)),
00044                   this, SLOT(onPrsTypeChanged(const QString &)));
00045       onPrsTypeChanged(presentationType->currentText());
00046     }
00047 }
00048 
00049 pqTableTo3DPanel::~pqTableTo3DPanel()
00050 {
00051 }
00052 
00053 void pqTableTo3DPanel::onScaleModeChanged(bool checked)
00054 {
00055   QLineEdit* scaleFactor = this->findChild<QLineEdit*>("ScaleFactor");
00056   if (scaleFactor)
00057     {
00058       scaleFactor->setEnabled(!checked);
00059     }
00060 }
00061 
00062 void pqTableTo3DPanel::onPrsTypeChanged(const QString& type)
00063 {
00064   QWidget* numberContours = this->findChild<QWidget*>("NumberOfContours");
00065   if (numberContours)
00066     {
00067       numberContours->setEnabled(type == "Contour");
00068     }
00069 }