-// 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
+// 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
-//
-// See http://www.salome-platform.org/ or email : webmaster.salome@opencascade.com
+// 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
+
// VISU VISUGUI : GUI of VISU component
// File : VisuGUI_CutPlanesDlg.cxx
// Author : Laurent CORNABE & Hubert ROLLAND
// Module : VISU
-// $Header$
-//
+
#include "VisuGUI_CutPlanesDlg.h"
#include "VISU_ColoredPrs3dFactory.hh"
//#include "OB_Browser.h"
-#include "VisuGUI_TableDlg.h"
+#include "VISU_TableDlg.h"
#include "SVTK_ViewWindow.h"
#include "LightApp_Application.h"
+#include <SalomeApp_IntSpinBox.h>
+#include <SalomeApp_DoubleSpinBox.h>
+
#include "SUIT_Application.h"
#include "SUIT_Desktop.h"
#include "SUIT_ViewWindow.h"
#include <QLineEdit>
#include <QTabWidget>
#include <QKeyEvent>
-#include <QSpinBox>
#include <QRadioButton>
#include <QTableWidget>
#include <QGroupBox>
QLabel* LabelPosi_3 = new QLabel (tr("LBL_NB_PLANS"), this);
- nbPlan = new QSpinBox( this );
+ nbPlan = new SalomeApp_IntSpinBox( this );
+ nbPlan->setAcceptNames( false );
nbPlan->setMinimum( 1 );
nbPlan->setMaximum(100);
nbPlan->setSingleStep( 1 );
LabelRot1 = new QLabel (tr("LBL_ROT_X"), GBrot );
GBrotLayout->addWidget( LabelRot1, 0, 0 );
- Rot1 = new QtxDoubleSpinBox( -180, 180, 10, GBrot );
+ Rot1 = new SalomeApp_DoubleSpinBox( GBrot );
+ VISU::initSpinBox( Rot1, -180., 180., 10., "angle_precision" );
Rot1->setValue( 0 );
Rot1->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
connect( Rot1, SIGNAL( valueChanged( double )), this, SLOT( onRotation( double ) ) );
LabelRot2 = new QLabel (tr("LBL_ROT_Y"), GBrot );
GBrotLayout->addWidget( LabelRot2, 1, 0 );
- Rot2 = new QtxDoubleSpinBox( -180, 180, 10, GBrot );
+ Rot2 = new SalomeApp_DoubleSpinBox( GBrot );
+ VISU::initSpinBox( Rot2, -180., 180., 10., "angle_precision" );
Rot2->setValue( 0 );
Rot2->setSizePolicy( QSizePolicy( QSizePolicy::Expanding, QSizePolicy::Fixed ) );
connect( Rot2, SIGNAL( valueChanged( double )), this, SLOT( onRotation( double ) ) );
GBrotLayout->addWidget( Rot2, 1, 1 );
QLabel* aPosLbl = new QLabel(tr( "LBL_POS" ), this);
- myPosSpn = new QtxDoubleSpinBox( 0, 1, 0.1, this );
+ myPosSpn = new SalomeApp_DoubleSpinBox( this );
+ VISU::initSpinBox( myPosSpn, 0., 1., .1, "parametric_precision" );
GDeformation = new QGroupBox(tr("LBL_DEFORMATION"), this);
GDeformation->setCheckable(true);
myVectorialFieldCombo = new QComboBox (GDeformation);
GDeformationLayout->addWidget( myVectorialFieldCombo, 0, 1 );
- SUIT_ResourceMgr* aResourceMgr = VISU::GetResourceMgr();
- int aPrecision = aResourceMgr->integerValue( "VISU", "floating_point_precision", 0 );
-
QLabel* LabelDeformation2 = new QLabel (tr("LBL_DEFROMATION_SCALE"), GDeformation);
GDeformationLayout->addWidget( LabelDeformation2, 1, 0 );
- myScaleSpn = new QtxDoubleSpinBox (0, 1.0E+38, 0.1, aPrecision*(-1), 38, GDeformation);
+ myScaleSpn = new SalomeApp_DoubleSpinBox (GDeformation);
+ VISU::initSpinBox( myScaleSpn, 0., 1.0E+38, 0.1, "visual_data_precision" );
myScaleSpn->setSizePolicy(QSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed));
GDeformationLayout->addWidget( myScaleSpn, 1, 1 );
connect(myVectorialFieldCombo, SIGNAL(activated(int)), this, SLOT(onVectorialFieldChanged(int)));
void VisuGUI_CutPlanesPane::initFromPrsObject (VISU::CutPlanes_i* thePrs)
{
setNbPlanes(thePrs->GetNbPlanes());
- setRotation(thePrs->GetRotateX()*180./PI, thePrs->GetRotateY()*180./PI);
+ setRotation(thePrs->GetRotateX()*180./M_PI, thePrs->GetRotateY()*180./M_PI);
setPlanePos(thePrs->GetOrientationType());
myPosSpn->setValue(thePrs->GetDisplacement());
InitEntity2VectorialFieldsMap(thePrs);
int VisuGUI_CutPlanesPane::storeToPrsObject (VISU::CutPlanes_i* thePrs)
{
- thePrs->SetOrientation(getOrientaion(), getRotation1()*PI/180., getRotation2()*PI/180.);
+ thePrs->SetOrientation(getOrientaion(), getRotation1()*M_PI/180., getRotation2()*M_PI/180.);
thePrs->SetNbPlanes(getNbPlanes());
thePrs->SetDisplacement(myPosSpn->value());
for (int i = 0; i < getNbPlanes(); ++i) {
int aNbRows = myPosTable->rowCount();
int aNbPlanes = getNbPlanes();
- myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*PI/180.,getRotation2()*PI/180.);
+ myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*M_PI/180.,getRotation2()*M_PI/180.);
myCutPlanes->SetNbPlanes(aNbPlanes);
myCutPlanes->SetDisplacement(myPosSpn->value());
myCutPlanes->SetScale(getScaleFactor());
if (!(bool)myCutPlanes) return;
if (myPreviewCheck->isChecked()) {
if (SVTK_ViewWindow* vf = VISU::GetActiveViewWindow<SVTK_ViewWindow>()) {
- myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*PI/180.,getRotation2()*PI/180.);
+ myCutPlanes->SetOrientation(getOrientaion(),getRotation1()*M_PI/180.,getRotation2()*M_PI/180.);
myCutPlanes->GetPipeLine()->Update();
deletePlanes();
createPlanes();
storeToPrsObject(myCutPlanes);
myCutPlanes->GetPipeLine()->Update();
createPlanes();
- if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false)) {
- vf->onFitAll();
- }
+ if(VISU::GetResourceMgr()->booleanValue("VISU","automatic_fit_all",false))
+ vf->onFitAll(); // Repaint() is called inside
+ else
+ vf->Repaint();
} else {
deletePlanes();
vf->Repaint();