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_Poly3DDlg.h"
25 #include "HYDROGUI_ObjSelector.h"
33 HYDROGUI_Poly3DDlg::HYDROGUI_Poly3DDlg( HYDROGUI_Module* theModule, const QString& theTitle )
34 : HYDROGUI_InputPanel( theModule, theTitle ),
38 QGroupBox* aNameGroup = new QGroupBox( tr( "POLYLINE_3D_NAME" ) );
40 QLabel* aNameLabel = new QLabel( tr( "NAME" ), aNameGroup );
41 myName = new QLineEdit( aNameGroup );
43 QGridLayout* aNameLayout = new QGridLayout( aNameGroup );
44 aNameLayout->setMargin( 5 );
45 aNameLayout->setSpacing( 5 );
46 aNameLayout->addWidget( aNameLabel, 0, 0 );
47 aNameLayout->addWidget( myName, 0, 1 );
50 QGroupBox* aParamGroup = new QGroupBox( tr( "PARAMETERS" ) );
52 myProfileLabel = new QLabel( tr( "PROFILE" ), aParamGroup );
53 myProfile = new HYDROGUI_ObjSelector( theModule, KIND_PROFILE, aParamGroup );
55 myPolylineLabel = new QLabel( tr( "POLYLINE" ), aParamGroup );
56 myPolyline = new HYDROGUI_ObjSelector( theModule, KIND_POLYLINEXY, aParamGroup );
58 QGridLayout* aParamLayout = new QGridLayout( aParamGroup );
59 aParamLayout->setMargin( 5 );
60 aParamLayout->setSpacing( 5 );
61 aParamLayout->addWidget( myProfileLabel, 0, 0 );
62 aParamLayout->addWidget( myProfile, 0, 1 );
63 aParamLayout->addWidget( myPolylineLabel, 1, 0 );
64 aParamLayout->addWidget( myPolyline, 1, 1 );
67 addWidget( aNameGroup );
68 addWidget( aParamGroup );
74 HYDROGUI_Poly3DDlg::~HYDROGUI_Poly3DDlg()
78 void HYDROGUI_Poly3DDlg::reset()
85 void HYDROGUI_Poly3DDlg::setMode( const bool theIsEdit )
90 void HYDROGUI_Poly3DDlg::setResultName( const QString& theName )
92 myName->setText( theName );
95 QString HYDROGUI_Poly3DDlg::getResultName() const
97 return myName->text();
100 void HYDROGUI_Poly3DDlg::setSelectedObjects( const QString& theName1,
101 const QString& theName2 )
103 myProfile->SetName( theName1 );
104 myPolyline->SetName( theName2 );
107 bool HYDROGUI_Poly3DDlg::getSelectedObjects( QString& theName1,
108 QString& theName2 ) const
110 theName1 = myProfile->GetName();
111 theName2 = myPolyline->GetName();
112 return !theName1.isEmpty() && !theName2.isEmpty();
115 void HYDROGUI_Poly3DDlg::setPreselectedObject( const QString& theName )
117 myProfile->SetName( theName );
118 myPolyline->SetChecked( true );
119 myPolyline->SetName( QString() );