1 // SMESH SMESHGUI : GUI for SMESH component
3 // Copyright (C) 2003 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.opencascade.org/SALOME/ or email : webmaster.salome@opencascade.org
24 // File : SMESHGUI_MoveNodesDlg.cxx
25 // Author : Nicolas REJNERI
29 #include "SMESHGUI_MoveNodesDlg.h"
30 #include <SMESHGUI_SpinBox.h>
32 #include <SUIT_ResourceMgr.h>
34 #include <SMDSAbs_ElementType.hxx>
37 #include <qbuttongroup.h>
38 #include <qradiobutton.h>
41 //=================================================================================
42 // name : SMESHGUI_MoveNodesDlg::SMESHGUI_MoveNodesDlg
44 //=================================================================================
45 SMESHGUI_MoveNodesDlg::SMESHGUI_MoveNodesDlg()
48 setCaption( tr( "CAPTION" ) );
50 QVBoxLayout* main = new QVBoxLayout( mainFrame() );
52 QPixmap iconMoveNode( resMgr()->loadPixmap( "SMESH", tr( "ICON_DLG_MOVE_NODE" ) ) );
54 QButtonGroup* aPixGrp = new QButtonGroup(1, Qt::Vertical, tr("MESH_NODE"), mainFrame() );
55 aPixGrp->setExclusive(TRUE);
56 QRadioButton* aRBut = new QRadioButton(aPixGrp);
57 aRBut->setPixmap(iconMoveNode);
58 aRBut->setChecked(TRUE);
60 main->addWidget( aPixGrp );
62 QGroupBox* anIdGrp = new QGroupBox( 3, Qt::Horizontal, tr( "SMESH_MOVE" ), mainFrame() );
63 createObject( tr( "NODE_ID" ), anIdGrp, 0 );
64 setNameIndication( 0, OneName );
65 setObjectType( 0, prefix( "SMESH element" ) + SMDSAbs_Node, -1 );
67 main->addWidget( anIdGrp );
69 QGroupBox* aCoordGrp = new QGroupBox(1, Qt::Vertical, tr("SMESH_COORDINATES"), mainFrame() );
70 new QLabel(tr("SMESH_X"), aCoordGrp);
71 myX = new SMESHGUI_SpinBox(aCoordGrp);
72 new QLabel(tr("SMESH_Y"), aCoordGrp);
73 myY = new SMESHGUI_SpinBox(aCoordGrp);
74 new QLabel(tr("SMESH_Z"), aCoordGrp);
75 myZ = new SMESHGUI_SpinBox(aCoordGrp);
77 main->addWidget( aCoordGrp );
79 myX->RangeStepAndValidator(-999999.999, +999999.999, 25.0, 3);
80 myY->RangeStepAndValidator(-999999.999, +999999.999, 25.0, 3);
81 myZ->RangeStepAndValidator(-999999.999, +999999.999, 25.0, 3);
83 connect( myX, SIGNAL( valueChanged( double ) ), this, SIGNAL( valueChanged() ) );
84 connect( myY, SIGNAL( valueChanged( double ) ), this, SIGNAL( valueChanged() ) );
85 connect( myZ, SIGNAL( valueChanged( double ) ), this, SIGNAL( valueChanged() ) );
88 //=================================================================================
89 // name : SMESHGUI_MoveNodesDlg::~SMESHGUI_MoveNodesDlg
91 //=================================================================================
92 SMESHGUI_MoveNodesDlg::~SMESHGUI_MoveNodesDlg()
96 //=================================================================================
97 // name : SMESHGUI_MoveNodesDlg::setCoords
99 //=================================================================================
100 void SMESHGUI_MoveNodesDlg::setCoords( const double x, const double y, const double z )
107 //=================================================================================
108 // name : SMESHGUI_MoveNodesDlg::coords
110 //=================================================================================
111 void SMESHGUI_MoveNodesDlg::coords( double& x, double& y, double& z ) const