]> SALOME platform Git repositories - modules/hydro.git/commitdiff
Salome HOME
bug #155: create profile of splines
authorasl <asl@opencascade.com>
Wed, 4 Dec 2013 12:27:04 +0000 (12:27 +0000)
committerasl <asl@opencascade.com>
Wed, 4 Dec 2013 12:27:04 +0000 (12:27 +0000)
src/HYDROCurveCreator/CurveCreator_Profile.cxx
src/HYDROGUI/HYDROGUI_PolylineDlg.h
src/HYDROGUI/HYDROGUI_ProfileDlg.cxx
src/HYDROGUI/HYDROGUI_ProfileDlg.h

index ee0d204bd4f2e3bd02142c6310822bc3454a8f5f..0a13021c493a908647f6316ab731bfea25b3180a 100644 (file)
@@ -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 )
index 866527c12eaf09897f57d2968ad0e9f5f32110c2..cc19c3bfb10a8d1ce45067708b1ae90c21540b00 100755 (executable)
@@ -57,6 +57,7 @@ public:
 protected slots:
   void processStartedSubOperation( QWidget* );
   void processFinishedSubOperation( QWidget* );
+
 signals:
   void                  createPreview( QString );
   void                  selectionChanged();
index 8c691004167402773c43d4c38e485fc3c3be79c7..dc40477a815b38ed5dc367b7248b5965e6fafc0f 100644 (file)
@@ -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<QBoxLayout*>( myAddElementBox->layout() );
+  anAddElementLayout->addWidget( theWidget );
+
+  theWidget->show();
+  myAddElementBox->show();
+}
+
+void HYDROGUI_ProfileDlg::processFinishedSubOperation( QWidget* theWidget )
+{
+  myEditorWidget->setEnabled( true );
+
+  QBoxLayout* anAddElementLayout = dynamic_cast<QBoxLayout*>( myAddElementBox->layout() );
+  anAddElementLayout->removeWidget( theWidget );
+
+  theWidget->hide();
+  myAddElementBox->hide();
+}
index e2f1c5f30a2eee413141537222b126a715b70aa5..96f37e7deb17ddc3dc1eb459cc32bd8795f8768b 100644 (file)
@@ -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;
 };