1 // Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
3 // Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
4 // CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
6 // This library is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU Lesser General Public
8 // License as published by the Free Software Foundation; either
9 // version 2.1 of the License.
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 // Lesser General Public License for more details.
16 // You should have received a copy of the GNU Lesser General Public
17 // License along with this library; if not, write to the Free Software
18 // Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
20 // See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
23 #include "HYDROGUI_TranslateObstacleDlg.h"
25 #include <QtxDoubleSpinBox.h>
30 #include <QGridLayout>
34 HYDROGUI_TranslateObstacleDlg::HYDROGUI_TranslateObstacleDlg( HYDROGUI_Module* theModule, const QString& theTitle )
35 : HYDROGUI_InputPanel( theModule, theTitle )
38 QGroupBox* aNameGroup = new QGroupBox( tr( "OBSTACLE_NAME" ), this );
40 QLabel* aNameLabel = new QLabel( tr( "NAME" ), aNameGroup );
41 myName = new QLineEdit( aNameGroup );
42 myName->setEnabled( false );
44 QBoxLayout* aNameLayout = new QHBoxLayout( aNameGroup );
45 aNameLayout->setMargin( 5 );
46 aNameLayout->setSpacing( 5 );
47 aNameLayout->addWidget( aNameLabel );
48 aNameLayout->addWidget( myName );
50 // Translation arguments
51 QGroupBox* anArgGroup = new QGroupBox( tr( "TRANSLATION_ARGUMENTS" ), this );
53 QLabel* aDxLabel = new QLabel( tr( "DX" ), anArgGroup );
54 myDxSpin = new QtxDoubleSpinBox( -1e+15, +1e+15, 10, anArgGroup );
56 QLabel* aDyLabel = new QLabel( tr( "DY" ), anArgGroup );
57 myDySpin = new QtxDoubleSpinBox( -1e+15, +1e+15, 10, anArgGroup );
59 QLabel* aDzLabel = new QLabel( tr( "DZ" ), anArgGroup );
60 myDzSpin = new QtxDoubleSpinBox( -1e+15, +1e+15, 10, anArgGroup );
62 QGridLayout* anArgLayout = new QGridLayout( anArgGroup );
63 anArgLayout->setMargin( 5 );
64 anArgLayout->setSpacing( 5 );
66 anArgLayout->addWidget( aDxLabel, 0, 0 );
67 anArgLayout->addWidget( myDxSpin, 0, 1 );
68 anArgLayout->addWidget( aDyLabel, 1, 0 );
69 anArgLayout->addWidget( myDySpin, 1, 1 );
70 anArgLayout->addWidget( aDzLabel, 2, 0 );
71 anArgLayout->addWidget( myDzSpin, 2, 1 );
74 addWidget( aNameGroup );
75 addWidget( anArgGroup );
78 // Connect signals and slots
79 connect( myDxSpin, SIGNAL( valueChanged( double ) ), this, SIGNAL( argumentsChanged() ) );
80 connect( myDySpin, SIGNAL( valueChanged( double ) ), this, SIGNAL( argumentsChanged() ) );
81 connect( myDzSpin, SIGNAL( valueChanged( double ) ), this, SIGNAL( argumentsChanged() ) );
84 HYDROGUI_TranslateObstacleDlg::~HYDROGUI_TranslateObstacleDlg()
88 void HYDROGUI_TranslateObstacleDlg::reset()
92 myDxSpin->setValue( 0 );
93 myDySpin->setValue( 0 );
94 myDzSpin->setValue( 0 );
97 void HYDROGUI_TranslateObstacleDlg::setName( const QString& theName )
99 myName->setText( theName );
102 double HYDROGUI_TranslateObstacleDlg::getDx() const
104 return myDxSpin->value();
107 double HYDROGUI_TranslateObstacleDlg::getDy() const
109 return myDySpin->value();
112 double HYDROGUI_TranslateObstacleDlg::getDz() const
114 return myDzSpin->value();