From f0d76ff6227bfa6cdacdeac79fc557cfd0130f7f Mon Sep 17 00:00:00 2001 From: abn Date: Wed, 2 Sep 2015 16:54:05 +0200 Subject: [PATCH] Preparing future VTK release: VTK_LARGE_FLOAT is deprecated. --- src/SVTK/SVTK_CubeAxesActor2D.cxx | 6 ++-- src/SVTK/SVTK_NonIsometricDlg.cxx | 6 ++-- src/SVTK/SVTK_Renderer.cxx | 10 +++---- src/SVTK/SVTK_UpdateRateDlg.cxx | 6 ++-- src/SVTK/salomevtkPVAxesActor.h | 6 ++-- src/VTKViewer/VTKViewer_Actor.cxx | 4 +-- src/VTKViewer/VTKViewer_Trihedron.cxx | 4 +-- src/VTKViewer/VTKViewer_Utilities.cxx | 40 +++++++++++++-------------- 8 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/SVTK/SVTK_CubeAxesActor2D.cxx b/src/SVTK/SVTK_CubeAxesActor2D.cxx index 027487233..874bbe8ee 100644 --- a/src/SVTK/SVTK_CubeAxesActor2D.cxx +++ b/src/SVTK/SVTK_CubeAxesActor2D.cxx @@ -286,7 +286,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) if ( this->FlyMode == VTK_FLY_CLOSEST_TRIAD ) { // Loop over points and find the closest point to the camera - min = VTK_LARGE_FLOAT; + min = VTK_FLOAT_MAX; for (i=0; i < 8; i++) { if ( pts[i][2] < min ) @@ -310,7 +310,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) double e1[2], e2[2], e3[2]; // Find distance to origin - d2Min = VTK_LARGE_FLOAT; + d2Min = VTK_FLOAT_MAX; for (i=0; i < 8; i++) { d2 = pts[i][0]*pts[i][0] + pts[i][1]*pts[i][1]; @@ -323,7 +323,7 @@ int SVTK_CubeAxesActor2D::RenderOpaqueGeometry(vtkViewport *viewport) // find minimum slope point connected to closest point and on // right side (in projected coordinates). This is the first edge. - minSlope = VTK_LARGE_FLOAT; + minSlope = VTK_FLOAT_MAX; for (xIdx=0, i=0; i<3; i++) { num = (pts[Conn[idx][i]][1] - pts[idx][1]); diff --git a/src/SVTK/SVTK_NonIsometricDlg.cxx b/src/SVTK/SVTK_NonIsometricDlg.cxx index 05104b9a3..009ba0c08 100644 --- a/src/SVTK/SVTK_NonIsometricDlg.cxx +++ b/src/SVTK/SVTK_NonIsometricDlg.cxx @@ -67,7 +67,7 @@ SVTK_NonIsometricDlg QLabel* TextLabelX = new QLabel (tr("LBL_X"), aGroupBox); TextLabelX->setObjectName("TextLabelX"); TextLabelX->setFixedWidth(15); - m_sbXcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox); + m_sbXcoeff = new QtxDoubleSpinBox(-VTK_FLOAT_MAX, VTK_FLOAT_MAX, 0.1, aGroupBox); m_sbXcoeff->setMinimumWidth(80); m_sbXcoeff->setValue(1.0); @@ -75,7 +75,7 @@ SVTK_NonIsometricDlg QLabel* TextLabelY = new QLabel (tr("LBL_Y"), aGroupBox); TextLabelY->setObjectName("TextLabelY"); TextLabelY->setFixedWidth(15); - m_sbYcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox); + m_sbYcoeff = new QtxDoubleSpinBox(-VTK_FLOAT_MAX, VTK_FLOAT_MAX, 0.1, aGroupBox); m_sbYcoeff->setMinimumWidth(80); m_sbYcoeff->setValue(1.0); @@ -83,7 +83,7 @@ SVTK_NonIsometricDlg QLabel* TextLabelZ = new QLabel (tr("LBL_Z"), aGroupBox); TextLabelZ->setObjectName("TextLabelZ"); TextLabelZ->setFixedWidth(15); - m_sbZcoeff = new QtxDoubleSpinBox(-VTK_LARGE_FLOAT, VTK_LARGE_FLOAT, 0.1, aGroupBox); + m_sbZcoeff = new QtxDoubleSpinBox(-VTK_FLOAT_MAX, VTK_FLOAT_MAX, 0.1, aGroupBox); m_sbZcoeff->setMinimumWidth(80); m_sbZcoeff->setValue(1.0); diff --git a/src/SVTK/SVTK_Renderer.cxx b/src/SVTK/SVTK_Renderer.cxx index 1a251d9e4..6a6420e6f 100644 --- a/src/SVTK/SVTK_Renderer.cxx +++ b/src/SVTK/SVTK_Renderer.cxx @@ -395,9 +395,9 @@ inline bool CheckBndBox(const double theBounds[6]) { - if(theBounds[0] > -VTK_LARGE_FLOAT && theBounds[1] < VTK_LARGE_FLOAT && - theBounds[2] > -VTK_LARGE_FLOAT && theBounds[3] < VTK_LARGE_FLOAT && - theBounds[4] > -VTK_LARGE_FLOAT && theBounds[5] < VTK_LARGE_FLOAT) + if(theBounds[0] > -VTK_FLOAT_MAX && theBounds[1] < VTK_FLOAT_MAX && + theBounds[2] > -VTK_FLOAT_MAX && theBounds[3] < VTK_FLOAT_MAX && + theBounds[4] > -VTK_FLOAT_MAX && theBounds[5] < VTK_FLOAT_MAX) return true; return false; } @@ -413,8 +413,8 @@ SVTK_Renderer bool aCDisplayed = IsCubeAxesDisplayed(); double aNewBndBox[6]; - aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT; - aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT; + aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_FLOAT_MAX; + aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_FLOAT_MAX; int aVisibleNum = myTrihedron->GetVisibleActorCount(GetDevice()); if(aVisibleNum){ diff --git a/src/SVTK/SVTK_UpdateRateDlg.cxx b/src/SVTK/SVTK_UpdateRateDlg.cxx index 8a02385be..15a8d0a24 100644 --- a/src/SVTK/SVTK_UpdateRateDlg.cxx +++ b/src/SVTK/SVTK_UpdateRateDlg.cxx @@ -50,7 +50,7 @@ #include static double OFF_UPDATE_RATE = 0.00001; -static double FLOAT_TOLERANCE = 1.0 / VTK_LARGE_FLOAT; +static double FLOAT_TOLERANCE = 1.0 / VTK_FLOAT_MAX; namespace { @@ -195,7 +195,7 @@ SVTK_UpdateRateDlg aLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); aGridLayout->addWidget(aLabel, 0, 0); - QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_LARGE_FLOAT, 2, aGroupBox); + QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_FLOAT_MAX, 2, aGroupBox); aDblSpinBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); aGridLayout->addWidget(aDblSpinBox, 0, 1); @@ -209,7 +209,7 @@ SVTK_UpdateRateDlg aLabel->setSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed); aGridLayout->addWidget(aLabel, 1, 0); - QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_LARGE_FLOAT, 2, aGroupBox); + QtxDoubleSpinBox* aDblSpinBox = new QtxDoubleSpinBox(OFF_UPDATE_RATE, VTK_FLOAT_MAX, 2, aGroupBox); aDblSpinBox->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed); aGridLayout->addWidget(aDblSpinBox, 1, 1); diff --git a/src/SVTK/salomevtkPVAxesActor.h b/src/SVTK/salomevtkPVAxesActor.h index 6ab2edb8e..04a5a9f0b 100644 --- a/src/SVTK/salomevtkPVAxesActor.h +++ b/src/SVTK/salomevtkPVAxesActor.h @@ -148,11 +148,11 @@ public: // Description: // Set/get the radius of the pieces of the axes actor - vtkSetClampMacro(ConeRadius, float, 0, VTK_LARGE_FLOAT); + vtkSetClampMacro(ConeRadius, float, 0, VTK_FLOAT_MAX); vtkGetMacro(ConeRadius, float); - vtkSetClampMacro(SphereRadius, float, 0, VTK_LARGE_FLOAT); + vtkSetClampMacro(SphereRadius, float, 0, VTK_FLOAT_MAX); vtkGetMacro(SphereRadius, float); - vtkSetClampMacro(CylinderRadius, float, 0, VTK_LARGE_FLOAT); + vtkSetClampMacro(CylinderRadius, float, 0, VTK_FLOAT_MAX); vtkGetMacro(CylinderRadius, float); // Description: diff --git a/src/VTKViewer/VTKViewer_Actor.cxx b/src/VTKViewer/VTKViewer_Actor.cxx index 76df0121d..e19a2506d 100755 --- a/src/VTKViewer/VTKViewer_Actor.cxx +++ b/src/VTKViewer/VTKViewer_Actor.cxx @@ -491,14 +491,14 @@ VTKViewer_Actor if(myIsInfinite) return true; - static double MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT; + static double MAX_DISTANCE = 0.9*VTK_FLOAT_MAX; double aBounds[6]; GetBounds(aBounds); for(int i = 0; i < 6; i++) if(fabs(aBounds[i]) > MAX_DISTANCE) return true; - static double MIN_DISTANCE = 1.0/VTK_LARGE_FLOAT; + static double MIN_DISTANCE = 1.0/VTK_FLOAT_MAX; if(GetLength() < MIN_DISTANCE) return true; diff --git a/src/VTKViewer/VTKViewer_Trihedron.cxx b/src/VTKViewer/VTKViewer_Trihedron.cxx index 9c1dee3aa..e32c596f5 100755 --- a/src/VTKViewer/VTKViewer_Trihedron.cxx +++ b/src/VTKViewer/VTKViewer_Trihedron.cxx @@ -52,8 +52,8 @@ vtkStandardNewMacro(VTKViewer_UnScaledActor); /*!Constructor*/ VTKViewer_UnScaledActor::VTKViewer_UnScaledActor() { - Bounds[0] = Bounds[2] = Bounds[4] = VTK_LARGE_FLOAT; - Bounds[1] = Bounds[3] = Bounds[5] = -VTK_LARGE_FLOAT; + Bounds[0] = Bounds[2] = Bounds[4] = VTK_FLOAT_MAX; + Bounds[1] = Bounds[3] = Bounds[5] = -VTK_FLOAT_MAX; } /*! diff --git a/src/VTKViewer/VTKViewer_Utilities.cxx b/src/VTKViewer/VTKViewer_Utilities.cxx index 235f5f9a1..ad68c7007 100755 --- a/src/VTKViewer/VTKViewer_Utilities.cxx +++ b/src/VTKViewer/VTKViewer_Utilities.cxx @@ -48,7 +48,7 @@ ResetCamera(vtkRenderer* theRenderer, int aCount = ComputeVisiblePropBounds(theRenderer,aBounds); if(theUsingZeroFocalPoint || aCount){ - static double MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT; + static double MIN_DISTANCE = 1.0 / VTK_FLOAT_MAX; double aLength = aBounds[1]-aBounds[0]; aLength = std::max((aBounds[3]-aBounds[2]),aLength); @@ -120,8 +120,8 @@ ComputeBounds(vtkActorCollection* theCollection, double theBounds[6]) { int aCount = 0; - theBounds[0] = theBounds[2] = theBounds[4] = VTK_LARGE_FLOAT; - theBounds[1] = theBounds[3] = theBounds[5] = -VTK_LARGE_FLOAT; + theBounds[0] = theBounds[2] = theBounds[4] = VTK_FLOAT_MAX; + theBounds[1] = theBounds[3] = theBounds[5] = -VTK_FLOAT_MAX; // loop through all props theCollection->InitTraversal(); @@ -132,8 +132,8 @@ ComputeBounds(vtkActorCollection* theCollection, double theBounds[6]) if(anActor->IsInfinitive()) continue; double *aBounds = aProp->GetBounds(); - static double MIN_DISTANCE = 1./VTK_LARGE_FLOAT; - static double MAX_DISTANCE = 0.9*VTK_LARGE_FLOAT; + static double MIN_DISTANCE = 1./VTK_FLOAT_MAX; + static double MAX_DISTANCE = 0.9*VTK_FLOAT_MAX; if(fabs(aBounds[1] - aBounds[0]) < MIN_DISTANCE) { aBounds[0]-=0.001; @@ -248,8 +248,8 @@ bool IsBBEmpty(vtkRenderer* theRenderer) return false; double aNewBndBox[6]; - aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT; - aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT; + aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_FLOAT_MAX; + aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_FLOAT_MAX; // iterate through displayed objects and set size if necessary VTK::ActorCollectionCopy aCopy(theRenderer->GetActors()); @@ -262,9 +262,9 @@ bool IsBBEmpty(vtkRenderer* theRenderer) if(anActor->GetVisibility() && !anActor->IsInfinitive()) { double *aBounds = anActor->GetBounds(); - if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT && - aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT && - aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT) + if(aBounds[0] > -VTK_FLOAT_MAX && aBounds[1] < VTK_FLOAT_MAX && + aBounds[2] > -VTK_FLOAT_MAX && aBounds[3] < VTK_FLOAT_MAX && + aBounds[4] > -VTK_FLOAT_MAX && aBounds[5] < VTK_FLOAT_MAX) isAny = true; } @@ -292,8 +292,8 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, double theCenter[3]) return false; double aNewBndBox[6]; - aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_LARGE_FLOAT; - aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_LARGE_FLOAT; + aNewBndBox[ 0 ] = aNewBndBox[ 2 ] = aNewBndBox[ 4 ] = VTK_FLOAT_MAX; + aNewBndBox[ 1 ] = aNewBndBox[ 3 ] = aNewBndBox[ 5 ] = -VTK_FLOAT_MAX; // iterate through displayed objects and set size if necessary VTK::ActorCollectionCopy aCopy(theRenderer->GetActors()); @@ -312,9 +312,9 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, double theCenter[3]) //Ignore invalid bounds if(!isBoundValid(aBounds)) continue; - if(aBounds[0] > -VTK_LARGE_FLOAT && aBounds[1] < VTK_LARGE_FLOAT && - aBounds[2] > -VTK_LARGE_FLOAT && aBounds[3] < VTK_LARGE_FLOAT && - aBounds[4] > -VTK_LARGE_FLOAT && aBounds[5] < VTK_LARGE_FLOAT) + if(aBounds[0] > -VTK_FLOAT_MAX && aBounds[1] < VTK_FLOAT_MAX && + aBounds[2] > -VTK_FLOAT_MAX && aBounds[3] < VTK_FLOAT_MAX && + aBounds[4] > -VTK_FLOAT_MAX && aBounds[5] < VTK_FLOAT_MAX) { for(int i = 0; i < 5; i = i + 2){ if(aBounds[i] < aNewBndBox[i]) @@ -334,11 +334,11 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, double theCenter[3]) return true; } - if(aNewBndBox[0] > -VTK_LARGE_FLOAT && aNewBndBox[1] < VTK_LARGE_FLOAT && - aNewBndBox[2] > -VTK_LARGE_FLOAT && aNewBndBox[3] < VTK_LARGE_FLOAT && - aNewBndBox[4] > -VTK_LARGE_FLOAT && aNewBndBox[5] < VTK_LARGE_FLOAT) + if(aNewBndBox[0] > -VTK_FLOAT_MAX && aNewBndBox[1] < VTK_FLOAT_MAX && + aNewBndBox[2] > -VTK_FLOAT_MAX && aNewBndBox[3] < VTK_FLOAT_MAX && + aNewBndBox[4] > -VTK_FLOAT_MAX && aNewBndBox[5] < VTK_FLOAT_MAX) { - static double MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT; + static double MIN_DISTANCE = 1.0 / VTK_FLOAT_MAX; double aLength = aNewBndBox[1]-aNewBndBox[0]; aLength = std::max((aNewBndBox[3]-aNewBndBox[2]),aLength); @@ -371,7 +371,7 @@ bool ComputeBBCenter(vtkRenderer* theRenderer, double theCenter[3]) printf("aCount = %d\n",aCount); if(aCount){ - static double MIN_DISTANCE = 1.0 / VTK_LARGE_FLOAT; + static double MIN_DISTANCE = 1.0 / VTK_FLOAT_MAX; double aLength = aBounds[1]-aBounds[0]; aLength = max((aBounds[3]-aBounds[2]),aLength); -- 2.39.2