Skip to content
Snippets Groups Projects
Commit f4a2f605 authored by LINJIAO email's avatar LINJIAO email
Browse files

Refs #20172. use <limits>. roll back V3D.h

parent 4341969e
No related merge requests found
...@@ -2,6 +2,7 @@ ...@@ -2,6 +2,7 @@
#include "MantidKernel/Strings.h" #include "MantidKernel/Strings.h"
#include "MantidKernel/Tolerance.h" #include "MantidKernel/Tolerance.h"
#include <iostream> #include <iostream>
#include <limits>
#ifdef ENABLE_OPENCASCADE #ifdef ENABLE_OPENCASCADE
// Opencascade defines _USE_MATH_DEFINES without checking whether it is already // Opencascade defines _USE_MATH_DEFINES without checking whether it is already
...@@ -397,8 +398,8 @@ void Cylinder::getBoundingBox(double &xmax, double &ymax, double &zmax, ...@@ -397,8 +398,8 @@ void Cylinder::getBoundingBox(double &xmax, double &ymax, double &zmax,
listOfPoints.push_back(zmaxPoint); listOfPoints.push_back(zmaxPoint);
} }
if (!listOfPoints.empty()) { if (!listOfPoints.empty()) {
xmin = ymin = zmin = DBL_MAX; xmin = ymin = zmin = std::numeric_limits<double>::max();
xmax = ymax = zmax = DBL_MIN; xmax = ymax = zmax = std::numeric_limits<double>::min();
for (std::vector<V3D>::const_iterator it = listOfPoints.begin(); for (std::vector<V3D>::const_iterator it = listOfPoints.begin();
it != listOfPoints.end(); ++it) { it != listOfPoints.end(); ++it) {
// std::cout<<(*it)<<'\n'; // std::cout<<(*it)<<'\n';
......
...@@ -3,6 +3,7 @@ ...@@ -3,6 +3,7 @@
#include "MantidKernel/Strings.h" #include "MantidKernel/Strings.h"
#include "MantidKernel/Tolerance.h" #include "MantidKernel/Tolerance.h"
#include <iostream> #include <iostream>
#include <limits>
#ifdef ENABLE_OPENCASCADE #ifdef ENABLE_OPENCASCADE
// Opencascade defines _USE_MATH_DEFINES without checking whether it is already // Opencascade defines _USE_MATH_DEFINES without checking whether it is already
...@@ -393,8 +394,8 @@ void Plane::getBoundingBox(double &xmax, double &ymax, double &zmax, ...@@ -393,8 +394,8 @@ void Plane::getBoundingBox(double &xmax, double &ymax, double &zmax,
// now sort the vertices to find the mins and max // now sort the vertices to find the mins and max
// std::cout<<listOfPoints.size()<<'\n'; // std::cout<<listOfPoints.size()<<'\n';
if (!listOfPoints.empty()) { if (!listOfPoints.empty()) {
xmin = ymin = zmin = DBL_MAX; xmin = ymin = zmin = std::numeric_limits<double>::max();
xmax = ymax = zmax = -DBL_MAX; xmax = ymax = zmax = -std::numeric_limits<double>::max();
for (std::vector<V3D>::const_iterator it = listOfPoints.begin(); for (std::vector<V3D>::const_iterator it = listOfPoints.begin();
it != listOfPoints.end(); ++it) { it != listOfPoints.end(); ++it) {
// std::cout<<(*it)<<'\n'; // std::cout<<(*it)<<'\n';
......
...@@ -2,7 +2,6 @@ ...@@ -2,7 +2,6 @@
#define MANTID_KERNEL_V3D_H_ #define MANTID_KERNEL_V3D_H_
#include <cmath> #include <cmath>
#include <cfloat>
#include <iosfwd> #include <iosfwd>
#include <vector> #include <vector>
#include "MantidKernel/DllConfig.h" #include "MantidKernel/DllConfig.h"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment