-// Copyright (C) 2007-2008 CEA/DEN, EDF R&D, OPEN CASCADE
+// Copyright (C) 2007-2013 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
+// 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
//
+
#include "VisuGUI_OffsetDlg.h"
#include "VisuGUI.h"
#include "LightApp_SelectionMgr.h"
#include "SALOME_ListIteratorOfListIO.hxx"
#include "SalomeApp_Application.h"
+#include <SalomeApp_DoubleSpinBox.h>
#include "SVTK_ViewWindow.h"
#include "SVTK_ViewModel.h"
#include "SUIT_ViewManager.h"
#include "SUIT_MessageBox.h"
#include "SUIT_ResourceMgr.h"
-#include "QtxDoubleSpinBox.h"
-
// VTK Includes
#include "vtkRenderer.h"
aHBLay->setSpacing(6);
aHBLay->addWidget( new QLabel ("dX:", anOffsetsPane) );
- aHBLay->addWidget( myDxEdt = new QtxDoubleSpinBox (anOffsetsPane) );
- myDxEdt->setRange(-MAXVAL, MAXVAL);
+ aHBLay->addWidget( myDxEdt = new SalomeApp_DoubleSpinBox (anOffsetsPane) );
+ VISU::initSpinBox( myDxEdt, -MAXVAL, MAXVAL, 1., "length_precision" );
aHBLay->addWidget( new QLabel("dY:", anOffsetsPane) );;
- aHBLay->addWidget( myDyEdt = new QtxDoubleSpinBox (anOffsetsPane) );
- myDyEdt->setRange(-MAXVAL, MAXVAL);
+ aHBLay->addWidget( myDyEdt = new SalomeApp_DoubleSpinBox (anOffsetsPane) );
+ VISU::initSpinBox( myDyEdt, -MAXVAL, MAXVAL, 1., "length_precision" );
aHBLay->addWidget( new QLabel("dZ:", anOffsetsPane) );
- aHBLay->addWidget( myDzEdt = new QtxDoubleSpinBox (anOffsetsPane) );
- myDzEdt->setRange(-MAXVAL, MAXVAL);
+ aHBLay->addWidget( myDzEdt = new SalomeApp_DoubleSpinBox (anOffsetsPane) );
+ VISU::initSpinBox( myDzEdt, -MAXVAL, MAXVAL, 1., "length_precision" );
QPushButton* aResetBtn = new QPushButton(tr("BTN_RESET"), anOffsetsPane);
aHBLay->addWidget( aResetBtn );
QString anEntry(anIO->getEntry());
VISU::TObjectInfo anObjectInfo = VISU::GetObjectByEntry(aStudy, anEntry.toLatin1().constData());
if(VISU::Prs3d_i* aPrsObject = VISU::GetPrs3dFromBase(anObjectInfo.myBase))
- addPresentation(aPrsObject);
+ addPresentation(aPrsObject);
else if (VISU::PointMap3d_i* aPrs = dynamic_cast<VISU::PointMap3d_i*>(anObjectInfo.myBase)) {
- addPointMapPresentation(aPrs);
+ addPointMapPresentation(aPrs);
}
}
}
}
}
-void VisuGUI_OffsetDlg::setOffset (const vtkFloatingPointType* theOffset)
+void VisuGUI_OffsetDlg::setOffset (const double* theOffset)
{
myDxEdt->setValue(theOffset[0]);
myDyEdt->setValue(theOffset[1]);
myDzEdt->setValue(theOffset[2]);
}
-void VisuGUI_OffsetDlg::getOffset (vtkFloatingPointType* theOffset) const
+void VisuGUI_OffsetDlg::getOffset (double* theOffset) const
{
theOffset[0] = myDxEdt->value();
theOffset[1] = myDyEdt->value();
return false;
}
-void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, vtkFloatingPointType* theOffset)
+void VisuGUI_OffsetDlg::updateOffset (VISU::Prs3d_i* thePrs, double* theOffset)
{
if (myPrsList.count() == 0)
return;
if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
if (VISU_Actor* anActor = VISU::FindActor(vw, thePrs)) {
- anActor->SetPosition(theOffset);
+ anActor->SetPosition(theOffset);
vw->onAdjustTrihedron();
vw->getRenderer()->ResetCameraClippingRange();
vw->Repaint();
}
}
-void VisuGUI_OffsetDlg::updatePointMapOffset (VISU::PointMap3d_i* thePrs, vtkFloatingPointType* theOffset)
+void VisuGUI_OffsetDlg::updatePointMapOffset (VISU::PointMap3d_i* thePrs, double* theOffset)
{
if (myPointMapList.count() == 0)
return;
for (int i = 0, iEnd = aViews.size(); i < iEnd; i++) {
if (SUIT_ViewWindow* aViewWindow = aViews.at(i)) {
if (SVTK_ViewWindow* vw = dynamic_cast<SVTK_ViewWindow*>(aViewWindow)) {
- vw->onAdjustTrihedron();
+ vw->onAdjustTrihedron();
if (VISU_ActorBase* anActor = VISU::FindActorBase(vw, thePrs)) {
anActor->SetPosition(theOffset);
- vw->highlight(thePrs->GetIO(), 1);
+ vw->highlight(thePrs->GetIO(), 1);
vw->getRenderer()->ResetCameraClippingRange();
vw->Repaint();
}
void VisuGUI_OffsetDlg::accept()
{
- vtkFloatingPointType anOffset[3];
+ double anOffset[3];
getOffset(anOffset);
for (int i = 0; i < myPrsList.count(); i++) {
updateOffset(myPrsList.at(i), anOffset);
updateOffset(myPrsList.at(i), myOldOffsets[i].myOffset);
}
for (int i = 0; i < myPointMapList.count(); i++) {
- updatePointMapOffset(myPointMapList.at(i), myOldOffsets[i].myOffset);
+ updatePointMapOffset(myPointMapList.at(i), myOldPointMapOffsets[i].myOffset);
}
QDialog::reject();
}
void VisuGUI_OffsetDlg::onApply()
{
- vtkFloatingPointType anOffset[3];
+ double anOffset[3];
getOffset(anOffset);
for (int i = 0; i < myPrsList.count(); i++) {