-// 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
-//
+// Copyright (C) 2014-2015 EDF-R&D
// 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
#include "HYDROGUI_ProfileInterpolateDlg.h"
-#include "HYDROGUI_Tool.h"
+#include "HYDROGUI_Tool2.h"
#include "HYDROGUI_Module.h"
#include "HYDROGUI_ObjComboBox.h"
#include "HYDROGUI_OCCSelector.h"
#include <HYDROData_Profile.h>
HYDROGUI_ProfileInterpolateDlg::HYDROGUI_ProfileInterpolateDlg( HYDROGUI_Module* theModule, const QString& theTitle )
- : HYDROGUI_ViewerDlg( theModule, theTitle )
+ : HYDROGUI_ViewerDlg( theModule, theTitle, false )
{
QWidget* main = new QGroupBox( mainFrame() );
QGridLayout* base = new QGridLayout( main );
addWidget( main );
- base->addWidget( new QLabel( tr( "RIVER_OBJECT" ), main ), 0, 0, 1, 1 );
+ base->addWidget( new QLabel( tr( "STREAM_OBJECT" ), main ), 0, 0, 1, 1 );
base->addWidget( myRiver = new HYDROGUI_ObjComboBox( theModule, QString::null, KIND_STREAM, main ), 0, 1, 1, 1 );
base->addWidget( new QLabel( tr( "INTERPOLATOR" ), main ), 1, 0, 1, 1 );
connect( myProfileFinish, SIGNAL( objectSelected( const QString& ) ), this, SIGNAL( profileFinishChanged( const QString& ) ) );
connect( myProfileNumber, SIGNAL( valueChanged( int ) ), this, SIGNAL( profileNumberChanged( int ) ) );
- connect( myParams, SIGNAL( myParams->textChanged( const QString& ) ), this, SIGNAL( interpolatorParametersChanged( const QString& ) ) );
+ connect( myParams, SIGNAL( editingFinished() ), this, SIGNAL( onParametersEditingFinished() ) );
new HYDROGUI_OCCSelector( module(), viewer(), selectionMgr() );
void HYDROGUI_ProfileInterpolateDlg::setRiver( const QString& theName )
{
- myRiver->setSectedObject( theName );
+ myRiver->setSelectedObject( theName );
}
QString HYDROGUI_ProfileInterpolateDlg::profileStart() const
void HYDROGUI_ProfileInterpolateDlg::setProfileStart( const QString& theName )
{
- myProfileStart->setSectedObject( theName );
+ myProfileStart->setSelectedObject( theName );
}
QString HYDROGUI_ProfileInterpolateDlg::profileFinish() const
void HYDROGUI_ProfileInterpolateDlg::setProfileFinish( const QString& theName )
{
- myProfileFinish->setSectedObject( theName );
+ myProfileFinish->setSelectedObject( theName );
}
int HYDROGUI_ProfileInterpolateDlg::profileNumber() const
myRiver->reset();
myProfileStart->reset();
myProfileFinish->reset();
+ myParams->clear();
+ myDescr->clear();
+}
- myDescr->setText( QString::null );
+void HYDROGUI_ProfileInterpolateDlg::onParametersEditingFinished()
+{
+ emit interpolatorParametersChanged( myParams->text() );
}
void HYDROGUI_ProfileInterpolateDlg::onRiverChanged( const QString& theName )
void HYDROGUI_ProfileInterpolateDlg::updateState()
{
- setApplyEnabled( !river().isEmpty() && !profileStart().isEmpty() && !profileFinish().isEmpty() );
+ setApplyEnabled( !river().isEmpty() && !profileStart().isEmpty() && !profileFinish().isEmpty() && profileStart() != profileFinish() );
}
HYDROGUI_ObjComboBox* HYDROGUI_ProfileInterpolateDlg::activeProfile() const