Salome HOME
Merge from V5_1_3_BR branch (07/12/09)
[modules/geom.git] / src / BasicGUI / BasicGUI_PointDlg.cxx
index 9b2f525ac58cc383b30df860c32b9763828085e1..972c39dfa514097e5206bc7ca82c66a0b3349f33 100644 (file)
 #include <GEOMImpl_Types.hxx>
 
 #include <QApplication>
+#include <QButtonGroup>
+#include <QHBoxLayout>
 #include <QLabel>
+#include <QRadioButton>
 
 #include <gp_Pnt.hxx>
 #include <TopoDS_Shape.hxx>
 #include <TColStd_IndexedMapOfInteger.hxx>
 #include <TopTools_IndexedMapOfShape.hxx>
 
+#define PARAM_VALUE 0
+#define COORD_VALUE 1
+
+#define GEOM_POINT_XYZ    0
+#define GEOM_POINT_REF    1
+#define GEOM_POINT_EDGE   2
+#define GEOM_POINT_INTINT 3
+#define GEOM_POINT_SURF   4
+
+
 //=================================================================================
 // class    : BasicGUI_PointDlg()
 // purpose  : Constructs a BasicGUI_PointDlg which is a child of 'parent', with the 
@@ -79,6 +92,19 @@ BasicGUI_PointDlg::BasicGUI_PointDlg( GeometryGUI* theGeometryGUI, QWidget* pare
   mainFrame()->RadioButton5->show();
   mainFrame()->RadioButton5->setIcon( image5 );
 
+  QGroupBox* paramGrp = new QGroupBox( centralWidget() );
+  myParamCoord = new QButtonGroup( paramGrp );
+  QHBoxLayout* boxLayout = new QHBoxLayout( paramGrp );
+  boxLayout->setMargin( 0 ); boxLayout->setSpacing( 6 );
+  QRadioButton* btn = new QRadioButton( tr( "GEOM_PARAM_VALUE" ), paramGrp );
+  myParamCoord->addButton( btn, PARAM_VALUE );
+  boxLayout->addWidget( btn );
+  btn = new QRadioButton( tr( "GEOM_COORD_VALUE" ), paramGrp );
+  myParamCoord->addButton( btn, COORD_VALUE );
+  boxLayout->addWidget( btn );
+  myParamCoord->setExclusive( true );
+  myParamCoord->button( PARAM_VALUE )->setChecked( true );
+
   GroupXYZ = new DlgRef_3Spin( centralWidget() );
   GroupXYZ->GroupBox1->setTitle( tr( "GEOM_COORDINATES" ) );
   GroupXYZ->TextLabel1->setText( tr( "GEOM_X" ) );
@@ -86,13 +112,13 @@ BasicGUI_PointDlg::BasicGUI_PointDlg( GeometryGUI* theGeometryGUI, QWidget* pare
   GroupXYZ->TextLabel3->setText( tr( "GEOM_Z" ) );
 
   GroupOnCurve = new DlgRef_1Sel1Spin( centralWidget() );
-  GroupOnCurve->GroupBox1->setTitle( tr( "GEOM_PARAM_POINT" ) );
+  GroupOnCurve->GroupBox1->setTitle( tr( "GEOM_POINT_ON_EDGE" ) );
   GroupOnCurve->TextLabel1->setText( tr( "GEOM_EDGE" ) );
   GroupOnCurve->TextLabel2->setText( tr( "GEOM_PARAMETER" ) );
   GroupOnCurve->PushButton1->setIcon( image2 );
 
   GroupOnSurface = new DlgRef_1Sel2Spin( centralWidget() );
-  GroupOnSurface->GroupBox1->setTitle( tr( "GEOM_PARAM_POINT" ) );
+  GroupOnSurface->GroupBox1->setTitle( tr( "GEOM_POINT_ON_FACE" ) );
   GroupOnSurface->TextLabel1->setText( tr( "GEOM_FACE" ) );
   GroupOnSurface->TextLabel2->setText( tr( "GEOM_UPARAMETER" ) );
   GroupOnSurface->TextLabel3->setText( tr( "GEOM_VPARAMETER" ) );
@@ -114,7 +140,7 @@ BasicGUI_PointDlg::BasicGUI_PointDlg( GeometryGUI* theGeometryGUI, QWidget* pare
   GroupLineIntersection->PushButton2->setIcon( image2 );
   GroupLineIntersection->LineEdit2->setEnabled(false);
 
-  myCoordGrp = new QGroupBox( tr( "GEOM_COORDINATES" ), centralWidget() );
+  myCoordGrp = new QGroupBox( tr( "GEOM_COORDINATES_RES" ), centralWidget() );
   QGridLayout* myCoordGrpLayout = new QGridLayout( myCoordGrp );
   myCoordGrpLayout->addWidget( new QLabel( tr( "GEOM_X" ), myCoordGrp ), 0, 0 );
   myX = new QLineEdit( myCoordGrp );
@@ -128,6 +154,7 @@ BasicGUI_PointDlg::BasicGUI_PointDlg( GeometryGUI* theGeometryGUI, QWidget* pare
 
   QVBoxLayout* layout = new QVBoxLayout( centralWidget() );
   layout->setMargin( 0 ); layout->setSpacing( 6 );
+  layout->addWidget( paramGrp );
   layout->addWidget( GroupXYZ );
   layout->addWidget( GroupOnCurve );
   layout->addWidget( GroupOnSurface );
@@ -221,6 +248,9 @@ void BasicGUI_PointDlg::Init()
 
   connect( this,           SIGNAL( constructorsClicked( int ) ), this, SLOT( ConstructorsClicked( int ) ) );
 
+
+  connect( myParamCoord->button( PARAM_VALUE ), SIGNAL( clicked() ), this, SLOT( ClickParamCoord() ) );
+  connect( myParamCoord->button( COORD_VALUE ), SIGNAL( clicked() ), this, SLOT( ClickParamCoord() ) );
   connect( GroupOnCurve->PushButton1, SIGNAL( clicked() ),       this, SLOT( SetEditCurrentArgument() ) );
   connect( GroupOnCurve->LineEdit1,   SIGNAL( returnPressed() ), this, SLOT( LineEditReturnPressed() ) );
 
@@ -280,7 +310,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
   globalSelection(); // close local contexts, if any
 
   switch ( constructorId ) {
-  case 0:
+  case GEOM_POINT_XYZ:
     {
       localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
       
@@ -291,10 +321,12 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
 
       myCoordGrp->hide();
 
+      myParamCoord->button( PARAM_VALUE )->hide();
+      myParamCoord->button( COORD_VALUE )->hide();
       GroupXYZ->show();
       break;
     }
-  case 1:
+  case GEOM_POINT_REF:
     {
       myEditCurrentArgument = GroupRefPoint->LineEdit1;
       myEditCurrentArgument->setText( "" );
@@ -302,6 +334,8 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
       GroupRefPoint->PushButton1->setDown(true);      
       localSelection( GEOM::GEOM_Object::_nil(), TopAbs_VERTEX );
       
+      myParamCoord->button( PARAM_VALUE )->hide();
+      myParamCoord->button( COORD_VALUE )->hide();
       GroupXYZ->hide();
       GroupOnCurve->hide();
       GroupLineIntersection->hide();
@@ -312,7 +346,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
       myCoordGrp->show();
       break;
     }
-  case 2:
+  case GEOM_POINT_EDGE:
     {
       myEditCurrentArgument = GroupOnCurve->LineEdit1;
       myEditCurrentArgument->setText( "" );
@@ -320,17 +354,19 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
       GroupOnCurve->PushButton1->setDown(true);
       localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
 
-      GroupXYZ->hide();
       GroupRefPoint->hide();
       GroupLineIntersection->hide();
       GroupOnSurface->hide();
 
+      myParamCoord->button( PARAM_VALUE )->show();
+      myParamCoord->button( COORD_VALUE )->show();
       GroupOnCurve->show();
-      
       myCoordGrp->show();
+
+      updateParamCoord( false );
       break;
     }
-  case 3:
+  case GEOM_POINT_INTINT:
     {
       myEditCurrentArgument = GroupLineIntersection->LineEdit1;
       GroupLineIntersection->LineEdit1->setText( "" );
@@ -344,6 +380,8 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
 
       localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
 
+      myParamCoord->button( PARAM_VALUE )->hide();
+      myParamCoord->button( COORD_VALUE )->hide();
       GroupXYZ->hide();
       GroupRefPoint->hide();
       GroupOnCurve->hide();
@@ -354,7 +392,7 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
       GroupLineIntersection->show();
       break;
     }
-  case 4:
+  case GEOM_POINT_SURF:
     {
       myEditCurrentArgument = GroupOnSurface->LineEdit1;
       myEditCurrentArgument->setText( "" );
@@ -362,14 +400,16 @@ void BasicGUI_PointDlg::ConstructorsClicked(int constructorId)
       GroupOnSurface->PushButton1->setDown(true);
       localSelection( GEOM::GEOM_Object::_nil(), TopAbs_FACE );
 
-      GroupXYZ->hide();
       GroupRefPoint->hide();
       GroupOnCurve->hide();
       GroupLineIntersection->hide();
 
+      myParamCoord->button( PARAM_VALUE )->show();
+      myParamCoord->button( COORD_VALUE )->show();
       GroupOnSurface->show();
-
       myCoordGrp->show();
+
+      updateParamCoord( false );
       break;
     }
   }
@@ -420,7 +460,7 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
 {
   const int id = getConstructorId();
 
-  if ( ( id == 1 || id == 2 || id == 4 ) && myEditCurrentArgument != 0 )
+  if ( ( id == GEOM_POINT_REF || id == GEOM_POINT_EDGE || id == GEOM_POINT_SURF ) && myEditCurrentArgument != 0 )
   {
     myEditCurrentArgument->setText( "" );
     myX->setText( "" );
@@ -442,9 +482,9 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
       TopAbs_ShapeEnum aNeedType = TopAbs_VERTEX;
       TopoDS_Shape aShape;
       if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
-        if ( id == 2 || id == 3 )
+        if ( id == GEOM_POINT_EDGE || id == GEOM_POINT_INTINT )
           aNeedType = TopAbs_EDGE;
-        else if ( id == 4 )
+        else if ( id == GEOM_POINT_SURF )
           aNeedType = TopAbs_FACE;
 
         TColStd_IndexedMapOfInteger aMap;
@@ -473,7 +513,7 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
           if ( aShape.ShapeType() != aNeedType ) {
             aSelectedObject = GEOM::GEOM_Object::_nil();
             aName = "";
-            if ( id == 0 ) return;
+            if ( id == GEOM_POINT_XYZ ) return;
           }
         }
       }
@@ -481,21 +521,21 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
       if ( aShape.IsNull() || aShape.ShapeType() != aNeedType)
        return;
 
-      if ( id == 0 ) {
+      if ( id == GEOM_POINT_XYZ ) {
         gp_Pnt aPnt = BRep_Tool::Pnt( TopoDS::Vertex( aShape ) );
         GroupXYZ->SpinBox_DX->setValue( aPnt.X() );
         GroupXYZ->SpinBox_DY->setValue( aPnt.Y() );
         GroupXYZ->SpinBox_DZ->setValue( aPnt.Z() );
       }
-      else if ( id == 1 ) {
+      else if ( id == GEOM_POINT_REF ) {
         myRefPoint = aSelectedObject;
         GroupRefPoint->LineEdit1->setText( aName );
       }
-      else if ( id == 2 ) {
+      else if ( id == GEOM_POINT_EDGE ) {
         myEdge = aSelectedObject;
         GroupOnCurve->LineEdit1->setText( aName );
       }
-      else if ( id == 3 ) {
+      else if ( id == GEOM_POINT_INTINT ) {
        myEditCurrentArgument->setText( aName );
        globalSelection();
        localSelection( GEOM::GEOM_Object::_nil(), TopAbs_EDGE );
@@ -510,7 +550,7 @@ void BasicGUI_PointDlg::SelectionIntoArgument()
            GroupLineIntersection->PushButton1->click();
         }
       }
-      else if ( id == 4 )
+      else if ( id == GEOM_POINT_SURF )
       {
        myFace = aSelectedObject;
        GroupOnSurface->LineEdit1->setText( aName );
@@ -606,7 +646,10 @@ void BasicGUI_PointDlg::enterEvent( QEvent* )
 void BasicGUI_PointDlg::ActivateThisDialog( )
 {
   GEOMBase_Skeleton::ActivateThisDialog();
-  // myGeomGUI->SetState( 0 );
+
+  connect( myGeomGUI->getApp()->selectionMgr(), SIGNAL( currentSelectionChanged() ),
+          this, SLOT( SelectionIntoArgument() ) );
+
   ConstructorsClicked( getConstructorId() );
 }
 
@@ -667,7 +710,7 @@ double BasicGUI_PointDlg::getVParameter() const
 //=================================================================================
 void BasicGUI_PointDlg::OnPointSelected( const gp_Pnt& thePnt )
 {
-  if ( getConstructorId() == 0 ) {
+  if ( getConstructorId() == GEOM_POINT_XYZ ) {
     GroupXYZ->SpinBox_DX->setValue( thePnt.X() );
     GroupXYZ->SpinBox_DY->setValue( thePnt.Y() );
     GroupXYZ->SpinBox_DZ->setValue( thePnt.Z() );
@@ -692,14 +735,14 @@ GEOM::GEOM_IOperations_ptr BasicGUI_PointDlg::createOperation()
 bool BasicGUI_PointDlg::isValid( QString& msg )
 {
   const int id = getConstructorId();
-  if ( id == 0 ) {
+  if ( id == GEOM_POINT_XYZ ) {
     bool ok = true;
     ok = GroupXYZ->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
     ok = GroupXYZ->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
     ok = GroupXYZ->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
     return ok;
   }
-  else if ( id == 1 ) {
+  else if ( id == GEOM_POINT_REF ) {
     bool ok = true;
     ok = GroupRefPoint->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
     ok = GroupRefPoint->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
@@ -707,16 +750,30 @@ bool BasicGUI_PointDlg::isValid( QString& msg )
 
     return !myRefPoint->_is_nil() && ok;
   }
-  else if ( id == 2 ) {
-    bool ok = GroupOnCurve->SpinBox_DX->isValid( msg, !IsPreview() );
+  else if ( id == GEOM_POINT_EDGE ) {
+    bool ok = true;
+    if ( myParamCoord->checkedId() == PARAM_VALUE )
+      ok = GroupOnCurve->SpinBox_DX->isValid( msg, !IsPreview() );
+    else {
+      ok = GroupXYZ->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+      ok = GroupXYZ->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+      ok = GroupXYZ->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
+    }
     return !myEdge->_is_nil() && ok;
   }
-  else if ( id == 3 )
+  else if ( id == GEOM_POINT_INTINT )
     return ( !myLine1->_is_nil() && !myLine2->_is_nil() );
-  else if ( id == 4 ) {
+  else if ( id == GEOM_POINT_SURF ) {
     bool ok = true;
-    ok = GroupOnSurface->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
-    ok = GroupOnSurface->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+    if ( myParamCoord->checkedId() == PARAM_VALUE ) {
+      ok = GroupOnSurface->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+      ok = GroupOnSurface->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+    }
+    else {
+      ok = GroupXYZ->SpinBox_DX->isValid( msg, !IsPreview() ) && ok;
+      ok = GroupXYZ->SpinBox_DY->isValid( msg, !IsPreview() ) && ok;
+      ok = GroupXYZ->SpinBox_DZ->isValid( msg, !IsPreview() ) && ok;
+    }
     return !myFace->_is_nil() && ok;
     
   }
@@ -734,8 +791,10 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
   GEOM::GEOM_Object_var anObj;
   QStringList aParameters;
 
+  GEOM::GEOM_IBasicOperations_var anOper = GEOM::GEOM_IBasicOperations::_narrow( getOperation() );
+
   switch ( getConstructorId() ) {
-  case 0 :
+  case GEOM_POINT_XYZ :
     {
       double x = GroupXYZ->SpinBox_DX->value();
       double y = GroupXYZ->SpinBox_DY->value();
@@ -745,11 +804,11 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
       aParameters << GroupXYZ->SpinBox_DY->text();
       aParameters << GroupXYZ->SpinBox_DZ->text();
       
-      anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->MakePointXYZ( x, y, z );
+      anObj = anOper->MakePointXYZ( x, y, z );
       res = true;
       break;
     }
-  case 1 :
+  case GEOM_POINT_REF :
     {
       double dx = GroupRefPoint->SpinBox_DX->value();
       double dy = GroupRefPoint->SpinBox_DY->value();
@@ -759,41 +818,65 @@ bool BasicGUI_PointDlg::execute( ObjectList& objects )
       aParameters << GroupRefPoint->SpinBox_DY->text();
       aParameters << GroupRefPoint->SpinBox_DZ->text();
       
-      anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
-       MakePointWithReference( myRefPoint, dx, dy, dz );
+      anObj = anOper->MakePointWithReference( myRefPoint, dx, dy, dz );
       res = true;
       break;
     }
-  case 2 :
-    anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
-      MakePointOnCurve( myEdge, getParameter() );
-    aParameters<<GroupOnCurve->SpinBox_DX->text();
-    res = true;
-    break;
-  case 3 :
-    anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
-      MakePointOnLinesIntersection( myLine1, myLine2 );
-    res = true;
-    break;
-  case 4 :
-    anObj = GEOM::GEOM_IBasicOperations::_narrow( getOperation() )->
-      MakePointOnSurface( myFace, getUParameter(), getVParameter() );
-    aParameters<<GroupOnSurface->SpinBox_DX->text();
-    aParameters<<GroupOnSurface->SpinBox_DY->text();
+  case GEOM_POINT_EDGE :
+    {
+      if ( myParamCoord->checkedId() == PARAM_VALUE ) {
+        anObj = anOper->MakePointOnCurve( myEdge, getParameter() );
+        aParameters<<GroupOnCurve->SpinBox_DX->text();
+      } else {
+        double x = GroupXYZ->SpinBox_DX->value();
+        double y = GroupXYZ->SpinBox_DY->value();
+        double z = GroupXYZ->SpinBox_DZ->value();
+        
+        aParameters << GroupXYZ->SpinBox_DX->text();
+        aParameters << GroupXYZ->SpinBox_DY->text();
+        aParameters << GroupXYZ->SpinBox_DZ->text();
+        
+        anObj = anOper->MakePointOnCurveByCoord( myEdge, x, y, z );
+      }
+      res = true;
+      break;
+    }
+  case GEOM_POINT_INTINT :
+    anOper->MakePointOnLinesIntersection( myLine1, myLine2 );
     res = true;
     break;
+  case GEOM_POINT_SURF :
+    {
+      if ( myParamCoord->checkedId() == PARAM_VALUE ) {
+        anObj = anOper->MakePointOnSurface( myFace, getUParameter(), getVParameter() );
+        aParameters<<GroupOnSurface->SpinBox_DX->text();
+        aParameters<<GroupOnSurface->SpinBox_DY->text();
+      } else {
+        double x = GroupXYZ->SpinBox_DX->value();
+        double y = GroupXYZ->SpinBox_DY->value();
+        double z = GroupXYZ->SpinBox_DZ->value();
+        
+        aParameters << GroupXYZ->SpinBox_DX->text();
+        aParameters << GroupXYZ->SpinBox_DY->text();
+        aParameters << GroupXYZ->SpinBox_DZ->text();
+        
+        anObj = anOper->MakePointOnSurfaceByCoord( myFace, x, y, z );
+      }
+      res = true;
+      break;
+    }
   }
   
-  if(!anObj->_is_nil() && !IsPreview() && (getConstructorId()==0 || 
-                                          getConstructorId() == 1 ||
-                                          getConstructorId() == 2 ||
-                                          getConstructorId() == 4) ) {
-    anObj->SetParameters(GeometryGUI::JoinObjectParameters(aParameters));
+  const int id = getConstructorId();
+  if(!anObj->_is_nil() && !IsPreview() && (id ==  GEOM_POINT_XYZ || 
+                                          id == GEOM_POINT_REF ||
+                                          id == GEOM_POINT_EDGE ||
+                                          id == GEOM_POINT_SURF) ) {
+      anObj->SetParameters(aParameters.join(":").toLatin1().constData());
   }
   
 
-  if ( getConstructorId() == 1 || getConstructorId() == 2 ||
-       getConstructorId() == 4 ) {
+  if ( id == GEOM_POINT_REF || id == GEOM_POINT_EDGE || id == GEOM_POINT_SURF ) {
     TopoDS_Shape aShape;
     if ( GEOMBase::GetShape( anObj, aShape ) && !aShape.IsNull() &&
          aShape.ShapeType() == TopAbs_VERTEX ) {
@@ -825,21 +908,58 @@ void BasicGUI_PointDlg::addSubshapesToStudy()
   QMap<QString, GEOM::GEOM_Object_var> objMap;
 
   switch ( getConstructorId() ) {
-  case 0:
+  case GEOM_POINT_XYZ:
     break;
-  case 1:
+  case GEOM_POINT_REF:
     objMap[GroupRefPoint->LineEdit1->text()] = myRefPoint;
     break;
-  case 2:
+  case GEOM_POINT_EDGE:
     objMap[GroupOnCurve->LineEdit1->text()] = myEdge;
     break;
-  case 3:
+  case GEOM_POINT_INTINT:
     objMap[GroupLineIntersection->LineEdit1->text()] = myLine1;
     objMap[GroupLineIntersection->LineEdit2->text()] = myLine2;
     break;
-  case 4:
+  case GEOM_POINT_SURF:
     objMap[GroupOnSurface->LineEdit1->text()] = myFace;
     break;
   }
   addSubshapesToFather( objMap );
 }
+
+//=================================================================================
+// function : ClickParamCoord()
+// purpose  :
+//=================================================================================
+void BasicGUI_PointDlg::ClickParamCoord()
+{
+  updateParamCoord( true );
+  displayPreview();
+}
+
+//=================================================================================
+// function : updateParamCoord
+// purpose  :
+//=================================================================================
+void BasicGUI_PointDlg::updateParamCoord(bool theIsUpdate)
+{
+  bool isParam = myParamCoord->checkedId() == PARAM_VALUE;
+  GroupXYZ->setShown( !isParam );
+  
+  const int id = getConstructorId();
+  if ( id == GEOM_POINT_EDGE ) {
+    GroupOnCurve->TextLabel2->setShown( isParam );
+    GroupOnCurve->SpinBox_DX->setShown( isParam );
+  }
+  else if ( id == GEOM_POINT_SURF ) {
+    GroupOnSurface->TextLabel2->setShown( isParam );
+    GroupOnSurface->TextLabel3->setShown( isParam );
+    GroupOnSurface->SpinBox_DX->setShown( isParam );
+    GroupOnSurface->SpinBox_DY->setShown( isParam );
+  }
+  if ( theIsUpdate ) {
+    qApp->processEvents();
+    updateGeometry();
+    resize( minimumSizeHint() );
+  }
+}