X-Git-Url: http://git.salome-platform.org/gitweb/?a=blobdiff_plain;f=src%2FHYDROGUI%2FHYDROGUI_PolylineDlg.cxx;h=52087532823dc23305f6f3f65816ea7b7d54523a;hb=de7cf9bb0a7a41d6487013c87f4a54d0664cd303;hp=384a0ceecd3ed406331ff8b0b0a32deabc33002b;hpb=0b4df27e9f347d6187dbf30bacf80b45c21813d4;p=modules%2Fhydro.git diff --git a/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx b/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx index 384a0cee..52087532 100755 --- a/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_PolylineDlg.cxx @@ -21,28 +21,96 @@ // #include "HYDROGUI_PolylineDlg.h" + +#include "HYDROGUI_Module.h" #include #include +#include +#include +#include +#include HYDROGUI_PolylineDlg::HYDROGUI_PolylineDlg( HYDROGUI_Module* theModule, const QString& theTitle ) -: HYDROGUI_InputPanel( theModule, theTitle ) +: HYDROGUI_InputPanel( theModule, theTitle ), myName(NULL) { - CurveCreator_Curve *aStaticCurve = NULL; + QHBoxLayout* aNameLayout = new QHBoxLayout(); + QLabel* aNameLabel = new QLabel(tr("CURVE_NAME_TLT"), this); + aNameLayout->addWidget(aNameLabel); + myName = new QLineEdit(this); + aNameLayout->addWidget(myName); + + addLayout(aNameLayout); + + myEditorWidget = new CurveCreator_Widget( this, NULL ); + myEditorWidget->setInstantSketchingEnabled( true ); + addWidget( myEditorWidget, 3 ); + + myAddElementBox = new QGroupBox( tr( "ADD_ELEMENT" ), this ); + addWidget( myAddElementBox, 2 ); - aStaticCurve = new CurveCreator_Curve(CurveCreator::Dim3d); + QBoxLayout* anAddElementLayout = new QVBoxLayout( myAddElementBox ); + anAddElementLayout->setMargin( 0 ); + anAddElementLayout->setSpacing( 5 ); - CurveCreator_Widget *aWidget = - new CurveCreator_Widget( this, aStaticCurve); + connect( myEditorWidget, SIGNAL( selectionChanged() ), this, SIGNAL( selectionChanged() ) ); + connect( myEditorWidget, SIGNAL( subOperationStarted(QWidget*) ), this, SLOT( processStartedSubOperation(QWidget*) ) ); + connect( myEditorWidget, SIGNAL( subOperationFinished(QWidget*) ), this, SLOT( processFinishedSubOperation(QWidget*) ) ); - addWidget( aWidget ); - addStretch(); + myAddElementBox->hide(); } HYDROGUI_PolylineDlg::~HYDROGUI_PolylineDlg() { } +void HYDROGUI_PolylineDlg::processStartedSubOperation( QWidget* theWidget ) +{ + myEditorWidget->setEnabled( false ); + + QBoxLayout* anAddElementLayout = dynamic_cast( myAddElementBox->layout() ); + anAddElementLayout->addWidget( theWidget ); + + theWidget->show(); + myAddElementBox->show(); +} + +void HYDROGUI_PolylineDlg::processFinishedSubOperation( QWidget* theWidget ) +{ + myEditorWidget->setEnabled( true ); + + QBoxLayout* anAddElementLayout = dynamic_cast( myAddElementBox->layout() ); + anAddElementLayout->removeWidget( theWidget ); + + theWidget->hide(); + myAddElementBox->hide(); +} + void HYDROGUI_PolylineDlg::reset() { -} \ No newline at end of file +} + +void HYDROGUI_PolylineDlg::setPolylineName( const QString& theName ) +{ + myName->setText(theName); +} + +QString HYDROGUI_PolylineDlg::getPolylineName() const +{ + return myName->text(); +} + +void HYDROGUI_PolylineDlg::setCurve( CurveCreator_Curve* theCurve ) +{ + myEditorWidget->setCurve( theCurve ); +} + +QList HYDROGUI_PolylineDlg::getSelectedSections() +{ + return myEditorWidget->getSelectedSections(); +} + +QList< QPair< int, int > > HYDROGUI_PolylineDlg::getSelectedPoints() +{ + return myEditorWidget->getSelectedPoints(); +}