Small text fixes; replaced std::endl with \n when it follows a literal

This commit is contained in:
Efi Fogel 2021-04-22 14:09:00 +03:00
parent ba8aec60f2
commit 03e8c5352c
29 changed files with 93 additions and 107 deletions

View File

@ -358,7 +358,7 @@ face \f$ f_2\f$. The face \f$ f_1\f$ has a more complicated structure
as it contains two holes in its interior: One hole consists of two as it contains two holes in its interior: One hole consists of two
adjacent faces \f$ f_3\f$ and \f$ f_4\f$, while the other hole adjacent faces \f$ f_3\f$ and \f$ f_4\f$, while the other hole
comprises of two edges. \f$ f_1\f$ also contains two isolated vertices comprises of two edges. \f$ f_1\f$ also contains two isolated vertices
\f$ u_1\f$ and \f$ u_2\f$ in its interior. \f$ u_1\f$ and \f$ u_2\f$ in its interior (which do not count has holes).
\cgalFigureEnd \cgalFigureEnd
<!-----------------------------------------------------------------------------> <!----------------------------------------------------------------------------->
@ -399,7 +399,10 @@ the `Arrangement_2` class template; their description follows.
In this section we always use `Arr_non_caching_segment_traits_2` as In this section we always use `Arr_non_caching_segment_traits_2` as
our traits-class model in order to construct arrangements of line our traits-class model in order to construct arrangements of line
segments. In succeeding sections we also use `Arr_segment_traits_2` segments. In succeeding sections we also use `Arr_segment_traits_2`
as our traits-class model. In Section \ref aos_sec-unbounded we use as our traits-class model. These two traits trade computation time
and storage space. The latter tores the underlying line of every
segment of the arrangement to expedite certain operations on the
arrangement segments. In Section \ref aos_sec-unbounded we use
`Arr_linear_traits_2` to construct arrangements of linear curves `Arr_linear_traits_2` to construct arrangements of linear curves
(i.e., lines, rays, and line segments). The \ref (i.e., lines, rays, and line segments). The \ref
PkgArrangementOnSurface2 package contains several other traits PkgArrangementOnSurface2 package contains several other traits
@ -424,7 +427,7 @@ defined in the header file `Arr_print.h`, prints out quantitative
measures of a given arrangement. While in what follows it is used only measures of a given arrangement. While in what follows it is used only
by examples, it demonstrates well the use of the member functions by examples, it demonstrates well the use of the member functions
\link Arrangement_on_surface_2::number_of_vertices() \link Arrangement_on_surface_2::number_of_vertices()
`number_of_vertices`\endlink, \link `number_of_vertices()`\endlink, \link
Arrangement_on_surface_2::number_of_edges() Arrangement_on_surface_2::number_of_edges()
`number_of_edges()`\endlink, and \link `number_of_edges()`\endlink, and \link
Arrangement_on_surface_2::number_of_faces() Arrangement_on_surface_2::number_of_faces()

View File

@ -5,10 +5,9 @@
// Print all neighboring vertices to a given arrangement vertex. // Print all neighboring vertices to a given arrangement vertex.
// //
template<class Arrangement> template<class Arrangement>
void print_neighboring_vertices(typename Arrangement::Vertex_const_handle v) void print_neighboring_vertices(typename Arrangement::Vertex_const_handle v) {
{
if (v->is_isolated()) { if (v->is_isolated()) {
std::cout << "The vertex (" << v->point() << ") is isolated" << std::endl; std::cout << "The vertex (" << v->point() << ") is isolated\n";
return; return;
} }
@ -25,8 +24,7 @@ void print_neighboring_vertices(typename Arrangement::Vertex_const_handle v)
// boundary. // boundary.
// //
template <typename Arrangement> template <typename Arrangement>
void print_ccb(typename Arrangement::Ccb_halfedge_const_circulator circ) void print_ccb(typename Arrangement::Ccb_halfedge_const_circulator circ) {
{
std::cout << "(" << circ->source()->point() << ")"; std::cout << "(" << circ->source()->point() << ")";
typename Arrangement::Ccb_halfedge_const_circulator curr = circ; typename Arrangement::Ccb_halfedge_const_circulator curr = circ;
do { do {
@ -41,10 +39,9 @@ void print_ccb(typename Arrangement::Ccb_halfedge_const_circulator circ)
// Print the boundary description of an arrangement face. // Print the boundary description of an arrangement face.
// //
template <typename Arrangement> template <typename Arrangement>
void print_face(typename Arrangement::Face_const_handle f) void print_face(typename Arrangement::Face_const_handle f) {
{
// Print the outer boundary. // Print the outer boundary.
if (f->is_unbounded()) std::cout << "Unbounded face." << std::endl; if (f->is_unbounded()) std::cout << "Unbounded face.\n";
else { else {
std::cout << "Outer boundary: "; std::cout << "Outer boundary: ";
print_ccb<Arrangement>(f->outer_ccb()); print_ccb<Arrangement>(f->outer_ccb());
@ -71,25 +68,24 @@ void print_face(typename Arrangement::Face_const_handle f)
// Print the given arrangement. // Print the given arrangement.
// //
template <typename Arrangement> template <typename Arrangement>
void print_arrangement(const Arrangement& arr) void print_arrangement(const Arrangement& arr) {
{
CGAL_precondition(arr.is_valid()); CGAL_precondition(arr.is_valid());
// Print the arrangement vertices. // Print the arrangement vertices.
std::cout << arr.number_of_vertices() << " vertices:" << std::endl; std::cout << arr.number_of_vertices() << " vertices:\n";
for (auto vit = arr.vertices_begin(); vit != arr.vertices_end(); ++vit) { for (auto vit = arr.vertices_begin(); vit != arr.vertices_end(); ++vit) {
std::cout << "(" << vit->point() << ")"; std::cout << "(" << vit->point() << ")";
if (vit->is_isolated()) std::cout << " - Isolated." << std::endl; if (vit->is_isolated()) std::cout << " - Isolated.\n";
else std::cout << " - degree " << vit->degree() << std::endl; else std::cout << " - degree " << vit->degree() << std::endl;
} }
// Print the arrangement edges. // Print the arrangement edges.
std::cout << arr.number_of_edges() << " edges:" << std::endl; std::cout << arr.number_of_edges() << " edges:\n";
for (auto eit = arr.edges_begin(); eit != arr.edges_end(); ++eit) for (auto eit = arr.edges_begin(); eit != arr.edges_end(); ++eit)
std::cout << "[" << eit->curve() << "]" << std::endl; std::cout << "[" << eit->curve() << "]\n";
// Print the arrangement faces. // Print the arrangement faces.
std::cout << arr.number_of_faces() << " faces:" << std::endl; std::cout << arr.number_of_faces() << " faces:\n";
for (auto fit = arr.faces_begin(); fit != arr.faces_end(); ++fit) for (auto fit = arr.faces_begin(); fit != arr.faces_end(); ++fit)
print_face<Arrangement>(fit); print_face<Arrangement>(fit);
} }
@ -98,9 +94,8 @@ void print_arrangement(const Arrangement& arr)
// Print the size of the given arrangement. // Print the size of the given arrangement.
// //
template <typename Arrangement> template <typename Arrangement>
void print_arrangement_size(const Arrangement& arr) void print_arrangement_size(const Arrangement& arr) {
{ std::cout << "The arrangement size:\n"
std::cout << "The arrangement size:" << std::endl
<< " |V| = " << arr.number_of_vertices() << " |V| = " << arr.number_of_vertices()
<< ", |E| = " << arr.number_of_edges() << ", |E| = " << arr.number_of_edges()
<< ", |F| = " << arr.number_of_faces() << std::endl; << ", |F| = " << arr.number_of_faces() << std::endl;
@ -110,16 +105,14 @@ void print_arrangement_size(const Arrangement& arr)
// Print the size of the given unbounded arrangement. // Print the size of the given unbounded arrangement.
// //
template <typename Arrangement> template <typename Arrangement>
void print_unbounded_arrangement_size(const Arrangement& arr) void print_unbounded_arrangement_size(const Arrangement& arr) {
{ std::cout << "The arrangement size:\n"
std::cout << "The arrangement size:" << std::endl
<< " |V| = " << arr.number_of_vertices() << " |V| = " << arr.number_of_vertices()
<< " (plus " << arr.number_of_vertices_at_infinity() << " (plus " << arr.number_of_vertices_at_infinity()
<< " at infinity)" << " at infinity)"
<< ", |E| = " << arr.number_of_edges() << ", |E| = " << arr.number_of_edges()
<< ", |F| = " << arr.number_of_faces() << ", |F| = " << arr.number_of_faces()
<< " (" << arr.number_of_unbounded_faces() << " unbounded)" << " (" << arr.number_of_unbounded_faces() << " unbounded)\n\n";
<< std::endl << std::endl;
} }
#endif #endif

View File

@ -48,7 +48,7 @@ int main() {
std::cout << "face "; std::cout << "face ";
print_ccb<Ex_arrangement>(fit->outer_ccb()); print_ccb<Ex_arrangement>(fit->outer_ccb());
} }
else std::cout << "the unbounded face." << std::endl; else std::cout << "the unbounded face.\n";
} }
return 0; return 0;
} }

View File

@ -44,7 +44,7 @@ int main() {
// Print the distance of each vertex from v0. // Print the distance of each vertex from v0.
std::cout << "The graph distances of the arrangement vertices from (" std::cout << "The graph distances of the arrangement vertices from ("
<< v0->point() << ") :" << std::endl; << v0->point() << ") :\n";
for (auto vit = arr.vertices_begin(); vit != arr.vertices_end(); ++vit) for (auto vit = arr.vertices_begin(); vit != arr.vertices_end(); ++vit)
std::cout << "(" << vit->point() << ") at distance " std::cout << "(" << vit->point() << ") at distance "
<< CGAL::to_double(dist_map[vit]) << std::endl; << CGAL::to_double(dist_map[vit]) << std::endl;

View File

@ -44,11 +44,11 @@ int main() {
std::cout << " feature above: "; std::cout << " feature above: ";
if (CGAL::assign(hh, curr.second)) if (CGAL::assign(hh, curr.second))
std::cout << '[' << hh->curve() << ']' << std::endl; std::cout << '[' << hh->curve() << ']\n';
else if (CGAL::assign(vh, curr.second)) else if (CGAL::assign(vh, curr.second))
std::cout << '(' << vh->point() << ')' << std::endl; std::cout << '(' << vh->point() << ')\n';
else if (CGAL::assign(fh, curr.second)) std::cout << "NONE" << std::endl; else if (CGAL::assign(fh, curr.second)) std::cout << "NONE\n";
else std::cout << "EMPTY" << std::endl; else std::cout << "EMPTY\n";
} }
return 0; return 0;

View File

@ -46,7 +46,7 @@ int main() {
// Print the vertex only if incident RED and BLUE edges were found. // Print the vertex only if incident RED and BLUE edges were found.
if (has_red && has_blue) { if (has_red && has_blue) {
std::cout << "Red intersect blue at (" << vit->point() << ")" << std::endl; std::cout << "Red intersect blue at (" << vit->point() << ")\n";
} }
} }
@ -64,7 +64,7 @@ int main() {
// Print the edge only if it corresponds to a red-blue overlap. // Print the edge only if it corresponds to a red-blue overlap.
if (has_red && has_blue) if (has_red && has_blue)
std::cout << "Red overlap blue at [" << eit->curve() << "]" << std::endl; std::cout << "Red overlap blue at [" << eit->curve() << "]\n";
} }
return 0; return 0;

View File

@ -27,15 +27,15 @@ int main() {
// Print out the curves and the number of edges each one induces. // Print out the curves and the number of edges each one induces.
std::cout << "The arrangement contains " std::cout << "The arrangement contains "
<< arr.number_of_curves() << " curves:" << std::endl; << arr.number_of_curves() << " curves:\n";
for (auto cit = arr.curves_begin(); cit != arr.curves_end(); ++cit) for (auto cit = arr.curves_begin(); cit != arr.curves_end(); ++cit)
std::cout << "Curve [" << *cit << "] induces " std::cout << "Curve [" << *cit << "] induces "
<< arr.number_of_induced_edges(cit) << " edges." << std::endl; << arr.number_of_induced_edges(cit) << " edges.\n";
// Print the arrangement edges along with the list of curves that // Print the arrangement edges along with the list of curves that
// induce each edge. // induce each edge.
std::cout << "The arrangement comprises " std::cout << "The arrangement comprises "
<< arr.number_of_edges() << " edges:" << std::endl; << arr.number_of_edges() << " edges:\n";
for (auto eit = arr.edges_begin(); eit != arr.edges_end(); ++eit) { for (auto eit = arr.edges_begin(); eit != arr.edges_end(); ++eit) {
std::cout << "[" << eit->curve() << "]. Originating curves: "; std::cout << "[" << eit->curve() << "]. Originating curves: ";
for (auto ocit = arr.originating_curves_begin(eit); for (auto ocit = arr.originating_curves_begin(eit);

View File

@ -51,13 +51,13 @@ int main() {
// Copy the arrangement and print the vertices along with their colors. // Copy the arrangement and print the vertices along with their colors.
Ex_arrangement arr2 = arr; Ex_arrangement arr2 = arr;
std::cout << "The arrangement vertices:" << std::endl; std::cout << "The arrangement vertices:\n";
for (auto vit = arr2.vertices_begin(); vit != arr2.vertices_end(); ++vit) { for (auto vit = arr2.vertices_begin(); vit != arr2.vertices_end(); ++vit) {
std::cout << '(' << vit->point() << ") - "; std::cout << '(' << vit->point() << ") - ";
switch (vit->data()) { switch (vit->data()) {
case BLUE : std::cout << "BLUE." << std::endl; break; case BLUE : std::cout << "BLUE.\n"; break;
case RED : std::cout << "RED." << std::endl; break; case RED : std::cout << "RED.\n"; break;
case WHITE : std::cout << "WHITE." << std::endl; break; case WHITE : std::cout << "WHITE.\n"; break;
} }
} }

View File

@ -95,7 +95,7 @@ int main() {
read(arr2, in_file, formatter); read(arr2, in_file, formatter);
in_file.close(); in_file.close();
std::cout << "The arrangement vertices: " << std::endl; std::cout << "The arrangement vertices:\n";
for (auto vit = arr2.vertices_begin(); vit != arr2.vertices_end(); ++vit) for (auto vit = arr2.vertices_begin(); vit != arr2.vertices_end(); ++vit)
std::cout << '(' << vit->point() << ") - " << vit->data() << std::endl; std::cout << '(' << vit->point() << ") - " << vit->data() << std::endl;

View File

@ -16,7 +16,7 @@ int main(int argc, char* argv[]) {
std::ifstream in_file(filename); std::ifstream in_file(filename);
if (! in_file.is_open()) { if (! in_file.is_open()) {
std::cerr << "Failed to open " << filename << "!" << std::endl; std::cerr << "Failed to open " << filename << "!\n";
return 1; return 1;
} }
@ -35,14 +35,14 @@ int main(int argc, char* argv[]) {
// Construct the dual arrangement by aggregately inserting the lines. // Construct the dual arrangement by aggregately inserting the lines.
Arrangement arr; Arrangement arr;
insert(arr, dual_lines.begin(), dual_lines.end()); insert(arr, dual_lines.begin(), dual_lines.end());
std::cout << "The dual arrangement size:" << std::endl std::cout << "The dual arrangement size:\n"
<< "V = " << arr.number_of_vertices() << "V = " << arr.number_of_vertices()
<< " (+ " << arr.number_of_vertices_at_infinity() << " (+ " << arr.number_of_vertices_at_infinity()
<< " at infinity)" << " at infinity)"
<< ", E = " << arr.number_of_edges() << ", E = " << arr.number_of_edges()
<< ", F = " << arr.number_of_faces() << ", F = " << arr.number_of_faces()
<< " (" << arr.number_of_unbounded_faces() << " (" << arr.number_of_unbounded_faces()
<< " unbounded)" << std::endl; << " unbounded)\n";
// Look for a vertex whose degree is greater than 4. // Look for a vertex whose degree is greater than 4.
bool found_collinear = false; bool found_collinear = false;
@ -53,11 +53,9 @@ int main(int argc, char* argv[]) {
} }
} }
if (found_collinear) if (found_collinear)
std::cout << "Found at least three collinear points in the input set." std::cout << "Found at least three collinear points in the input set.\n";
<< std::endl;
else else
std::cout << "No three collinear points are found in the input set." std::cout << "No three collinear points are found in the input set.\n";
<< std::endl;
// Pick two points from the input set, compute their midpoint and insert // Pick two points from the input set, compute their midpoint and insert
// its dual line into the arrangement. // its dual line into the arrangement.

View File

@ -44,7 +44,7 @@ int main(int argc, char* argv[]) {
std::cout << "Point no. " << k+1 << ": (" << points[k] << "), "; std::cout << "Point no. " << k+1 << ": (" << points[k] << "), ";
++circ; ++circ;
} }
std::cout << "are collinear." << std::endl; std::cout << "are collinear.\n";
} }
} }
return 0; return 0;

View File

@ -16,7 +16,7 @@ int main() {
e2 = e2->twin(); // as we wish e2 to be directed from right to left e2 = e2->twin(); // as we wish e2 to be directed from right to left
arr.insert_at_vertices(s3, e1->target(), e2->source()); arr.insert_at_vertices(s3, e1->target(), e2->source());
arr.insert_at_vertices(s4, e2->target(), e1->source()); arr.insert_at_vertices(s4, e2->target(), e1->source());
std::cout << "After step (a):" << std::endl; std::cout << "After step (a):\n";
print_arrangement(arr); print_arrangement(arr);
// Step (b)---split e1 and e2 and connect the split points with a segment. // Step (b)---split e1 and e2 and connect the split points with a segment.
@ -33,7 +33,7 @@ int main() {
arr.remove_edge(e); arr.remove_edge(e);
arr.merge_edge(e1, e1->next(), s1); arr.merge_edge(e1, e1->next(), s1);
arr.merge_edge(e2, e2->next(), s2); arr.merge_edge(e2, e2->next(), s2);
std::cout << std::endl << "After step (c):" << std::endl; std::cout << std::endl << "After step (c):\n";
print_arrangement(arr); print_arrangement(arr);
return 0; return 0;
} }

View File

@ -32,13 +32,13 @@ int main() {
Curve_handle handles[9]; Curve_handle handles[9];
for (size_t k = 0; k < 9; ++k) handles[k] = insert(arr, C[k]); for (size_t k = 0; k < 9; ++k) handles[k] = insert(arr, C[k]);
std::cout << "The initial arrangement size:" << std::endl; std::cout << "The initial arrangement size:\n";
print_arrangement_size(arr); print_arrangement_size(arr);
// Remove the large circle C[0]. // Remove the large circle C[0].
std::cout << "Removing C[0]: "; std::cout << "Removing C[0]: ";
std::cout << remove_curve(arr, handles[0]) std::cout << remove_curve(arr, handles[0])
<< " edges have been removed." << std::endl; << " edges have been removed.\n";
print_arrangement_size(arr); print_arrangement_size(arr);
// Locate the point q, which should be on an edge e. // Locate the point q, which should be on an edge e.
@ -51,12 +51,12 @@ int main() {
// Split the edge e to two edges e1 and e2; // Split the edge e to two edges e1 and e2;
auto e1 = arr.split_edge(arr.non_const_handle(*e), q); auto e1 = arr.split_edge(arr.non_const_handle(*e), q);
auto e2 = e1->next(); auto e2 = e1->next();
std::cout << "After edge split: " << std::endl; std::cout << "After edge split:\n";
print_arrangement_size(arr); print_arrangement_size(arr);
// Merge back the two split edges. // Merge back the two split edges.
arr.merge_edge(e1, e2); arr.merge_edge(e1, e2);
std::cout << "After edge merge: " << std::endl; std::cout << "After edge merge:\n";
print_arrangement_size(arr); print_arrangement_size(arr);
return 0; return 0;
} }

View File

@ -43,10 +43,10 @@ int main() {
// Go over all arrangement faces and print the index of each face and its // Go over all arrangement faces and print the index of each face and its
// outer boundary. The face index is stored in the data field. // outer boundary. The face index is stored in the data field.
std::cout << arr.number_of_faces() << " faces:" << std::endl; std::cout << arr.number_of_faces() << " faces:\n";
for (auto fit = arr.faces_begin(); fit != arr.faces_end(); ++fit) { for (auto fit = arr.faces_begin(); fit != arr.faces_end(); ++fit) {
std::cout << "Face no. " << fit->data() << ": "; std::cout << "Face no. " << fit->data() << ": ";
if (fit->is_unbounded()) std::cout << "Unbounded." << std::endl; if (fit->is_unbounded()) std::cout << "Unbounded.\n";
else { else {
auto curr = fit->outer_ccb(); auto curr = fit->outer_ccb();
std::cout << curr->source()->point(); std::cout << curr->source()->point();

View File

@ -40,7 +40,7 @@ int main() {
insert(arr, Ex_polyline(ctr_curve(pts4, pts4 + 2), "D")); insert(arr, Ex_polyline(ctr_curve(pts4, pts4 + 2), "D"));
// Print all edges that correspond to an overlapping polyline. // Print all edges that correspond to an overlapping polyline.
std::cout << "The overlapping subcurves:" << std::endl; std::cout << "The overlapping subcurves:\n";
for (auto eit = arr.edges_begin(); eit != arr.edges_end(); ++eit) { for (auto eit = arr.edges_begin(); eit != arr.edges_end(); ++eit) {
if (eit->curve().data().length() > 1) { if (eit->curve().data().length() > 1) {
std::cout << " [" << eit->curve() << "] " std::cout << " [" << eit->curve() << "] "

View File

@ -15,7 +15,7 @@ int main() {
insert(arr, Segment(Point(1, 1), Point(1, 6))); insert(arr, Segment(Point(1, 1), Point(1, 6)));
insert(arr, Segment(Point(5, 1), Point(5, 6))); insert(arr, Segment(Point(5, 1), Point(5, 6)));
std::cout << "The initial arrangement:" << std::endl; std::cout << "The initial arrangement:\n";
print_arrangement(arr); print_arrangement(arr);
// Remove e1 and its incident vertices using the function remove_edge(). // Remove e1 and its incident vertices using the function remove_edge().
@ -27,7 +27,7 @@ int main() {
// Remove e2 using the free remove_edge() function. // Remove e2 using the free remove_edge() function.
remove_edge(arr, e2); remove_edge(arr, e2);
std::cout << "The final arrangement:" << std::endl; std::cout << "The final arrangement:\n";
print_arrangement(arr); print_arrangement(arr);
return 0; return 0;
} }

View File

@ -14,7 +14,7 @@ int main() {
// Construct the arrangement. // Construct the arrangement.
Arrangement arr1; Arrangement arr1;
construct_segments_arr(arr1); construct_segments_arr(arr1);
std::cout << "Writing" << std::endl; std::cout << "Writing\n";
print_arrangement_size(arr1); print_arrangement_size(arr1);
// Write the arrangement to a file. // Write the arrangement to a file.
@ -27,7 +27,7 @@ int main() {
std::ifstream in_file("arr_ex_io.dat"); std::ifstream in_file("arr_ex_io.dat");
in_file >> arr2; in_file >> arr2;
in_file.close(); in_file.close();
std::cout << "Reading" << std::endl; std::cout << "Reading\n";
print_arrangement_size(arr2); print_arrangement_size(arr2);
return 0; return 0;

View File

@ -25,7 +25,7 @@ int main() {
Arr_with_hist arr1; Arr_with_hist arr1;
insert(arr1, segs, segs + 6); insert(arr1, segs, segs + 6);
std::cout << "Writing an arrangement of " std::cout << "Writing an arrangement of "
<< arr1.number_of_curves() << " input segments:" << std::endl; << arr1.number_of_curves() << " input segments:\n";
print_arrangement_size(arr1); print_arrangement_size(arr1);
// Write the arrangement to a file. // Write the arrangement to a file.
@ -39,7 +39,7 @@ int main() {
in_file >> arr2; in_file >> arr2;
in_file.close(); in_file.close();
std::cout << "Read an arrangement of " std::cout << "Read an arrangement of "
<< arr2.number_of_curves() << " input segments:" << std::endl; << arr2.number_of_curves() << " input segments:\n";
print_arrangement_size(arr2); print_arrangement_size(arr2);
return 0; return 0;

View File

@ -23,14 +23,13 @@ int main() {
insert(arr, curves.begin(), curves.end()); insert(arr, curves.begin(), curves.end());
// Print out the size of the resulting arrangement. // Print out the size of the resulting arrangement.
std::cout << "Writing an arrangement of size:" << std::endl std::cout << "Writing an arrangement of size:\n"
<< " V = " << arr.number_of_vertices() << " V = " << arr.number_of_vertices()
<< " (plus " << arr.number_of_vertices_at_infinity() << " (plus " << arr.number_of_vertices_at_infinity()
<< " at infinity)" << " at infinity)"
<< ", E = " << arr.number_of_edges() << ", E = " << arr.number_of_edges()
<< ", F = " << arr.number_of_faces() << ", F = " << arr.number_of_faces()
<< " (" << arr.number_of_unbounded_faces() << " unbounded)" << " (" << arr.number_of_unbounded_faces() << " unbounded)\n\n";
<< std::endl << std::endl;
// Write the arrangement to a file. // Write the arrangement to a file.
std::ofstream out_file("arr_ex_io_unbounded.dat"); std::ofstream out_file("arr_ex_io_unbounded.dat");
@ -45,14 +44,13 @@ int main() {
in_file >> arr2; in_file >> arr2;
in_file.close(); in_file.close();
std::cout << "Read an arrangement of size:" << std::endl std::cout << "Read an arrangement of size:\n"
<< " V = " << arr2.number_of_vertices() << " V = " << arr2.number_of_vertices()
<< " (plus " << arr2.number_of_vertices_at_infinity() << " (plus " << arr2.number_of_vertices_at_infinity()
<< " at infinity)" << " at infinity)"
<< ", E = " << arr2.number_of_edges() << ", E = " << arr2.number_of_edges()
<< ", F = " << arr2.number_of_faces() << ", F = " << arr2.number_of_faces()
<< " (" << arr2.number_of_unbounded_faces() << " unbounded)" << " (" << arr2.number_of_unbounded_faces() << " unbounded)\n\n";
<< std::endl << std::endl;
return 0; return 0;
} }

View File

@ -12,16 +12,14 @@ class My_observer : public CGAL::Arr_observer<Arrangement> {
public: public:
My_observer(Arrangement& arr) : CGAL::Arr_observer<Arrangement>(arr) {} My_observer(Arrangement& arr) : CGAL::Arr_observer<Arrangement>(arr) {}
virtual void before_split_face(Face_handle, Halfedge_handle e) virtual void before_split_face(Face_handle, Halfedge_handle e) {
{
std::cout << "-> The insertion of : [ " << e->curve() std::cout << "-> The insertion of : [ " << e->curve()
<< " ] causes a face to split." << std::endl; << " ] causes a face to split.\n";
} }
virtual void before_merge_face(Face_handle, Face_handle, Halfedge_handle e) virtual void before_merge_face(Face_handle, Face_handle, Halfedge_handle e) {
{
std::cout << "-> The removal of : [ " << e->curve() std::cout << "-> The removal of : [ " << e->curve()
<< " ] causes two faces to merge." << std::endl; << " ] causes two faces to merge.\n";
} }
}; };

View File

@ -59,13 +59,12 @@ int main() {
CGAL::overlay(arr1, arr2, overlay_arr, overlay_traits); CGAL::overlay(arr1, arr2, overlay_arr, overlay_traits);
// Go over the faces of the overlay arrangement and print their labels. // Go over the faces of the overlay arrangement and print their labels.
std::cout << "The overlay faces are: " << std::endl; std::cout << "The overlay faces are:\n";
for (auto res_fit = overlay_arr.faces_begin(); for (auto res_fit = overlay_arr.faces_begin();
res_fit != overlay_arr.faces_end(); ++res_fit) res_fit != overlay_arr.faces_end(); ++res_fit)
{ {
std::cout << " " << res_fit->data().c_str() << " (" std::cout << " " << res_fit->data().c_str() << " ("
<< (res_fit->is_unbounded() ? "unbounded" : "bounded") << (res_fit->is_unbounded() ? "unbounded" : "bounded") << ").\n";
<< ")." << std::endl;
} }
return 0; return 0;
} }

View File

@ -7,7 +7,7 @@
#include <iostream> #include <iostream>
int main() { int main() {
std::cout << "Sorry, this example needs CORE ..." << std::endl; std::cout << "Sorry, this example needs CORE ...\n";
return 0; return 0;
} }
@ -52,8 +52,7 @@ int main() {
Bezier_curve B; Bezier_curve B;
in_file >> n_curves; in_file >> n_curves;
size_t k; for (size_t k = 0; k < n_curves; ++k) {
for (k = 0; k < n_curves; ++k) {
// Read the current curve (specified by its control points). // Read the current curve (specified by its control points).
in_file >> B; in_file >> B;
// convert it into x-monotone bezier curve. // convert it into x-monotone bezier curve.
@ -71,4 +70,5 @@ int main() {
return 0; return 0;
} }
#endif #endif

View File

@ -7,7 +7,7 @@
#include <iostream> #include <iostream>
int main() { int main() {
std::cout << "Sorry, this example needs CORE ..." << std::endl; std::cout << "Sorry, this example needs CORE ...\n";
return 0; return 0;
} }
@ -108,7 +108,7 @@ int main() {
insert(polycurve_arrangment, polycurve_1); insert(polycurve_arrangment, polycurve_1);
insert(polycurve_arrangment, polycurve_2); insert(polycurve_arrangment, polycurve_2);
insert(polycurve_arrangment, x_polycurve_1); insert(polycurve_arrangment, x_polycurve_1);
std::cout << "Arrangment Statistics: " << std::endl; std::cout << "Arrangment Statistics:\n";
print_arrangement(polycurve_arrangment); print_arrangement(polycurve_arrangment);
return 0; return 0;

View File

@ -7,7 +7,7 @@
#include <iostream> #include <iostream>
int main() { int main() {
std::cout << "Sorry, this example needs CORE ..." << std::endl; std::cout << "Sorry, this example needs CORE ...\n";
return 0; return 0;
} }
@ -112,13 +112,13 @@ int main() {
Polycurve_conic_arrangment x_pc_arrangment(&traits); Polycurve_conic_arrangment x_pc_arrangment(&traits);
insert(x_pc_arrangment, conic_x_mono_polycurve_1); insert(x_pc_arrangment, conic_x_mono_polycurve_1);
insert(x_pc_arrangment, conic_x_mono_polycurve_2); insert(x_pc_arrangment, conic_x_mono_polycurve_2);
std::cout << "X-monotone polycurve arrangement Statistics: " << std::endl; std::cout << "X-monotone polycurve arrangement Statistics:\n";
print_arrangement(x_pc_arrangment); print_arrangement(x_pc_arrangment);
Polycurve_conic_arrangment pc_arrangment(&traits); Polycurve_conic_arrangment pc_arrangment(&traits);
insert(pc_arrangment, conic_polycurve_1); insert(pc_arrangment, conic_polycurve_1);
insert(pc_arrangment, conic_polycurve_2); insert(pc_arrangment, conic_polycurve_2);
std::cout << "Polycurve arrangement Statistics: " << std::endl; std::cout << "Polycurve arrangement Statistics:\n";
print_arrangement(pc_arrangment); print_arrangement(pc_arrangment);
return 0; return 0;

View File

@ -19,8 +19,8 @@ int main (int argc, char* argv[]) {
// Open the input file. // Open the input file.
std::ifstream in_file(filename); std::ifstream in_file(filename);
if (! in_file.is_open()) { if (! in_file.is_open()) {
std::cerr << "Failed to open " << filename << " ..." << std::endl; std::cerr << "Failed to open " << filename << " ...\n";
return (1); return 1;
} }
std::list<Segment> segments; std::list<Segment> segments;
@ -31,7 +31,7 @@ int main (int argc, char* argv[]) {
CGAL::Timer timer; CGAL::Timer timer;
std::cout << "Performing aggregated insertion of " std::cout << "Performing aggregated insertion of "
<< segments.size() << " segments." << std::endl; << segments.size() << " segments.\n";
timer.start(); timer.start();
insert(arr, segments.begin(), segments.end()); insert(arr, segments.begin(), segments.end());
@ -39,8 +39,7 @@ int main (int argc, char* argv[]) {
print_arrangement_size(arr); print_arrangement_size(arr);
std::cout << "Construction took " << timer.time() std::cout << "Construction took " << timer.time() << " seconds.\n";
<< " seconds." << std::endl;
return 0; return 0;
} }

View File

@ -25,8 +25,8 @@ int main(int argc, char* argv[]) {
std::ifstream in_file(filename); std::ifstream in_file(filename);
if (! in_file.is_open()) { if (! in_file.is_open()) {
std::cerr << "Failed to open " << filename << " ..." << std::endl; std::cerr << "Failed to open " << filename << " ...\n";
return (1); return 1;
} }
// Read the segments from the file. // Read the segments from the file.
@ -54,8 +54,7 @@ int main(int argc, char* argv[]) {
Arrangement_2 arr; Arrangement_2 arr;
CGAL::Timer timer; CGAL::Timer timer;
std::cout << "Performing aggregated insertion of " std::cout << "Performing aggregated insertion of " << n << " segments.\n";
<< n << " segments." << std::endl;
timer.start(); timer.start();
insert_non_intersecting_curves (arr, segments.begin(), segments.end()); insert_non_intersecting_curves (arr, segments.begin(), segments.end());
@ -66,8 +65,7 @@ int main(int argc, char* argv[]) {
<< ", E = " << arr.number_of_edges() << ", E = " << arr.number_of_edges()
<< ", F = " << arr.number_of_faces() << std::endl; << ", F = " << arr.number_of_faces() << std::endl;
std::cout << "Construction took " << timer.time() std::cout << "Construction took " << timer.time() << " seconds.\n";
<< " seconds." << std::endl;
return 0; return 0;
} }

View File

@ -6,7 +6,7 @@
#ifndef CGAL_USE_CORE #ifndef CGAL_USE_CORE
#include <iostream> #include <iostream>
int main() { int main() {
std::cout << "Sorry, this example needs CORE ..." << std::endl; std::cout << "Sorry, this example needs CORE ...\n";
return 0; return 0;
} }
@ -97,7 +97,7 @@ int main() {
insert(arr, arcs.begin(), arcs.end()); insert(arr, arcs.begin(), arcs.end());
// Print the arrangement size. // Print the arrangement size.
std::cout << "The arrangement size:" << std::endl std::cout << "The arrangement size:\n"
<< " V = " << arr.number_of_vertices() << " V = " << arr.number_of_vertices()
<< ", E = " << arr.number_of_edges() << ", E = " << arr.number_of_edges()
<< ", F = " << arr.number_of_faces() << std::endl; << ", F = " << arr.number_of_faces() << std::endl;

View File

@ -102,7 +102,7 @@ protected:
boost::get<Face_const_handle>(&(it->second))) // inside a face boost::get<Face_const_handle>(&(it->second))) // inside a face
std::cout << "inside " std::cout << "inside "
<< (((*f)->is_unbounded()) ? "the unbounded" : "a bounded") << (((*f)->is_unbounded()) ? "the unbounded" : "a bounded")
<< " face." << std::endl; << " face.\n";
else if (const Halfedge_const_handle* e = else if (const Halfedge_const_handle* e =
boost::get<Halfedge_const_handle>(&(it->second))) // on an edge boost::get<Halfedge_const_handle>(&(it->second))) // on an edge
std::cout << "on an edge: " << (*e)->curve() << std::endl; std::cout << "on an edge: " << (*e)->curve() << std::endl;

View File

@ -53,16 +53,16 @@ int main() {
} }
std::cout << " feature above: "; std::cout << " feature above: ";
if (! curr.second) std::cout << "EMPTY" << std::endl; if (! curr.second) std::cout << "EMPTY\n";
else { else {
auto* vh = boost::get<Vertex_const_handle>(&*(curr.second));; auto* vh = boost::get<Vertex_const_handle>(&*(curr.second));;
if (vh) std::cout << '(' << (*vh)->point() << ')' << std::endl; if (vh) std::cout << '(' << (*vh)->point() << ')\n';
else { else {
auto* hh = boost::get<Halfedge_const_handle>(&*(curr.second)); auto* hh = boost::get<Halfedge_const_handle>(&*(curr.second));
CGAL_assertion(hh); CGAL_assertion(hh);
if (! (*hh)->is_fictitious()) if (! (*hh)->is_fictitious())
std::cout << '[' << (*hh)->curve() << ']' << std::endl; std::cout << '[' << (*hh)->curve() << ']\n';
else std::cout << "NONE" << std::endl; else std::cout << "NONE\n";
} }
} }
} }