From: asl Date: Wed, 4 Dec 2013 12:27:04 +0000 (+0000) Subject: bug #155: create profile of splines X-Git-Tag: BR_hydro_v_0_4~49 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=f8d32cb2595584ebe43d5a664a457500e17e454d;p=modules%2Fhydro.git bug #155: create profile of splines --- diff --git a/src/HYDROCurveCreator/CurveCreator_Profile.cxx b/src/HYDROCurveCreator/CurveCreator_Profile.cxx index ee0d204b..0a13021c 100644 --- a/src/HYDROCurveCreator/CurveCreator_Profile.cxx +++ b/src/HYDROCurveCreator/CurveCreator_Profile.cxx @@ -136,13 +136,13 @@ bool CurveCreator_Profile::setClosed( const int theISection, bool CurveCreator_Profile::setSectionTypeInternal( const int theISection, const CurveCreator::SectionType theType ) { - return false; + return CurveCreator_Curve::setSectionTypeInternal( theISection, theType ); } bool CurveCreator_Profile::setSectionType( const int theISection, const CurveCreator::SectionType theType ) { - return false; + return CurveCreator_Curve::setSectionType( theISection, theType ); } bool CurveCreator_Profile::addPointsInternal( const CurveCreator::SectionsMap &theSectionsMap ) diff --git a/src/HYDROGUI/HYDROGUI_PolylineDlg.h b/src/HYDROGUI/HYDROGUI_PolylineDlg.h index 866527c1..cc19c3bf 100755 --- a/src/HYDROGUI/HYDROGUI_PolylineDlg.h +++ b/src/HYDROGUI/HYDROGUI_PolylineDlg.h @@ -57,6 +57,7 @@ public: protected slots: void processStartedSubOperation( QWidget* ); void processFinishedSubOperation( QWidget* ); + signals: void createPreview( QString ); void selectionChanged(); diff --git a/src/HYDROGUI/HYDROGUI_ProfileDlg.cxx b/src/HYDROGUI/HYDROGUI_ProfileDlg.cxx index 8c691004..dc40477a 100644 --- a/src/HYDROGUI/HYDROGUI_ProfileDlg.cxx +++ b/src/HYDROGUI/HYDROGUI_ProfileDlg.cxx @@ -54,6 +54,14 @@ HYDROGUI_ProfileDlg::HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QStr myEditorWidget = new CurveCreator_Widget( this, NULL ); addWidget( myEditorWidget, 3 ); + myAddElementBox = new QGroupBox( tr( "ADD_ELEMENT" ), this ); + addWidget( myAddElementBox, 2 ); + + QBoxLayout* anAddElementLayout = new QVBoxLayout( myAddElementBox ); + anAddElementLayout->setMargin( 0 ); + anAddElementLayout->setSpacing( 5 ); + + OCCViewer_ViewManager* aViewMgr = new OCCViewer_ViewManager( theModule->getApp()->activeStudy(), 0 ); myViewer = new OCCViewer_Viewer( true ); @@ -82,6 +90,8 @@ HYDROGUI_ProfileDlg::HYDROGUI_ProfileDlg( HYDROGUI_Module* theModule, const QStr 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*) ) ); + + myAddElementBox->hide(); } HYDROGUI_ProfileDlg::~HYDROGUI_ProfileDlg() @@ -138,3 +148,25 @@ bool HYDROGUI_ProfileDlg::deleteEnabled() { return myEditorWidget->removeEnabled(); } + +void HYDROGUI_ProfileDlg::processStartedSubOperation( QWidget* theWidget ) +{ + myEditorWidget->setEnabled( false ); + + QBoxLayout* anAddElementLayout = dynamic_cast( myAddElementBox->layout() ); + anAddElementLayout->addWidget( theWidget ); + + theWidget->show(); + myAddElementBox->show(); +} + +void HYDROGUI_ProfileDlg::processFinishedSubOperation( QWidget* theWidget ) +{ + myEditorWidget->setEnabled( true ); + + QBoxLayout* anAddElementLayout = dynamic_cast( myAddElementBox->layout() ); + anAddElementLayout->removeWidget( theWidget ); + + theWidget->hide(); + myAddElementBox->hide(); +} diff --git a/src/HYDROGUI/HYDROGUI_ProfileDlg.h b/src/HYDROGUI/HYDROGUI_ProfileDlg.h index e2f1c5f3..96f37e7d 100644 --- a/src/HYDROGUI/HYDROGUI_ProfileDlg.h +++ b/src/HYDROGUI/HYDROGUI_ProfileDlg.h @@ -31,6 +31,7 @@ class QLineEdit; class CurveCreator_Widget; class CurveCreator_ICurve; class OCCViewer_Viewer; +class QGroupBox; class HYDROGUI_ProfileDlg : public HYDROGUI_InputPanel { @@ -55,6 +56,10 @@ public: void deleteSelected(); bool deleteEnabled(); +protected slots: + void processStartedSubOperation( QWidget* ); + void processFinishedSubOperation( QWidget* ); + signals: void createPreview( QString ); void selectionChanged(); @@ -64,6 +69,7 @@ signals: private: QLineEdit* myName; CurveCreator_Widget* myEditorWidget; + QGroupBox* myAddElementBox; OCCViewer_Viewer* myViewer; };