mirror of https://github.com/CGAL/cgal
min/max issues
This commit is contained in:
parent
39102f0449
commit
87e979160f
|
|
@ -269,7 +269,7 @@ Kml::Nodes Kml::generate_ids_approx(Placemarks& placemarks, const double eps) {
|
||||||
|
|
||||||
for (const auto& node : lring->nodes) {
|
for (const auto& node : lring->nodes) {
|
||||||
// check if there is a node sufficiently close to the current one
|
// check if there is a node sufficiently close to the current one
|
||||||
auto node_index = std::numeric_limits<std::size_t>::max();
|
auto node_index = (std::numeric_limits<std::size_t>::max)();
|
||||||
for (std::size_t i = 0; i < nodes.size(); ++i) {
|
for (std::size_t i = 0; i < nodes.size(); ++i) {
|
||||||
const auto dist = node.distance_to(nodes[i]);
|
const auto dist = node.distance_to(nodes[i]);
|
||||||
if (dist < eps) {
|
if (dist < eps) {
|
||||||
|
|
@ -278,7 +278,7 @@ Kml::Nodes Kml::generate_ids_approx(Placemarks& placemarks, const double eps) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (node_index == std::numeric_limits<std::size_t>::max()) {
|
if (node_index == (std::numeric_limits<std::size_t>::max)()) {
|
||||||
// insert new node
|
// insert new node
|
||||||
nodes.push_back(node);
|
nodes.push_back(node);
|
||||||
const auto node_id = nodes.size() - 1;
|
const auto node_id = nodes.size() - 1;
|
||||||
|
|
@ -301,7 +301,7 @@ Kml::Nodes Kml::generate_ids_approx(Placemarks& placemarks, const double eps) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// find the pair of closest nodes
|
// find the pair of closest nodes
|
||||||
double min_dist = std::numeric_limits<double>::max();
|
double min_dist = (std::numeric_limits<double>::max)();
|
||||||
std::size_t ni1 = 0;
|
std::size_t ni1 = 0;
|
||||||
std::size_t ni2 = 0;
|
std::size_t ni2 = 0;
|
||||||
std::size_t num_nodes = nodes.size();
|
std::size_t num_nodes = nodes.size();
|
||||||
|
|
|
||||||
|
|
@ -510,7 +510,7 @@ public:
|
||||||
|
|
||||||
auto min_distance_and_vertex_between_constraint_and_encroaching_vertex(Vertex_handle va, Vertex_handle vb) const {
|
auto min_distance_and_vertex_between_constraint_and_encroaching_vertex(Vertex_handle va, Vertex_handle vb) const {
|
||||||
struct Result {
|
struct Result {
|
||||||
typename T_3::Geom_traits::FT min_dist = std::numeric_limits<double>::max();
|
typename T_3::Geom_traits::FT min_dist = (std::numeric_limits<double>::max)();
|
||||||
Vertex_handle v = {};
|
Vertex_handle v = {};
|
||||||
} result;
|
} result;
|
||||||
const auto vector_of_encroaching_vertices = encroaching_vertices(va, vb);
|
const auto vector_of_encroaching_vertices = encroaching_vertices(va, vb);
|
||||||
|
|
|
||||||
|
|
@ -987,7 +987,7 @@ Scene_triangulation_3_item_priv::compute_color_map(const QColor& base_color)
|
||||||
Geom_traits::Plane_3 Scene_triangulation_3_item::plane(CGAL::qglviewer::Vec offset) const
|
Geom_traits::Plane_3 Scene_triangulation_3_item::plane(CGAL::qglviewer::Vec offset) const
|
||||||
{
|
{
|
||||||
if (!d->is_intersection_enabled())
|
if (!d->is_intersection_enabled())
|
||||||
return Geom_traits::Plane_3(1.0, 0.0, 0.0, std::numeric_limits<float>::max());
|
return Geom_traits::Plane_3(1.0, 0.0, 0.0, (std::numeric_limits<float>::max)());
|
||||||
const CGAL::qglviewer::Vec& pos = d->frame->position() - offset;
|
const CGAL::qglviewer::Vec& pos = d->frame->position() - offset;
|
||||||
const CGAL::qglviewer::Vec& n =
|
const CGAL::qglviewer::Vec& n =
|
||||||
d->frame->inverseTransformOf(CGAL::qglviewer::Vec(0.f, 0.f, 1.f));
|
d->frame->inverseTransformOf(CGAL::qglviewer::Vec(0.f, 0.f, 1.f));
|
||||||
|
|
|
||||||
|
|
@ -112,7 +112,7 @@ int main(int argc, char** argv)
|
||||||
{
|
{
|
||||||
if (i!=0)
|
if (i!=0)
|
||||||
{
|
{
|
||||||
random=CGAL::Random(random.get_int(0, std::numeric_limits<int>::max()));
|
random=CGAL::Random(random.get_int(0, (std::numeric_limits<int>::max)()));
|
||||||
}
|
}
|
||||||
std::cout<<"Random seed: "<<random.get_seed()<<": ";
|
std::cout<<"Random seed: "<<random.get_seed()<<": ";
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -550,7 +550,7 @@ int go(Mesh mesh, CDT_options options) {
|
||||||
start_time = std::chrono::high_resolution_clock::now();
|
start_time = std::chrono::high_resolution_clock::now();
|
||||||
CGAL_CDT_3_TASK_BEGIN(compute_distances_task_handle);
|
CGAL_CDT_3_TASK_BEGIN(compute_distances_task_handle);
|
||||||
{
|
{
|
||||||
auto [min_sq_distance, min_edge] = std::ranges::min(
|
auto [min_sq_distance, min_edge] = (std::ranges::min)(
|
||||||
cdt.finite_edges() | std::views::transform([&](auto edge) { return std::make_pair(cdt.segment(edge).squared_length(), edge); }));
|
cdt.finite_edges() | std::views::transform([&](auto edge) { return std::make_pair(cdt.segment(edge).squared_length(), edge); }));
|
||||||
auto min_distance = CGAL::approximate_sqrt(min_sq_distance);
|
auto min_distance = CGAL::approximate_sqrt(min_sq_distance);
|
||||||
auto vertices_of_min_edge = cdt.vertices(min_edge);
|
auto vertices_of_min_edge = cdt.vertices(min_edge);
|
||||||
|
|
@ -566,7 +566,7 @@ int go(Mesh mesh, CDT_options options) {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
{
|
{
|
||||||
double min_distance = std::numeric_limits<double>::max();
|
double min_distance = (std::numeric_limits<double>::max)();
|
||||||
CDT::Vertex_handle min_va, min_vb, min_vertex;
|
CDT::Vertex_handle min_va, min_vb, min_vertex;
|
||||||
if(options.merge_facets) {
|
if(options.merge_facets) {
|
||||||
for(int i = 0; i < nb_patches; ++i) {
|
for(int i = 0; i < nb_patches; ++i) {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue