Salome HOME
Fix for the IPAL22822: Changes of plots in hexa8
[modules/visu.git] / src / VISUGUI / VisuGUI_CutSegmentDlg.cxx
index 764f8104eed382358943926fcace47b8c9f494ca..ccd194ddf021fa3927a622169d4118427ee25314 100644 (file)
@@ -1,24 +1,22 @@
-//  Copyright (C) 2007-2008  CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2011  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
+// 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
 //
+
 //  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();