#include <list>
#include <iostream>
#include <cassert>
#include <CGAL/Exact_rational.h>
#include <CGAL/Cartesian.h>
#include <CGAL/Arr_segment_traits_2.h>
#include <CGAL/Arr_curve_data_traits_2.h>
#include <CGAL/Envelope_2/Envelope_diagram_1.h>
#include <CGAL/Envelope_2/envelope_2.h>
using Number_type = CGAL::Exact_rational;
using Segment_2 = Segment_traits_2::X_monotone_curve_2;
using Labeled_segment_2 = Traits_2::X_monotone_curve_2;
int main() {
std::list<Labeled_segment_2> segments;
Diagram_1 min_diag;
Diagram_1::Edge_const_descriptor e = min_diag.leftmost();
while (e != min_diag.rightmost()) {
std::cout << "Edge:";
if (! min_diag.empty_edge_curves(e)) {
for (const auto& cv : min_diag.edge_curves(e)) std::cout << ' ' << cv.data();
std::cout << std::endl;
}
else std::cout << " [empty]" << std::endl;
auto v = min_diag.right_vertex(e);
std::cout << "Vertex (" << min_diag.point(v) << "):";
for (const auto& cv : min_diag.vertex_curves(v)) std::cout << ' ' << cv.data();
std::cout << std::endl;
e = min_diag.right_edge(v);
}
assert(min_diag.empty_edge_curves(e));
std::cout << "Edge: [empty]" << std::endl;
return 0;
}
This class is the default envelope-diagram class used by envelope functions to represent the minimiza...
Definition Envelope_diagram_1.h:31
void lower_envelope_x_monotone_2(InputIterator begin, InputIterator end, EnvelopeDiagram &diag)
computes the lower envelope of a set of -monotone curves in , given by the range [begin,...