TAU packages

This commit is contained in:
Andreas Fabri 2022-01-26 16:45:19 +00:00
parent 44f72971b4
commit 0ce35e88ff
18 changed files with 40 additions and 29 deletions

View File

@ -2,6 +2,7 @@
// Constructing an arrangement of algebraic segments.
#include <iostream>
#include <cassert>
#include <CGAL/config.h>
#if (!CGAL_USE_CORE) && (!CGAL_USE_LEDA) && (!(CGAL_USE_GMP && CGAL_USE_MPFI))
@ -52,7 +53,7 @@ int main() {
std::vector<X_monotone_curve> segs;
for(size_t i = 0; i < pre_segs.size(); ++i) {
auto* curr_p = boost::get<X_monotone_curve>(&pre_segs[i]);
CGAL_assertion(curr_p);
assert(curr_p);
segs.push_back(*curr_p);
}
// Construct an ellipse (C2) with the equation 2*x^2+5*y^2-7=0.

View File

@ -29,7 +29,7 @@ int main() {
// with (-3, 4) and (4, 3) as its endpoints. We want the arc to be
// clockwise-oriented, so it passes through (0, 5) as well.
Conic_arc c4(Rat_point(-3, 4), Rat_point(0, 5), Rat_point(4, 3));
CGAL_assertion(c4.is_valid());
insert(arr, c4);
// Insert a full unit circle (C5) that is centered at (0, 4).
@ -46,7 +46,7 @@ int main() {
0, 0, 0, 0, 1, 3, // the line: y = -3.
Point(1.41, -2), // approximation of the target.
0, 0, 0, 0, 1, 2); // the line: y = -2.
CGAL_assertion(c6.is_valid());
insert(arr, c6);
// Insert the right half of the circle centered at (4, 2.5) whose radius

View File

@ -3,6 +3,7 @@
// using the arrangement of the dual lines.
#include <cstdlib>
#include <cassert>
#include "arr_linear.h"
#include "read_objects.h"
@ -74,7 +75,7 @@ int main(int argc, char* argv[]) {
break;
}
}
CGAL_assertion(found_collinear);
assert(found_collinear);
return (0);
}

View File

@ -46,7 +46,6 @@ int main() {
const Point q{_7_halves, 7};
Point_location::result_type obj = pl.locate(q);
auto* e = boost::get<Arr_with_hist::Halfedge_const_handle>(&obj);
CGAL_assertion(e);
// Split the edge e to two edges e1 and e2;
auto e1 = arr.split_edge(arr.non_const_handle(*e), q);

View File

@ -1,6 +1,8 @@
//! \file examples/Arrangement_on_surface_2/face_extension_overlay.cpp
// A face overlay of two arrangements with extended face records.
#include <cassert>
#include <CGAL/basic.h>
#include <CGAL/Arr_overlay_2.h>
#include <CGAL/Arr_default_overlay_traits.h>
@ -21,7 +23,8 @@ int main() {
insert_non_intersecting_curve(arr1, Segment(Point(6, 2), Point(6, 6)));
insert_non_intersecting_curve(arr1, Segment(Point(6, 6), Point(2, 6)));
insert_non_intersecting_curve(arr1, Segment(Point(2, 6), Point(2, 2)));
CGAL_assertion(arr1.number_of_faces() == 2);
// 2 because the bounded and the unbounded one
assert(arr1.number_of_faces() == 2);
// Mark just the bounded face.
for (auto fit = arr1.faces_begin(); fit != arr1.faces_end(); ++fit)
@ -33,7 +36,6 @@ int main() {
insert_non_intersecting_curve(arr2, Segment(Point(7, 4), Point(4, 7)));
insert_non_intersecting_curve(arr2, Segment(Point(4, 7), Point(1, 4)));
insert_non_intersecting_curve(arr2, Segment(Point(1, 4), Point(4, 1)));
CGAL_assertion(arr2.number_of_faces() == 2);
for (auto fit = arr2.faces_begin(); fit != arr2.faces_end(); ++fit)
fit->set_data(fit != arr2.unbounded_face()); // mark the bounded face.

View File

@ -33,7 +33,7 @@ int main() {
Point q(4, 1);
auto obj = pl.locate(q);
auto* f = boost::get<Arrangement::Face_const_handle>(&obj);
CGAL_assertion(f != nullptr);
std::cout << "The query point (" << q << ") is located in: ";
print_face<Arrangement>(*f);

View File

@ -1,6 +1,8 @@
//! \file examples/Arrangement_on_surface_2/overlay_color.cpp
// The overlay of two arrangement with extended dcel structures
#include <cassert>
#include <CGAL/basic.h>
#include <CGAL/Arr_extended_dcel.h>
#include <CGAL/Arr_overlay_2.h>
@ -25,7 +27,7 @@ int main() {
insert(arr1, Segment(Point(0, 0), Point(0, 4)));
insert(arr1, Segment(Point(2, 0), Point(2, 4)));
insert(arr1, Segment(Point(4, 0), Point(4, 4)));
CGAL_assertion(arr1.number_of_faces() == 5);
assert(arr1.number_of_faces() == 5);
for (auto vit = arr1.vertices_begin(); vit != arr1.vertices_end(); ++vit)
vit->set_data(vcol1);
for (auto hit = arr1.halfedges_begin(); hit != arr1.halfedges_end(); ++hit)
@ -41,7 +43,7 @@ int main() {
insert(arr2, Segment(Point(0, 0), Point(0, 6)));
insert(arr2, Segment(Point(3, 0), Point(3, 6)));
insert(arr2, Segment(Point(6, 0), Point(6, 6)));
CGAL_assertion(arr2.number_of_faces() == 5);
assert(arr2.number_of_faces() == 5);
for (auto vit = arr2.vertices_begin(); vit != arr2.vertices_end(); ++vit)
vit->set_data(vcol2);
for (auto hit = arr2.halfedges_begin(); hit != arr2.halfedges_end(); ++hit)

View File

@ -59,7 +59,6 @@ int main() {
std::vector<Make_x_monotone_result> obj_vector;
bezier_traits.make_x_monotone_2_object()(B, std::back_inserter(obj_vector));
auto* x_seg_p = boost::get<Bezier_x_monotone_curve>(&obj_vector[0]);
CGAL_assertion(x_seg_p);
x_curves.push_back(*x_seg_p);
}

View File

@ -5,6 +5,7 @@
// #define CGAL_ARRANGEMENT_ON_SURFACE_INSERT_VERBOSE 1
// #define CGAL_ARR_CONSTRUCTION_SL_VISITOR_VERBOSE 1
#include <cassert>
#include <vector>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
@ -57,26 +58,26 @@ int main() {
X_monotone_curve_2 xcv_sp1 = ctr_xcv(sp, p1);
X_monotone_curve_2 xcv_sp2 = ctr_xcv(sp, p2);
X_monotone_curve_2 xcv_sp3 = ctr_xcv(sp, p3);
CGAL_assertion(xcv_sp1.is_vertical());
CGAL_assertion(xcv_sp2.is_vertical());
CGAL_assertion(xcv_sp3.is_vertical());
assert(xcv_sp1.is_vertical());
assert(xcv_sp2.is_vertical());
assert(xcv_sp3.is_vertical());
xcvs.push_back(xcv_sp1); // 0
xcvs.push_back(xcv_sp2); // 1
xcvs.push_back(xcv_sp3); // 2
X_monotone_curve_2 xcv_12 = ctr_xcv(p1, p2);
X_monotone_curve_2 xcv_23 = ctr_xcv(p2, p3);
CGAL_assertion(!xcv_12.is_vertical());
CGAL_assertion(!xcv_23.is_vertical());
assert(!xcv_12.is_vertical());
assert(!xcv_23.is_vertical());
xcvs.push_back(xcv_12); // 3
xcvs.push_back(xcv_23); // 4
X_monotone_curve_2 xcv_np1 = ctr_xcv(np, p1);
X_monotone_curve_2 xcv_np2 = ctr_xcv(np, p2);
X_monotone_curve_2 xcv_np3 = ctr_xcv(np, p3);
CGAL_assertion(xcv_np1.is_vertical());
CGAL_assertion(xcv_np2.is_vertical());
CGAL_assertion(xcv_np3.is_vertical());
assert(xcv_np1.is_vertical());
assert(xcv_np2.is_vertical());
assert(xcv_np3.is_vertical());
xcvs.push_back(xcv_np1); // 5
xcvs.push_back(xcv_np2); // 6
xcvs.push_back(xcv_np3); // 7

View File

@ -45,7 +45,6 @@ int main() {
if (vh) std::cout << '(' << (*vh)->point() << ')';
else {
auto* hh = boost::get<Halfedge_const_handle>(&*(curr.first));
CGAL_assertion(hh);
if (! (*hh)->is_fictitious())
std::cout << '[' << (*hh)->curve() << ']';
else std::cout << "NONE";
@ -59,7 +58,6 @@ int main() {
if (vh) std::cout << '(' << (*vh)->point() << ")\n";
else {
auto* hh = boost::get<Halfedge_const_handle>(&*(curr.second));
CGAL_assertion(hh);
if (! (*hh)->is_fictitious())
std::cout << '[' << (*hh)->curve() << "]\n";
else std::cout << "NONE\n";

View File

@ -2,6 +2,8 @@
// Constructing an arrangement of unbounded linear objects using the insertion
// function for non-intersecting curves.
#include <cassert>
#include "arr_linear.h"
#include "arr_print.h"
@ -13,7 +15,7 @@ int main() {
X_monotone_curve c1 = Line(Point(-1, 0), Point(1, 0));
arr.insert_in_face_interior(c1, arr.unbounded_face());
Vertex_handle v = insert_point(arr, Point(0,0));
CGAL_assertion(! v->is_at_open_boundary());
assert(! v->is_at_open_boundary());
// Add two more rays using the specialized insertion functions.
arr.insert_from_right_vertex(Ray(Point(0, 0), Point(-1, 1)), v); // c2

View File

@ -8,6 +8,7 @@
#include <CGAL/Lazy_exact_nt.h>
#include <list>
#include <cassert>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef Kernel::Point_2 Point_2;
@ -28,7 +29,7 @@ Polygon_2 construct_polygon (const Circle_2& circle)
Curve_2 curve (circle);
std::list<CGAL::Object> objects;
traits.make_x_monotone_2_object() (curve, std::back_inserter(objects));
CGAL_assertion (objects.size() == 2);
assert(objects.size() == 2);
// Construct the polygon.
Polygon_2 pgn;

View File

@ -10,6 +10,7 @@
#include <list>
#include <cstdlib>
#include <cmath>
#include <cassert>
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef Kernel::Point_2 Point_2;
@ -29,7 +30,7 @@ Polygon_2 construct_polygon (const Circle_2& circle)
Curve_2 curve (circle);
std::list<CGAL::Object> objects;
traits.make_x_monotone_2_object() (curve, std::back_inserter(objects));
CGAL_assertion (objects.size() == 2);
assert(objects.size() == 2);
// Construct the polygon.
Polygon_2 pgn;

View File

@ -8,6 +8,7 @@
#include <CGAL/Arrangement_2.h>
#include <CGAL/Envelope_diagram_1.h>
#include <CGAL/envelope_2.h>
#include <cassert>
typedef CGAL::Exact_rational Number_type;
typedef CGAL::Cartesian<Number_type> Kernel;
@ -42,7 +43,7 @@ void print_diagram (const Diagram_1& diag)
e = v->right();
}
CGAL_assertion (e->is_empty());
assert(e->is_empty());
std::cout << "Edge: [empty]" << std::endl;
return;

View File

@ -10,6 +10,7 @@
#include <list>
#include <iostream>
#include <cassert>
typedef CGAL::Exact_rational Number_type;
typedef CGAL::Cartesian<Number_type> Kernel;
@ -74,7 +75,7 @@ int main ()
e = v->right();
}
CGAL_assertion (e->is_empty());
assert(e->is_empty());
std::cout << "Edge: [empty]" << std::endl;
return (0);

View File

@ -2,6 +2,7 @@
#define BOPS_LINEAR_H
#include <list>
#include <cassert>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Boolean_set_operations_2.h>

View File

@ -21,7 +21,7 @@ int main()
// Compute the Minkowski sum.
Polygon_with_holes_2 sum = CGAL::minkowski_sum_2(P, Q);
CGAL_assertion(sum.number_of_holes() == 0);
assert(sum.number_of_holes() == 0);
std::cout << "P (+) Q = " << sum.outer_boundary() << std::endl;
return 0;
}

View File

@ -1,7 +1,8 @@
//! \file examples/Arrangement_on_surface_2/plane_sweep.cpp
//! \file examples/Surface_sweep_2/plane_sweep.cpp
// Computing intersection points among curves using the surface-sweep alg.
#include <list>
#include <cassert>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Arr_segment_traits_2.h>
@ -39,7 +40,7 @@ int main()
std::cout << "Found " << sub_segs.size()
<< " interior-disjoint sub-segments." << std::endl;
CGAL_assertion(CGAL::do_curves_intersect (segments, segments + 4));
assert(CGAL::do_curves_intersect (segments, segments + 4));
return 0;
}