]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
IPAL52206: TC7.3.0: Wrong step of multi-translation if point is selected
authorkga <kga@opencascade.com>
Mon, 9 Dec 2013 07:11:45 +0000 (07:11 +0000)
committerkga <kga@opencascade.com>
Mon, 9 Dec 2013 07:11:45 +0000 (07:11 +0000)
src/TransformationGUI/TransformationGUI_MultiRotationDlg.cxx
src/TransformationGUI/TransformationGUI_MultiTranslationDlg.cxx

index a7074e16d5328171109c35f6c1de1bf2c7233c95..fa4fa14b6c1a975a2224fe0b4c03f4536156fed8 100644 (file)
@@ -174,11 +174,11 @@ void TransformationGUI_MultiRotationDlg::ConstructorsClicked (int constructorId)
 {
   disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
 
-  myBase.nullify();
-  myVector.nullify();
+  //myBase.nullify();
+  //myVector.nullify();
 
-  GroupArgs->LineEdit1->setText("");
-  GroupArgs->LineEdit2->setText("");
+  //GroupArgs->LineEdit1->setText("");
+  //GroupArgs->LineEdit2->setText("");
 
   GroupArgs->SpinBox_DX1->setValue(myAng);
   GroupArgs->SpinBox_DY1->setValue(myNbTimes1);
@@ -294,10 +294,10 @@ void TransformationGUI_MultiRotationDlg::SelectionIntoArgument()
     }
     
     // clear selection
-    disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
-    myGeomGUI->getApp()->selectionMgr()->clearSelected();
-    connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
-            this, SLOT(SelectionIntoArgument()));
+    // disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+    // myGeomGUI->getApp()->selectionMgr()->clearSelected();
+    // connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+    //         this, SLOT(SelectionIntoArgument()));
   }
   else {
     if ( myEditCurrentArgument == GroupArgs->LineEdit1 )
index b9862ae650001381e97cc17f48b12bc6a3983bab..1cb934f8ad0d5b80e8b504e668adaabcc8b21a14 100644 (file)
@@ -239,15 +239,21 @@ void TransformationGUI_MultiTranslationDlg::ConstructorsClicked (int constructor
       GroupDimensions->hide();
       GroupPoints->show();
 
-      GroupPoints->LineEdit1->setText("");
-      GroupPoints->LineEdit2->setText("");
-      myBase.nullify();
-      myVectorU.nullify();
+      //GroupPoints->LineEdit1->setText("");
+      //GroupPoints->LineEdit2->setText("");
+      //myBase.nullify();
+      //myVectorU.nullify();
+
+      if ( myBase ) GroupDimensions->LineEdit1->setText( GEOMBase::GetName( myBase.get() ) );
+      if ( myVectorU ) GroupDimensions->LineEdit2->setText( GEOMBase::GetName( myVectorU.get() ) );
 
       GroupPoints->SpinBox_DX->setValue(myStepU);
       GroupPoints->SpinBox_DY->setValue(myNbTimesU);
 
-      GroupPoints->PushButton1->click();
+      if ( !myBase )
+       GroupPoints->PushButton1->click();
+      else if ( !myVectorU )
+       GroupPoints->PushButton2->click();
       break;
     }
   case 1: // Translate double
@@ -255,19 +261,28 @@ void TransformationGUI_MultiTranslationDlg::ConstructorsClicked (int constructor
       GroupPoints->hide();
       GroupDimensions->show();
 
-      GroupDimensions->LineEdit1->setText("");
-      GroupDimensions->LineEdit2->setText("");
-      GroupDimensions->LineEdit3->setText("");
-      myBase.nullify();
-      myVectorU.nullify();
-      myVectorV.nullify();
+      //GroupDimensions->LineEdit1->setText("");
+      //GroupDimensions->LineEdit2->setText("");
+      //GroupDimensions->LineEdit3->setText("");
+      //myBase.nullify();
+      //myVectorU.nullify();
+      //myVectorV.nullify();
+
+      if ( myBase ) GroupDimensions->LineEdit1->setText( GEOMBase::GetName( myBase.get() ) );
+      if ( myVectorU ) GroupDimensions->LineEdit2->setText( GEOMBase::GetName( myVectorU.get() ) );
+      if ( myVectorV ) GroupDimensions->LineEdit3->setText( GEOMBase::GetName( myVectorV.get() ) );
 
       GroupDimensions->SpinBox_DX1->setValue(myStepU);
       GroupDimensions->SpinBox_DY1->setValue(myNbTimesU);
       GroupDimensions->SpinBox_DX2->setValue(myStepV);
       GroupDimensions->SpinBox_DY2->setValue(myNbTimesV);
 
-      GroupDimensions->PushButton1->click();
+      if ( !myBase )
+       GroupDimensions->PushButton1->click();
+      else if ( !myVectorU )
+       GroupDimensions->PushButton2->click();
+      else if ( !myVectorV )
+       GroupDimensions->PushButton3->click();
       break;
     }
   }
@@ -329,7 +344,7 @@ void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument()
     QString aName = GEOMBase::GetName( aSelectedObject.get() );
     myEditCurrentArgument->setText( aName );
 
-    if ( myEditCurrentArgument == GroupPoints->LineEdit1 ) {
+    if ( myEditCurrentArgument == GroupPoints->LineEdit1 || myEditCurrentArgument == GroupDimensions->LineEdit1 ) {
       myBase = aSelectedObject;
 
       // recompute myStepU (Mantis issue 0021718)
@@ -338,36 +353,26 @@ void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument()
       anOper->GetBoundingBox(myBase.get(), true, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax);
       if (anOper->IsDone()) {
         myStepU = floor(1.5 * (Xmax - Xmin));
+        myStepV = floor(1.5 * (Ymax - Ymin));
         GroupPoints->SpinBox_DX->setValue(myStepU);
+        GroupDimensions->SpinBox_DX1->setValue(myStepU);
+        GroupDimensions->SpinBox_DX2->setValue(myStepV);
       }
 
-      if (!myVectorU)
+      if ( myEditCurrentArgument == GroupPoints->LineEdit1 && !myVectorU )
         GroupPoints->PushButton2->click();
+      if ( myEditCurrentArgument == GroupDimensions->LineEdit1 ) {
+       if ( !myVectorU )
+         GroupDimensions->PushButton2->click();
+       else if ( !myVectorV )
+         GroupDimensions->PushButton3->click();
+      }
     }
     else if ( myEditCurrentArgument == GroupPoints->LineEdit2 ) {
       myVectorU = aSelectedObject;
       if ( !myBase )
         GroupPoints->PushButton1->click();
     }
-    else if ( myEditCurrentArgument == GroupDimensions->LineEdit1 ) {
-      myBase = aSelectedObject;
-
-      // recompute myStepU and myStepV (Mantis issue 0021718)
-      GEOM::GEOM_IMeasureOperations_var anOper = getGeomEngine()->GetIMeasureOperations(getStudyId());
-      double Xmin, Xmax, Ymin, Ymax, Zmin, Zmax;
-      anOper->GetBoundingBox(myBase.get(), true, Xmin, Xmax, Ymin, Ymax, Zmin, Zmax);
-      if (anOper->IsDone()) {
-        myStepU = floor(1.5 * (Xmax - Xmin));
-        myStepV = floor(1.5 * (Ymax - Ymin));
-        GroupDimensions->SpinBox_DX1->setValue(myStepU);
-        GroupDimensions->SpinBox_DX2->setValue(myStepV);
-      }
-
-      if ( !myVectorU )
-        GroupDimensions->PushButton2->click();
-      else if ( !myVectorV )
-        GroupDimensions->PushButton3->click();
-    }
     else if ( myEditCurrentArgument == GroupDimensions->LineEdit2 ) {
       myVectorU = aSelectedObject;
       if ( !myVectorV )
@@ -384,10 +389,10 @@ void TransformationGUI_MultiTranslationDlg::SelectionIntoArgument()
     }
 
     // clear selection
-    disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
-    myGeomGUI->getApp()->selectionMgr()->clearSelected();
-    connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
-            this, SLOT(SelectionIntoArgument()));
+    // disconnect(myGeomGUI->getApp()->selectionMgr(), 0, this, 0);
+    // myGeomGUI->getApp()->selectionMgr()->clearSelected();
+    // connect(myGeomGUI->getApp()->selectionMgr(), SIGNAL(currentSelectionChanged()),
+    //         this, SLOT(SelectionIntoArgument()));
   }
   else {
     if ( myEditCurrentArgument == GroupPoints->LineEdit1 ||