Salome HOME
lot 12 GUI p.1
authorisn <isn@opencascade.com>
Mon, 4 Feb 2019 18:29:42 +0000 (21:29 +0300)
committerisn <isn@opencascade.com>
Tue, 19 Mar 2019 13:20:58 +0000 (16:20 +0300)
src/HYDROGUI/HYDROGUI_ChannelDlg.cxx
src/HYDROGUI/HYDROGUI_ChannelDlg.h

index d2c66807160120a18b793d532e8503823118ab7a..c8fa95f374cdfd8d497a4f75dafbcccae4a57526 100644 (file)
@@ -27,6 +27,7 @@
 #include <QLineEdit>
 #include <QCheckBox>
 #include <QtxDoubleSpinBox.h>
+#include <QRadioButton>
 
 HYDROGUI_ChannelDlg::HYDROGUI_ChannelDlg( HYDROGUI_Module* theModule, const QString& theTitle )
 : HYDROGUI_InputPanel( theModule, theTitle )
@@ -58,20 +59,58 @@ HYDROGUI_ChannelDlg::HYDROGUI_ChannelDlg( HYDROGUI_Module* theModule, const QStr
   myEquiDistance->setValue( 1.0 );
   myEquiDistance->setSingleStep( 1.0 );
 
+  //for digue
+  myLCVal = new QtxDoubleSpinBox( aParamGroup );
+  myLCVal->setRange( 0.0, 999999 );
+  myLCVal->setValue( 50 );
+  myLCVal->setSingleStep( 0.1 );
+
+  myDeltaZVal = new QtxDoubleSpinBox( aParamGroup );
+  myDeltaZVal->setRange( 0.0, 999999 );
+  myDeltaZVal->setValue( 5.0 );
+  myDeltaZVal->setSingleStep( 0.1 );
+
+  myCoteZVal = new QtxDoubleSpinBox( aParamGroup );
+  myCoteZVal->setRange( 0.0, 999999 );
+  myCoteZVal->setValue( 1.0 );
+  myCoteZVal->setSingleStep( 0.1 );
+  //END for digue
+
   myInvertDirection = new QCheckBox(aParamGroup);
   myInvertDirection->setChecked(false);
 
+  myProfileLabel = new QLabel( tr( "CHANNEL_PROFILE" ), aParamGroup);
+
+  myProfileModeButton = new QRadioButton( tr( "VIA_PROFILE" ), myObjectNameGroup );
+  QRadioButton* ProfileModeButton2 = new QRadioButton( tr( "PREDEF" ), myObjectNameGroup );
+
   QGridLayout* aParamsLayout = new QGridLayout( aParamGroup );
   aParamsLayout->setMargin( 5 );
   aParamsLayout->setSpacing( 5 );
   aParamsLayout->addWidget( new QLabel( tr( "CHANNEL_GUIDE_LINE" ), aParamGroup ), 0, 0 );
   aParamsLayout->addWidget( myGuideLines, 0, 1 );
-  aParamsLayout->addWidget( new QLabel( tr( "CHANNEL_PROFILE" ), aParamGroup ), 1, 0 );
-  aParamsLayout->addWidget( myProfiles, 1, 1 );
-  aParamsLayout->addWidget( new QLabel( tr( "EQUI_DISTANCE" ), aParamGroup ), 2, 0 );
-  aParamsLayout->addWidget( myEquiDistance, 2, 1 );
-  aParamsLayout->addWidget( new QLabel( tr( "INVERT_DIRECTION" ), aParamGroup ), 3, 0 );
-  aParamsLayout->addWidget( myInvertDirection, 3, 1 );
+    
+  aParamsLayout->addWidget( myProfileModeButton, 1, 0 );
+  aParamsLayout->addWidget( ProfileModeButton2, 1, 1 );
+
+  aParamsLayout->addWidget( myProfileLabel, 2, 0 );
+  aParamsLayout->addWidget( myProfiles, 2, 1 );
+
+  myLCValLabel = new QLabel( tr( "LC_VALUE" ), aParamGroup);
+  myDeltaZValLabel = new QLabel( tr( "DELTAZ_VALUE" ), aParamGroup);
+  myCoteZValLabel = new QLabel( tr( "COTEZ_VALUE" ), aParamGroup);
+
+  aParamsLayout->addWidget( myLCValLabel, 3, 0 );
+  aParamsLayout->addWidget( myLCVal, 3, 1 );
+  aParamsLayout->addWidget( myDeltaZValLabel, 4, 0 );
+  aParamsLayout->addWidget( myDeltaZVal, 4, 1 );
+  aParamsLayout->addWidget( myCoteZValLabel, 5, 0 );
+  aParamsLayout->addWidget( myCoteZVal, 5, 1 );
+
+  aParamsLayout->addWidget( new QLabel( tr( "EQUI_DISTANCE" ), aParamGroup ), 6, 0 );
+  aParamsLayout->addWidget( myEquiDistance, 6, 1 );
+  aParamsLayout->addWidget( new QLabel( tr( "INVERT_DIRECTION" ), aParamGroup ), 7, 0 );
+  aParamsLayout->addWidget( myInvertDirection, 7, 1 );
 
   // Common
   addWidget( myObjectNameGroup );
@@ -82,6 +121,9 @@ HYDROGUI_ChannelDlg::HYDROGUI_ChannelDlg( HYDROGUI_Module* theModule, const QStr
   // Connect signals and slots
   connect( myGuideLines, SIGNAL( currentIndexChanged( int ) ), this, SLOT( onChannelDefChanged() ) );
   connect( myProfiles, SIGNAL(  currentIndexChanged( int ) ), this, SLOT( onChannelDefChanged() ) );
+  
+  connect( myProfileModeButton, SIGNAL( toggled( bool ) ), this, SLOT( onProfileModeChanged( bool ) ) );
+  myProfileModeButton->setChecked(true);
 }
 
 HYDROGUI_ChannelDlg::~HYDROGUI_ChannelDlg()
@@ -176,6 +218,39 @@ void HYDROGUI_ChannelDlg::onChannelDefChanged()
   emit CreatePreview();
 }
 
+void HYDROGUI_ChannelDlg::onProfileModeChanged(bool mode)
+{
+  if ( signalsBlocked() )
+    return;
+  if (mode)
+  {
+    myProfiles->setVisible(true);
+    myProfileLabel->setVisible(true);
+    myLCValLabel->setVisible(false);
+    myLCVal->setVisible(false);
+    myDeltaZValLabel->setVisible(false);
+    myDeltaZVal->setVisible(false);
+    myCoteZValLabel->setVisible(false);
+    myCoteZVal->setVisible(false);
+  }
+  else
+  {
+    myProfiles->setVisible(false);
+    myProfileLabel->setVisible(false);
+    myLCValLabel->setVisible(true);
+    myLCVal->setVisible(true);
+    myDeltaZValLabel->setVisible(true);
+    myDeltaZVal->setVisible(true);
+    myCoteZValLabel->setVisible(true);
+    myCoteZVal->setVisible(true);
+  }
+}
+
+bool HYDROGUI_ChannelDlg::getProfileMode()
+{
+  return myProfileModeButton->isChecked();
+}
+
 double HYDROGUI_ChannelDlg::getEquiDistance() const
 {
   return myEquiDistance->value();
index 1501dc2fe97149126746f4a4f5c43d6c15547a46..d651c44687ce658df0f63f62af9bda6bce99b140 100644 (file)
@@ -27,6 +27,8 @@ class QGroupBox;
 class QLineEdit;
 class QCheckBox;
 class QtxDoubleSpinBox;
+class QLabel;
+class QRadioButton;
 
 class HYDROGUI_ChannelDlg : public HYDROGUI_InputPanel
 {
@@ -55,12 +57,16 @@ public:
   bool                       getInvertDirection() const;
   void                       setInvertDirection( bool isChecked );
 
+  bool                       getProfileMode();
+
+
 
 signals:
   void                       CreatePreview();
 
 private slots:
   void                       onChannelDefChanged();
+  void                       onProfileModeChanged(bool);
 
 protected:
 
@@ -70,8 +76,19 @@ protected:
   QComboBox*                 myGuideLines;
   QComboBox*                 myProfiles;
 
+  QLabel*                    myProfileLabel;
+  QLabel*                    myLCValLabel;
+  QLabel*                    myDeltaZValLabel;
+  QLabel*                    myCoteZValLabel;
+
   QtxDoubleSpinBox*          myEquiDistance;
   QCheckBox*                 myInvertDirection;
+
+  QtxDoubleSpinBox*          myLCVal;  
+  QtxDoubleSpinBox*          myDeltaZVal;
+  QtxDoubleSpinBox*          myCoteZVal;
+
+  QRadioButton*              myProfileModeButton;
 };
 
 #endif