mirror of https://github.com/CGAL/cgal
encapsulated std::max and std::min because of a conflict with a macro
This commit is contained in:
parent
eb360523c6
commit
2dc771d03a
|
|
@ -157,10 +157,10 @@ namespace CGAL {
|
|||
|
||||
FT u = ((a2 < M_PI_2) ? 2 * M_PI - a1 : a1) * c;
|
||||
|
||||
min[0] = std::min<FT>(min[0], u);
|
||||
max[0] = std::max<FT>(max[0], u);
|
||||
min[1] = std::min<FT>(min[1], v);
|
||||
max[1] = std::max<FT>(max[1], v);
|
||||
min[0] = (std::min<FT>)(min[0], u);
|
||||
max[0] = (std::max<FT>)(max[0], u);
|
||||
min[1] = (std::min<FT>)(min[1], v);
|
||||
max[1] = (std::max<FT>)(max[1], v);
|
||||
|
||||
parameterSpace[i] = std::pair<FT, FT>(u, v);
|
||||
}
|
||||
|
|
@ -168,7 +168,7 @@ namespace CGAL {
|
|||
|
||||
void parameter_extend(const Point ¢er, FT width, FT min[2], FT max[2]) const {
|
||||
//V length of axis in box? not enough
|
||||
FT maxLambda = std::numeric_limits<double>::max(), minLambda = -std::numeric_limits<double>::max();
|
||||
FT maxLambda = (std::numeric_limits<double>::max)(), minLambda = -(std::numeric_limits<double>::max)();
|
||||
Vector a = m_axis.to_vector();
|
||||
Point p = m_point_on_axis;
|
||||
|
||||
|
|
@ -179,8 +179,8 @@ namespace CGAL {
|
|||
if (l1 * l2 > 0) {
|
||||
std::cout << "Cylinder::parameterExtend(): dim 0, l1*l2 > 0" << std::endl;
|
||||
}
|
||||
minLambda = std::max<FT>(minLambda, std::min<FT>(l1, l2));
|
||||
maxLambda = std::min<FT>(maxLambda, std::max<FT>(l1, l2));
|
||||
minLambda = (std::max<FT>)(minLambda, (std::min<FT>)(l1, l2));
|
||||
maxLambda = (std::min<FT>)(maxLambda, (std::max<FT>)(l1, l2));
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -612,20 +612,20 @@ namespace CGAL {
|
|||
|
||||
|
||||
void buildBoundingCube() {
|
||||
FT min[] = {std::numeric_limits<FT>::max(), std::numeric_limits<FT>::max(), std::numeric_limits<FT>::max()};
|
||||
FT max[] = {std::numeric_limits<FT>::min(), std::numeric_limits<FT>::min(), std::numeric_limits<FT>::min()};
|
||||
FT min[] = {(std::numeric_limits<FT>::max)(), (std::numeric_limits<FT>::max)(), (std::numeric_limits<FT>::max)()};
|
||||
FT max[] = {(std::numeric_limits<FT>::min)(), (std::numeric_limits<FT>::min)(), (std::numeric_limits<FT>::min)()};
|
||||
|
||||
for (unsigned int i = 0;i<this->size();i++) {
|
||||
Point p = get(m_pointPMap, *this->at(i));
|
||||
min[0] = std::min<FT>(min[0], p.x());
|
||||
min[1] = std::min<FT>(min[1], p.y());
|
||||
min[2] = std::min<FT>(min[2], p.z());
|
||||
max[0] = std::max<FT>(max[0], p.x());
|
||||
max[1] = std::max<FT>(max[1], p.y());
|
||||
max[2] = std::max<FT>(max[2], p.z());
|
||||
min[0] = (std::min<FT>)(min[0], p.x());
|
||||
min[1] = (std::min<FT>)(min[1], p.y());
|
||||
min[2] = (std::min<FT>)(min[2], p.z());
|
||||
max[0] = (std::max<FT>)(max[0], p.x());
|
||||
max[1] = (std::max<FT>)(max[1], p.y());
|
||||
max[2] = (std::max<FT>)(max[2], p.z());
|
||||
}
|
||||
|
||||
m_width = std::max(max[0] - min[0], std::max(max[1] - min[1], max[2] - min[2])) * 0.5;
|
||||
m_width = (std::max)(max[0] - min[0], (std::max)(max[1] - min[1], max[2] - min[2])) * 0.5;
|
||||
|
||||
// m_center[0] = (min[0] + max[0]) * 0.5;
|
||||
// m_center[1] = (min[1] + max[1]) * 0.5;
|
||||
|
|
|
|||
|
|
@ -101,10 +101,10 @@ namespace CGAL {
|
|||
Vector p = (get(this->m_pointPMap, *(this->m_first + indices[i])) - m_point_on_primitive);
|
||||
FT u = p * m_base1;
|
||||
FT v = p * m_base2;
|
||||
min[0] = std::min<FT>(min[0], u);
|
||||
max[0] = std::max<FT>(max[0], u);
|
||||
min[1] = std::min<FT>(min[1], v);
|
||||
max[1] = std::max<FT>(max[1], v);
|
||||
min[0] = (std::min<FT>)(min[0], u);
|
||||
max[0] = (std::max<FT>)(max[0], u);
|
||||
min[1] = (std::min<FT>)(min[1], v);
|
||||
max[1] = (std::max<FT>)(max[1], v);
|
||||
parameterSpace[i] = std::pair<FT, FT>(u, v);
|
||||
}
|
||||
}
|
||||
|
|
@ -125,10 +125,10 @@ namespace CGAL {
|
|||
Vector p = (corner[i] - m_plane.point());
|
||||
FT u = p * m_base1;
|
||||
FT v = p * m_base2;
|
||||
min[0] = std::min(min[0], u);
|
||||
min[1] = std::min(min[1], v);
|
||||
max[0] = std::max(max[0], u);
|
||||
max[1] = std::max(max[1], v);
|
||||
min[0] = (std::min)(min[0], u);
|
||||
min[1] = (std::min)(min[1], v);
|
||||
max[0] = (std::max)(max[0], u);
|
||||
max[1] = (std::max)(max[1], v);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -47,12 +47,12 @@ namespace CGAL {
|
|||
|
||||
Shape_base() :
|
||||
m_isValid(true),
|
||||
m_lowerBound(std::numeric_limits<FT>::min()),
|
||||
m_upperBound(std::numeric_limits<FT>::min()),
|
||||
m_lowerBound((std::numeric_limits<FT>::min)()),
|
||||
m_upperBound((std::numeric_limits<FT>::min)()),
|
||||
m_score(0),
|
||||
m_sum_ExpectedValue(0),
|
||||
m_nb_subset_used(0),
|
||||
m_hasconnected_component(false) {
|
||||
m_has_connected_component(false) {
|
||||
}
|
||||
|
||||
virtual ~Shape_base() {}
|
||||
|
|
@ -141,7 +141,7 @@ namespace CGAL {
|
|||
// if (m_hasconnected_component)
|
||||
// return m_score;
|
||||
|
||||
m_hasconnected_component = true;
|
||||
m_has_connected_component = true;
|
||||
if (!supports_connected_component())
|
||||
return m_indices.size();
|
||||
|
||||
|
|
@ -368,7 +368,7 @@ namespace CGAL {
|
|||
|
||||
FT m_sum_ExpectedValue;
|
||||
int m_nb_subset_used; //count the number of subset used so far for the score, and thus indicate the next one to use
|
||||
bool m_hasconnected_component;
|
||||
bool m_has_connected_component;
|
||||
|
||||
std::vector<int> m_indices; //indices of the points fitting to the candidate
|
||||
inputIterator m_first;
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ refer to schnabels paper
|
|||
|
||||
//create subsets ------------------------------------------------
|
||||
//how many subsets ?
|
||||
m_num_subsets = std::max((int) std::floor(std::log(double(m_numAvailablePoints))/std::log(2.))-9, 2);
|
||||
m_num_subsets = (std::max)((int) std::floor(std::log(double(m_numAvailablePoints))/std::log(2.))-9, 2);
|
||||
|
||||
// SUBSET GENERATION ->
|
||||
// approach with increasing subset sizes -> replace with octree later on
|
||||
|
|
@ -615,7 +615,7 @@ refer to schnabels paper
|
|||
}
|
||||
|
||||
inline FT StopProbability(FT _sizeC, FT _np, FT _dC, FT _l) const {
|
||||
return std::min<float>(std::pow(1.f - _sizeC / (_np * _l * 3), _dC), 1.); //4 is (1 << (m_reqSamples - 1))) with m_reqSamples=3 (min number of points to create a candidate)
|
||||
return (std::min<float>)(std::pow(1.f - _sizeC / (_np * _l * 3), _dC), 1.); //4 is (1 << (m_reqSamples - 1))) with m_reqSamples=3 (min number of points to create a candidate)
|
||||
}
|
||||
|
||||
static bool candComp(const Shape* a, const Shape* b) {
|
||||
|
|
|
|||
Loading…
Reference in New Issue