Salome HOME
Additional minor fix of issue 0017431: unset the MODAL behavior for the 'Basic Proper...
[modules/geom.git] / src / GenerationGUI / GenerationGUI_RevolDlg.cxx
index 01db4575e19daaa8c540149251ef7a25b9a8fe7c..8f9a6008e97668248e8d2fd5f64c0c6c145bcdcf 100644 (file)
@@ -118,7 +118,9 @@ void GenerationGUI_RevolDlg::Init()
 
   double SpecificStep = 5;
   /* min, max, step and decimals for spin boxes & initial values */
-  initSpinBox( GroupPoints->SpinBox_DX, COORD_MIN, COORD_MAX, SpecificStep, 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
+  //initSpinBox( GroupPoints->SpinBox_DX, COORD_MIN, COORD_MAX, SpecificStep, 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
+  // 05.06.2008 skl for IPAL12958
+  initSpinBox( GroupPoints->SpinBox_DX, 0.0, 360.0, SpecificStep, 3 ); // VSR: TODO: DBL_DIGITS_DISPLAY
   GroupPoints->SpinBox_DX->setValue( 45.0 );
 
   /* signals and slots connections */
@@ -135,9 +137,7 @@ void GenerationGUI_RevolDlg::Init()
   connect( GroupPoints->CheckButton1, SIGNAL( toggled( bool ) ),        this, SLOT( onBothway() ) );
   connect( GroupPoints->CheckButton2, SIGNAL( toggled( bool ) ),        this, SLOT( onReverse() ) );
 
-  // VSR: TODO ->>
-  connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), GroupPoints->SpinBox_DX, SLOT( SetStep( double ) ) );
-  // <<-
+  connect( myGeomGUI, SIGNAL( SignalDefaultStepValueChanged( double ) ), this, SLOT( SetDoubleSpinBoxStep( double ) ) );
 
   connect( ( (SalomeApp_Application*)( SUIT_Session::session()->activeApplication() ) )->selectionMgr(),
           SIGNAL( currentSelectionChanged() ), this, SLOT( SelectionIntoArgument() ) );
@@ -147,6 +147,16 @@ void GenerationGUI_RevolDlg::Init()
   globalSelection( GEOM_ALLSHAPES );
 }
 
+//=================================================================================
+// function : SetDoubleSpinBoxStep()
+// purpose  : Double spin box management
+//=================================================================================
+void GenerationGUI_RevolDlg::SetDoubleSpinBoxStep( double step )
+{
+  GroupPoints->SpinBox_DX->setSingleStep(step);
+}
+
+
 
 //=================================================================================
 // function : ClickOnOk()
@@ -208,7 +218,11 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
   erasePreview();
   myEditCurrentArgument->setText( "" );
   
-  if ( IObjectCount() != 1 ) {
+  LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
+  SALOME_ListIO aSelList;
+  aSelMgr->selectedObjects(aSelList);
+
+  if (aSelList.Extent() != 1) {
     if ( myEditCurrentArgument == GroupPoints->LineEdit1 )
       myOkBase = false;        
     else if ( myEditCurrentArgument == GroupPoints->LineEdit2 )
@@ -218,7 +232,7 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
   
   // nbSel == 1
   Standard_Boolean testResult = Standard_False;
-  GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject( firstIObject(), testResult );
+  GEOM::GEOM_Object_ptr aSelectedObject = GEOMBase::ConvertIOinGEOMObject(aSelList.First(), testResult);
   QString aName = GEOMBase::GetName( aSelectedObject );
   
   if ( !testResult )
@@ -239,9 +253,8 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
       TopoDS_Shape aShape;
       
       if ( GEOMBase::GetShape( aSelectedObject, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
-       LightApp_SelectionMgr* aSelMgr = myGeomGUI->getApp()->selectionMgr();
        TColStd_IndexedMapOfInteger aMap;
-       aSelMgr->GetIndexes( firstIObject(), aMap );
+       aSelMgr->GetIndexes(aSelList.First(), aMap);
        if ( aMap.Extent() == 1 ) {
          
          int anIndex = aMap( 1 );
@@ -279,7 +292,6 @@ void GenerationGUI_RevolDlg::SelectionIntoArgument()
   displayPreview();
 }
 
-
 //=================================================================================
 // function : SetEditCurrentArgument()
 // purpose  :