Salome HOME
Merge from V5_1_4_BR 07/05/2010
[modules/geom.git] / src / OperationGUI / OperationGUI_Fillet1d2dDlg.cxx
index d3220fed89829a38281e420a0e100e5f3e183292..51e9fbacfdf12cf297dea94d9a67ab86f46d9515 100644 (file)
@@ -1,28 +1,26 @@
-// GEOM GEOMGUI : GUI for Geometry component
-//
-// Copyright (C) 2003  OPEN CASCADE, EADS/CCR, LIP6, CEA/DEN,
-// CEDRAT, EDF R&D, LEG, PRINCIPIA R&D, BUREAU VERITAS
+//  Copyright (C) 2007-2010  CEA/DEN, EDF R&D, OPEN CASCADE
 //
-// This library is free software; you can redistribute it and/or
-// modify it under the terms of the GNU Lesser General Public
-// License as published by the Free Software Foundation; either
-// version 2.1 of the License.
+//  This library is free software; you can redistribute it and/or
+//  modify it under the terms of the GNU Lesser General Public
+//  License as published by the Free Software Foundation; either
+//  version 2.1 of the License.
 //
-// This library is distributed in the hope that it will be useful,
-// but WITHOUT ANY WARRANTY; without even the implied warranty of
-// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
-// Lesser General Public License for more details.
+//  This library is distributed in the hope that it will be useful,
+//  but WITHOUT ANY WARRANTY; without even the implied warranty of
+//  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
+//  Lesser General Public License for more details.
 //
-// You should have received a copy of the GNU Lesser General Public
-// License along with this library; if not, write to the Free Software
-// Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
+//  You should have received a copy of the GNU Lesser General Public
+//  License along with this library; if not, write to the Free Software
+//  Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307 USA
 //
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+//  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
+// GEOM GEOMGUI : GUI for Geometry component
 // File   : OperationGUI_Fillet1d2dDlg.cxx
 // Author : DMV, OCN.
 //
-
 #include "OperationGUI_Fillet1d2dDlg.h"
 
 #include <DlgRef.h>
@@ -88,7 +86,7 @@ OperationGUI_Fillet1d2dDlg::OperationGUI_Fillet1d2dDlg (GeometryGUI* theGeometry
 
   // Set range of spinboxes
   double SpecificStep = 10.0;
-  initSpinBox(GroupVertexes->SpinBox_DX, 0.00001, COORD_MAX, SpecificStep, 5); // VSR: TODO: DBL_DIGITS_DISPLAY
+  initSpinBox(GroupVertexes->SpinBox_DX, 0.00001, COORD_MAX, SpecificStep, "length_precision" );
 
   setHelpFileName(myIs1D ? "fillet1d_operation_page.html" : "fillet2d_operation_page.html");
 
@@ -139,6 +137,8 @@ void OperationGUI_Fillet1d2dDlg::Init()
 
   initName(myIs1D ? tr("GEOM_FILLET_1D") : tr("GEOM_FILLET_2D"));
   GroupVertexes->PushButton1->click();
+
+  SelectionIntoArgument();
 }
 
 //=================================================================================
@@ -193,36 +193,36 @@ void OperationGUI_Fillet1d2dDlg::SelectionIntoArgument()
         GEOMBase::ConvertIOinGEOMObject(aSelList.First(), aResult);
       
       if (aResult && !anObj->_is_nil()) {
-       QString aName = GEOMBase::GetName( anObj );
-       TopoDS_Shape aShape;
-       if ( GEOMBase::GetShape( anObj, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
-         TColStd_IndexedMapOfInteger aMap;
-         aSelMgr->GetIndexes(aSelList.First(), aMap);
-         if ( aMap.Extent() == 1 ) { // Local Selection
-           int anIndex = aMap( 1 );
-           aName += QString( myIs1D ? ":wire_%1" : ":face_%1" ).arg( anIndex );
+        QString aName = GEOMBase::GetName( anObj );
+        TopoDS_Shape aShape;
+        if ( GEOMBase::GetShape( anObj, aShape, TopAbs_SHAPE ) && !aShape.IsNull() ) {
+          TColStd_IndexedMapOfInteger aMap;
+          aSelMgr->GetIndexes(aSelList.First(), aMap);
+          if ( aMap.Extent() == 1 ) { // Local Selection
+            int anIndex = aMap( 1 );
+            aName += QString( myIs1D ? ":wire_%1" : ":face_%1" ).arg( anIndex );
    
-           //Find SubShape Object in Father
-           GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( anObj, aName );
-           
-           if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
-             GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
-             anObj = aShapesOp->GetSubShape( anObj, anIndex );
-           }
-           else
-             anObj = aFindedObject; // get Object from study
-         }
-         else { // Global Selection
-           if ( aShape.ShapeType() != (myIs1D ? TopAbs_WIRE : TopAbs_FACE) ) {
-             anObj = GEOM::GEOM_Object::_nil();
-             aName = "";
-           }
-         }
-       }
-       myShape = anObj;
-       myEditCurrentArgument->setText(aName
+            //Find SubShape Object in Father
+            GEOM::GEOM_Object_var aFindedObject = GEOMBase_Helper::findObjectInFather( anObj, aName );
+            
+            if ( aFindedObject == GEOM::GEOM_Object::_nil() ) { // Object not found in study
+              GEOM::GEOM_IShapesOperations_var aShapesOp = getGeomEngine()->GetIShapesOperations( getStudyId() );
+              anObj = aShapesOp->GetSubShape( anObj, anIndex );
+            }
+            else
+              anObj = aFindedObject; // get Object from study
+          }
+          else { // Global Selection
+            if ( aShape.ShapeType() != (myIs1D ? TopAbs_WIRE : TopAbs_FACE) ) {
+              anObj = GEOM::GEOM_Object::_nil();
+              aName = "";
+            }
+          }
+        }
+        myShape = anObj;
+        myEditCurrentArgument->setText(aName
 );
-       displayPreview();
+        displayPreview();
       }
     }
   } else if (myEditCurrentArgument == GroupVertexes->LineEdit2) {
@@ -248,7 +248,7 @@ void OperationGUI_Fillet1d2dDlg::SelectionIntoArgument()
 
           isPreview = true;
           myEditCurrentArgument->setText(aName);
-         myVertexes = anIndexes;
+          myVertexes = anIndexes;
         }
       }
     }