]> SALOME platform Git repositories - modules/geom.git/commitdiff
Salome HOME
DCQ : Limit Torus use
authordcq <dcq@opencascade.com>
Thu, 8 Apr 2004 08:15:01 +0000 (08:15 +0000)
committerdcq <dcq@opencascade.com>
Thu, 8 Apr 2004 08:15:01 +0000 (08:15 +0000)
src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx
src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h

index 96eeb4d05e274ca4dd2727166031779fc701cdfb..3a2c44ff92e6a9da65a89b0d1f820d47ca757833 100644 (file)
@@ -102,7 +102,6 @@ void PrimitiveGUI_TorusDlg::Init()
 
   myRadius1 = 300.0;
   myRadius2 = 100.0;
-  myOkRadius1 = myOkRadius2 = true;
   myOkPoint1 = myOkDir = false;
 
   myEdgeFilter = new GEOM_EdgeFilter(StdSelect_Line, myGeom);
@@ -167,7 +166,6 @@ void PrimitiveGUI_TorusDlg::ConstructorsClicked(int constructorId)
   mySelection->ClearFilters();
   myGeomBase->EraseSimulationShape();
   disconnect(mySelection, 0, this, 0);
-  myOkRadius1 = myOkRadius2 = true;
   myRadius1 = 300.0;
   myRadius2 = 100.0;
 
@@ -237,7 +235,7 @@ void PrimitiveGUI_TorusDlg::ClickOnApply()
   myGeomBase->EraseSimulationShape();
   mySimulationTopoDs.Nullify();
 
-  if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2 )       
+  if(myOkPoint1 && myOkDir)      
     myPrimitiveGUI->MakeTorusAndDisplay(myPoint1, myDir, myRadius1, myRadius2); 
   return ;
 }
@@ -279,7 +277,7 @@ void PrimitiveGUI_TorusDlg::SelectionIntoArgument()
     myOkDir = true;
   }
 
-  if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2)
+  if(myOkPoint1 && myOkDir)
     MakeTorusSimulationAndDisplay();
   return;
 }
@@ -375,15 +373,23 @@ void PrimitiveGUI_TorusDlg::ValueChangedInSpinBox(double newValue)
   QObject* send = (QObject*)sender();
   
   if(send == GroupPoints->SpinBox_DX || send == GroupDimensions->SpinBox_DX) {
-    myRadius1 = newValue;
-    myOkRadius1 = true;
+    if(newValue > myRadius2)
+      myRadius1 = newValue;
+    else {
+      GroupPoints->SpinBox_DX->SetValue(myRadius1);
+      GroupDimensions->SpinBox_DX->SetValue(myRadius1);
+    }
   }
   else if(send == GroupPoints->SpinBox_DY || send == GroupDimensions->SpinBox_DY) {
-    myRadius2 = newValue;
-    myOkRadius2 = true;
+    if(newValue < myRadius1)
+      myRadius2 = newValue;
+    else {
+      GroupPoints->SpinBox_DY->SetValue(myRadius2);
+      GroupDimensions->SpinBox_DY->SetValue(myRadius2);
+    }
   }
   
-  if(myOkPoint1 && myOkDir && myOkRadius1 && myOkRadius2)
+  if(myOkPoint1 && myOkDir)
     MakeTorusSimulationAndDisplay();
   return;
 }
index 2eb3b32b5b213537cfbffb6fe8d0a07a9f43171f..84068f432b75fdb395cc394bc7fcc1d54ceafcd9 100644 (file)
@@ -72,8 +72,6 @@ private:
 
     Standard_Real myRadius1;
     Standard_Real myRadius2;
-    bool myOkRadius1;
-    bool myOkRadius2;
 
     DlgRef_2Sel2Spin* GroupPoints;
     DlgRef_2Spin* GroupDimensions;