From: dcq Date: Thu, 8 Apr 2004 08:15:01 +0000 (+0000) Subject: DCQ : Limit Torus use X-Git-Tag: Base_Ecole_Ete~1 X-Git-Url: http://git.salome-platform.org/gitweb/?a=commitdiff_plain;h=5ef9687887e106efd8ef99255bd48e647181861f;p=modules%2Fgeom.git DCQ : Limit Torus use --- diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx index 96eeb4d05..3a2c44ff9 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.cxx @@ -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; } diff --git a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h index 2eb3b32b5..84068f432 100644 --- a/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h +++ b/src/PrimitiveGUI/PrimitiveGUI_TorusDlg.h @@ -72,8 +72,6 @@ private: Standard_Real myRadius1; Standard_Real myRadius2; - bool myOkRadius1; - bool myOkRadius2; DlgRef_2Sel2Spin* GroupPoints; DlgRef_2Spin* GroupDimensions;