]> SALOME platform Git repositories - modules/visu.git/blobdiff - src/VISUGUI/VisuGUI_CutSegmentDlg.cxx
Salome HOME
Merge from V5_1_main 14/05/2010
[modules/visu.git] / src / VISUGUI / VisuGUI_CutSegmentDlg.cxx
index 764f8104eed382358943926fcace47b8c9f494ca..1872d10a483d0c3e5895bd88111541b905af6d6c 100644 (file)
@@ -1,7 +1,4 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
-//
-//  Copyright (C) 2003-2007  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
@@ -19,6 +16,7 @@
 //
 //  See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
 //
+
 //  File   : VisuGUI_CutSegmentDlg.cxx
 //  Author : Oleg UVAROV
 //  Module : VISU
@@ -41,6 +39,7 @@
 
 #include "LightApp_Application.h"
 #include "SalomeApp_Study.h"
+#include <SalomeApp_DoubleSpinBox.h>
 
 #include "SUIT_ResourceMgr.h"
 
@@ -95,14 +94,15 @@ VisuGUI_CutSegmentDlg::VisuGUI_CutSegmentDlg (SalomeApp_Module* theModule)
   QLabel* aPoint2YLabel = new QLabel( tr( "LBL_Y" ), aSegmentBox );
   QLabel* aPoint2ZLabel = new QLabel( tr( "LBL_Z" ), aSegmentBox );
   for( int i = 0; i < 3; i++ ) {
-    myPoint1.append( new QtxDoubleSpinBox( aSegmentBox ) );
-    myPoint2.append( new QtxDoubleSpinBox( aSegmentBox ) );
+    myPoint1.append( new SalomeApp_DoubleSpinBox( aSegmentBox ) );
+    myPoint2.append( new SalomeApp_DoubleSpinBox( aSegmentBox ) );
   }
 
-  QListIterator<QtxDoubleSpinBox*> anIter( myPoint1 + myPoint2 );
+  QListIterator<SalomeApp_DoubleSpinBox*> anIter( myPoint1 + myPoint2 );
   while( anIter.hasNext() ) {
-    QtxDoubleSpinBox* aSpinBox = anIter.next();
-    aSpinBox->setDecimals( 6 );
+    SalomeApp_DoubleSpinBox* aSpinBox = anIter.next();
+    // Use default range - see QDoubleSpinBox minimum/maximum properties
+    VISU::initSpinBox( aSpinBox, 0., 99.99, 1., "length_precision" );
     aSpinBox->setMinimumWidth( 100 );
   }
 
@@ -213,7 +213,7 @@ VisuGUI_CutSegmentDlg::~VisuGUI_CutSegmentDlg()
 
 //------------------------------------------------------------------------------
 void VisuGUI_CutSegmentDlg::initFromPrsObject ( VISU::ColoredPrs3d_i* thePrs,
-                                               bool theInit )
+                                                bool theInit )
 {
   if( theInit )
     myPrsCopy = VISU::TSameAsFactory<VISU::TCUTSEGMENT>().Create(thePrs, VISU::ColoredPrs3d_i::EDoNotPublish);
@@ -433,7 +433,7 @@ void VisuGUI_CutSegmentDlg::updatePoints( bool update )
   aPoints->InsertNextPoint( aPoint2 );
 
   vtkCellArray* aVerts = vtkCellArray::New();
-  for( int i = 0, n = aPoints->GetNumberOfPoints(); i < n; i++ )
+  for( vtkIdType i = 0, n = aPoints->GetNumberOfPoints(); i < n; i++ )
     aVerts->InsertNextCell( 1, &i );
 
   vtkPolyData* aProfile = vtkPolyData::New();