-// Copyright (C) 2007-2013 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2015 CEA/DEN, EDF R&D, OPEN CASCADE
//
// Copyright (C) 2003-2007 OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
// This library is free software; you can redistribute it and/or
// modify it under the terms of the GNU Lesser General Public
// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+// version 2.1 of the License, or (at your option) any later version.
//
// This library is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// Parameters
QGroupBox* aParamGroup = new QGroupBox( tr( "PARAMETERS" ) );
- myProfileLabel = new QLabel( tr( "PROFILE" ), aParamGroup );
- myProfile = new HYDROGUI_ObjSelector( theModule, KIND_PROFILE, aParamGroup );
-
myPolylineLabel = new QLabel( tr( "POLYLINE" ), aParamGroup );
myPolyline = new HYDROGUI_ObjSelector( theModule, KIND_POLYLINEXY, aParamGroup );
+ myProfileLabel = new QLabel( tr( "PROFILE" ), aParamGroup );
+ myProfile = new HYDROGUI_ObjSelector( theModule, KIND_PROFILE, aParamGroup );
+
+ myBathLabel = new QLabel( tr( "BATH" ), aParamGroup );
+ myBath = new HYDROGUI_ObjSelector( theModule, KIND_BATHYMETRY, aParamGroup );
+
QGridLayout* aParamLayout = new QGridLayout( aParamGroup );
aParamLayout->setMargin( 5 );
aParamLayout->setSpacing( 5 );
- aParamLayout->addWidget( myProfileLabel, 0, 0 );
- aParamLayout->addWidget( myProfile, 0, 1 );
- aParamLayout->addWidget( myPolylineLabel, 1, 0 );
- aParamLayout->addWidget( myPolyline, 1, 1 );
+ aParamLayout->addWidget( myPolylineLabel, 0, 0 );
+ aParamLayout->addWidget( myPolyline, 0, 1 );
+ aParamLayout->addWidget( myProfileLabel, 1, 0 );
+ aParamLayout->addWidget( myProfile, 1, 1 );
+ aParamLayout->addWidget( myBathLabel, 2, 0 );
+ aParamLayout->addWidget( myBath, 2, 1 );
// Common
addWidget( aNameGroup );
addStretch();
setMode( myIsEdit );
+
+ connect( myProfile, SIGNAL( selectionChanged() ), this, SLOT( OnSelectionChanged() ) );
+ connect( myBath, SIGNAL( selectionChanged() ), this, SLOT( OnSelectionChanged() ) );
}
HYDROGUI_Poly3DDlg::~HYDROGUI_Poly3DDlg()
return myName->text();
}
-void HYDROGUI_Poly3DDlg::setSelectedObjects( const QString& theName1,
- const QString& theName2 )
+void HYDROGUI_Poly3DDlg::setSelectedObjects( const QString& theNamePoly,
+ const QString& theNameProfile,
+ const QString& theNameBath )
{
- myProfile->SetName( theName1 );
- myPolyline->SetName( theName2 );
+ myPolyline->SetName( theNamePoly );
+ myProfile->SetName( theNameProfile );
+ myBath->SetName( theNameBath );
}
-bool HYDROGUI_Poly3DDlg::getSelectedObjects( QString& theName1,
- QString& theName2 ) const
+bool HYDROGUI_Poly3DDlg::getSelectedObjects( QString& theNamePoly,
+ QString& theNameProfile,
+ QString& theNameBath ) const
{
- theName1 = myProfile->GetName();
- theName2 = myPolyline->GetName();
- return !theName1.isEmpty() && !theName2.isEmpty();
+ theNamePoly = myPolyline->GetName();
+ theNameProfile = myProfile->GetName();
+ theNameBath = myBath->GetName();
+ return !theNamePoly.isEmpty() && ( !theNameProfile.isEmpty() || !theNameBath.isEmpty() );
}
void HYDROGUI_Poly3DDlg::setPreselectedObject( const QString& theName )
myPolyline->SetChecked( true );
myPolyline->SetName( QString() );
}
+
+void HYDROGUI_Poly3DDlg::OnSelectionChanged()
+{
+ if( sender()==myProfile && !myProfile->GetName().isEmpty() )
+ myBath->Clear();
+ if( sender()==myBath && !myBath->GetName().isEmpty() )
+ myProfile->Clear();
+}