Salome HOME
PR: synchro V6_main tag mergeto_V7_main_11Feb13
[modules/geom.git] / src / TransformationGUI / TransformationGUI_MultiRotationDlg.cxx
index f450a2f8c8f5037dbdfc061d1f0d75b2e57a005d..5f22ed33a0b2e7380b75b04af6e290760f3d6688 100644 (file)
@@ -69,34 +69,25 @@ TransformationGUI_MultiRotationDlg::TransformationGUI_MultiRotationDlg
   mainFrame()->RadioButton3->setAttribute(Qt::WA_DeleteOnClose);
   mainFrame()->RadioButton3->close();
 
-  GroupPoints = new DlgRef_2Sel1SpinInt(centralWidget());
-  GroupPoints->GroupBox1->setTitle(tr("GEOM_MULTIROTATION_SIMPLE"));
-  GroupPoints->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
-  GroupPoints->TextLabel2->setText(tr("GEOM_VECTOR"));
-  GroupPoints->TextLabel3->setText(tr("GEOM_NB_TIMES"));
-  GroupPoints->PushButton1->setIcon(image2);
-  GroupPoints->PushButton2->setIcon(image2);
-  GroupPoints->LineEdit1->setReadOnly(true);
-  GroupPoints->LineEdit2->setReadOnly(true);
-
-  GroupDimensions = new DlgRef_2Sel4Spin1Check(centralWidget());
-  GroupDimensions->GroupBox1->setTitle(tr("GEOM_MULTIROTATION_DOUBLE"));
-  GroupDimensions->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
-  GroupDimensions->TextLabel2->setText(tr("GEOM_VECTOR"));
-  GroupDimensions->TextLabel3->setText(tr("GEOM_ANGLE"));
-  GroupDimensions->TextLabel4->setText(tr("GEOM_NB_TIMES"));
-  GroupDimensions->TextLabel5->setText(tr("GEOM_STEP"));
-  GroupDimensions->TextLabel6->setText(tr("GEOM_NB_TIMES"));
-  GroupDimensions->CheckButton1->setText(tr("GEOM_REVERSE"));
-  GroupDimensions->PushButton1->setIcon(image2);
-  GroupDimensions->PushButton2->setIcon(image2);
-  GroupDimensions->LineEdit1->setReadOnly(true);
-  GroupDimensions->LineEdit2->setReadOnly(true);
-
-  QVBoxLayout* layout = new QVBoxLayout(centralWidget());
-  layout->setMargin(0); layout->setSpacing(6);
-  layout->addWidget(GroupPoints);
-  layout->addWidget(GroupDimensions);
+  bool isAngleStep = false;
+
+  GroupArgs = new TransformationGUI_2Sel4Spin1Check (centralWidget());
+  GroupArgs->GroupBox1->setTitle(tr("GEOM_MULTIROTATION_DOUBLE"));
+  GroupArgs->TextLabel1->setText(tr("GEOM_MAIN_OBJECT"));
+  GroupArgs->TextLabel2->setText(tr("GEOM_VECTOR"));
+  //GroupArgs->TextLabel3->setText(tr("GEOM_ANGLE_STEP"));
+  GroupArgs->CheckAngleStep->setText(tr("GEOM_ANGLE_STEP"));
+  GroupArgs->CheckAngleStep->setChecked(isAngleStep);
+  GroupArgs->TextLabel4->setText(tr("GEOM_NB_TIMES"));
+  GroupArgs->TextLabel5->setText(tr("GEOM_STEP_R"));
+  GroupArgs->TextLabel6->setText(tr("GEOM_NB_TIMES"));
+  GroupArgs->CheckButton1->setText(tr("GEOM_REVERSE"));
+  GroupArgs->PushButton1->setIcon(image2);
+  GroupArgs->PushButton2->setIcon(image2);
+  GroupArgs->LineEdit1->setReadOnly(true);
+  GroupArgs->LineEdit2->setReadOnly(true);
+  GroupArgs->SpinBox_DX1->setEnabled(isAngleStep);
+  GroupArgs->CheckButton1->setEnabled(isAngleStep);
   /***************************************************************/
 
   setHelpFileName("multi_rotation_operation_page.html");
@@ -119,38 +110,23 @@ TransformationGUI_MultiRotationDlg::~TransformationGUI_MultiRotationDlg()
 //=================================================================================
 void TransformationGUI_MultiRotationDlg::Init()
 {
+  // init variables
+  myAng = 45.0;
+  myStep = 50.0;
+  myNbTimes1 = myNbTimes2 = 3;
+
   // Get setting of step value from file configuration
   SUIT_ResourceMgr* resMgr = SUIT_Session::session()->resourceMgr();
   double step = resMgr->doubleValue("Geometry", "SettingsGeomStep", 100);
 
   int SpecificStep1 = 5;
   int SpecificStep2 = 1;
-  // init variables
-  myAng = 45.0;
-  myStep = 50.0;
-  myNbTimes1 = myNbTimes2 = 2;
 
   // min, max, step and decimals for spin boxes & initial values
-  initSpinBox(GroupPoints->SpinBox_DX, 1, 999, SpecificStep2);
-  GroupPoints->SpinBox_DX->setValue(myNbTimes1);
-
-  initSpinBox(GroupDimensions->SpinBox_DX1, COORD_MIN, COORD_MAX, SpecificStep1, "angle_precision" );
-  initSpinBox(GroupDimensions->SpinBox_DY1, 1, 999, SpecificStep2);
-  initSpinBox(GroupDimensions->SpinBox_DX2, COORD_MIN, COORD_MAX, step,"length_precision" );
-  initSpinBox(GroupDimensions->SpinBox_DY2, 1, 999, SpecificStep2);
-  GroupDimensions->SpinBox_DX1->setValue(myAng);
-  GroupDimensions->SpinBox_DY1->setValue(myNbTimes1);
-  GroupDimensions->SpinBox_DX2->setValue(myStep);
-  GroupDimensions->SpinBox_DY2->setValue(myNbTimes2);
-
-  GroupPoints->LineEdit1->setText("");
-  GroupPoints->LineEdit2->setText("");
-
-  GroupDimensions->LineEdit1->setText("");
-  GroupDimensions->LineEdit2->setText("");
-
-  myBase.nullify();
-  myVector.nullify();
+  initSpinBox(GroupArgs->SpinBox_DX1, COORD_MIN, COORD_MAX, SpecificStep1, "angle_precision");
+  initSpinBox(GroupArgs->SpinBox_DY1, 1, 999, SpecificStep2);
+  initSpinBox(GroupArgs->SpinBox_DX2, COORD_MIN, COORD_MAX, step, "length_precision");
+  initSpinBox(GroupArgs->SpinBox_DY2, 1, 999, SpecificStep2);
 
   mainFrame()->GroupBoxPublish->show();
 
@@ -158,25 +134,23 @@ void TransformationGUI_MultiRotationDlg::Init()
   connect(buttonOk(),    SIGNAL(clicked()), this, SLOT(ClickOnOk()));
   connect(buttonApply(), SIGNAL(clicked()), this, SLOT(ClickOnApply()));
 
-  connect(this,          SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
+  connect(this, SIGNAL(constructorsClicked(int)), this, SLOT(ConstructorsClicked(int)));
 
-  connect(GroupPoints->PushButton1,     SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-  connect(GroupPoints->PushButton2,     SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-  connect(GroupDimensions->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
-  connect(GroupDimensions->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+  connect(GroupArgs->PushButton1, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
+  connect(GroupArgs->PushButton2, SIGNAL(clicked()), this, SLOT(SetEditCurrentArgument()));
 
-  connect(GroupPoints->SpinBox_DX,      SIGNAL(valueChanged(int)),    this, SLOT(ValueChangedInSpinBox(int)));
-  connect(GroupDimensions->SpinBox_DX1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
-  connect(GroupDimensions->SpinBox_DY1, SIGNAL(valueChanged(int)),    this, SLOT(ValueChangedInSpinBox(int)));
-  connect(GroupDimensions->SpinBox_DX2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
-  connect(GroupDimensions->SpinBox_DY2, SIGNAL(valueChanged(int)),    this, SLOT(ValueChangedInSpinBox(int)));
+  connect(GroupArgs->SpinBox_DX1, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+  connect(GroupArgs->SpinBox_DY1, SIGNAL(valueChanged(int)),    this, SLOT(ValueChangedInSpinBox(int)));
+  connect(GroupArgs->SpinBox_DX2, SIGNAL(valueChanged(double)), this, SLOT(ValueChangedInSpinBox(double)));
+  connect(GroupArgs->SpinBox_DY2, SIGNAL(valueChanged(int)),    this, SLOT(ValueChangedInSpinBox(int)));
 
-  connect(GroupDimensions->SpinBox_DX1,SIGNAL(textChanged( const QString& )),
-          this, SLOT(TextValueChangedInSpinBox( const QString& )));
+  connect(GroupArgs->SpinBox_DX1, SIGNAL(textChanged(const QString&)),
+          this, SLOT(TextValueChangedInSpinBox(const QString&)));
 
   connect(myGeomGUI, SIGNAL(SignalDefaultStepValueChanged(double)), this, SLOT(SetDoubleSpinBoxStep(double)));
 
-  connect(GroupDimensions->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseAngle()));
+  connect(GroupArgs->CheckAngleStep, SIGNAL(toggled(bool)), this, SLOT(CheckAngleStep(bool)));
+  connect(GroupArgs->CheckButton1, SIGNAL(toggled(bool)), this, SLOT(ReverseAngle()));
 
   initName(tr("GEOM_MULTIROTATION"));
 
@@ -189,13 +163,7 @@ void TransformationGUI_MultiRotationDlg::Init()
 //=================================================================================
 void TransformationGUI_MultiRotationDlg::SetDoubleSpinBoxStep (double step)
 {
-  GroupDimensions->SpinBox_DX2->setSingleStep(step);
-
-  // san: Commented so as not to override specific step settings
-  //GroupPoints->SpinBox_DX->setSingleStep((int)step);
-  //GroupDimensions->SpinBox_DX1->setSingleStep(step);
-  //GroupDimensions->SpinBox_DY1->setSingleStep((int)step);
-  //GroupDimensions->SpinBox_DY2->setSingleStep((int)step);
+  GroupArgs->SpinBox_DX2->setSingleStep(step);
 }
 
 //=================================================================================
@@ -206,42 +174,42 @@ void TransformationGUI_MultiRotationDlg::ConstructorsClicked (int constructorId)
 {
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
 
-  switch (constructorId) {
-  case 0: // Rotate simple
-    {
-      GroupDimensions->hide();
-      GroupPoints->show();
+  myBase.nullify();
+  myVector.nullify();
 
-      GroupPoints->LineEdit1->setText("");
-      GroupPoints->LineEdit2->setText("");
-      myBase.nullify();
-      myVector.nullify();
+  GroupArgs->LineEdit1->setText("");
+  GroupArgs->LineEdit2->setText("");
 
-      GroupPoints->SpinBox_DX->setValue(myNbTimes1);
+  GroupArgs->SpinBox_DX1->setValue(myAng);
+  GroupArgs->SpinBox_DY1->setValue(myNbTimes1);
+  GroupArgs->SpinBox_DX2->setValue(myStep);
+  GroupArgs->SpinBox_DY2->setValue(myNbTimes2);
 
-      GroupPoints->PushButton1->click();
+  switch (constructorId) {
+  case 0: // Rotate simple
+    {
+      GroupArgs->GroupBox1->setTitle(tr("GEOM_MULTIROTATION_SIMPLE"));
+      GroupArgs->TextLabel5->hide();
+      GroupArgs->TextLabel6->hide();
+      GroupArgs->SpinBox_DX2->hide();
+      GroupArgs->SpinBox_DY2->hide();
+      GroupArgs->CheckButton1->hide();
     }
     break;
   case 1: // Rotate double
     {
-      GroupPoints->hide();
-      GroupDimensions->show();
-
-      GroupDimensions->LineEdit1->setText("");
-      GroupDimensions->LineEdit2->setText("");
-      myBase.nullify();
-      myVector.nullify();
-
-      GroupDimensions->SpinBox_DX1->setValue(myAng);
-      GroupDimensions->SpinBox_DY1->setValue(myNbTimes1);
-      GroupDimensions->SpinBox_DX2->setValue(myStep);
-      GroupDimensions->SpinBox_DY2->setValue(myNbTimes2);
-
-      GroupDimensions->PushButton1->click();
+      GroupArgs->GroupBox1->setTitle(tr("GEOM_MULTIROTATION_DOUBLE"));
+      GroupArgs->TextLabel5->show();
+      GroupArgs->TextLabel6->show();
+      GroupArgs->SpinBox_DX2->show();
+      GroupArgs->SpinBox_DY2->show();
+      GroupArgs->CheckButton1->show();
     }
     break;
   }
 
+  GroupArgs->PushButton1->click();
+
   qApp->processEvents();
   updateGeometry();
   resize(minimumSizeHint());
@@ -289,33 +257,39 @@ void TransformationGUI_MultiRotationDlg::SelectionIntoArgument()
 {
   erasePreview();
 
-  TopAbs_ShapeEnum aNeedType = ( myEditCurrentArgument == GroupPoints->LineEdit2 ||
-                                myEditCurrentArgument == GroupDimensions->LineEdit2 ) ?
+  TopAbs_ShapeEnum aNeedType = ( myEditCurrentArgument == GroupArgs->LineEdit2 ) ?
     TopAbs_EDGE : TopAbs_SHAPE;
   GEOM::GeomObjPtr aSelectedObject = getSelected( aNeedType );
   TopoDS_Shape aShape;
   if ( aSelectedObject && GEOMBase::GetShape( aSelectedObject.get(), aShape ) && !aShape.IsNull() ) {
     QString aName = GEOMBase::GetName( aSelectedObject.get() );
     myEditCurrentArgument->setText( aName );
-    if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
-      myBase = aSelectedObject;
-      if ( !myVector )
-       GroupPoints->PushButton2->click();
-    }
-    else if ( myEditCurrentArgument == GroupPoints->LineEdit2)  {
-      myVector = aSelectedObject;
-      if ( !myBase )
-       GroupPoints->PushButton1->click();
-    }
-    else if ( myEditCurrentArgument == GroupDimensions->LineEdit1 ) {
+    if ( myEditCurrentArgument == GroupArgs->LineEdit1 ) {
       myBase = aSelectedObject;
+
+      // recompute myAng and myStep (Mantis issue 0021718)
+      GEOM::GEOM_IMeasureOperations_var anOper = getGeomEngine()->GetIMeasureOperations(getStudyId());
+      double Xmin, Xmax, Ymin, Ymax, Zmin, Zmax;
+      anOper->GetBoundingBox(myBase.get(), Xmin, Xmax, Ymin, Ymax, Zmin, Zmax);
+      if (anOper->IsDone()) {
+        // angular step
+        double diag = sqrt((Xmax-Xmin)*(Xmax-Xmin) + (Ymax-Ymin)*(Ymax-Ymin));
+        double d = sqrt((0.5*(Xmax+Xmin))*(0.5*(Xmax+Xmin)) + (0.5*(Ymax+Ymin))*(0.5*(Ymax+Ymin)));
+        myAng = floor(2.0 * atan(diag/d) * 180.0 / M_PI);
+        GroupArgs->SpinBox_DX1->setValue(myAng);
+
+        // radial step
+        myStep = Max(floor(1.5*(Xmax-Xmin)), floor(1.5*(Ymax-Ymin)));
+        GroupArgs->SpinBox_DX2->setValue(myStep);
+      }
+
       if ( !myVector )
-       GroupDimensions->PushButton2->click();
+       GroupArgs->PushButton2->click();
     }
-    else if ( myEditCurrentArgument == GroupDimensions->LineEdit2 ) {
+    else if ( myEditCurrentArgument == GroupArgs->LineEdit2 ) {
       myVector = aSelectedObject;
       if ( !myBase )
-       GroupDimensions->PushButton1->click();
+       GroupArgs->PushButton1->click();
     }
     
     // clear selection
@@ -325,11 +299,9 @@ void TransformationGUI_MultiRotationDlg::SelectionIntoArgument()
            this, SLOT(SelectionIntoArgument()));
   }
   else {
-    if ( myEditCurrentArgument == GroupPoints->LineEdit1 ||
-        myEditCurrentArgument == GroupDimensions->LineEdit1 )
+    if ( myEditCurrentArgument == GroupArgs->LineEdit1 )
       myBase.nullify();
-    else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ||
-             myEditCurrentArgument == GroupDimensions->LineEdit2 )
+    else if ( myEditCurrentArgument == GroupArgs->LineEdit2 )
       myVector.nullify();
     myEditCurrentArgument->setText("");
   }
@@ -348,33 +320,19 @@ void TransformationGUI_MultiRotationDlg::SetEditCurrentArgument()
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
   globalSelection(GEOM_ALLSHAPES);
 
-  if (send == GroupPoints->PushButton1) {
-    myEditCurrentArgument = GroupPoints->LineEdit1;
-
-    GroupPoints->PushButton2->setDown(false);
-    GroupPoints->LineEdit2->setEnabled(false);
-  }
-  else if (send == GroupPoints->PushButton2) {
-    myEditCurrentArgument = GroupPoints->LineEdit2;
-
-    localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
-
-    GroupPoints->PushButton1->setDown(false);
-    GroupPoints->LineEdit1->setEnabled(false);
-  }
-  else if (send == GroupDimensions->PushButton1) {
-    myEditCurrentArgument = GroupDimensions->LineEdit1;
+  if (send == GroupArgs->PushButton1) {
+    myEditCurrentArgument = GroupArgs->LineEdit1;
 
-    GroupDimensions->PushButton2->setDown(false);
-    GroupDimensions->LineEdit2->setEnabled(false);
+    GroupArgs->PushButton2->setDown(false);
+    GroupArgs->LineEdit2->setEnabled(false);
   }
-  else if (send == GroupDimensions->PushButton2) {
-    myEditCurrentArgument = GroupDimensions->LineEdit2;
+  else if (send == GroupArgs->PushButton2) {
+    myEditCurrentArgument = GroupArgs->LineEdit2;
 
     localSelection(GEOM::GEOM_Object::_nil(), TopAbs_EDGE);
 
-    GroupDimensions->PushButton1->setDown(false);
-    GroupDimensions->LineEdit1->setEnabled(false);
+    GroupArgs->PushButton1->setDown(false);
+    GroupArgs->LineEdit1->setEnabled(false);
   }
   connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
           this, SLOT(SelectionIntoArgument()));
@@ -416,12 +374,13 @@ void TransformationGUI_MultiRotationDlg::enterEvent (QEvent*)
 // function : TextValueChangedInSpinBox()
 // purpose  :
 //=================================================================================
-void TransformationGUI_MultiRotationDlg::TextValueChangedInSpinBox(const QString& s){
+void TransformationGUI_MultiRotationDlg::TextValueChangedInSpinBox (const QString& s)
+{
   bool isDigit;
   s.toDouble(&isDigit);
-  if(!isDigit)
-    GroupDimensions->CheckButton1->setChecked(false);
-  GroupDimensions->CheckButton1->setEnabled(isDigit);
+  if (!isDigit)
+    GroupArgs->CheckButton1->setChecked(false);
+  GroupArgs->CheckButton1->setEnabled(isDigit);
 }
 
 //=================================================================================
@@ -432,9 +391,9 @@ void TransformationGUI_MultiRotationDlg::ValueChangedInSpinBox (double newValue)
 {
   QObject* send = (QObject*)sender();
 
-  if (send == GroupDimensions->SpinBox_DX1)
+  if (send == GroupArgs->SpinBox_DX1)
     myAng = newValue;
-  else if (send == GroupDimensions->SpinBox_DX2)
+  else if (send == GroupArgs->SpinBox_DX2)
     myStep = newValue;
 
   processPreview();
@@ -448,9 +407,9 @@ void TransformationGUI_MultiRotationDlg::ValueChangedInSpinBox (int newValue)
 {
   QObject* send = (QObject*)sender();
 
-  if (send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DY1)
+  if (send == GroupArgs->SpinBox_DY1)
     myNbTimes1 = newValue;
-  else if (send == GroupDimensions->SpinBox_DY2)
+  else if (send == GroupArgs->SpinBox_DY2)
     myNbTimes2 = newValue;
 
   processPreview();
@@ -458,7 +417,7 @@ void TransformationGUI_MultiRotationDlg::ValueChangedInSpinBox (int newValue)
 
 //=================================================================================
 // function : ReverseAngle()
-// purpose  : 'state' not used here
+// purpose  :
 //=================================================================================
 void TransformationGUI_MultiRotationDlg::ReverseAngle()
 {
@@ -467,11 +426,22 @@ void TransformationGUI_MultiRotationDlg::ReverseAngle()
   int aConstructorId = getConstructorId();
 
   if (aConstructorId == 1)
-    GroupDimensions->SpinBox_DX1->setValue(myAng);
+    GroupArgs->SpinBox_DX1->setValue(myAng);
 
   processPreview();
 }
 
+//=================================================================================
+// function : CheckAngleStep()
+// purpose  :
+//=================================================================================
+void TransformationGUI_MultiRotationDlg::CheckAngleStep (bool isOn)
+{
+  GroupArgs->SpinBox_DX1->setEnabled(isOn);
+  GroupArgs->CheckButton1->setEnabled(isOn);
+  processPreview();
+}
+
 //=================================================================================
 // function : createOperation
 // purpose  :
@@ -488,16 +458,20 @@ GEOM::GEOM_IOperations_ptr TransformationGUI_MultiRotationDlg::createOperation()
 bool TransformationGUI_MultiRotationDlg::isValid (QString& msg)
 {
   bool ok = false;
-  switch(getConstructorId()){
+  switch (getConstructorId()) {
   case 0:
-    ok = GroupPoints->SpinBox_DX->isValid( msg, !IsPreview() ) &&  myBase && myVector;
+    ok = (GroupArgs->SpinBox_DX1->isValid( msg, !IsPreview() ) &&
+          GroupArgs->SpinBox_DY1->isValid( msg, !IsPreview() ) &&
+          //myBase && myVector); // myVector = DZ by default
+          myBase);
     break;
   case 1:
-    ok = GroupDimensions->SpinBox_DX1->isValid( msg, !IsPreview() ) &&
-         GroupDimensions->SpinBox_DY1->isValid( msg, !IsPreview() ) &&
-         GroupDimensions->SpinBox_DX2->isValid( msg, !IsPreview() ) &&
-         GroupDimensions->SpinBox_DY2->isValid( msg, !IsPreview() ) &&
-         myBase && myVector;
+    ok = (GroupArgs->SpinBox_DX1->isValid( msg, !IsPreview() ) &&
+          GroupArgs->SpinBox_DY1->isValid( msg, !IsPreview() ) &&
+          GroupArgs->SpinBox_DX2->isValid( msg, !IsPreview() ) &&
+          GroupArgs->SpinBox_DY2->isValid( msg, !IsPreview() ) &&
+          //myBase && myVector); // myVector = DZ by default
+          myBase);
     break;
   default:
     break;
@@ -520,29 +494,38 @@ bool TransformationGUI_MultiRotationDlg::execute (ObjectList& objects)
 
   switch (getConstructorId()) {
   case 0:
-    if ( myBase && myVector ) {
+    if (GroupArgs->CheckAngleStep->isChecked())
+      anObj = anOper->MultiRotate1DByStep(myBase.get(), myVector.get(), myAng * M_PI / 180., myNbTimes1);
+    else
       anObj = anOper->MultiRotate1D(myBase.get(), myVector.get(), myNbTimes1);
-      if(!IsPreview())
-        aParameters<<GroupPoints->SpinBox_DX->text();
-      res = true;
+
+    if (!IsPreview()) {
+      if (GroupArgs->CheckAngleStep->isChecked())
+        aParameters << GroupArgs->SpinBox_DX1->text();
+      aParameters << GroupArgs->SpinBox_DY1->text();
     }
+    res = true;
     break;
   case 1:
-    if ( myBase && myVector ) {
-      anObj = anOper->MultiRotate2D(myBase.get(), myVector.get(), myAng, myNbTimes1, myStep, myNbTimes2);
-      if(!IsPreview()) {
-        aParameters<<GroupDimensions->SpinBox_DX1->text();
-        aParameters<<GroupDimensions->SpinBox_DY1->text();
-        aParameters<<GroupDimensions->SpinBox_DX2->text();
-        aParameters<<GroupDimensions->SpinBox_DY2->text();
-      }
-      res = true;
+    if (GroupArgs->CheckAngleStep->isChecked())
+      anObj = anOper->MultiRotate2DByStep(myBase.get(), myVector.get(), myAng * M_PI / 180., myNbTimes1,
+                                          myStep, myNbTimes2);
+    else
+      anObj = anOper->MultiRotate2DNbTimes(myBase.get(), myVector.get(), myNbTimes1, myStep, myNbTimes2);
+
+    if (!IsPreview()) {
+      if (GroupArgs->CheckAngleStep->isChecked())
+        aParameters << GroupArgs->SpinBox_DX1->text();
+      aParameters << GroupArgs->SpinBox_DY1->text();
+      aParameters << GroupArgs->SpinBox_DX2->text();
+      aParameters << GroupArgs->SpinBox_DY2->text();
     }
+    res = true;
     break;
   }
 
   if (!anObj->_is_nil()) {
-    if(!IsPreview())
+    if (!IsPreview())
       anObj->SetParameters(aParameters.join(":").toLatin1().constData());
     objects.push_back(anObj._retn());
   }
@@ -586,3 +569,82 @@ void TransformationGUI_MultiRotationDlg::restoreSubShapes (SALOMEDS::Study_ptr
                                         mainFrame()->CheckBoxAddPrefix->isChecked());
   }
 }
+
+//=================================================================================
+// function : TransformationGUI_2Sel4Spin1Check
+// purpose  :
+//=================================================================================
+TransformationGUI_2Sel4Spin1Check::TransformationGUI_2Sel4Spin1Check (QWidget *parent)
+{
+  gridLayout = new QGridLayout (parent);
+  gridLayout->setSpacing(6);
+  gridLayout->setContentsMargins(11, 11, 11, 11);
+  gridLayout->setHorizontalSpacing(0);
+  gridLayout->setVerticalSpacing(0);
+  gridLayout->setContentsMargins(0, 0, 0, 0);
+
+  GroupBox1 = new QGroupBox (parent);
+
+  gridLayout1 = new QGridLayout (GroupBox1);
+  gridLayout1->setSpacing(6);
+  gridLayout1->setContentsMargins(11, 11, 11, 11);
+  gridLayout1->setHorizontalSpacing(6);
+  gridLayout1->setVerticalSpacing(6);
+  gridLayout1->setContentsMargins(9, 9, 9, 9);
+
+  // 2Sel
+  TextLabel1 = new QLabel(GroupBox1);
+  TextLabel2 = new QLabel(GroupBox1);
+
+  PushButton1 = new QPushButton (GroupBox1);
+  PushButton2 = new QPushButton (GroupBox1);
+
+  LineEdit2 = new QLineEdit(GroupBox1);
+  LineEdit1 = new QLineEdit(GroupBox1);
+
+  gridLayout1->addWidget(TextLabel1, 0, 0, 1, 1);
+  gridLayout1->addWidget(TextLabel2, 1, 0, 1, 1);
+  gridLayout1->addWidget(PushButton1, 0, 1, 1, 1);
+  gridLayout1->addWidget(PushButton2, 1, 1, 1, 1);
+  gridLayout1->addWidget(LineEdit1, 0, 2, 1, 1);
+  gridLayout1->addWidget(LineEdit2, 1, 2, 1, 1);
+
+  // 4Spin (double-int-double-int)
+  //TextLabel3 = new QLabel (GroupBox1);
+  CheckAngleStep = new QCheckBox (GroupBox1);
+  TextLabel4 = new QLabel (GroupBox1);
+  TextLabel5 = new QLabel (GroupBox1);
+  TextLabel6 = new QLabel (GroupBox1);
+
+  SpinBox_DX1 = new SalomeApp_DoubleSpinBox (GroupBox1);
+  SpinBox_DY1 = new SalomeApp_IntSpinBox (GroupBox1);
+  SpinBox_DX2 = new SalomeApp_DoubleSpinBox (GroupBox1);
+  SpinBox_DY2 = new SalomeApp_IntSpinBox (GroupBox1);
+
+  //gridLayout1->addWidget(TextLabel3, 2, 0, 1, 1);
+  gridLayout1->addWidget(CheckAngleStep, 2, 0, 1, 1);
+  gridLayout1->addWidget(TextLabel4, 3, 0, 1, 1);
+  gridLayout1->addWidget(TextLabel5, 5, 0, 1, 1);
+  gridLayout1->addWidget(TextLabel6, 6, 0, 1, 1);
+
+  gridLayout1->addWidget(SpinBox_DX1, 2, 1, 1, 2);
+  gridLayout1->addWidget(SpinBox_DY1, 3, 1, 1, 2);
+  gridLayout1->addWidget(SpinBox_DX2, 5, 1, 1, 2);
+  gridLayout1->addWidget(SpinBox_DY2, 6, 1, 1, 2);
+
+  // 1Check
+  CheckButton1 = new QCheckBox (GroupBox1);
+
+  gridLayout1->addWidget(CheckButton1, 4, 0, 1, 3);
+
+  gridLayout->addWidget(GroupBox1, 0, 0, 1, 1);
+}
+
+//=================================================================================
+// function : ~TransformationGUI_2Sel4Spin1Check()
+// purpose  : Destroys the object and frees any allocated resources
+//=================================================================================
+TransformationGUI_2Sel4Spin1Check::~TransformationGUI_2Sel4Spin1Check()
+{
+  // no need to delete child widgets, Qt does it all for us
+}