Merge pull request #4673 from maxGimeno/CGAL_Fix_MIN_MAX_4_14-maxGimeno

CGAL: Fixes for min/max 4.14
This commit is contained in:
Sebastien Loriot 2020-04-27 09:45:16 +02:00 committed by GitHub
commit 1c05c79244
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
75 changed files with 245 additions and 247 deletions

View File

@ -857,8 +857,8 @@ void Scene::update_grid_size()
}
void Scene::generate_points_in(const unsigned int nb_points,
const double min,
const double max)
const double vmin,
const double vmax)
{
if(m_pPolyhedron == NULL)
{
@ -877,7 +877,7 @@ void Scene::generate_points_in(const unsigned int nb_points,
CGAL::Timer timer;
timer.start();
std::cout << "Generate " << nb_points << " points in interval ["
<< min << ";" << max << "]";
<< vmin << ";" << vmax << "]";
unsigned int nb_trials = 0;
Vector vec = random_vector();
@ -894,8 +894,8 @@ void Scene::generate_points_in(const unsigned int nb_points,
if(nb_intersections % 2 != 0)
signed_distance *= -1.0;
if(signed_distance >= min &&
signed_distance <= max)
if(signed_distance >= vmin &&
signed_distance <= vmax)
{
m_points.push_back(p);
if(m_points.size()%(nb_points/10) == 0)

View File

@ -192,7 +192,7 @@ public:
void generate_boundary_points(const unsigned int nb_points);
void generate_boundary_segments(const unsigned int nb_slices);
void generate_points_in(const unsigned int nb_points,
const double min, const double max);
const double vmin, const double vmax);
// algorithms/refine
void refine_loop();

View File

@ -118,10 +118,10 @@ QRectF ArrangementDemoGraphicsView::getViewportRect( ) const
QPointF p1 = this->mapToScene( 0, 0 );
QPointF p2 = this->mapToScene( this->width( ), this->height( ) );
double xmin = std::min( p1.x( ), p2.x( ) );
double xmax = std::max( p1.x( ), p2.x( ) );
double ymin = std::min( p1.y( ), p2.y( ) );
double ymax = std::max( p1.y( ), p2.y( ) );
double xmin = (std::min)( p1.x( ), p2.x( ) );
double xmax = (std::max)( p1.x( ), p2.x( ) );
double ymin = (std::min)( p1.y( ), p2.y( ) );
double ymax = (std::max)( p1.y( ), p2.y( ) );
QRectF res = QRectF( QPointF( xmin, ymin ), QPointF( xmax, ymax ) );

View File

@ -3031,8 +3031,8 @@ public:
y_dapprox = y_interval_for_curve_end(*this, CGAL::ARR_MIN_END, prec);
// adapt y-interval
ymin = CGAL::min(ymin, y_dapprox.first);
ymax = CGAL::max(ymax, y_dapprox.second);
ymin = (CGAL::min)(ymin, y_dapprox.first);
ymax = (CGAL::max)(ymax, y_dapprox.second);
// right end
@ -3112,9 +3112,9 @@ public:
(curr_xy, prec);
// adapt y-interval
ymin = CGAL::min(ymin,
ymin = (CGAL::min)(ymin,
CGAL::to_double(xy_approx.first));
ymax = CGAL::max(ymax,
ymax = (CGAL::max)(ymax,
CGAL::to_double(xy_approx.second));
}
}

View File

@ -581,7 +581,7 @@ void draw(const Arc_2& arc,
ref_bound = engine.pixel_h_r/CGAL_REFINE_X;
#ifdef CGAL_CKVA_RENDER_WITH_REFINEMENT
ref_bound = std::min(ref_bound, Rational(CGAL_REFINE_DOUBLE_APPROX));
ref_bound = (std::min)(ref_bound, Rational(CGAL_REFINE_DOUBLE_APPROX));
#endif
Gfx_OUT("computing y-coordinates\n");
@ -921,7 +921,7 @@ bool draw(const Point_2& pt, Coord_2& coord) {
const Coordinate_1& x0 = pt.x();
Rational ref_bound = engine.pixel_w_r / 2;
#ifdef CGAL_CKVA_RENDER_WITH_REFINEMENT
ref_bound = std::min(ref_bound, Rational(CGAL_REFINE_DOUBLE_APPROX));
ref_bound = (std::min)(ref_bound, Rational(CGAL_REFINE_DOUBLE_APPROX));
#endif
typename Curve_kernel_2::Algebraic_kernel_d_1::Approximate_relative_1
@ -941,7 +941,7 @@ bool draw(const Point_2& pt, Coord_2& coord) {
ref_bound = engine.pixel_h_r / CGAL_REFINE_X;
#ifdef CGAL_CKVA_RENDER_WITH_REFINEMENT
ref_bound = std::min(ref_bound, Rational(CGAL_REFINE_DOUBLE_APPROX));
ref_bound = (std::min)(ref_bound, Rational(CGAL_REFINE_DOUBLE_APPROX));
#endif
Coordinate_2 xy(x0, pt.curve(), pt.arcno());

View File

@ -17,8 +17,8 @@ int nr = 0;
double rerr(double exact,double approx) {
const double e = std::abs((exact-approx)/exact);
mine = std::min(mine,e);
maxe = std::max(maxe,e);
mine = (std::min)(mine,e);
maxe = (std::max)(maxe,e);
avge += e;
++nr;
return e;

View File

@ -103,7 +103,7 @@ void ASphapeIpelet::protected_run(int fn)
}
A.set_alpha(alpha==0?std::max(std::numeric_limits<double>::epsilon(),A.get_nth_alpha(0)/2.):
A.set_alpha(alpha==0?(std::max)(std::numeric_limits<double>::epsilon(),A.get_nth_alpha(0)/2.):
(std::size_t) alpha==A.number_of_alphas()?A.get_nth_alpha(alpha-1)+1:A.get_nth_alpha(alpha-1)/2.+A.get_nth_alpha(alpha)/2.);
for ( Alpha_shape_2::Alpha_shape_edges_iterator it=A.alpha_shape_edges_begin();it!=A.alpha_shape_edges_end();++it)
draw_in_ipe(A.segment(*it));

View File

@ -144,8 +144,8 @@ void diagrammeIpelet::protected_run(int fn)
Kernel::FT incr_len=(fn<2)?50:75;
//slightly increase the size of the Bbox
bbox=Iso_rectangle_2(bbox.min()+Kernel::Vector_2(-incr_len,-incr_len),
bbox.max()+Kernel::Vector_2(incr_len,incr_len));
bbox=Iso_rectangle_2((bbox.min)()+Kernel::Vector_2(-incr_len,-incr_len),
(bbox.max)()+Kernel::Vector_2(incr_len,incr_len));

View File

@ -99,8 +99,8 @@ void IpeletMesh2::protected_run(int fn)
double alpha=0;
int x=static_cast<int>( floor(bbox.max().x()-bbox.min().x()) );
int y=static_cast<int>( floor(bbox.max().y()-bbox.min().y()) );
int x=static_cast<int>( floor((bbox.max)().x()-(bbox.min)().x()) );
int y=static_cast<int>( floor((bbox.max)().y()-(bbox.min)().y()) );
int ret_val;
boost::tie(ret_val,alpha)=request_value_from_user<double>((boost::format("Max edge length (BBox %1%x%2%)") % x % y).str() );

View File

@ -85,7 +85,7 @@ void SubSelectIpelet::protected_run(int fn)
for (std::list<Circle_2>::iterator it=cir_list.begin();it!=cir_list.end();++it)
r_offsets.push_back(sqrt(CGAL::to_double(it->squared_radius())));
IpeMatrix tfm (1,0,0,1,-CGAL::to_double(bbox.min().x()),-CGAL::to_double(bbox.min().y()));
IpeMatrix tfm (1,0,0,1,-CGAL::to_double((bbox.min)().x()),-CGAL::to_double((bbox.min)().y()));
for (std::list<Polygon_2>::iterator it=pol_list.begin();it!=pol_list.end();++it)
if(!it->is_simple()){

View File

@ -104,8 +104,8 @@ void MregularIpelet::protected_run(int fn)
draw_in_ipe(rt);
else{//Draw kth Power diagram
double incr_len=75;
bbox=Iso_rectangle_2(bbox.min()+Kernel::Vector_2(-incr_len,-incr_len),
bbox.max()+Kernel::Vector_2(incr_len,incr_len));
bbox=Iso_rectangle_2((bbox.min)()+Kernel::Vector_2(-incr_len,-incr_len),
(bbox.max)()+Kernel::Vector_2(incr_len,incr_len));
draw_dual_in_ipe(rt,bbox); //draw Voronoi Diagram
}
}

View File

@ -114,7 +114,7 @@ void SkeletonIpelet::protected_run(int fn)
std::list<double> offsets;
//~ "Interior skeleton", "Exterior skeleton","Interior offset","Exterior offset","Interior offsets","Exterior offsets", "Help"
SkeletonPtr ss;
double max_edge=std::max((bbox.xmax()-bbox.xmin()),(bbox.ymax()-bbox.ymin()));
double max_edge=(std::max)((bbox.xmax()-bbox.xmin()),(bbox.ymax()-bbox.ymin()));
double dist=0.;
int ret_val=-1;
switch(fn){

View File

@ -96,8 +96,8 @@ namespace CGAL_svdlinf {
Kernel::FT incr_len = 75;
// slightly increase the size of the bbox
bbox = Iso_rectangle_2(
bbox.min()+Kernel::Vector_2(-incr_len,-incr_len),
bbox.max()+Kernel::Vector_2(incr_len,incr_len));
(bbox.min)()+Kernel::Vector_2(-incr_len,-incr_len),
(bbox.max)()+Kernel::Vector_2(incr_len,incr_len));
for (std::list<Segment_2>::iterator
sit = sg_list.begin();

View File

@ -265,8 +265,8 @@ public:
_page->DeselectAll();
Iso_rectangle_2 bbox_cgal(
static_cast<double>(bbox_ipe.Min().iX),static_cast<double>(bbox_ipe.Min().iY),
static_cast<double>(bbox_ipe.Max().iX),static_cast<double>(bbox_ipe.Max().iY)
static_cast<double>((bbox_ipe.Min)().iX),static_cast<double>((bbox_ipe.Min)().iY),
static_cast<double>((bbox_ipe.Max)().iX),static_cast<double>((bbox_ipe.Max)().iY)
);
return bbox_cgal;

View File

@ -67,8 +67,8 @@ public:
m_values.reserve (clusters.size());
for (std::size_t i = 0; i < clusters.size(); ++ i)
{
float min_z = std::numeric_limits<float>::max();
float max_z = -std::numeric_limits<float>::min();
float min_z = (std::numeric_limits<float>::max)();
float max_z = -(std::numeric_limits<float>::min)();
for (std::size_t j = 0; j < clusters[i].size(); ++ j)
{

View File

@ -97,7 +97,7 @@ public:
Image_float dem(grid.width(),grid.height());
z_max = 0.f;
z_min = std::numeric_limits<float>::max();
z_min = (std::numeric_limits<float>::max)();
for (std::size_t j = 0; j < grid.height(); ++ j)
for (std::size_t i = 0; i < grid.width(); ++ i)
@ -109,8 +109,8 @@ public:
for (typename Grid::iterator it = grid.indices_begin(i,j); it != end; ++ it)
{
float z = float(get(point_map, *(input.begin()+(*it))).z());
z_min = (std::min(z_min, z));
z_max = (std::max(z_max, z));
z_min = ((std::min)(z_min, z));
z_max = ((std::max)(z_max, z));
mean += z;
++ nb;
}

View File

@ -90,13 +90,13 @@ public:
for (std::size_t i = 0; i < grid.width(); ++ i)
if (grid.has_points(i,j))
{
float z_max = -std::numeric_limits<float>::max();
float z_max = -(std::numeric_limits<float>::max)();
typename Grid::iterator end = grid.indices_end(i,j);
for (typename Grid::iterator it = grid.indices_begin(i,j); it != end; ++ it)
{
float z = float(get(point_map, *(input.begin()+(*it))).z());
z_max = (std::max(z_max, z));
z_max = ((std::max)(z_max, z));
}
dtm(i,j) = z_max;

View File

@ -90,13 +90,13 @@ public:
for (std::size_t i = 0; i < grid.width(); ++ i)
if (grid.has_points(i,j))
{
float z_min = std::numeric_limits<float>::max();
float z_min = (std::numeric_limits<float>::max)();
typename Grid::iterator end = grid.indices_end(i,j);
for (typename Grid::iterator it = grid.indices_begin(i,j); it != end; ++ it)
{
float z = float(get(point_map, *(input.begin()+(*it))).z());
z_min = (std::min(z_min, z));
z_min = ((std::min)(z_min, z));
}
dtm(i,j) = z_min;

View File

@ -90,15 +90,15 @@ public:
for (std::size_t i = 0; i < grid.width(); ++ i)
if (grid.has_points(i,j))
{
float z_max = -std::numeric_limits<float>::max();
float z_min = std::numeric_limits<float>::max();
float z_max = -(std::numeric_limits<float>::max)();
float z_min = (std::numeric_limits<float>::max)();
typename Grid::iterator end = grid.indices_end(i,j);
for (typename Grid::iterator it = grid.indices_begin(i,j); it != end; ++ it)
{
float z = float(get(point_map, *(input.begin()+(*it))).z());
z_max = (std::max(z_max, z));
z_min = (std::min(z_min, z));
z_max = ((std::max)(z_max, z));
z_min = ((std::min)(z_min, z));
}
dtm(i,j) = z_max - z_min;

View File

@ -49,15 +49,15 @@ typedef unsigned short compressed_float;
typedef unsigned char compressed_float;
# endif
inline compressed_float compress_float (const float& f, const float& min = 0.f, const float& max = 1.f)
inline compressed_float compress_float (const float& f, const float& fmin = 0.f, const float& fmax = 1.f)
{
return static_cast<compressed_float>
(float(std::numeric_limits<compressed_float>::max()) * (f - min) / (max - min));
(float((std::numeric_limits<compressed_float>::max)()) * (f - fmin) / (fmax - fmin));
}
inline float decompress_float (const compressed_float& t, const float& min = 0.f, const float& max = 1.f)
inline float decompress_float (const compressed_float& t, const float& fmin = 0.f, const float& fmax = 1.f)
{
return ((max - min) * (t / float(std::numeric_limits<compressed_float>::max())) + min);
return ((fmax - fmin) * (t / float((std::numeric_limits<compressed_float>::max)())) + fmin);
}
#endif

View File

@ -135,7 +135,7 @@ public:
if (maxz < arz) maxz = arz;
if (maxz < atz) maxz = atz;
double d = std::max(maxx, std::max(maxy, maxz));
double d = (std::max)(maxx, (std::max)(maxy, maxz));
double eps = 3.27418e-11 * d * d * d * d * d * d;
if (det > eps) return ON_BOUNDED_SIDE;

View File

@ -39,20 +39,20 @@ int main(int argc, char* argv[])
Point_3 sp = tm.point(source);
std::cout << "source: " << sp << " " << source << std::endl;
vertex_descriptor far;
vertex_descriptor vfar;
double sdistance = 0;
BOOST_FOREACH(vertex_descriptor vd , vertices(tm)){
std::cout << vd << " is at distance " << get(vertex_distance, vd) << " to " << source << std::endl;
if(get(vertex_distance, vd) > sdistance){
far = vd;
vfar = vd;
sdistance = get(vertex_distance, vd);
}
}
std::cout << "far: " << tm.point(far) << " " << far << std::endl;
std::cout << "vfar: " << tm.point(vfar) << " " << vfar << std::endl;
hm.add_source(far);
hm.add_source(vfar);
hm.estimate_geodesic_distances(vertex_distance);
BOOST_FOREACH(vertex_descriptor vd , vertices(tm)){

View File

@ -43,19 +43,19 @@ int main()
//Point_3 sp = sm.point(source);
vertex_descriptor far;
vertex_descriptor vfar;
// double sdistance = 0;
BOOST_FOREACH(vertex_descriptor vd , vertices(sm)){
std::cout << vd << " is at distance " << get(heat_intensity, vd) << " from " << source << std::endl;
/*
if(squared_distance(sp,sm.point(vd)) > sdistance){
far = vd;
vfar = vd;
sdistance = squared_distance(sp,sm.point(vd));
}
*/
}
hm.add_source(far);
hm.add_source(vfar);
hm.estimate_geodesic_distances(heat_intensity);
BOOST_FOREACH(vertex_descriptor vd , vertices(sm)){

View File

@ -37,19 +37,19 @@ int main(int argc, char* argv[])
Point_3 sp = sm.point(source);
std::cout << "source: " << sp << " " << source << std::endl;
vertex_descriptor far;
vertex_descriptor vfar;
double sdistance = 0;
BOOST_FOREACH(vertex_descriptor vd , vertices(sm)){
if(get(vertex_distance,vd) > sdistance){
far = vd;
vfar = vd;
sdistance = get(vertex_distance,vd);
}
}
assert(sdistance > 2.9);
assert(sdistance < CGAL_PI);
hm.add_source(far);
hm.add_source(vfar);
assert(hm.sources().size() == 2);
hm.estimate_geodesic_distances(vertex_distance);
@ -63,7 +63,7 @@ int main(int argc, char* argv[])
assert(sdistance > 1.4);
assert(sdistance < CGAL_PI/2.0);
hm.remove_source(far);
hm.remove_source(vfar);
assert(hm.sources().size() == 1);
hm.clear_sources();
@ -71,7 +71,7 @@ int main(int argc, char* argv[])
// add range of sources
std::vector<vertex_descriptor> vrange;
vrange.push_back(source);
vrange.push_back(far);
vrange.push_back(vfar);
hm.add_sources(vrange);
assert(hm.sources().size() == 2);
hm.estimate_geodesic_distances(vertex_distance);

View File

@ -37,19 +37,19 @@ int main(int argc, char* argv[])
Point_3 sp = sm.point(source);
std::cout << "source: " << sp << " " << source << std::endl;
vertex_descriptor far;
vertex_descriptor vfar;
double sdistance = 0;
BOOST_FOREACH(vertex_descriptor vd , vertices(sm)){
if(get(vertex_distance,vd) > sdistance){
far = vd;
vfar = vd;
sdistance = get(vertex_distance,vd);
}
}
assert(sdistance > 2.9);
assert(sdistance < CGAL_PI);
hm.add_source(far);
hm.add_source(vfar);
assert(hm.sources().size() == 2);
hm.estimate_geodesic_distances(vertex_distance);
@ -63,7 +63,7 @@ int main(int argc, char* argv[])
assert(sdistance > 1.4);
assert(sdistance < CGAL_PI/2.0);
hm.remove_source(far);
hm.remove_source(vfar);
assert(hm.sources().size() == 1);
hm.clear_sources();
@ -71,7 +71,7 @@ int main(int argc, char* argv[])
// add range of sources
std::vector<vertex_descriptor> vrange;
vrange.push_back(source);
vrange.push_back(far);
vrange.push_back(vfar);
hm.add_sources(vrange);
assert(hm.sources().size() == 2);
hm.estimate_geodesic_distances(vertex_distance);

View File

@ -319,7 +319,7 @@ MainWindow::on_actionInsertRandomPoints_triggered()
tr("Enter number of random points"),
100,
0,
std::numeric_limits<int>::max(),
(std::numeric_limits<int>::max)(),
1,
&ok);

View File

@ -32,7 +32,7 @@
int main()
{
double d = std::numeric_limits<double>::denorm_min();
double e = std::numeric_limits<double>::min();
double e = (std::numeric_limits<double>::min)();
// Note : denorm_min == min is actually not necessarily a bug.
// So a better test should be found.
if (d == 0 || d == e)

View File

@ -34,7 +34,7 @@ namespace CGAL {
#ifdef CGAL_EIGEN3_ENABLED
const int UNKNOWN_DIMENSION=Eigen::Dynamic;
#elif defined CGAL_CXX11
const int UNKNOWN_DIMENSION=std::numeric_limits<int>::max();
const int UNKNOWN_DIMENSION=(std::numeric_limits<int>::max)();
#else
const int UNKNOWN_DIMENSION=(unsigned)-1/2;
#endif

View File

@ -91,8 +91,8 @@ int main() {
assert(b1.bounded_side(qq1)==CGAL::ON_BOUNDARY);
assert(b1.bounded_side(qq4)==CGAL::ON_UNBOUNDED_SIDE);
assert(b1.bounded_side(mm1)==CGAL::ON_BOUNDED_SIDE);
// std::cout << "b1.min()=" << b1.min() << std::endl;
// std::cout << "b1.max()=" << b1.max() << std::endl;
// std::cout << "(b1.min)()=" << (b1.min)() << std::endl;
// std::cout << "(b1.max)()=" << (b1.max)() << std::endl;
std::cout << "volume of b1=" << b1.volume() << std::endl;
std::cout << "volume of b4=" << b4.volume() << std::endl;
std::cout << "volume of b5=" << b5.volume() << std::endl;

View File

@ -94,8 +94,8 @@ int main() {
assert(b1.bounded_side(qq1)==CGAL::ON_BOUNDARY);
assert(b1.bounded_side(qq4)==CGAL::ON_UNBOUNDED_SIDE);
assert(b1.bounded_side(mm1)==CGAL::ON_BOUNDED_SIDE);
// std::cout << "b1.min()=" << b1.min() << std::endl;
// std::cout << "b1.max()=" << b1.max() << std::endl;
// std::cout << "(b1.min)()=" << (b1.min)() << std::endl;
// std::cout << "(b1.max)()=" << (b1.max)() << std::endl;
std::cout << "volume of b1=" << b1.volume() << std::endl;
std::cout << "volume of b4=" << b4.volume() << std::endl;
std::cout << "volume of b5=" << b5.volume() << std::endl;

View File

@ -71,7 +71,7 @@ bool read_off_ascii(Surface_mesh& mesh,
// #Vertice, #Faces, #Edges
items = fscanf(in, "%d %d %d\n", (int*)&nV, (int*)&nF, (int*)&nE);
mesh.clear();
mesh.reserve(nV, std::max(3*nV, nE), nF);
mesh.reserve(nV, (std::max)(3*nV, nE), nF);
// read vertices: pos [normal] [color] [texcoord]
@ -186,7 +186,7 @@ bool read_off_binary(Surface_mesh& mesh,
read(in, nF);
read(in, nE);
mesh.clear();
mesh.reserve(nV, std::max(3*nV, nE), nF);
mesh.reserve(nV, (std::max)(3*nV, nE), nF);
// read vertices: pos [normal] [color] [texcoord]

View File

@ -223,7 +223,7 @@ public:
Vector<Scalar,N>& normalize()
{
Scalar n = norm(*this);
if (n > std::numeric_limits<Scalar>::min())
if (n > (std::numeric_limits<Scalar>::min)())
*this *= 1.0/n;
return *this;
}
@ -513,7 +513,7 @@ public:
Vector<Scalar,3>& normalize()
{
Scalar n = norm(*this);
n = (n > std::numeric_limits<Scalar>::min()) ? 1.0/n : 0.0;
n = (n > (std::numeric_limits<Scalar>::min)()) ? 1.0/n : 0.0;
x *= n;
y *= n;
z *= n;

View File

@ -63,7 +63,7 @@ private:
Dart getShortestEdge()
{
double weight = std::numeric_limits<double>::max();
double weight = (std::numeric_limits<double>::max)();
Dart dart = NIL;
bool boundary=false;

View File

@ -319,7 +319,7 @@ private:
Dart_handle getShortestEdge()
{
double weight = std::numeric_limits<double>::max();
double weight = (std::numeric_limits<double>::max)();
Dart_handle dart = lcc.null_dart_handle;
int m=lcc.get_new_mark();

View File

@ -129,7 +129,7 @@ private:
// Find the mesh's shortest edge
EdgeHandle getShortestEdge()
{
double max_weight = std::numeric_limits<double>::max();
double max_weight = (std::numeric_limits<double>::max)();
EdgeHandle eh = Mesh::InvalidEdgeHandle;
bool boundary=false;

View File

@ -41,15 +41,15 @@ class Compute_min_angle
operator()(const Cell_handle ch) const
{
double min_quotient = compute_quotient(ch, 0, 1, 2, 3);
min_quotient = std::min(min_quotient,
min_quotient = (std::min)(min_quotient,
compute_quotient(ch, 0, 2, 1, 3));
min_quotient = std::min(min_quotient,
min_quotient = (std::min)(min_quotient,
compute_quotient(ch, 0, 3, 1, 2));
min_quotient = std::min(min_quotient,
min_quotient = (std::min)(min_quotient,
compute_quotient(ch, 1, 2, 0, 3));
min_quotient = std::min(min_quotient,
min_quotient = (std::min)(min_quotient,
compute_quotient(ch, 1, 3, 0, 2));
min_quotient = std::min(min_quotient,
min_quotient = (std::min)(min_quotient,
compute_quotient(ch, 2, 3, 0, 1));
const double volume = CGAL::to_double(tr.tetrahedron(ch).volume());
@ -128,19 +128,19 @@ namespace CGAL {
min_dihedral_angle_aux_compute_quotient(p0, p1, p2, p3, k);
min_quotient =
std::min(min_quotient,
(std::min)(min_quotient,
min_dihedral_angle_aux_compute_quotient(p0, p2, p1, p3, k));
min_quotient =
std::min(min_quotient,
(std::min)(min_quotient,
min_dihedral_angle_aux_compute_quotient(p0, p3, p1, p2, k));
min_quotient =
std::min(min_quotient,
(std::min)(min_quotient,
min_dihedral_angle_aux_compute_quotient(p1, p2, p0, p3, k));
min_quotient =
std::min(min_quotient,
(std::min)(min_quotient,
min_dihedral_angle_aux_compute_quotient(p1, p3, p0, p2, k));
min_quotient =
std::min(min_quotient,
(std::min)(min_quotient,
min_dihedral_angle_aux_compute_quotient(p2, p3, p0, p1, k));
// std::cerr << CGAL::sqrt(min_quotient) << " - "

View File

@ -452,7 +452,7 @@ private:
pNode->ref_node(candidate.ref_node());
pNode->size() = candidate.size();
pNode->done() = true;
m_max_size = std::max(m_max_size,pNode->size());
m_max_size = (std::max)(m_max_size,pNode->size());
// explore neighbors
for(unsigned int index_neighbor = 0;

View File

@ -87,9 +87,9 @@ class visual_hull_creator : public CGAL::Modifier_base<SNC_> {
public:
visual_hull_creator(Point_3 min, Point_3 max, Point_3 position,
visual_hull_creator(Point_3 pmin, Point_3 pmax, Point_3 position,
std::list<std::list<Point_3> > p) :
room_min(min), room_max(max), c_pos(position), polygon_list(p) { }
room_min(pmin), room_max(pmax), c_pos(position), polygon_list(p) { }
/*
void recompute_scene() {

View File

@ -384,24 +384,24 @@ class Infimaximal_box<Tag_true, Kernel> {
C.create_vertices_of_box_with_plane(h, b);
}
static void compute_min_max(const Plane_3& h, NT orth_coords[3], int& min, int& max) {
static void compute_min_max(const Plane_3& h, NT orth_coords[3], int& cmin, int& cmax) {
Vector_3 orth = h.orthogonal_vector();
orth_coords[0] = CGAL_NTS abs(orth.hx()[0]);
orth_coords[1] = CGAL_NTS abs(orth.hy()[0]);
orth_coords[2] = CGAL_NTS abs(orth.hz()[0]);
max = 0;
cmax = 0;
if(orth_coords[1] > orth_coords[0])
max = 1;
if(orth_coords[2] > orth_coords[max])
max = 2;
cmax = 1;
if(orth_coords[2] > orth_coords[cmax])
cmax = 2;
min = 0;
cmin = 0;
if(orth_coords[1] < orth_coords[0])
min = 1;
if(orth_coords[2] < orth_coords[min])
min = 2;
cmin = 1;
if(orth_coords[2] < orth_coords[cmin])
cmin = 2;
}
template<typename SNC_structure>

View File

@ -172,7 +172,7 @@ class Quotient
}
#ifdef CGAL_ROOT_OF_2_ENABLE_HISTOGRAM_OF_NUMBER_OF_DIGIT_ON_THE_COMPLEX_CONSTRUCTOR
int tam() const { return std::max(num.tam(), den.tam()); }
int tam() const { return (std::max)(num.tam(), den.tam()); }
#endif
public:

View File

@ -52,9 +52,9 @@ canonicalize_triangle(const typename Triangulation::Periodic_triangle& pt)
Offset o0 = pt[0].second;
Offset o1 = pt[1].second;
Offset o2 = pt[2].second;
int diffx = std::min(o0.x(), std::min(o1.x(), o2.x()));
int diffy = std::min(o0.y(), std::min(o1.y(), o2.y()));
int diffz = std::min(o0.z(), std::min(o1.z(), o2.z()));
int diffx = (std::min)(o0.x(), (std::min)(o1.x(), o2.x()));
int diffy = (std::min)(o0.y(), (std::min)(o1.y(), o2.y()));
int diffz = (std::min)(o0.z(), (std::min)(o1.z(), o2.z()));
Offset diff_off(diffx, diffy, diffz);
return CGAL::make_array(std::make_pair(pt[0].first, o0 - diff_off),
@ -73,9 +73,9 @@ canonicalize_tetrahedron(const typename Triangulation::Periodic_tetrahedron& pt)
Offset o2 = pt[2].second;
Offset o3 = pt[3].second;
int diffx = std::min(std::min(o0.x(), o1.x()), std::min(o2.x(), o3.x()));
int diffy = std::min(std::min(o0.y(), o1.y()), std::min(o2.y(), o3.y()));
int diffz = std::min(std::min(o0.z(), o1.z()), std::min(o2.z(), o3.z()));
int diffx = (std::min)((std::min)(o0.x(), o1.x()), (std::min)(o2.x(), o3.x()));
int diffy = (std::min)((std::min)(o0.y(), o1.y()), (std::min)(o2.y(), o3.y()));
int diffz = (std::min)((std::min)(o0.z(), o1.z()), (std::min)(o2.z(), o3.z()));
Offset diff_off(diffx, diffy, diffz);
return CGAL::make_array(std::make_pair(pt[0].first, o0 - diff_off),

View File

@ -184,18 +184,18 @@ struct Segments_function
Segments_function()
: segments(), nb_evals(0)
{
const FT min = 1, max = 3;
const FT mid = 0.5 * (min + max);
const FT vmin = 1, vmax = 3;
const FT mid = 0.5 * (vmin + vmax);
const Point pmid(mid, mid, mid);
segments.push_back(Segment(Point(min, mid, min), pmid));
segments.push_back(Segment(Point(max, mid, min), pmid));
segments.push_back(Segment(Point(min, mid, max), pmid));
segments.push_back(Segment(Point(max, mid, max), pmid));
segments.push_back(Segment(Point(mid, min, min), pmid));
segments.push_back(Segment(Point(mid, max, min), pmid));
segments.push_back(Segment(Point(mid, min, max), pmid));
segments.push_back(Segment(Point(mid, max, max), pmid));
segments.push_back(Segment(Point(vmin, mid, vmin), pmid));
segments.push_back(Segment(Point(vmax, mid, vmin), pmid));
segments.push_back(Segment(Point(vmin, mid, vmax), pmid));
segments.push_back(Segment(Point(vmax, mid, vmax), pmid));
segments.push_back(Segment(Point(mid, vmin, vmin), pmid));
segments.push_back(Segment(Point(mid, vmax, vmin), pmid));
segments.push_back(Segment(Point(mid, vmin, vmax), pmid));
segments.push_back(Segment(Point(mid, vmax, vmax), pmid));
}
FT operator()(const Point& p)
@ -204,7 +204,7 @@ struct Segments_function
FT min_distance = 1000000;
for (Segments::const_iterator si = segments.begin(); si != segments.end(); ++si)
min_distance = std::min(CGAL::squared_distance(p, *si), min_distance);
min_distance = (std::min)(CGAL::squared_distance(p, *si), min_distance);
return min_distance - 0.01; // Change the squared beam radius here
}

View File

@ -70,17 +70,17 @@ Point my_rand_p3()
}
// Random int in [0;256).
int my_rand_int(int min, int max)
int my_rand_int(int imin, int imax)
{
return r->get_int(min, max+1);
return r->get_int(imin, imax+1);
}
// Random offset
Offset my_rand_o3(int min, int max)
Offset my_rand_o3(int imin, int imax)
{
int x = my_rand_int(min,max);
int y = my_rand_int(min,max);
int z = my_rand_int(min,max);
int x = my_rand_int(imin,imax);
int y = my_rand_int(imin,imax);
int z = my_rand_int(imin,imax);
return Offset(x, y, z);
}

View File

@ -351,7 +351,7 @@ MainWindow::on_actionInsertRandomPoints_triggered()
tr("Enter number of random points"),
100,
0,
std::numeric_limits<int>::max(),
(std::numeric_limits<int>::max)(),
1,
&ok);

View File

@ -617,15 +617,15 @@ protected:
}
// Now we know that all vertices lie in different regions.
Hyperbolic_translation min(7, 2, 5);
Hyperbolic_translation vmin(7, 2, 5);
Hyperbolic_translation trans;
for(int i=0; i<3; ++i)
{
int j = (i + 1) % 3; // the index of the 'next' vertex
Hyperbolic_translation tmp = fh->translation(i).inverse() * fh->translation(j);
if(tmp < min)
if(tmp < vmin)
{
min = tmp;
vmin = tmp;
trans = fh->translation(i).inverse();
}
}

View File

@ -10,8 +10,8 @@
template <typename fl_t>
fl_t random_float(fl_t min, fl_t max) {
return fl_t(CGAL::get_default_random().get_double(min, max));
fl_t random_float(fl_t fmin, fl_t fmax) {
return fl_t(CGAL::get_default_random().get_double(fmin, fmax));
}
template <typename K>

View File

@ -107,9 +107,9 @@ int main(int argc, char* argv[])
t.start();
std::cerr << "bbox"<< std::endl;
Iso_cuboid_3 ic = CGAL::bounding_box(points(m).begin(), points(m).end());
Point_3 p = midpoint(ic.min(), ic.max());
double zmin = ic.min().z();
double zmax = ic.max().z();
Point_3 p = midpoint((ic.min)(), (ic.max)());
double zmin = (ic.min)().z();
double zmax = (ic.max)().z();
double delta = (zmax - zmin)/N;
std::cerr << "slicer"<< std::endl;

View File

@ -61,9 +61,9 @@ class Traversal_traits_with_transformation_helper
AK::Aff_transformation_3 a_at = c2f(at);
AK::FT xtrm[6] = { c2f(bbox.min(0)), c2f(bbox.max(0)),
c2f(bbox.min(1)), c2f(bbox.max(1)),
c2f(bbox.min(2)), c2f(bbox.max(2)) };
AK::FT xtrm[6] = { c2f((bbox.min)(0)), c2f((bbox.max)(0)),
c2f((bbox.min)(1)), c2f((bbox.max)(1)),
c2f((bbox.min)(2)), c2f((bbox.max)(2)) };
typename AK::Point_3 ps[8];
ps[0] = a_at( AK::Point_3(xtrm[0], xtrm[2], xtrm[4]) );
@ -93,9 +93,9 @@ class Traversal_traits_with_transformation_helper
AK::Aff_transformation_3 a_at = c2f(at);
AK::FT xtrm[6] = { c2f(bbox.min(0)), c2f(bbox.max(0)),
c2f(bbox.min(1)), c2f(bbox.max(1)),
c2f(bbox.min(2)), c2f(bbox.max(2)) };
AK::FT xtrm[6] = { c2f((bbox.min)(0)), c2f((bbox.max)(0)),
c2f((bbox.min)(1)), c2f((bbox.max)(1)),
c2f((bbox.min)(2)), c2f((bbox.max)(2)) };
typename AK::Point_3 ps[2];
ps[0] = a_at( AK::Point_3(xtrm[0], xtrm[2], xtrm[4]) );

View File

@ -19,7 +19,7 @@ typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
typedef K::Point_3 Point_3;
typedef CGAL::Surface_mesh<Point_3> Mesh;
typedef std::vector<std::size_t> Polygon;
typedef std::vector<std::size_t> CGAL_polygon;
void test_polygon_canonicalization(const bool verbose = false)
{
@ -34,8 +34,8 @@ void test_polygon_canonicalization(const bool verbose = false)
points.push_back(Point_3(1,1,-2)); // #5
// empty
Polygon polygon;
Polygon canonical_polygon = PMP::internal::construct_canonical_polygon(points, polygon, K());
CGAL_polygon polygon;
CGAL_polygon canonical_polygon = PMP::internal::construct_canonical_polygon(points, polygon, K());
assert(canonical_polygon.empty());
// 1 point
@ -76,7 +76,7 @@ void test_polygon_canonicalization(const bool verbose = false)
// all cyclic permutations
for(std::size_t i=0, end=polygon.size(); i<end; ++i)
{
Polygon cpol = PMP::internal::construct_canonical_polygon(points, polygon, K());
CGAL_polygon cpol = PMP::internal::construct_canonical_polygon(points, polygon, K());
if(verbose)
{
std::cout << "Input polygon:";
@ -93,7 +93,7 @@ void test_polygon_canonicalization(const bool verbose = false)
std::reverse(polygon.begin(), polygon.end());
for(std::size_t i=0, end=polygon.size(); i<end; ++i)
{
Polygon cpol = PMP::internal::construct_canonical_polygon(points, polygon, K());
CGAL_polygon cpol = PMP::internal::construct_canonical_polygon(points, polygon, K());
if(verbose)
{
std::cout << "Input polygon:";
@ -112,7 +112,7 @@ void test_merge_duplicate_points(const bool /*verbose*/ = false)
std::cout << "test merge duplicate points... " << std::endl;
std::vector<Point_3> points;
std::vector<Polygon> polygons;
std::vector<CGAL_polygon> polygons;
// empty
std::size_t res = PMP::merge_duplicate_points_in_polygon_soup(points, polygons);
@ -126,7 +126,7 @@ void test_merge_duplicate_points(const bool /*verbose*/ = false)
points.push_back(Point_3(1,1,0)); // #5 // identical to #2
points.push_back(Point_3(0,0,0)); // #6 // idental to #0
Polygon polygon;
CGAL_polygon polygon;
polygon.push_back(0); polygon.push_back(1); polygon.push_back(2);
polygons.push_back(polygon);
@ -146,7 +146,7 @@ void test_merge_duplicate_points(const bool /*verbose*/ = false)
for(std::size_t i=0, psn=polygons.size(); i<psn; ++i)
{
const Polygon& polygon = polygons[i];
const CGAL_polygon& polygon = polygons[i];
for(std::size_t j=0, pn=polygon.size(); j<pn; ++j)
{
assert(polygon[j] < points.size());
@ -159,7 +159,7 @@ void test_merge_duplicate_polygons(const bool /*verbose*/ = false)
std::cout << "test duplicate polygons merging..." << std::endl;
std::vector<Point_3> points;
std::vector<Polygon> polygons;
std::vector<CGAL_polygon> polygons;
points.push_back(Point_3(0,0,0)); // #0
points.push_back(Point_3(1,0,0)); // #1
@ -180,7 +180,7 @@ void test_merge_duplicate_polygons(const bool /*verbose*/ = false)
// -------------------------------------------------------
// 1 polygon
Polygon polygon;
CGAL_polygon polygon;
polygon.push_back(0); polygon.push_back(1); polygon.push_back(2);
polygons.push_back(polygon);
@ -257,7 +257,7 @@ void test_merge_duplicate_polygons(const bool /*verbose*/ = false)
assert(all_duplicate_polygons[0].size() == 2 && all_duplicate_polygons[1].size() == 3);
// Keep one for each duplicate
std::vector<Polygon> polygons_copy(polygons);
std::vector<CGAL_polygon> polygons_copy(polygons);
res = PMP::merge_duplicate_polygons_in_polygon_soup(points, polygons_copy,
params::all_default());
assert(res == 3 && polygons_copy.size() == 3);
@ -281,7 +281,7 @@ void test_simplify_polygons(const bool /*verbose*/ = false)
std::cout << "test simplify_polygons... " << std::endl;
std::vector<Point_3> points;
std::vector<Polygon> polygons;
std::vector<CGAL_polygon> polygons;
points.push_back(Point_3(0,0,0)); // #0
points.push_back(Point_3(1,2,0)); // #1
@ -292,7 +292,7 @@ void test_simplify_polygons(const bool /*verbose*/ = false)
points.push_back(Point_3(0,0,0)); // #6
// ------
Polygon polygon;
CGAL_polygon polygon;
polygon.push_back(0); polygon.push_back(2); polygon.push_back(4);
polygons.push_back(polygon);
@ -355,13 +355,13 @@ void test_remove_invalid_polygons(const bool /*verbose*/ = false)
// points are not actually needed since only the size of the polygons is considered
std::vector<Point_3> points;
std::vector<Polygon> polygons;
std::vector<CGAL_polygon> polygons;
std::size_t res = PMP::internal::remove_invalid_polygons_in_polygon_soup(points, polygons);
assert(res == 0 && polygons.size() == 0);
// non-trivial polygon
Polygon polygon;
CGAL_polygon polygon;
polygon.push_back(0); polygon.push_back(2); polygon.push_back(4);
polygons.push_back(polygon);
@ -431,7 +431,7 @@ void test_remove_isolated_points(const bool verbose = false)
std::cout << "test remove_isolated_points... " << std::endl;
std::vector<Point_3> points;
std::vector<Polygon> polygons;
std::vector<CGAL_polygon> polygons;
// everything empty
std::size_t res = test_remove_isolated_points_data_set(points, polygons, verbose);
@ -449,7 +449,7 @@ void test_remove_isolated_points(const bool verbose = false)
res = test_remove_isolated_points_data_set(points_copy, polygons, verbose);
assert(res == 6 && points_copy.empty() && polygons.empty());
Polygon polygon;
CGAL_polygon polygon;
polygon.push_back(0); polygon.push_back(2); polygon.push_back(4);
polygons.push_back(polygon);
@ -467,7 +467,7 @@ void test_slit_pinched_polygons(const bool /*verbose*/ = false)
std::cout << "test split_pinched_polygons... " << std::endl;
std::vector<Point_3> points;
std::vector<Polygon> polygons;
std::vector<CGAL_polygon> polygons;
// everything empty
std::size_t res = PMP::internal::split_pinched_polygons_in_polygon_soup<K>(points, polygons);
@ -481,7 +481,7 @@ void test_slit_pinched_polygons(const bool /*verbose*/ = false)
points.push_back(Point_3(1,1,0)); // #5
// no pinch
Polygon polygon;
CGAL_polygon polygon;
polygon.push_back(0); polygon.push_back(2); polygon.push_back(4);
polygons.push_back(polygon);

View File

@ -965,7 +965,6 @@ void MainWindow::updateViewerBBox(bool recenter = true)
for(int i=0; i<3; ++i)
{
offset[i] = -bbox_center[i];
}
if(offset != viewer->offset())
{

View File

@ -103,9 +103,9 @@ private Q_SLOTS:
connect(item, &Scene_surface_mesh_item::aboutToBeDestroyed,
this, &DoTreesIntersectplugin::cleanup);
CGAL::qglviewer::Vec pos((item->bbox().min(0) + item->bbox().max(0))/2.0,
(item->bbox().min(1) + item->bbox().max(1))/2.0,
(item->bbox().min(2) + item->bbox().max(2))/2.0);
CGAL::qglviewer::Vec pos(((item->bbox().min)(0) + (item->bbox().max)(0))/2.0,
((item->bbox().min)(1) + (item->bbox().max)(1))/2.0,
((item->bbox().min)(2) + (item->bbox().max)(2))/2.0);
Scene_movable_sm_item* mov_item = new Scene_movable_sm_item(pos,item->face_graph(),"");
connect(mov_item->manipulatedFrame(), &CGAL::qglviewer::ManipulatedFrame::modified,

View File

@ -527,7 +527,7 @@ void Cluster_classification::change_color (int index, float* vmin, float* vmax)
int cid = m_cluster_id[*it];
if (cid != -1)
{
float v = std::max (0.f, std::min(1.f, m_label_probabilities[corrected_index][cid]));
float v = std::max (0.f, (std::min)(1.f, m_label_probabilities[corrected_index][cid]));
m_points->point_set()->set_color(*it, ramp.r(v) * 255, ramp.g(v) * 255, ramp.b(v) * 255);
}
else
@ -546,8 +546,8 @@ void Cluster_classification::change_color (int index, float* vmin, float* vmax)
Feature_handle feature = m_features[corrected_index];
float min = std::numeric_limits<float>::max();
float max = -std::numeric_limits<float>::max();
float min = (std::numeric_limits<float>::max)();
float max = -(std::numeric_limits<float>::max)();
if (vmin != NULL && vmax != NULL
&& *vmin != std::numeric_limits<float>::infinity()

View File

@ -429,7 +429,7 @@ void Point_set_item_classification::change_color (int index, float* vmin, float*
for (Point_set::const_iterator it = m_points->point_set()->begin();
it != m_points->point_set()->first_selected(); ++ it)
{
float v = std::max (0.f, std::min(1.f, m_label_probabilities[corrected_index][*it]));
float v = (std::max)(0.f, (std::min)(1.f, m_label_probabilities[corrected_index][*it]));
m_points->point_set()->set_color(*it, ramp.r(v) * 255, ramp.g(v) * 255, ramp.b(v) * 255);
}
}
@ -444,8 +444,8 @@ void Point_set_item_classification::change_color (int index, float* vmin, float*
}
Feature_handle feature = m_features[corrected_index];
float min = std::numeric_limits<float>::max();
float max = -std::numeric_limits<float>::max();
float min = (std::numeric_limits<float>::max)();
float max = -(std::numeric_limits<float>::max)();
if (vmin != NULL && vmax != NULL
&& *vmin != std::numeric_limits<float>::infinity()

View File

@ -125,8 +125,8 @@ class Point_set_item_classification : public Item_classification_base
for (std::size_t i = 0; i < m_features.size(); ++ i)
{
float vmin = std::numeric_limits<float>::max();
float vmax = -std::numeric_limits<float>::max();
float vmin = (std::numeric_limits<float>::max)();
float vmax = -(std::numeric_limits<float>::max)();
float vmean = 0.f;
std::size_t nb = 0;

View File

@ -151,7 +151,7 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo
{
BOOST_FOREACH(face_descriptor fd, faces(*(m_mesh->polyhedron())))
{
float v = std::max (0.f, std::min(1.f, m_label_probabilities[corrected_index][fd]));
float v = std::max (0.f, (std::min)(1.f, m_label_probabilities[corrected_index][fd]));
m_color[fd] = CGAL::Color((unsigned char)(ramp.r(v) * 255),
(unsigned char)(ramp.g(v) * 255),
(unsigned char)(ramp.b(v) * 255));
@ -169,8 +169,8 @@ void Surface_mesh_item_classification::change_color (int index, float* vmin, flo
Feature_handle feature = m_features[corrected_index];
float min = std::numeric_limits<float>::max();
float max = -std::numeric_limits<float>::max();
float min = (std::numeric_limits<float>::max)();
float max = -(std::numeric_limits<float>::max)();
if (vmin != NULL && vmax != NULL
&& *vmin != std::numeric_limits<float>::infinity()

View File

@ -407,12 +407,12 @@ void Polyhedron_demo_affine_transform_plugin::grid()
Scene_item::Bbox b = item->bbox();
double x_t(CGAL::sqrt(CGAL::squared_distance(Kernel::Point_3(b.min(0), b.min(1), b.min(2)),
Kernel::Point_3(b.max(0), b.min(1), b.min(2))))),
y_t(CGAL::sqrt(CGAL::squared_distance(Kernel::Point_3(b.min(0), b.min(1), b.min(2)),
Kernel::Point_3(b.min(0), b.max(1), b.min(2))))),
z_t(CGAL::sqrt(CGAL::squared_distance(Kernel::Point_3(b.min(0), b.min(1), b.min(2)),
Kernel::Point_3(b.min(0), b.min(1), b.max(2)))));
double x_t(CGAL::sqrt(CGAL::squared_distance(Kernel::Point_3((b.min)(0), (b.min)(1), (b.min)(2)),
Kernel::Point_3((b.max)(0), (b.min)(1), (b.min)(2))))),
y_t(CGAL::sqrt(CGAL::squared_distance(Kernel::Point_3((b.min)(0), (b.min)(1), (b.min)(2)),
Kernel::Point_3((b.min)(0), (b.max)(1), (b.min)(2))))),
z_t(CGAL::sqrt(CGAL::squared_distance(Kernel::Point_3((b.min)(0), (b.min)(1), (b.min)(2)),
Kernel::Point_3((b.min)(0), (b.min)(1), (b.max)(2)))));
GridDialog dialog(mw);
dialog.x_space_doubleSpinBox->setValue(x_t);

View File

@ -116,9 +116,9 @@ bool Create_bbox_mesh_plugin::bbox(bool extended)
bbox.zmax() + delta_z);
}
if(bbox.min(0) > bbox.max(0) ||
bbox.min(1) > bbox.max(1) ||
bbox.min(2) > bbox.max(2))
if((bbox.min)(0) > (bbox.max)(0) ||
(bbox.min)(1) > (bbox.max)(1) ||
(bbox.min)(2) > (bbox.max)(2))
{
return false;
}

View File

@ -540,16 +540,15 @@ void Scene_edit_box_item::compute_bbox() const
const CGAL::qglviewer::Vec offset = static_cast<CGAL::Three::Viewer_interface*>(CGAL::QGLViewer::QGLViewerPool().first())->offset();
QVector3D min(d->pool[0], d->pool[1], d->pool[2]);
QVector3D max(d->pool[3], d->pool[4], d->pool[5]);
QVector3D vmin(d->pool[0], d->pool[1], d->pool[2]);
QVector3D vmax(d->pool[3], d->pool[4], d->pool[5]);
for(int i=0; i< 3; ++i)
{
min[i] += d->frame->translation()[i]-d->center_[i]-offset[i];
max[i] += d->frame->translation()[i]-d->center_[i]-offset[i];
vmin[i] += d->frame->translation()[i]-d->center_[i]-offset[i];
vmax[i] += d->frame->translation()[i]-d->center_[i]-offset[i];
}
_bbox = Scene_item::Bbox(min.x(),min.y(),min.z(),max.x(),max.y(),max.z());
_bbox = Scene_item::Bbox(vmin.x(),vmin.y(),vmin.z(),vmax.x(),vmax.y(),vmax.z());
}

View File

@ -150,10 +150,10 @@ Scene_facegraph_transform_item::compute_bbox() const {
++it) {
bbox = bbox + get(vpmap, *it).bbox();
}
CGAL::qglviewer::Vec min(bbox.xmin(),bbox.ymin(),bbox.zmin());
CGAL::qglviewer::Vec max(bbox.xmax(),bbox.ymax(),bbox.zmax());
_bbox = Bbox(min.x,min.y,min.z,
max.x,max.y,max.z);
CGAL::qglviewer::Vec vmin(bbox.xmin(),bbox.ymin(),bbox.zmin());
CGAL::qglviewer::Vec vmax(bbox.xmax(),bbox.ymax(),bbox.zmax());
_bbox = Bbox(vmin.x,vmin.y,vmin.z,
vmax.x,vmax.y,vmax.z);
}

View File

@ -485,10 +485,10 @@ public Q_SLOTS:
}
std::cout << "Parameterized with ARAP (SM) computed." << std::endl;
xmin = std::numeric_limits<double>::max();
xmax = std::numeric_limits<double>::min();
ymin = std::numeric_limits<double>::max();
ymax = std::numeric_limits<double>::min();
xmin = (std::numeric_limits<double>::max)();
xmax = (std::numeric_limits<double>::min)();
ymin = (std::numeric_limits<double>::max)();
ymax = (std::numeric_limits<double>::min)();
uv_map_3 =
sm->add_property_map<SMesh::Vertex_index, Point_3>("v:uv3").first;
for(SMesh::Vertex_index v : sm->vertices())

View File

@ -306,7 +306,7 @@ void Polyhedron_demo_mesh_segmentation_plugin::apply_Partition_button_clicked(Fa
faces(*pair->first->face_graph()))
{
if(sdf_pmap[f] != -1
&& sdf_pmap[f] != std::numeric_limits<double>::max())
&& sdf_pmap[f] != (std::numeric_limits<double>::max)())
{
has_sdf_values = true;
break;

View File

@ -150,7 +150,7 @@ void Polyhedron_demo_mesh_simplification_plugin::on_actionSimplify_triggered()
: 0),
(ui.m_use_edge_length->isChecked()
? ui.m_edge_length->value()
: std::numeric_limits<double>::max()));
: (std::numeric_limits<double>::max)()));
if (selection_item)
{

View File

@ -899,7 +899,7 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio
} //end for each component
QApplication::restoreOverrideCursor();
QPointF min(FLT_MAX, FLT_MAX), max(-FLT_MAX, -FLT_MAX);
QPointF pmin(FLT_MAX, FLT_MAX), pmax(-FLT_MAX, -FLT_MAX);
SMesh::Property_map<halfedge_descriptor,std::pair<float, float> > uv;
uv = tMesh.add_property_map<halfedge_descriptor,std::pair<float, float> >("h:uv",std::make_pair(0.0f,0.0f)).first;
@ -912,14 +912,14 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio
FT u = uv_pm[target(hd, sMesh)].x();
FT v = uv_pm[target(hd, sMesh)].y();
put(uv, *it, std::make_pair(static_cast<float>(u),static_cast<float>(v)));
if(u<min.x())
min.setX(u);
if(u>max.x())
max.setX(u);
if(v<min.y())
min.setY(v);
if(v>max.y())
max.setY(v);
if(u<pmin.x())
pmin.setX(u);
if(u>pmax.x())
pmax.setX(u);
if(v<pmin.y())
pmin.setY(v);
if(v>pmax.y())
pmax.setY(v);
}
Components* components = new Components(0);
@ -934,7 +934,7 @@ void Polyhedron_demo_parameterization_plugin::parameterize(const Parameterizatio
}
Scene_textured_facegraph_item* new_item = new Scene_textured_facegraph_item(tMesh);
UVItem *projection = new UVItem(components,new_item->textured_face_graph(), uv_borders, QRectF(min, max));
UVItem *projection = new UVItem(components,new_item->textured_face_graph(), uv_borders, QRectF(pmin, pmax));
projection->set_item_name(new_item_name);
new_item->setName(new_item_name);

View File

@ -438,10 +438,10 @@ struct Scene_c3t3_item_priv {
void invalidate_stats()
{
min_edges_length = std::numeric_limits<float>::max();
min_edges_length = (std::numeric_limits<float>::max)();
max_edges_length = 0;
mean_edges_length = 0;
min_dihedral_angle = std::numeric_limits<float>::max();
min_dihedral_angle = (std::numeric_limits<float>::max)();
max_dihedral_angle = 0;
mean_dihedral_angle = 0;
nb_subdomains = 0;
@ -449,8 +449,8 @@ struct Scene_c3t3_item_priv {
nb_cnc = 0;
nb_vertices = 0;
nb_tets = 0;
smallest_radius_radius = std::numeric_limits<float>::max();
smallest_edge_radius = std::numeric_limits<float>::max();
smallest_radius_radius = (std::numeric_limits<float>::max)();
smallest_edge_radius = (std::numeric_limits<float>::max)();
biggest_v_sma_cube = 0;
computed_stats = false;
}

View File

@ -30,7 +30,7 @@ struct Scene_polylines_item_private {
{
nb_vertices = 0;
nb_edges = 0;
min_length = std::numeric_limits<double>::max();
min_length = (std::numeric_limits<double>::max)();
max_length = 0;
mean_length = 0;
computed_stats = false;

View File

@ -118,8 +118,8 @@ hybrid_bezout_matrix(typename Polynomial_traits_d::Polynomial_d f,
B[i-sub-1][j-1] = s;
}
}
for (i = std::max(m+1, 1+sub); i <= n; i++) {
for (j = i-m; j <= std::min(i, n-sub); j++) {
for (i = (std::max)(m+1, 1+sub); i <= n; i++) {
for (j = i-m; j <= (std::min)(i, n-sub); j++) {
B[i-sub-1][j-1] = coeff(g,i-j);
}
}

View File

@ -146,8 +146,8 @@ inline bool is_time_clearly_not_within_possibly_inexact_bisector_time_interval(
{
FT lSrcT = aBisector->opposite()->vertex()->time() ;
FT lTgtT = aBisector->vertex()->time() ;
FT lLoT = std::min(lSrcT,lTgtT);
FT lHiT = std::max(lSrcT,lTgtT);
FT lLoT = (std::min)(lSrcT,lTgtT);
FT lHiT = (std::max)(lSrcT,lTgtT);
return ( aT < lLoT || aT > lHiT )
&& is_possibly_inexact_time_clearly_not_equal_to(aT,lLoT)
@ -159,8 +159,8 @@ inline bool is_time_clearly_within_possibly_inexact_bisector_time_interval( FT c
{
FT lSrcT = aBisector->opposite()->vertex()->time() ;
FT lTgtT = aBisector->vertex()->time() ;
FT lLoT = std::min(lSrcT,lTgtT);
FT lHiT = std::max(lSrcT,lTgtT);
FT lLoT = (std::min)(lSrcT,lTgtT);
FT lHiT = (std::max)(lSrcT,lTgtT);
return ( lLoT < aT && aT < lHiT )
&& is_possibly_inexact_time_clearly_not_equal_to(aT,lLoT)

View File

@ -449,7 +449,7 @@ public:
{
for (std::size_t i=0; i<parrays_.size(); ++i)
parrays_[i]->reserve(n);
capacity_ = std::max(n, capacity_);
capacity_ = (std::max)(n, capacity_);
}
// resize all arrays to size n
@ -474,7 +474,7 @@ public:
for (std::size_t i=0; i<parrays_.size(); ++i)
parrays_[i]->push_back();
++size_;
capacity_ = (std::max(size_, capacity_));
capacity_ = ((std::max)(size_, capacity_));
}
// reset element to its default property values

View File

@ -74,17 +74,17 @@ namespace CGAL {
typedef boost::uint32_t size_type;
/// Constructor. %Default construction creates an invalid index.
/// We write -1, which is <a href="https://en.cppreference.com/w/cpp/types/numeric_limits">
/// <tt>std::numeric_limits<size_type>::max()</tt></a>
/// <tt>(std::numeric_limits<size_type>::max)()</tt></a>
/// as `size_type` is an unsigned type.
explicit SM_Index(size_type _idx=(std::numeric_limits<size_type>::max)()) : idx_(_idx) {}
/// Get the underlying index of this index
operator size_type() const { return idx_; }
/// reset index to be invalid (index=std::numeric_limits<size_type>::max())
/// reset index to be invalid (index=(std::numeric_limits<size_type>::max)())
void reset() { idx_=(std::numeric_limits<size_type>::max)(); }
/// return whether the index is valid, i.e., the index is not equal to `%std::numeric_limits<size_type>::max()`.
/// return whether the index is valid, i.e., the index is not equal to `%(std::numeric_limits<size_type>::max)()`.
bool is_valid() const {
size_type inf = (std::numeric_limits<size_type>::max)();
return idx_ != inf;
@ -222,10 +222,10 @@ namespace CGAL {
// compatibility with OpenMesh handles
size_type idx() const { return (size_type)halfedge_ / 2; }
// resets index to be invalid (index=std::numeric_limits<size_type>::max())
// resets index to be invalid (index=(std::numeric_limits<size_type>::max)())
void reset() { halfedge_.reset(); }
// returns whether the index is valid, i.e., the index is not equal to std::numeric_limits<size_type>::max().
// returns whether the index is valid, i.e., the index is not equal to (std::numeric_limits<size_type>::max)().
bool is_valid() const { return halfedge_.is_valid(); }
// Are two indices equal?

View File

@ -64,7 +64,7 @@
#include <iostream>
#endif
#define CGAL_VSA_INVALID_TAG std::numeric_limits<std::size_t>::max()
#define CGAL_VSA_INVALID_TAG (std::numeric_limits<std::size_t>::max)()
namespace CGAL {

View File

@ -99,8 +99,8 @@ public:
}
else
{
m_minimum = std::min(m_minimum, sample);
m_maximum = std::max(m_maximum, sample);
m_minimum = (std::min)(m_minimum, sample);
m_maximum = (std::max)(m_maximum, sample);
}
m_sum += sample;
++m_numSamples;
@ -227,7 +227,7 @@ void run_benchmarks(CGAL::Random& rand, size_t numTrials, size_t numSources, siz
outData.constructionTime.add_sample(elapsed.wall);
#if !defined(NDEBUG)
outData.peakMemoryUsage.add_sample(std::max(shortestPaths.peak_memory_usage(), shortestPaths.current_memory_usage()));
outData.peakMemoryUsage.add_sample((std::max)(shortestPaths.peak_memory_usage(), shortestPaths.current_memory_usage()));
#endif
for (size_t j = 0; j < numQueries; ++j)
@ -333,4 +333,4 @@ int main(int argc, char* argv[])
}
return EXIT_SUCCESS;
}
}

View File

@ -422,7 +422,7 @@ public:
+ (sizeof(Cone_expansion_event) + (sizeof(Cone_expansion_event*)) * m_peakQueueSize)
+ (sizeof(Cone_tree_node) * m_nodesAtPeakQueue);
return std::max(peakNodeUsage, peakQueueUsage);
return (std::max)(peakNodeUsage, peakQueueUsage);
}
/// \endcond

View File

@ -332,13 +332,13 @@ public :
{
const Point& p = pVertex->point();
xmin = std::min(xmin,p.x());
ymin = std::min(ymin,p.y());
zmin = std::min(zmin,p.z());
xmin = (std::min)(xmin,p.x());
ymin = (std::min)(ymin,p.y());
zmin = (std::min)(zmin,p.z());
xmax = std::max(xmax,p.x());
ymax = std::max(ymax,p.y());
zmax = std::max(zmax,p.z());
xmax = (std::max)(xmax,p.x());
ymax = (std::max)(ymax,p.y());
zmax = (std::max)(zmax,p.z());
}
m_bbox = Iso_cuboid(xmin,ymin,zmin,
xmax,ymax,zmax);

View File

@ -139,8 +139,8 @@ int vtkCGALSurfaceMesherContourFilter::RequestData(
return 0;
Gray_level_image gray_level_image(image, Value);
GT::FT radius = std::max(image.xdim() * image.vx(),
std::max(image.ydim() * image.vy(),
GT::FT radius = (std::max)(image.xdim() * image.vx(),
(std::max)(image.ydim() * image.vy(),
image.zdim() * image.vz())
);
GT::Sphere_3 bounding_sphere(GT::Point_3(image.xdim() * image.vx()/2.,

View File

@ -46,11 +46,11 @@ public:
// For generating all the combinations of |k| distinct elements in the
// interval [min, max] (both included)
Combination_enumerator(const int k, const int min, const int max)
: combi_(k), k_(k), min_(min), max_(max), max_at_pos_0_(max + 1 - k)
Combination_enumerator(const int k, const int imin, const int imax)
: combi_(k), k_(k), min_(imin), max_(imax), max_at_pos_0_(imax + 1 - k)
{
CGAL_assertion_msg( min <= max, "min is larger than max");
CGAL_assertion_msg( 1 <= k && k <= ( max - min + 1 ), "wrong value of k");
CGAL_assertion_msg( imin <= imax, "min is larger than max");
CGAL_assertion_msg( 1 <= k && k <= ( imax - imin + 1 ), "wrong value of k");
init();
}