Merge pull request #6266 from afabri/CGAL-assertions_in_examples-GF

CGAL Examples: CGAL_assertion ->  assert

# Conflicts:
#	HalfedgeDS/examples/HalfedgeDS/hds_prog_compact2.cpp
#	Triangulation_2/examples/Triangulation_2/triangulation_print_OFF.h
This commit is contained in:
Laurent Rineau 2022-02-02 16:38:01 +01:00
commit 5b42a501cc
87 changed files with 255 additions and 244 deletions

View File

@ -6,7 +6,6 @@
#include <CGAL/Delaunay_triangulation_2.h> #include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/algorithm.h> #include <CGAL/algorithm.h>
#include <CGAL/assertions.h>
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>

View File

@ -2,6 +2,7 @@
// Constructing an arrangement of algebraic segments. // Constructing an arrangement of algebraic segments.
#include <iostream> #include <iostream>
#include <cassert>
#include <CGAL/config.h> #include <CGAL/config.h>
#if (!CGAL_USE_CORE) && (!CGAL_USE_LEDA) && (!(CGAL_USE_GMP && CGAL_USE_MPFI)) #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; std::vector<X_monotone_curve> segs;
for(size_t i = 0; i < pre_segs.size(); ++i) { for(size_t i = 0; i < pre_segs.size(); ++i) {
auto* curr_p = boost::get<X_monotone_curve>(&pre_segs[i]); auto* curr_p = boost::get<X_monotone_curve>(&pre_segs[i]);
CGAL_assertion(curr_p); assert(curr_p);
segs.push_back(*curr_p); segs.push_back(*curr_p);
} }
// Construct an ellipse (C2) with the equation 2*x^2+5*y^2-7=0. // 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 // 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. // 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)); Conic_arc c4(Rat_point(-3, 4), Rat_point(0, 5), Rat_point(4, 3));
CGAL_assertion(c4.is_valid());
insert(arr, c4); insert(arr, c4);
// Insert a full unit circle (C5) that is centered at (0, 4). // 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. 0, 0, 0, 0, 1, 3, // the line: y = -3.
Point(1.41, -2), // approximation of the target. Point(1.41, -2), // approximation of the target.
0, 0, 0, 0, 1, 2); // the line: y = -2. 0, 0, 0, 0, 1, 2); // the line: y = -2.
CGAL_assertion(c6.is_valid());
insert(arr, c6); insert(arr, c6);
// Insert the right half of the circle centered at (4, 2.5) whose radius // 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. // using the arrangement of the dual lines.
#include <cstdlib> #include <cstdlib>
#include <cassert>
#include "arr_linear.h" #include "arr_linear.h"
#include "read_objects.h" #include "read_objects.h"
@ -74,7 +75,7 @@ int main(int argc, char* argv[]) {
break; break;
} }
} }
CGAL_assertion(found_collinear); assert(found_collinear);
return (0); return (0);
} }

View File

@ -46,7 +46,6 @@ int main() {
const Point q{_7_halves, 7}; const Point q{_7_halves, 7};
Point_location::result_type obj = pl.locate(q); Point_location::result_type obj = pl.locate(q);
auto* e = boost::get<Arr_with_hist::Halfedge_const_handle>(&obj); auto* e = boost::get<Arr_with_hist::Halfedge_const_handle>(&obj);
CGAL_assertion(e);
// 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);

View File

@ -1,6 +1,8 @@
//! \file examples/Arrangement_on_surface_2/face_extension_overlay.cpp //! \file examples/Arrangement_on_surface_2/face_extension_overlay.cpp
// A face overlay of two arrangements with extended face records. // A face overlay of two arrangements with extended face records.
#include <cassert>
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Arr_overlay_2.h> #include <CGAL/Arr_overlay_2.h>
#include <CGAL/Arr_default_overlay_traits.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, 2), Point(6, 6)));
insert_non_intersecting_curve(arr1, Segment(Point(6, 6), Point(2, 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))); 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. // Mark just the bounded face.
for (auto fit = arr1.faces_begin(); fit != arr1.faces_end(); ++fit) 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(7, 4), Point(4, 7)));
insert_non_intersecting_curve(arr2, Segment(Point(4, 7), Point(1, 4))); insert_non_intersecting_curve(arr2, Segment(Point(4, 7), Point(1, 4)));
insert_non_intersecting_curve(arr2, Segment(Point(1, 4), Point(4, 1))); 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) for (auto fit = arr2.faces_begin(); fit != arr2.faces_end(); ++fit)
fit->set_data(fit != arr2.unbounded_face()); // mark the bounded face. fit->set_data(fit != arr2.unbounded_face()); // mark the bounded face.

View File

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

View File

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

View File

@ -1,3 +1,4 @@
#include <cassert>
#include <CGAL/Arr_point_location_result.h> #include <CGAL/Arr_point_location_result.h>
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
@ -106,7 +107,7 @@ void shoot_vertical_ray(const VerticalRayShooting& vrs,
else if ((e = boost::get<Halfedge_const_handle>(&obj)) ) // hit an edge else if ((e = boost::get<Halfedge_const_handle>(&obj)) ) // hit an edge
std::cout << "an edge: " << (*e)->curve() << std::endl; std::cout << "an edge: " << (*e)->curve() << std::endl;
else if ((f = boost::get<Face_const_handle>(&obj))) { // hit nothing else if ((f = boost::get<Face_const_handle>(&obj))) { // hit nothing
CGAL_assertion((*f)->is_unbounded()); assert((*f)->is_unbounded());
std::cout << "nothing." << std::endl; std::cout << "nothing." << std::endl;
} }
else CGAL_error_msg("Invalid object."); else CGAL_error_msg("Invalid object.");

View File

@ -59,7 +59,6 @@ int main() {
std::vector<Make_x_monotone_result> obj_vector; std::vector<Make_x_monotone_result> obj_vector;
bezier_traits.make_x_monotone_2_object()(B, std::back_inserter(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]); 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); x_curves.push_back(*x_seg_p);
} }

View File

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

View File

@ -1,13 +1,15 @@
#ifndef IS_IN_X_RANGE_H #ifndef IS_IN_X_RANGE_H
#define IS_IN_X_RANGE_H #define IS_IN_X_RANGE_H
#include <cassert>
// Check whether the given point is in the x-range of the given curve that // Check whether the given point is in the x-range of the given curve that
// represents a great-circle arc. // represents a great-circle arc.
template <typename GeometryTraits> template <typename GeometryTraits>
bool is_in_x_range(const typename GeometryTraits::X_monotone_curve_2& c, bool is_in_x_range(const typename GeometryTraits::X_monotone_curve_2& c,
const typename GeometryTraits::Point_2& p, const typename GeometryTraits::Point_2& p,
const GeometryTraits& traits) { const GeometryTraits& traits) {
CGAL_assertion(! traits.is_on_y_identification_2_object()(p)); assert(! traits.is_on_y_identification_2_object()(p));
if (traits.is_on_y_identification_2_object()(c)) return false; if (traits.is_on_y_identification_2_object()(c)) return false;

View File

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

View File

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

View File

@ -7,6 +7,7 @@
#include <fstream> #include <fstream>
#include <iostream> #include <iostream>
#include <cassert>
typedef CGAL::Simple_cartesian<double> K; typedef CGAL::Simple_cartesian<double> K;
typedef CGAL::Surface_mesh<K::Point_3> SM; typedef CGAL::Surface_mesh<K::Point_3> SM;
@ -39,7 +40,7 @@ int main(int argc, char** argv)
// Extract the part n°0 of the partition into a new, independent mesh // Extract the part n°0 of the partition into a new, independent mesh
typedef CGAL::Face_filtered_graph<SM> Filtered_graph; typedef CGAL::Face_filtered_graph<SM> Filtered_graph;
Filtered_graph filtered_sm(sm, 0 /*id of th part*/, face_pid_map); Filtered_graph filtered_sm(sm, 0 /*id of th part*/, face_pid_map);
CGAL_assertion(filtered_sm.is_selection_valid()); assert(filtered_sm.is_selection_valid());
SM part_sm; SM part_sm;
CGAL::copy_face_graph(filtered_sm, part_sm); CGAL::copy_face_graph(filtered_sm, part_sm);

View File

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

View File

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

View File

@ -5,6 +5,7 @@
#include <CGAL/Exact_rational.h> #include <CGAL/Exact_rational.h>
#include <CGAL/Min_sphere_of_spheres_d.h> #include <CGAL/Min_sphere_of_spheres_d.h>
#include <vector> #include <vector>
#include <cassert>
const int N = 1000; // number of spheres const int N = 1000; // number of spheres
const int LOW = 0, HIGH = 10000; // range of coordinates and radii const int LOW = 0, HIGH = 10000; // range of coordinates and radii
@ -29,5 +30,5 @@ int main () {
} }
Min_sphere ms(S.begin(),S.end()); // check in the spheres Min_sphere ms(S.begin(),S.end()); // check in the spheres
CGAL_assertion(ms.is_valid()); assert(ms.is_valid());
} }

View File

@ -5,6 +5,7 @@
#include <CGAL/Exact_rational.h> #include <CGAL/Exact_rational.h>
#include <CGAL/Min_sphere_of_spheres_d.h> #include <CGAL/Min_sphere_of_spheres_d.h>
#include <vector> #include <vector>
#include <cassert>
const int N = 1000; // number of spheres const int N = 1000; // number of spheres
const int LOW = 0, HIGH = 10000; // range of coordinates and radii const int LOW = 0, HIGH = 10000; // range of coordinates and radii
@ -30,5 +31,5 @@ int main () {
} }
Min_sphere ms(S.begin(),S.end()); // check in the spheres Min_sphere ms(S.begin(),S.end()); // check in the spheres
CGAL_assertion(ms.is_valid()); assert(ms.is_valid());
} }

View File

@ -5,6 +5,7 @@
#include <CGAL/Exact_rational.h> #include <CGAL/Exact_rational.h>
#include <CGAL/Min_sphere_of_spheres_d.h> #include <CGAL/Min_sphere_of_spheres_d.h>
#include <vector> #include <vector>
#include <cassert>
const int N = 1000; // number of spheres const int N = 1000; // number of spheres
const int D = 3; // dimension of points const int D = 3; // dimension of points
@ -31,5 +32,5 @@ int main () {
} }
Min_sphere ms(S.begin(),S.end()); // check in the spheres Min_sphere ms(S.begin(),S.end()); // check in the spheres
CGAL_assertion(ms.is_valid()); assert(ms.is_valid());
} }

View File

@ -1,6 +1,7 @@
#include <CGAL/Combinatorial_map.h> #include <CGAL/Combinatorial_map.h>
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <cassert>
typedef CGAL::Combinatorial_map<3> CMap_3; typedef CGAL::Combinatorial_map<3> CMap_3;
typedef CMap_3::Dart_handle Dart_handle; typedef CMap_3::Dart_handle Dart_handle;
@ -13,19 +14,19 @@ int main()
Dart_handle dh1 = cm.make_combinatorial_hexahedron(); Dart_handle dh1 = cm.make_combinatorial_hexahedron();
// Add two edges along two opposite facets. // Add two edges along two opposite facets.
CGAL_assertion( cm.is_insertable_cell_1_in_cell_2 assert( cm.is_insertable_cell_1_in_cell_2
(cm.beta(dh1,1),cm.beta(dh1,0)) ); (cm.beta(dh1,1),cm.beta(dh1,0)) );
cm.insert_cell_1_in_cell_2(cm.beta(dh1,1), cm.beta(dh1,0)); cm.insert_cell_1_in_cell_2(cm.beta(dh1,1), cm.beta(dh1,0));
CGAL_assertion( cm.is_valid() ); assert( cm.is_valid() );
Dart_handle dh2=cm.beta(dh1,2,1,1,2); Dart_handle dh2=cm.beta(dh1,2,1,1,2);
CGAL_assertion( cm.is_insertable_cell_1_in_cell_2 assert( cm.is_insertable_cell_1_in_cell_2
(dh2,cm.beta(dh2,1,1)) ); (dh2,cm.beta(dh2,1,1)) );
cm.insert_cell_1_in_cell_2(dh2, cm.beta(dh2,1,1)); cm.insert_cell_1_in_cell_2(dh2, cm.beta(dh2,1,1));
CGAL_assertion( cm.is_valid() ); assert( cm.is_valid() );
// Insert a facet along these two new edges plus two initial edges // Insert a facet along these two new edges plus two initial edges
// of the hexahedron. // of the hexahedron.
@ -35,28 +36,28 @@ int main()
path.push_back(cm.beta(dh2,0)); path.push_back(cm.beta(dh2,0));
path.push_back(cm.beta(dh2,2,1)); path.push_back(cm.beta(dh2,2,1));
CGAL_assertion( (cm.is_insertable_cell_2_in_cell_3 assert( (cm.is_insertable_cell_2_in_cell_3
(path.begin(),path.end())) ); (path.begin(),path.end())) );
Dart_handle dh3=cm.insert_cell_2_in_cell_3(path.begin(),path.end()); Dart_handle dh3=cm.insert_cell_2_in_cell_3(path.begin(),path.end());
CGAL_assertion( cm.is_valid() ); assert( cm.is_valid() );
// Display the combinatorial map characteristics. // Display the combinatorial map characteristics.
cm.display_characteristics(std::cout) << ", valid=" << cm.display_characteristics(std::cout) << ", valid=" <<
cm.is_valid() << std::endl; cm.is_valid() << std::endl;
// We use the removal operations to get back to the initial hexahedron. // We use the removal operations to get back to the initial hexahedron.
CGAL_assertion( (cm.is_removable<2>(dh3)) ); assert( (cm.is_removable<2>(dh3)) );
cm.remove_cell<2>(dh3); cm.remove_cell<2>(dh3);
CGAL_assertion( cm.is_valid() ); assert( cm.is_valid() );
CGAL_assertion( (cm.is_removable<1>(cm.beta(dh1,1))) ); assert( (cm.is_removable<1>(cm.beta(dh1,1))) );
cm.remove_cell<1>(cm.beta(dh1,1)); cm.remove_cell<1>(cm.beta(dh1,1));
CGAL_assertion( cm.is_valid() ); assert( cm.is_valid() );
CGAL_assertion( (cm.is_removable<1>(cm.beta(dh2,0))) ); assert( (cm.is_removable<1>(cm.beta(dh2,0))) );
cm.remove_cell<1>(cm.beta(dh2,0)); cm.remove_cell<1>(cm.beta(dh2,0));
CGAL_assertion( cm.is_valid() ); assert( cm.is_valid() );
// Display the combinatorial map characteristics. // Display the combinatorial map characteristics.
cm.display_characteristics(std::cout) << ", valid=" cm.display_characteristics(std::cout) << ", valid="
@ -64,4 +65,3 @@ int main()
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

View File

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

View File

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

View File

@ -1,6 +1,7 @@
#include <CGAL/Generalized_map.h> #include <CGAL/Generalized_map.h>
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <cassert>
typedef CGAL::Generalized_map<3> GMap_3; typedef CGAL::Generalized_map<3> GMap_3;
typedef GMap_3::Dart_handle Dart_handle; typedef GMap_3::Dart_handle Dart_handle;
@ -26,9 +27,9 @@ int main()
Dart_handle dh1 = gm.make_combinatorial_tetrahedron(); Dart_handle dh1 = gm.make_combinatorial_tetrahedron();
Dart_handle dh2 = gm.make_combinatorial_tetrahedron(); Dart_handle dh2 = gm.make_combinatorial_tetrahedron();
CGAL_assertion( gm.is_valid() ); assert( gm.is_valid() );
CGAL_assertion( gm.is_volume_combinatorial_tetrahedron(dh1) ); assert( gm.is_volume_combinatorial_tetrahedron(dh1) );
CGAL_assertion( gm.is_volume_combinatorial_tetrahedron(dh2) ); assert( gm.is_volume_combinatorial_tetrahedron(dh2) );
// 3) 3-sew them. // 3) 3-sew them.
gm.sew<3>(dh1, dh2); gm.sew<3>(dh1, dh2);
@ -59,4 +60,3 @@ int main()
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

View File

@ -1,6 +1,7 @@
#include <CGAL/Generalized_map.h> #include <CGAL/Generalized_map.h>
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <cassert>
typedef CGAL::Generalized_map<3> GMap_3; typedef CGAL::Generalized_map<3> GMap_3;
typedef GMap_3::Dart_handle Dart_handle; typedef GMap_3::Dart_handle Dart_handle;
@ -14,11 +15,11 @@ int main()
// Add two edges along two opposite facets. // Add two edges along two opposite facets.
gm.insert_cell_1_in_cell_2(d1,gm.alpha<0,1,0>(d1)); gm.insert_cell_1_in_cell_2(d1,gm.alpha<0,1,0>(d1));
CGAL_assertion( gm.is_valid() ); assert( gm.is_valid() );
Dart_handle d2=gm.alpha<2,1,0,1,2>(d1); Dart_handle d2=gm.alpha<2,1,0,1,2>(d1);
gm.insert_cell_1_in_cell_2(d2,gm.alpha<0,1,0>(d2)); gm.insert_cell_1_in_cell_2(d2,gm.alpha<0,1,0>(d2));
CGAL_assertion( gm.is_valid() ); assert( gm.is_valid() );
// Insert a facet along these two new edges plus two initial edges // Insert a facet along these two new edges plus two initial edges
// of the hexahedron. // of the hexahedron.
@ -29,7 +30,7 @@ int main()
path.push_back(gm.alpha<2,1>(d2)); path.push_back(gm.alpha<2,1>(d2));
Dart_handle d3=gm.insert_cell_2_in_cell_3(path.begin(),path.end()); Dart_handle d3=gm.insert_cell_2_in_cell_3(path.begin(),path.end());
CGAL_assertion( gm.is_valid() ); assert( gm.is_valid() );
// Display the generalized map characteristics. // Display the generalized map characteristics.
gm.display_characteristics(std::cout) << ", valid=" << gm.display_characteristics(std::cout) << ", valid=" <<
@ -37,14 +38,14 @@ int main()
// We use the removal operations to get back to the initial hexahedron. // We use the removal operations to get back to the initial hexahedron.
gm.remove_cell<2>(d3); gm.remove_cell<2>(d3);
CGAL_assertion( gm.is_valid() ); assert( gm.is_valid() );
gm.remove_cell<1>(gm.alpha<1>(d1)); gm.remove_cell<1>(gm.alpha<1>(d1));
CGAL_assertion( gm.is_valid() ); assert( gm.is_valid() );
gm.remove_cell<1>(gm.alpha<1>(d2)); gm.remove_cell<1>(gm.alpha<1>(d2));
CGAL_assertion( gm.is_valid() ); assert( gm.is_valid() );
CGAL_assertion( gm.is_volume_combinatorial_hexahedron(d1) ); assert( gm.is_volume_combinatorial_hexahedron(d1) );
// Display the generalized map characteristics. // Display the generalized map characteristics.
gm.display_characteristics(std::cout) << ", valid=" gm.display_characteristics(std::cout) << ", valid="
@ -52,4 +53,3 @@ int main()
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

View File

@ -1,6 +1,7 @@
#include <CGAL/Generalized_map.h> #include <CGAL/Generalized_map.h>
#include <iostream> #include <iostream>
#include <cstdlib> #include <cstdlib>
#include <cassert>
typedef CGAL::Generalized_map<4> GMap_4; typedef CGAL::Generalized_map<4> GMap_4;
typedef GMap_4::Dart_handle Dart_handle; typedef GMap_4::Dart_handle Dart_handle;
@ -11,7 +12,7 @@ int main()
Dart_handle d1 = gm.make_combinatorial_tetrahedron(); Dart_handle d1 = gm.make_combinatorial_tetrahedron();
Dart_handle d2 = gm.make_combinatorial_tetrahedron(); Dart_handle d2 = gm.make_combinatorial_tetrahedron();
CGAL_assertion(gm.is_valid()); assert(gm.is_valid());
gm.sew<4>(d1,d2); gm.sew<4>(d1,d2);

View File

@ -8,6 +8,7 @@
#include <CGAL/function_objects.h> #include <CGAL/function_objects.h>
#include <CGAL/Join_input_iterator.h> #include <CGAL/Join_input_iterator.h>
#include <CGAL/Counting_iterator.h> #include <CGAL/Counting_iterator.h>
#include <cassert>
using namespace CGAL; using namespace CGAL;
@ -41,16 +42,16 @@ int main() {
Count_iterator t2_end( t2, 50); Count_iterator t2_end( t2, 50);
std::copy( t2_begin, t2_end, std::back_inserter(segs)); std::copy( t2_begin, t2_end, std::back_inserter(segs));
CGAL_assertion( segs.size() == 100); assert( segs.size() == 100);
for ( Vector::iterator i = segs.begin(); i != segs.end(); i++){ for ( Vector::iterator i = segs.begin(); i != segs.end(); i++){
CGAL_assertion( i->source().x() <= 250); assert( i->source().x() <= 250);
CGAL_assertion( i->source().x() >= -250); assert( i->source().x() >= -250);
CGAL_assertion( i->source().y() <= 250); assert( i->source().y() <= 250);
CGAL_assertion( i->source().y() >= -250); assert( i->source().y() >= -250);
CGAL_assertion( i->target().x() <= 250); assert( i->target().x() <= 250);
CGAL_assertion( i->target().x() >= -250); assert( i->target().x() >= -250);
CGAL_assertion( i->target().y() <= 250); assert( i->target().y() <= 250);
CGAL_assertion( i->target().y() >= -250); assert( i->target().y() >= -250);
} }
return 0; return 0;
} }

View File

@ -1,6 +1,7 @@
#include <CGAL/HalfedgeDS_items_2.h> #include <CGAL/HalfedgeDS_items_2.h>
#include <CGAL/HalfedgeDS_default.h> #include <CGAL/HalfedgeDS_default.h>
#include <CGAL/IO/Color.h> #include <CGAL/IO/Color.h>
#include <cassert>
// A face type with a color member variable. // A face type with a color member variable.
template <class Refs> template <class Refs>
@ -30,6 +31,6 @@ int main() {
HDS hds; HDS hds;
Face_handle f = hds.faces_push_back( Face( CGAL::IO::red())); Face_handle f = hds.faces_push_back( Face( CGAL::IO::red()));
f->color = CGAL::IO::blue(); f->color = CGAL::IO::blue();
CGAL_assertion( f->color == CGAL::IO::blue()); assert( f->color == CGAL::IO::blue());
return 0; return 0;
} }

View File

@ -2,6 +2,7 @@
#include <CGAL/HalfedgeDS_vector.h> #include <CGAL/HalfedgeDS_vector.h>
#include <CGAL/HalfedgeDS_decorator.h> #include <CGAL/HalfedgeDS_decorator.h>
#include <cstddef> #include <cstddef>
#include <cassert>
// Define a new halfedge class. We assume that the Halfedge_handle can // Define a new halfedge class. We assume that the Halfedge_handle can
// be created from a pointer (e.g. the HalfedgeDS is based here on the // be created from a pointer (e.g. the HalfedgeDS is based here on the
@ -55,15 +56,15 @@ public:
(nxt & (~ std::ptrdiff_t(1)))); (nxt & (~ std::ptrdiff_t(1))));
} }
void set_opposite( Halfedge_handle h) { void set_opposite( Halfedge_handle h) {
CGAL_precondition(( &* h - 1 == &* HDS::halfedge_handle(this)) || assert(( &* h - 1 == &* HDS::halfedge_handle(this)) ||
( &* h + 1 == &* HDS::halfedge_handle(this))); ( &* h + 1 == &* HDS::halfedge_handle(this)));
if ( &* h - 1 == &* HDS::halfedge_handle(this)) if ( &* h - 1 == &* HDS::halfedge_handle(this))
nxt |= 1; nxt |= 1;
else else
nxt &= (~ std::ptrdiff_t(1)); nxt &= (~ std::ptrdiff_t(1));
} }
void set_next( Halfedge_handle h) { void set_next( Halfedge_handle h) {
CGAL_precondition( ((std::ptrdiff_t)(&*h) & 1) == 0); assert( ((std::ptrdiff_t)(&*h) & 1) == 0);
nxt = ((std::ptrdiff_t)(&*h)) | (nxt & 1); nxt = ((std::ptrdiff_t)(&*h)) | (nxt & 1);
} }
private: // Support for the Vertex_handle. private: // Support for the Vertex_handle.
@ -99,6 +100,6 @@ int main() {
HDS hds(1,2,2); HDS hds(1,2,2);
Decorator decorator(hds); Decorator decorator(hds);
decorator.create_loop(); decorator.create_loop();
CGAL_assertion( decorator.is_valid()); assert( decorator.is_valid());
return 0; return 0;
} }

View File

@ -2,6 +2,7 @@
#include <CGAL/HalfedgeDS_list.h> #include <CGAL/HalfedgeDS_list.h>
#include <CGAL/HalfedgeDS_decorator.h> #include <CGAL/HalfedgeDS_decorator.h>
#include <cstddef> #include <cstddef>
#include <cassert>
// Define a new halfedge class. We assume that the Halfedge_handle can // Define a new halfedge class. We assume that the Halfedge_handle can
// be created from a pointer (e.g. the HalfedgeDS is based here on the // be created from a pointer (e.g. the HalfedgeDS is based here on the
@ -54,15 +55,15 @@ public:
(~ std::ptrdiff_t(1)))); (~ std::ptrdiff_t(1))));
} }
void set_opposite( Halfedge_handle h) { void set_opposite( Halfedge_handle h) {
CGAL_precondition(( std::prev(&*h) == &* HDS::halfedge_handle(this)) || assert(( std::prev(&*h) == &* HDS::halfedge_handle(this)) ||
( std::next(&*h)== &* HDS::halfedge_handle(this))); ( std::next(&*h)== &* HDS::halfedge_handle(this)));
if ( std::prev(&*h) == &* HDS::halfedge_handle(this)) if ( std::prev(&*h) == &* HDS::halfedge_handle(this))
nxt |= 1; nxt |= 1;
else else
nxt &= (~ std::ptrdiff_t(1)); nxt &= (~ std::ptrdiff_t(1));
} }
void set_next( Halfedge_handle h) { void set_next( Halfedge_handle h) {
CGAL_precondition( ((std::ptrdiff_t)(&*h) & 1) == 0); assert( ((std::ptrdiff_t)(&*h) & 1) == 0);
nxt = ((std::ptrdiff_t)(&*h)) | (nxt & 1); nxt = ((std::ptrdiff_t)(&*h)) | (nxt & 1);
} }
private: // Support for the Vertex_handle. private: // Support for the Vertex_handle.
@ -98,6 +99,6 @@ int main() {
HDS hds; HDS hds;
Decorator decorator(hds); Decorator decorator(hds);
decorator.create_loop(); decorator.create_loop();
CGAL_assertion( decorator.is_valid()); assert( decorator.is_valid());
return 0; return 0;
} }

View File

@ -1,5 +1,6 @@
#include <CGAL/HalfedgeDS_default.h> #include <CGAL/HalfedgeDS_default.h>
#include <CGAL/HalfedgeDS_decorator.h> #include <CGAL/HalfedgeDS_decorator.h>
#include <cassert>
struct Traits { typedef int Point_2; }; struct Traits { typedef int Point_2; };
typedef CGAL::HalfedgeDS_default<Traits> HDS; typedef CGAL::HalfedgeDS_default<Traits> HDS;
@ -9,6 +10,6 @@ int main() {
HDS hds; HDS hds;
Decorator decorator(hds); Decorator decorator(hds);
decorator.create_loop(); decorator.create_loop();
CGAL_assertion( decorator.is_valid()); assert( decorator.is_valid());
return 0; return 0;
} }

View File

@ -1,6 +1,7 @@
#include <CGAL/HalfedgeDS_default.h> #include <CGAL/HalfedgeDS_default.h>
#include <CGAL/HalfedgeDS_decorator.h> #include <CGAL/HalfedgeDS_decorator.h>
#include <CGAL/N_step_adaptor.h> #include <CGAL/N_step_adaptor.h>
#include <cassert>
struct Traits { typedef int Point_2; }; struct Traits { typedef int Point_2; };
typedef CGAL::HalfedgeDS_default<Traits> HDS; typedef CGAL::HalfedgeDS_default<Traits> HDS;
@ -13,10 +14,10 @@ int main() {
Decorator decorator(hds); Decorator decorator(hds);
decorator.create_loop(); decorator.create_loop();
decorator.create_segment(); decorator.create_segment();
CGAL_assertion( decorator.is_valid()); assert( decorator.is_valid());
int n = 0; int n = 0;
for ( Iterator e = hds.halfedges_begin(); e != hds.halfedges_end(); ++e) for ( Iterator e = hds.halfedges_begin(); e != hds.halfedges_end(); ++e)
++n; ++n;
CGAL_assertion( n == 2); // == 2 edges assert( n == 2); // == 2 edges
return 0; return 0;
} }

View File

@ -1,6 +1,7 @@
#include <CGAL/HalfedgeDS_min_items.h> #include <CGAL/HalfedgeDS_min_items.h>
#include <CGAL/HalfedgeDS_default.h> #include <CGAL/HalfedgeDS_default.h>
#include <CGAL/HalfedgeDS_decorator.h> #include <CGAL/HalfedgeDS_decorator.h>
#include <cassert>
// no traits needed, argument can be arbitrary dummy. // no traits needed, argument can be arbitrary dummy.
typedef CGAL::HalfedgeDS_default<int, CGAL::HalfedgeDS_min_items> HDS; typedef CGAL::HalfedgeDS_default<int, CGAL::HalfedgeDS_min_items> HDS;
@ -10,6 +11,6 @@ int main() {
HDS hds; HDS hds;
Decorator decorator(hds); Decorator decorator(hds);
decorator.create_loop(); decorator.create_loop();
CGAL_assertion( decorator.is_valid()); assert( decorator.is_valid());
return 0; return 0;
} }

View File

@ -1,6 +1,7 @@
#include <CGAL/HalfedgeDS_min_items.h> #include <CGAL/HalfedgeDS_min_items.h>
#include <CGAL/HalfedgeDS_default.h> #include <CGAL/HalfedgeDS_default.h>
#include <CGAL/HalfedgeDS_decorator.h> #include <CGAL/HalfedgeDS_decorator.h>
#include <cassert>
// An items type using a halfedge with previous-pointer. // An items type using a halfedge with previous-pointer.
struct My_items : public CGAL::HalfedgeDS_min_items { struct My_items : public CGAL::HalfedgeDS_min_items {
@ -22,6 +23,6 @@ int main() {
HDS hds; HDS hds;
Decorator decorator(hds); Decorator decorator(hds);
decorator.create_loop(); decorator.create_loop();
CGAL_assertion( decorator.is_valid()); assert( decorator.is_valid());
return 0; return 0;
} }

View File

@ -1,5 +1,6 @@
#include <CGAL/HalfedgeDS_default.h> #include <CGAL/HalfedgeDS_default.h>
#include <CGAL/HalfedgeDS_decorator.h> #include <CGAL/HalfedgeDS_decorator.h>
#include <cassert>
struct Traits { typedef int Point_2; }; struct Traits { typedef int Point_2; };
typedef CGAL::HalfedgeDS_default<Traits> HDS; typedef CGAL::HalfedgeDS_default<Traits> HDS;
@ -11,10 +12,10 @@ int main() {
Decorator decorator(hds); Decorator decorator(hds);
decorator.create_loop(); decorator.create_loop();
decorator.create_segment(); decorator.create_segment();
CGAL_assertion( decorator.is_valid()); assert( decorator.is_valid());
int n = 0; int n = 0;
for ( Iterator i = hds.halfedges_begin(); i != hds.halfedges_end(); ++i ) for ( Iterator i = hds.halfedges_begin(); i != hds.halfedges_end(); ++i )
++n; ++n;
CGAL_assertion( n == 4); // == 2 edges assert( n == 4); // == 2 edges
return 0; return 0;
} }

View File

@ -1,6 +1,7 @@
#include <CGAL/HalfedgeDS_items_2.h> #include <CGAL/HalfedgeDS_items_2.h>
#include <CGAL/HalfedgeDS_vector.h> #include <CGAL/HalfedgeDS_vector.h>
#include <CGAL/HalfedgeDS_decorator.h> #include <CGAL/HalfedgeDS_decorator.h>
#include <cassert>
struct Traits { typedef int Point_2; }; struct Traits { typedef int Point_2; };
typedef CGAL::HalfedgeDS_vector< Traits, CGAL::HalfedgeDS_items_2> HDS; typedef CGAL::HalfedgeDS_vector< Traits, CGAL::HalfedgeDS_items_2> HDS;
@ -10,6 +11,6 @@ int main() {
HDS hds(1,2,2); HDS hds(1,2,2);
Decorator decorator(hds); Decorator decorator(hds);
decorator.create_loop(); decorator.create_loop();
CGAL_assertion( decorator.is_valid()); assert( decorator.is_valid());
return 0; return 0;
} }

View File

@ -1,6 +1,7 @@
#include <CGAL/Linear_cell_complex_for_generalized_map.h> #include <CGAL/Linear_cell_complex_for_generalized_map.h>
#include <iostream> #include <iostream>
#include <vector> #include <vector>
#include <cassert>
typedef CGAL::Linear_cell_complex_for_generalized_map<4,5> LCC_4; typedef CGAL::Linear_cell_complex_for_generalized_map<4,5> LCC_4;
typedef LCC_4::Dart_handle Dart_handle; typedef LCC_4::Dart_handle Dart_handle;
@ -42,24 +43,24 @@ int main()
// Add one vertex on the middle of the edge containing dart d1. // Add one vertex on the middle of the edge containing dart d1.
Dart_handle d3 = lcc.insert_barycenter_in_cell<1>(d1); Dart_handle d3 = lcc.insert_barycenter_in_cell<1>(d1);
CGAL_assertion( lcc.is_valid() ); assert( lcc.is_valid() );
lcc.display_characteristics(std::cout); lcc.display_characteristics(std::cout);
std::cout<<", valid="<<lcc.is_valid()<<std::endl; std::cout<<", valid="<<lcc.is_valid()<<std::endl;
// Add one edge to cut the face containing dart d3 in two. // Add one edge to cut the face containing dart d3 in two.
Dart_handle d4 = lcc.insert_cell_1_in_cell_2(d3, lcc.alpha(d1, 1, 0, 1)); Dart_handle d4 = lcc.insert_cell_1_in_cell_2(d3, lcc.alpha(d1, 1, 0, 1));
CGAL_assertion( lcc.is_valid() ); assert( lcc.is_valid() );
lcc.display_characteristics(std::cout); lcc.display_characteristics(std::cout);
std::cout<<", valid="<<lcc.is_valid()<<std::endl; std::cout<<", valid="<<lcc.is_valid()<<std::endl;
// We use removal operations to get back to the initial configuration. // We use removal operations to get back to the initial configuration.
lcc.remove_cell<1>(d4); lcc.remove_cell<1>(d4);
CGAL_assertion( lcc.is_valid() ); assert( lcc.is_valid() );
lcc.remove_cell<0>(d3); lcc.remove_cell<0>(d3);
CGAL_assertion( lcc.is_valid() ); assert( lcc.is_valid() );
lcc.unsew<4>(d1); lcc.unsew<4>(d1);
@ -68,4 +69,3 @@ int main()
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

View File

@ -5,6 +5,7 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <cassert>
// This example works both with cmap and gmap as combinatorial data structure. // This example works both with cmap and gmap as combinatorial data structure.
@ -46,7 +47,7 @@ void display_voronoi(LCC_2& alcc, Dart_handle adart)
toremove.pop(); toremove.pop();
} }
CGAL_assertion(alcc.is_without_boundary(1)); assert(alcc.is_without_boundary(1));
std::cout<<"Voronoi subdvision, only finite faces:"<<std::endl<<" "; std::cout<<"Voronoi subdvision, only finite faces:"<<std::endl<<" ";
alcc.display_characteristics(std::cout) << ", valid=" alcc.display_characteristics(std::cout) << ", valid="
@ -122,7 +123,7 @@ int main(int narg, char** argv)
std::istream_iterator<Point> begin(iFile), end; std::istream_iterator<Point> begin(iFile), end;
T.insert(begin, end); T.insert(begin, end);
CGAL_assertion(T.is_valid(false)); assert(T.is_valid(false));
// 2) Convert the triangulation into a 2D lcc. // 2) Convert the triangulation into a 2D lcc.
LCC_2 lcc; LCC_2 lcc;
@ -131,7 +132,7 @@ int main(int narg, char** argv)
Dart_handle dh=CGAL::import_from_triangulation_2<LCC_2, Triangulation> Dart_handle dh=CGAL::import_from_triangulation_2<LCC_2, Triangulation>
(lcc, T, &face_to_dart); (lcc, T, &face_to_dart);
CGAL_assertion(lcc.is_without_boundary()); assert(lcc.is_without_boundary());
std::cout<<"Delaunay triangulation :"<<std::endl<<" "; std::cout<<"Delaunay triangulation :"<<std::endl<<" ";
lcc.display_characteristics(std::cout) << ", valid=" lcc.display_characteristics(std::cout) << ", valid="
@ -141,7 +142,7 @@ int main(int narg, char** argv)
LCC_2 dual_lcc; LCC_2 dual_lcc;
Dart_handle ddh=lcc.dual(dual_lcc, dh); Dart_handle ddh=lcc.dual(dual_lcc, dh);
// Here, dual_lcc is the 2D Voronoi diagram. // Here, dual_lcc is the 2D Voronoi diagram.
CGAL_assertion(dual_lcc.is_without_boundary()); assert(dual_lcc.is_without_boundary());
// 4) We update the geometry of dual_lcc by using the std::map // 4) We update the geometry of dual_lcc by using the std::map
// face_to_dart. // face_to_dart.
@ -159,4 +160,3 @@ int main(int narg, char** argv)
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

View File

@ -4,6 +4,7 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <cassert>
/* // If you want to use exact constructions. /* // If you want to use exact constructions.
#include <CGAL/Exact_predicates_exact_constructions_kernel.h> #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
@ -48,7 +49,7 @@ void display_voronoi(LCC_3& alcc, Dart_handle adart)
toremove.pop(); toremove.pop();
} }
CGAL_assertion(alcc.is_without_boundary(1) && alcc.is_without_boundary(2)); assert(alcc.is_without_boundary(1) && alcc.is_without_boundary(2));
std::cout<<"Voronoi subdvision, only finite volumes:"<<std::endl<<" "; std::cout<<"Voronoi subdvision, only finite volumes:"<<std::endl<<" ";
alcc.display_characteristics(std::cout) << ", valid=" alcc.display_characteristics(std::cout) << ", valid="
@ -126,7 +127,7 @@ int main(int narg, char** argv)
std::istream_iterator<Point> begin(iFile), end; std::istream_iterator<Point> begin(iFile), end;
T.insert(begin, end); T.insert(begin, end);
CGAL_assertion(T.is_valid(false)); assert(T.is_valid(false));
// 2) Convert the triangulation into a 3D lcc. // 2) Convert the triangulation into a 3D lcc.
LCC_3 lcc; LCC_3 lcc;
@ -144,7 +145,7 @@ int main(int narg, char** argv)
LCC_3 dual_lcc; LCC_3 dual_lcc;
Dart_handle ddh=lcc.dual(dual_lcc, dh); Dart_handle ddh=lcc.dual(dual_lcc, dh);
// Here, dual_lcc is the 3D Voronoi diagram. // Here, dual_lcc is the 3D Voronoi diagram.
CGAL_assertion(dual_lcc.is_without_boundary()); assert(dual_lcc.is_without_boundary());
// 4) We update the geometry of dual_lcc by using the std::map // 4) We update the geometry of dual_lcc by using the std::map
// face_to_dart. // face_to_dart.
@ -161,4 +162,3 @@ int main(int narg, char** argv)
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

View File

@ -8,6 +8,7 @@
#include <CGAL/make_mesh_3.h> #include <CGAL/make_mesh_3.h>
#include <cstdlib> #include <cstdlib>
#include <cassert>
// Domain // Domain
typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
@ -54,8 +55,7 @@ const std::pair<int, int> incident_subdomains[] = {
int main() int main()
{ {
const std::size_t nb_patches = sizeof(filenames) / sizeof(const char*); const std::size_t nb_patches = sizeof(filenames) / sizeof(const char*);
CGAL_assertion(sizeof(incident_subdomains) == assert(sizeof(incident_subdomains) == nb_patches * sizeof(std::pair<int, int>));
nb_patches * sizeof(std::pair<int, int>));
std::vector<Polyhedron> patches(nb_patches); std::vector<Polyhedron> patches(nb_patches);
for(std::size_t i = 0; i < nb_patches; ++i) { for(std::size_t i = 0; i < nb_patches; ++i) {
std::ifstream input(CGAL::data_file_path(filenames[i])); std::ifstream input(CGAL::data_file_path(filenames[i]));

View File

@ -9,6 +9,7 @@
#include <CGAL/Polyhedral_complex_mesh_domain_3.h> #include <CGAL/Polyhedral_complex_mesh_domain_3.h>
#include <CGAL/make_mesh_3.h> #include <CGAL/make_mesh_3.h>
#include <cstdlib> #include <cstdlib>
#include <cassert>
// Domain // Domain
typedef CGAL::Exact_predicates_inexact_constructions_kernel K; typedef CGAL::Exact_predicates_inexact_constructions_kernel K;
@ -63,8 +64,8 @@ int main()
#endif #endif
const std::size_t nb_patches = sizeof(filenames) / sizeof(const char*); const std::size_t nb_patches = sizeof(filenames) / sizeof(const char*);
CGAL_assertion(sizeof(incident_subdomains) == assert(sizeof(incident_subdomains) ==
nb_patches * sizeof(std::pair<int, int>)); nb_patches * sizeof(std::pair<int, int>));
std::vector<Face_graph> patches(nb_patches); std::vector<Face_graph> patches(nb_patches);
for(std::size_t i = 0; i < nb_patches; ++i) { for(std::size_t i = 0; i < nb_patches; ++i) {
std::ifstream input(CGAL::data_file_path(filenames[i])); std::ifstream input(CGAL::data_file_path(filenames[i]));

View File

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

View File

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

View File

@ -1,6 +1,7 @@
#include <CGAL/Exact_integer.h> #include <CGAL/Exact_integer.h>
#include <CGAL/Filtered_extended_homogeneous.h> #include <CGAL/Filtered_extended_homogeneous.h>
#include <CGAL/Nef_polyhedron_2.h> #include <CGAL/Nef_polyhedron_2.h>
#include <cassert>
typedef CGAL::Exact_integer RT; typedef CGAL::Exact_integer RT;
typedef CGAL::Filtered_extended_homogeneous<RT> Extended_kernel; typedef CGAL::Filtered_extended_homogeneous<RT> Extended_kernel;
@ -15,13 +16,13 @@ int main() {
Line l(2,4,2); // l : 2x + 4y + 2 = 0 Line l(2,4,2); // l : 2x + 4y + 2 = 0
Nef_polyhedron N2(l,Nef_polyhedron::INCLUDED); Nef_polyhedron N2(l,Nef_polyhedron::INCLUDED);
Nef_polyhedron N3 = N2.complement(); Nef_polyhedron N3 = N2.complement();
CGAL_assertion(N1 == N2.join(N3)); assert(N1 == N2.join(N3));
Point p1(0,0), p2(10,10), p3(-20,15); Point p1(0,0), p2(10,10), p3(-20,15);
Point triangle[3] = { p1, p2, p3 }; Point triangle[3] = { p1, p2, p3 };
Nef_polyhedron N4(triangle, triangle+3); Nef_polyhedron N4(triangle, triangle+3);
Nef_polyhedron N5 = N2.intersection(N4); Nef_polyhedron N5 = N2.intersection(N4);
CGAL_assertion(N5 <= N2 && N5 <= N4); assert(N5 <= N2 && N5 <= N4);
return 0; return 0;
} }

View File

@ -1,6 +1,7 @@
#include <CGAL/Exact_integer.h> #include <CGAL/Exact_integer.h>
#include <CGAL/Extended_homogeneous.h> #include <CGAL/Extended_homogeneous.h>
#include <CGAL/Nef_polyhedron_3.h> #include <CGAL/Nef_polyhedron_3.h>
#include <cassert>
typedef CGAL::Exact_integer NT; typedef CGAL::Exact_integer NT;
typedef CGAL::Extended_homogeneous<NT> Kernel; typedef CGAL::Extended_homogeneous<NT> Kernel;
@ -12,16 +13,16 @@ int main() {
Nef_polyhedron N1(Plane_3(2,5,7,11), Nef_polyhedron::INCLUDED); Nef_polyhedron N1(Plane_3(2,5,7,11), Nef_polyhedron::INCLUDED);
Nef_polyhedron N2(Plane_3(2,5,7,11), Nef_polyhedron::EXCLUDED); Nef_polyhedron N2(Plane_3(2,5,7,11), Nef_polyhedron::EXCLUDED);
CGAL_assertion(N1 >= N2); assert(N1 >= N2);
CGAL_assertion(N2 <= N1); assert(N2 <= N1);
CGAL_assertion(N1 != N2); assert(N1 != N2);
CGAL_assertion(N1 > N2); assert(N1 > N2);
CGAL_assertion(N2 < N1); assert(N2 < N1);
N2 = N2.closure(); N2 = N2.closure();
CGAL_assertion(N1==N2); assert(N1==N2);
CGAL_assertion(N1>=N2); assert(N1>=N2);
CGAL_assertion(N1<=N2); assert(N1<=N2);
return 0; return 0;
} }

View File

@ -1,6 +1,7 @@
#include <CGAL/Exact_integer.h> #include <CGAL/Exact_integer.h>
#include <CGAL/Extended_homogeneous.h> #include <CGAL/Extended_homogeneous.h>
#include <CGAL/Nef_polyhedron_3.h> #include <CGAL/Nef_polyhedron_3.h>
#include <cassert>
typedef CGAL::Extended_homogeneous<CGAL::Exact_integer> Kernel; typedef CGAL::Extended_homogeneous<CGAL::Exact_integer> Kernel;
typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron; typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron;
@ -14,19 +15,19 @@ int main() {
Nef_polyhedron N4(Plane_3( 1, 2, 5,-1), Nef_polyhedron::INCLUDED); Nef_polyhedron N4(Plane_3( 1, 2, 5,-1), Nef_polyhedron::INCLUDED);
Nef_polyhedron N5(Plane_3( 1, 2, 5,-1), Nef_polyhedron::EXCLUDED); Nef_polyhedron N5(Plane_3( 1, 2, 5,-1), Nef_polyhedron::EXCLUDED);
CGAL_assertion(N0 == N1); assert(N0 == N1);
CGAL_assertion(N3 == N4); assert(N3 == N4);
CGAL_assertion(N0 != N2); assert(N0 != N2);
CGAL_assertion(N3 != N5); assert(N3 != N5);
CGAL_assertion(N4 >= N5); assert(N4 >= N5);
CGAL_assertion(N5 <= N4); assert(N5 <= N4);
CGAL_assertion(N4 > N5); assert(N4 > N5);
CGAL_assertion(N5 < N4); assert(N5 < N4);
N5 = N5.closure(); N5 = N5.closure();
CGAL_assertion(N4 >= N5); assert(N4 >= N5);
CGAL_assertion(N4 <= N5); assert(N4 <= N5);
return 0; return 0;
} }

View File

@ -1,6 +1,7 @@
#include <CGAL/Exact_integer.h> #include <CGAL/Exact_integer.h>
#include <CGAL/Homogeneous.h> #include <CGAL/Homogeneous.h>
#include <CGAL/Nef_polyhedron_3.h> #include <CGAL/Nef_polyhedron_3.h>
#include <cassert>
typedef CGAL::Homogeneous<CGAL::Exact_integer> Kernel; typedef CGAL::Homogeneous<CGAL::Exact_integer> Kernel;
typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron; typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron;
@ -9,7 +10,7 @@ int main() {
Nef_polyhedron N0(Nef_polyhedron::EMPTY); Nef_polyhedron N0(Nef_polyhedron::EMPTY);
Nef_polyhedron N1(Nef_polyhedron::COMPLETE); Nef_polyhedron N1(Nef_polyhedron::COMPLETE);
CGAL_assertion (N0 == N1.complement()); assert(N0 == N1.complement());
CGAL_assertion (N0 != N1); assert(N0 != N1);
return 0; return 0;
} }

View File

@ -1,6 +1,7 @@
#include <CGAL/Exact_integer.h> #include <CGAL/Exact_integer.h>
#include <CGAL/Extended_homogeneous.h> #include <CGAL/Extended_homogeneous.h>
#include <CGAL/Nef_polyhedron_3.h> #include <CGAL/Nef_polyhedron_3.h>
#include <cassert>
typedef CGAL::Extended_homogeneous<CGAL::Exact_integer> Kernel; typedef CGAL::Extended_homogeneous<CGAL::Exact_integer> Kernel;
typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron; typedef CGAL::Nef_polyhedron_3<Kernel> Nef_polyhedron;
@ -22,11 +23,11 @@ int main() {
Cube1 *= !I3; Cube1 *= !I3;
Nef_polyhedron Cube2 = N1 * N2 * N3 * N4 * N5 * N6; Nef_polyhedron Cube2 = N1 * N2 * N3 * N4 * N5 * N6;
CGAL_assertion(Cube1 == Cube2); // both are closed cube assert(Cube1 == Cube2); // both are closed cube
CGAL_assertion(Cube1 == Cube1.closure()); assert(Cube1 == Cube1.closure());
CGAL_assertion(Cube1 == Cube1.regularization()); assert(Cube1 == Cube1.regularization());
CGAL_assertion((N1 - N1.boundary()) == N1.interior()); assert((N1 - N1.boundary()) == N1.interior());
CGAL_assertion(I1.closure() == I1.complement().interior().complement()); assert(I1.closure() == I1.complement().interior().complement());
CGAL_assertion(I1.regularization() == I1.interior().closure()); assert(I1.regularization() == I1.interior().closure());
return 0; return 0;
} }

View File

@ -1,6 +1,7 @@
#include <CGAL/Exact_integer.h> #include <CGAL/Exact_integer.h>
#include <CGAL/Extended_homogeneous.h> #include <CGAL/Extended_homogeneous.h>
#include <CGAL/Nef_polyhedron_3.h> #include <CGAL/Nef_polyhedron_3.h>
#include <cassert>
typedef CGAL::Exact_integer NT; typedef CGAL::Exact_integer NT;
typedef CGAL::Extended_homogeneous<NT> Kernel; typedef CGAL::Extended_homogeneous<NT> Kernel;
@ -22,6 +23,6 @@ int main() {
Nef_polyhedron Cube1(I2 *!I1); Nef_polyhedron Cube1(I2 *!I1);
Cube1 *= !I3; Cube1 *= !I3;
Nef_polyhedron Cube2 = N1 * N2 * N3 * N4 * N5 * N6; Nef_polyhedron Cube2 = N1 * N2 * N3 * N4 * N5 * N6;
CGAL_assertion (Cube1 == Cube2); assert(Cube1 == Cube2);
return 0; return 0;
} }

View File

@ -2,6 +2,7 @@
#include <CGAL/Homogeneous.h> #include <CGAL/Homogeneous.h>
#include <CGAL/Nef_polyhedron_3.h> #include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/IO/Nef_polyhedron_iostream_3.h> #include <CGAL/IO/Nef_polyhedron_iostream_3.h>
#include <cassert>
typedef CGAL::Exact_integer NT; typedef CGAL::Exact_integer NT;
typedef CGAL::Homogeneous<NT> Kernel; typedef CGAL::Homogeneous<NT> Kernel;
@ -12,9 +13,9 @@ int main() {
Nef_polyhedron N; Nef_polyhedron N;
std::cin >> N; std::cin >> N;
CGAL_assertion((N - N.boundary()) == N.interior()); assert((N - N.boundary()) == N.interior());
CGAL_assertion(N.closure() == N.complement().interior().complement()); assert(N.closure() == N.complement().interior().complement());
CGAL_assertion(N.regularization() == N.interior().closure()); assert(N.regularization() == N.interior().closure());
return 0; return 0;
} }

View File

@ -2,6 +2,7 @@
#include <CGAL/Extended_homogeneous.h> #include <CGAL/Extended_homogeneous.h>
#include <CGAL/Nef_polyhedron_3.h> #include <CGAL/Nef_polyhedron_3.h>
#include <CGAL/IO/Nef_polyhedron_iostream_3.h> #include <CGAL/IO/Nef_polyhedron_iostream_3.h>
#include <cassert>
typedef CGAL::Extended_homogeneous<CGAL::Exact_integer> Kernel; typedef CGAL::Extended_homogeneous<CGAL::Exact_integer> Kernel;
@ -21,11 +22,11 @@ int main() {
Aff_transformation_3 scale(CGAL::SCALING, 3, 2); Aff_transformation_3 scale(CGAL::SCALING, 3, 2);
N.transform(transl); N.transform(transl);
CGAL_assertion(N == Nef_polyhedron(Plane_3(0,1,0,-7))); assert(N == Nef_polyhedron(Plane_3(0,1,0,-7)));
N.transform(rotx90); N.transform(rotx90);
CGAL_assertion(N == Nef_polyhedron(Plane_3(0,0,1,-7))); assert(N == Nef_polyhedron(Plane_3(0,0,1,-7)));
N.transform(scale); N.transform(scale);
CGAL_assertion(N == Nef_polyhedron(Plane_3(0,0,2,-21))); assert(N == Nef_polyhedron(Plane_3(0,0,2,-21)));
return 0; return 0;
} }

View File

@ -1,6 +1,7 @@
#include <CGAL/Exact_integer.h> #include <CGAL/Exact_integer.h>
#include <CGAL/Homogeneous.h> #include <CGAL/Homogeneous.h>
#include <CGAL/Nef_polyhedron_S2.h> #include <CGAL/Nef_polyhedron_S2.h>
#include <cassert>
typedef CGAL::Exact_integer RT; typedef CGAL::Exact_integer RT;
typedef CGAL::Homogeneous<RT> Kernel; typedef CGAL::Homogeneous<RT> Kernel;
@ -16,7 +17,7 @@ int main() {
Sphere_circle c(1,1,1); // c : x + y + z = 0 Sphere_circle c(1,1,1); // c : x + y + z = 0
Nef_polyhedron N2(c, Nef_polyhedron::INCLUDED); Nef_polyhedron N2(c, Nef_polyhedron::INCLUDED);
Nef_polyhedron N3(N2.complement()); Nef_polyhedron N3(N2.complement());
CGAL_assertion(N1 == N2.join(N3)); assert(N1 == N2.join(N3));
Sphere_point p1(1,0,0), p2(0,1,0), p3(0,0,1); Sphere_point p1(1,0,0), p2(0,1,0), p3(0,0,1);
Sphere_segment s1(p1,p2), s2(p2,p3), s3(p3,p1); Sphere_segment s1(p1,p2), s2(p2,p3), s3(p3,p1);
Sphere_segment triangle[3] = { s1, s2, s3 }; Sphere_segment triangle[3] = { s1, s2, s3 };
@ -24,7 +25,7 @@ int main() {
Nef_polyhedron N5; Nef_polyhedron N5;
N5 += N2; N5 += N2;
N5 = N5.intersection(N4); N5 = N5.intersection(N4);
CGAL_assertion(N5 <= N2 && N5 != N4); assert(N5 <= N2 && N5 != N4);
return 0; return 0;
} }

View File

@ -23,7 +23,6 @@ int main(int argc, char* argv[])
{ {
while (ifs >> p) while (ifs >> p)
{ T.insert(p); } { T.insert(p); }
CGAL_assertion(T.is_valid());
if( T.is_triangulation_in_1_sheet()) if( T.is_triangulation_in_1_sheet())
{ T.convert_to_9_sheeted_covering(); } { T.convert_to_9_sheeted_covering(); }

View File

@ -31,8 +31,6 @@ int main()
Delaunay T; Delaunay T;
T.insert( points.begin(), points.end() ); T.insert( points.begin(), points.end() );
CGAL_assertion( T.number_of_vertices() == 6 );
// check that the info was correctly set. // check that the info was correctly set.
Delaunay::Finite_vertices_iterator vit; Delaunay::Finite_vertices_iterator vit;
for (vit = T.finite_vertices_begin(); vit != T.finite_vertices_end(); ++vit) for (vit = T.finite_vertices_begin(); vit != T.finite_vertices_end(); ++vit)

View File

@ -46,8 +46,6 @@ int main()
T.insert( boost::make_transform_iterator(points.begin(), Auto_count()), T.insert( boost::make_transform_iterator(points.begin(), Auto_count()),
boost::make_transform_iterator(points.end(), Auto_count() ) ); boost::make_transform_iterator(points.end(), Auto_count() ) );
CGAL_assertion( T.number_of_vertices() == 6 );
// check that the info was correctly set. // check that the info was correctly set.
Delaunay::Finite_vertices_iterator vit; Delaunay::Finite_vertices_iterator vit;
for (vit = T.finite_vertices_begin(); vit != T.finite_vertices_end(); ++vit) for (vit = T.finite_vertices_begin(); vit != T.finite_vertices_end(); ++vit)

View File

@ -41,9 +41,6 @@ int main()
T.insert( boost::make_zip_iterator(boost::make_tuple( points.begin(), indices.begin() )), T.insert( boost::make_zip_iterator(boost::make_tuple( points.begin(), indices.begin() )),
boost::make_zip_iterator(boost::make_tuple( points.end(), indices.end() ) ) ); boost::make_zip_iterator(boost::make_tuple( points.end(), indices.end() ) ) );
CGAL_assertion( T.number_of_vertices() == 6 );
// check that the info was correctly set. // check that the info was correctly set.
Delaunay::Finite_vertices_iterator vit; Delaunay::Finite_vertices_iterator vit;
for (vit = T.finite_vertices_begin(); vit != T.finite_vertices_end(); ++vit) for (vit = T.finite_vertices_begin(); vit != T.finite_vertices_end(); ++vit)

View File

@ -10,6 +10,7 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
#include <vector> #include <vector>
#include <cassert>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
@ -42,7 +43,7 @@ int main(int argc, char* argv[])
CGAL::parameters::vertex_point_map(get(CGAL::vertex_point, mesh)) CGAL::parameters::vertex_point_map(get(CGAL::vertex_point, mesh))
.geom_traits(Kernel()))); .geom_traits(Kernel())));
CGAL_assertion(CGAL::is_valid_polygon_mesh(mesh)); assert(CGAL::is_valid_polygon_mesh(mesh));
std::cout << "* FILL HOLE NUMBER " << ++nb_holes << std::endl; std::cout << "* FILL HOLE NUMBER " << ++nb_holes << std::endl;
std::cout << " Number of facets in constructed patch: " << patch_facets.size() << std::endl; std::cout << " Number of facets in constructed patch: " << patch_facets.size() << std::endl;
@ -51,7 +52,7 @@ int main(int argc, char* argv[])
} }
} }
CGAL_assertion(CGAL::is_valid_polygon_mesh(mesh)); assert(CGAL::is_valid_polygon_mesh(mesh));
std::cout << std::endl; std::cout << std::endl;
std::cout << nb_holes << " holes have been filled" << std::endl; std::cout << nb_holes << " holes have been filled" << std::endl;

View File

@ -5,6 +5,7 @@
#include <vector> #include <vector>
#include <iterator> #include <iterator>
#include <cassert>
typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel; typedef CGAL::Exact_predicates_inexact_constructions_kernel Kernel;
typedef Kernel::Point_3 Point; typedef Kernel::Point_3 Point;
@ -44,7 +45,7 @@ int main()
std::vector<Triangle_int> patch_will_be_empty; std::vector<Triangle_int> patch_will_be_empty;
CGAL::Polygon_mesh_processing::triangulate_hole_polyline(polyline_collinear, CGAL::Polygon_mesh_processing::triangulate_hole_polyline(polyline_collinear,
back_inserter(patch_will_be_empty)); back_inserter(patch_will_be_empty));
CGAL_assertion(patch_will_be_empty.empty()); assert(patch_will_be_empty.empty());
return 0; return 0;
} }

View File

@ -1,6 +1,7 @@
#include <CGAL/Simple_cartesian.h> #include <CGAL/Simple_cartesian.h>
#include <CGAL/Polyhedron_incremental_builder_3.h> #include <CGAL/Polyhedron_incremental_builder_3.h>
#include <CGAL/Polyhedron_3.h> #include <CGAL/Polyhedron_3.h>
#include <cassert>
// A modifier creating a triangle with the incremental builder. // A modifier creating a triangle with the incremental builder.
template <class HDS> template <class HDS>
@ -33,6 +34,6 @@ int main() {
Polyhedron P; Polyhedron P;
Build_triangle<HalfedgeDS> triangle; Build_triangle<HalfedgeDS> triangle;
P.delegate( triangle); P.delegate( triangle);
CGAL_assertion( P.is_triangle( P.halfedges_begin())); assert( P.is_triangle( P.halfedges_begin()));
return 0; return 0;
} }

View File

@ -26,7 +26,6 @@ int main() {
for ( Facet_iterator i = P.facets_begin(); i != P.facets_end(); ++i) { for ( Facet_iterator i = P.facets_begin(); i != P.facets_end(); ++i) {
Halfedge_facet_circulator j = i->facet_begin(); Halfedge_facet_circulator j = i->facet_begin();
// Facets in polyhedral surfaces are at least triangles. // Facets in polyhedral surfaces are at least triangles.
CGAL_assertion( CGAL::circulator_size(j) >= 3);
std::cout << CGAL::circulator_size(j) << ' '; std::cout << CGAL::circulator_size(j) << ' ';
do { do {
std::cout << ' ' << std::distance(P.vertices_begin(), j->vertex()); std::cout << ' ' << std::distance(P.vertices_begin(), j->vertex());

View File

@ -5,6 +5,7 @@
#include <vector> #include <vector>
#include <cmath> #include <cmath>
#include <fstream> #include <fstream>
#include <cassert>
typedef CGAL::Simple_cartesian<double> Kernel; typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Vector_3 Vector; typedef Kernel::Vector_3 Vector;
@ -27,7 +28,7 @@ void create_center_vertex( Polyhedron& P, Facet_iterator f) {
vec = vec + ( h->vertex()->point() - CGAL::ORIGIN); vec = vec + ( h->vertex()->point() - CGAL::ORIGIN);
++ order; ++ order;
} while ( ++h != f->facet_begin()); } while ( ++h != f->facet_begin());
CGAL_assertion( order >= 3); // guaranteed by definition of polyhedron assert( order >= 3); // guaranteed by definition of polyhedron
Point center = CGAL::ORIGIN + (vec / static_cast<double>(order)); Point center = CGAL::ORIGIN + (vec / static_cast<double>(order));
Halfedge_handle new_center = P.create_center_vertex( f->halfedge()); Halfedge_handle new_center = P.create_center_vertex( f->halfedge());
new_center->vertex()->point() = center; new_center->vertex()->point() = center;
@ -44,7 +45,7 @@ struct Smooth_old_vertex {
vec = vec + ( h->opposite()->vertex()->point() - CGAL::ORIGIN) vec = vec + ( h->opposite()->vertex()->point() - CGAL::ORIGIN)
* alpha / static_cast<double>(degree); * alpha / static_cast<double>(degree);
++ h; ++ h;
CGAL_assertion( h != v.vertex_begin()); // even degree guaranteed assert( h != v.vertex_begin()); // even degree guaranteed
++ h; ++ h;
} while ( h != v.vertex_begin()); } while ( h != v.vertex_begin());
return (CGAL::ORIGIN + vec); return (CGAL::ORIGIN + vec);

View File

@ -7,6 +7,7 @@
#include <cctype> #include <cctype>
#include <cmath> #include <cmath>
#include <fstream> #include <fstream>
#include <cassert>
typedef CGAL::Simple_cartesian<double> Kernel; typedef CGAL::Simple_cartesian<double> Kernel;
typedef Kernel::Vector_3 Vector; typedef Kernel::Vector_3 Vector;
@ -29,7 +30,7 @@ void create_center_vertex( Polyhedron& P, Facet_iterator f) {
vec = vec + ( h->vertex()->point() - CGAL::ORIGIN); vec = vec + ( h->vertex()->point() - CGAL::ORIGIN);
++ order; ++ order;
} while ( ++h != f->facet_begin()); } while ( ++h != f->facet_begin());
CGAL_assertion( order >= 3); // guaranteed by definition of polyhedron assert( order >= 3); // guaranteed by definition of polyhedron
Point center = CGAL::ORIGIN + (vec / static_cast<double>(order)); Point center = CGAL::ORIGIN + (vec / static_cast<double>(order));
Halfedge_handle new_center = P.create_center_vertex( f->halfedge()); Halfedge_handle new_center = P.create_center_vertex( f->halfedge());
new_center->vertex()->point() = center; new_center->vertex()->point() = center;
@ -55,7 +56,7 @@ struct Smooth_old_vertex {
vec = vec + ( h->opposite()->vertex()->point() - CGAL::ORIGIN) vec = vec + ( h->opposite()->vertex()->point() - CGAL::ORIGIN)
* alpha / static_cast<double>(degree); * alpha / static_cast<double>(degree);
++ h; ++ h;
CGAL_assertion( h != v.vertex_begin()); // even degree guaranteed assert( h != v.vertex_begin()); // even degree guaranteed
++ h; ++ h;
} while ( h != v.vertex_begin()); } while ( h != v.vertex_begin());
return (CGAL::ORIGIN + vec); return (CGAL::ORIGIN + vec);
@ -101,11 +102,10 @@ void subdiv( Polyhedron& P) {
++e; // careful, incr. before flip since flip destroys current edge ++e; // careful, incr. before flip since flip destroys current edge
flip_edge( P, h); flip_edge( P, h);
}; };
CGAL_postcondition( P.is_valid());
} }
void trisect_border_halfedge( Polyhedron& P, Halfedge_handle e) { void trisect_border_halfedge( Polyhedron& P, Halfedge_handle e) {
CGAL_precondition( e->is_border()); assert( e->is_border());
// Create two new vertices on e. // Create two new vertices on e.
e = e->prev(); e = e->prev();
P.split_vertex( e, e->next()->opposite()); P.split_vertex( e, e->next()->opposite());
@ -121,7 +121,7 @@ void trisect_border_halfedge( Polyhedron& P, Halfedge_handle e) {
template <class OutputIterator> template <class OutputIterator>
void smooth_border_vertices( Halfedge_handle e, OutputIterator out) { void smooth_border_vertices( Halfedge_handle e, OutputIterator out) {
CGAL_precondition( e->is_border()); assert( e->is_border());
// We know that the vertex at this edge is from the unrefined mesh. // We know that the vertex at this edge is from the unrefined mesh.
// Get the locus vectors of the unrefined vertices in the neighborhood. // Get the locus vectors of the unrefined vertices in the neighborhood.
Vector v0 = e->prev()->prev()->opposite()->vertex()->point() -CGAL::ORIGIN; Vector v0 = e->prev()->prev()->opposite()->vertex()->point() -CGAL::ORIGIN;
@ -166,8 +166,6 @@ void subdiv_border( Polyhedron& P) {
e->next()->vertex()->point() = *i++; e->next()->vertex()->point() = *i++;
} }
} while ( e++ != last_e); } while ( e++ != last_e);
CGAL_assertion( i == pts.end());
CGAL_postcondition( P.is_valid());
} }
using namespace std; using namespace std;

View File

@ -6,6 +6,7 @@
#include <algorithm> #include <algorithm>
#include <vector> #include <vector>
#include <fstream> #include <fstream>
#include <cassert>
using std::cerr; using std::cerr;
using std::endl; using std::endl;
@ -63,7 +64,7 @@ struct Intersect_facets {
} }
if ( v != Halfedge_const_handle()) { if ( v != Halfedge_const_handle()) {
// found shared vertex: // found shared vertex:
CGAL_assertion( h->vertex() == v->vertex()); assert( h->vertex() == v->vertex());
// geomtric check if the opposite segments intersect the triangles // geomtric check if the opposite segments intersect the triangles
Triangle t1( h->vertex()->point(), Triangle t1( h->vertex()->point(),
h->next()->vertex()->point(), h->next()->vertex()->point(),

View File

@ -35,8 +35,6 @@ int main( int argc, char *argv[] ) {
// read the sites from the stream and insert them in the diagram // read the sites from the stream and insert them in the diagram
while ( ifs >> site ) { while ( ifs >> site ) {
sdg.insert( site ); sdg.insert( site );
CGAL_SDG_DEBUG( sdg.file_output_verbose(std::cout); );
CGAL_assertion( sdg.is_valid(false, 1) );
} }
ifs.close(); ifs.close();

View File

@ -32,8 +32,6 @@ int main( int argc, char *argv[] ) {
// read the sites from the stream and insert them in the diagram // read the sites from the stream and insert them in the diagram
while ( ifs >> site ) { while ( ifs >> site ) {
sdg.insert( site ); sdg.insert( site );
CGAL_SDG_DEBUG( sdg.file_output_verbose(std::cout); );
CGAL_assertion( sdg.is_valid(false, 1) );
} }
ifs.close(); ifs.close();

View File

@ -67,7 +67,6 @@ void iv_file_scanner( istream& in)
// point coordinate list starts here // point coordinate list starts here
offset = points.size(); offset = points.size();
in >> c; in >> c;
CGAL_assertion( c == '[');
in >> c; in >> c;
while ( in && ( c != ']')) { while ( in && ( c != ']')) {
in.putback( c); in.putback( c);
@ -99,7 +98,6 @@ void iv_file_scanner( istream& in)
// indices start here // indices start here
std::size_t face_offset = facets.size(); std::size_t face_offset = facets.size();
in >> c; in >> c;
CGAL_assertion( c == '[');
facets.push_back( Facet()); facets.push_back( Facet());
Facet* facet = &facets.back(); Facet* facet = &facets.back();
in >> c; in >> c;
@ -133,7 +131,6 @@ void iv_file_scanner( istream& in)
// indices start here // indices start here
std::size_t face_offset = facets.size(); std::size_t face_offset = facets.size();
in >> c; in >> c;
CGAL_assertion( c == '[');
facets.push_back( Facet()); facets.push_back( Facet());
Facet* facet = &facets.back(); Facet* facet = &facets.back();
in >> c; in >> c;

View File

@ -20,6 +20,8 @@
#include <CGAL/Surface_mesh.h> #include <CGAL/Surface_mesh.h>
#include <CGAL/Random.h> #include <CGAL/Random.h>
#include <cassert>
template<class SM> template<class SM>
class SimpleSurfaceMeshWithSmallFacesViewerQt : public CGAL::Basic_viewer_qt class SimpleSurfaceMeshWithSmallFacesViewerQt : public CGAL::Basic_viewer_qt
{ {
@ -54,7 +56,7 @@ public:
bool exist; bool exist;
typename SM::template Property_map<face_descriptor, FT> faces_size; typename SM::template Property_map<face_descriptor, FT> faces_size;
boost::tie(faces_size, exist)=sm.template property_map<face_descriptor, FT>("f:size"); boost::tie(faces_size, exist)=sm.template property_map<face_descriptor, FT>("f:size");
CGAL_assertion(exist); assert(exist);
m_min_size=faces_size[*(sm.faces().begin())]; m_min_size=faces_size[*(sm.faces().begin())];
m_max_size=m_min_size; m_max_size=m_min_size;
@ -84,7 +86,7 @@ protected:
bool exist; bool exist;
typename SM::template Property_map<face_descriptor, FT> faces_size; typename SM::template Property_map<face_descriptor, FT> faces_size;
boost::tie(faces_size, exist)=sm.template property_map<face_descriptor, FT>("f:size"); boost::tie(faces_size, exist)=sm.template property_map<face_descriptor, FT>("f:size");
CGAL_assertion(exist); assert(exist);
// It it is smaller, color the face in red. // It it is smaller, color the face in red.
if (get(faces_size, fh)<m_min_size+((m_max_size-m_min_size)/(100-m_threshold))) if (get(faces_size, fh)<m_min_size+((m_max_size-m_min_size)/(100-m_threshold)))

View File

@ -4,6 +4,7 @@
#include <CGAL/Polygon_mesh_processing/triangulate_faces.h> #include <CGAL/Polygon_mesh_processing/triangulate_faces.h>
#include <fstream> #include <fstream>
#include <string> #include <string>
#include <cassert>
#include "draw_surface_mesh_small_faces.h" #include "draw_surface_mesh_small_faces.h"
typedef CGAL::Simple_cartesian<double> K; typedef CGAL::Simple_cartesian<double> K;
@ -28,7 +29,7 @@ int main(int argc, char* argv[])
Mesh::Property_map<face_descriptor, FT> faces_size; Mesh::Property_map<face_descriptor, FT> faces_size;
bool created; bool created;
boost::tie(faces_size, created)=sm.add_property_map<face_descriptor, FT>("f:size",0.); boost::tie(faces_size, created)=sm.add_property_map<face_descriptor, FT>("f:size",0.);
CGAL_assertion(created); assert(created);
for(face_descriptor fd : sm.faces()) for(face_descriptor fd : sm.faces())
{ faces_size[fd]=CGAL::Polygon_mesh_processing::face_area(fd, sm); } { faces_size[fd]=CGAL::Polygon_mesh_processing::face_area(fd, sm); }
@ -39,4 +40,3 @@ int main(int argc, char* argv[])
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

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. // Computing intersection points among curves using the surface-sweep alg.
#include <list> #include <list>
#include <cassert>
#include <CGAL/Exact_predicates_exact_constructions_kernel.h> #include <CGAL/Exact_predicates_exact_constructions_kernel.h>
#include <CGAL/Arr_segment_traits_2.h> #include <CGAL/Arr_segment_traits_2.h>
@ -39,7 +40,7 @@ int main()
std::cout << "Found " << sub_segs.size() std::cout << "Found " << sub_segs.size()
<< " interior-disjoint sub-segments." << std::endl; << " 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; return 0;
} }

View File

@ -14,6 +14,7 @@
#include <boost/unordered_set.hpp> #include <boost/unordered_set.hpp>
#include <utility> #include <utility>
#include <cassert>
namespace CGAL namespace CGAL
{ {
@ -42,7 +43,7 @@ namespace Tetrahedral_remeshing
else else
c->set_subdomain_index(2); c->set_subdomain_index(2);
} }
CGAL_assertion(tr.is_valid(true)); assert(tr.is_valid(true));
} }
@ -66,7 +67,7 @@ namespace Tetrahedral_remeshing
for (typename Tr::Cell_handle c : tr.finite_cell_handles()) for (typename Tr::Cell_handle c : tr.finite_cell_handles())
c->set_subdomain_index(1); c->set_subdomain_index(1);
CGAL_assertion(tr.is_valid(true)); assert(tr.is_valid(true));
} }
template<typename Tr> template<typename Tr>
@ -185,7 +186,7 @@ namespace Tetrahedral_remeshing
add_edge(v2, v6, tr, constraints); add_edge(v2, v6, tr, constraints);
add_edge(v3, v7, tr, constraints); add_edge(v3, v7, tr, constraints);
CGAL_assertion(tr.is_valid(true)); assert(tr.is_valid(true));
} }
} }
} }

View File

@ -9,6 +9,7 @@
#include <iostream> #include <iostream>
#include <utility> #include <utility>
#include <cassert>
#include "tetrahedral_remeshing_generate_input.h" #include "tetrahedral_remeshing_generate_input.h"
@ -45,8 +46,8 @@ public:
const key_type& k, const key_type& k,
const bool b) const bool b)
{ {
CGAL_assertion(map.m_set_ptr != nullptr); assert(map.m_set_ptr != nullptr);
CGAL_assertion(k.first < k.second); assert(k.first < k.second);
if (b) map.m_set_ptr->insert(k); if (b) map.m_set_ptr->insert(k);
else map.m_set_ptr->erase(k); else map.m_set_ptr->erase(k);
} }
@ -54,8 +55,8 @@ public:
friend value_type get(const Constrained_edges_property_map& map, friend value_type get(const Constrained_edges_property_map& map,
const key_type& k) const key_type& k)
{ {
CGAL_assertion(map.m_set_ptr != nullptr); assert(map.m_set_ptr != nullptr);
CGAL_assertion(k.first < k.second); assert(k.first < k.second);
return (map.m_set_ptr->count(k) > 0); return (map.m_set_ptr->count(k) > 0);
} }
}; };
@ -80,7 +81,6 @@ int main(int argc, char* argv[])
CGAL::Tetrahedral_remeshing::generate_input_cube(nbv, t3, constraints); CGAL::Tetrahedral_remeshing::generate_input_cube(nbv, t3, constraints);
make_constraints_from_cube_edges(t3, constraints); make_constraints_from_cube_edges(t3, constraints);
CGAL_assertion(t3.is_valid());
CGAL::tetrahedral_isotropic_remeshing(t3, target_edge_length, CGAL::tetrahedral_isotropic_remeshing(t3, target_edge_length,
CGAL::parameters::edge_is_constrained_map( CGAL::parameters::edge_is_constrained_map(
@ -89,4 +89,3 @@ int main(int argc, char* argv[])
return EXIT_SUCCESS; return EXIT_SUCCESS;
} }

View File

@ -1,6 +1,6 @@
#include <CGAL/Triangulation_data_structure.h> #include <CGAL/Triangulation_data_structure.h>
#include <CGAL/Combination_enumerator.h> #include <CGAL/Combination_enumerator.h>
#include <CGAL/assertions.h> #include <cassert>
#include <iostream> #include <iostream>
#include <iterator> #include <iterator>
@ -96,7 +96,7 @@ void find_face_from_vertices( const TDS & tds,
} }
} }
std::cerr << "Could not build a face from vertices"<<std::endl; std::cerr << "Could not build a face from vertices"<<std::endl;
CGAL_assertion(false); assert(false);
} }
@ -112,9 +112,9 @@ int main()
tds.insert_increase_dimension(one_vertex); tds.insert_increase_dimension(one_vertex);
// we get a triangulation of space of dim sdim homeomorphic to // we get a triangulation of space of dim sdim homeomorphic to
// the boundary of simplex of dimension sdim+1 with sdim+2 vertices // the boundary of simplex of dimension sdim+1 with sdim+2 vertices
CGAL_assertion( sdim == tds.current_dimension() ); assert( sdim == tds.current_dimension() );
CGAL_assertion( 2+sdim == tds.number_of_vertices() ); assert( 2+sdim == tds.number_of_vertices() );
CGAL_assertion( 2+sdim == tds.number_of_full_cells() ); assert( 2+sdim == tds.number_of_full_cells() );
barycentric_subdivide(tds, tds.full_cells_begin()); barycentric_subdivide(tds, tds.full_cells_begin());
@ -122,7 +122,7 @@ int main()
// |tds.current_dimension()+1|. Eg, 1440 for dimension 5. // |tds.current_dimension()+1|. Eg, 1440 for dimension 5.
std::cout << "Triangulation has " std::cout << "Triangulation has "
<< tds.number_of_full_cells() << " full cells"; << tds.number_of_full_cells() << " full cells";
CGAL_assertion( tds.is_valid() ); assert( tds.is_valid() );
std::cout << " and is valid!"<<std::endl; std::cout << " and is valid!"<<std::endl;
return 0; return 0;
} }

View File

@ -3,7 +3,7 @@
#include <CGAL/Delaunay_triangulation.h> #include <CGAL/Delaunay_triangulation.h>
#include <CGAL/algorithm.h> #include <CGAL/algorithm.h>
#include <CGAL/Timer.h> #include <CGAL/Timer.h>
#include <CGAL/assertions.h> #include <cassert>
#include <iostream> #include <iostream>
#include <iterator> #include <iterator>
@ -28,7 +28,7 @@ int main(int argc, char **argv)
std::copy_n(rand_it, N, std::back_inserter(points)); std::copy_n(rand_it, N, std::back_inserter(points));
T t(D); T t(D);
CGAL_assertion(t.empty()); assert(t.empty());
// insert the points in the triangulation, only if they are outside the // insert the points in the triangulation, only if they are outside the
// convex hull // convex hull

View File

@ -1,7 +1,7 @@
#include <CGAL/Epick_d.h> #include <CGAL/Epick_d.h>
#include <CGAL/point_generators_d.h> #include <CGAL/point_generators_d.h>
#include <CGAL/Regular_triangulation.h> #include <CGAL/Regular_triangulation.h>
#include <CGAL/assertions.h> #include <cassert>
#include <iostream> #include <iostream>
#include <iterator> #include <iterator>
@ -27,11 +27,11 @@ int main()
points.push_back(Weighted_point(*rand_it++, rng.get_double(0., 10.))); points.push_back(Weighted_point(*rand_it++, rng.get_double(0., 10.)));
T t(D); T t(D);
CGAL_assertion(t.empty()); assert(t.empty());
// Insert the points in the triangulation // Insert the points in the triangulation
t.insert(points.begin(), points.end()); t.insert(points.begin(), points.end());
CGAL_assertion( t.is_valid() ); assert( t.is_valid() );
std::cout << "Regular triangulation successfully computed: " std::cout << "Regular triangulation successfully computed: "
<< t.number_of_vertices() << " vertices, " << t.number_of_vertices() << " vertices, "
<< t.number_of_finite_full_cells() << " finite cells." << t.number_of_finite_full_cells() << " finite cells."

View File

@ -4,11 +4,11 @@
#include <CGAL/point_generators_d.h> #include <CGAL/point_generators_d.h>
#include <CGAL/Triangulation.h> #include <CGAL/Triangulation.h>
#include <CGAL/algorithm.h> #include <CGAL/algorithm.h>
#include <CGAL/assertions.h>
#include <iostream> #include <iostream>
#include <iterator> #include <iterator>
#include <vector> #include <vector>
#include <cassert>
typedef CGAL::Epick_d< CGAL::Dynamic_dimension_tag > K; typedef CGAL::Epick_d< CGAL::Dynamic_dimension_tag > K;
typedef CGAL::Triangulation<K> Triangulation; typedef CGAL::Triangulation<K> Triangulation;
@ -23,9 +23,9 @@ int main()
std::copy_n(rand_it, N, std::back_inserter(points)); std::copy_n(rand_it, N, std::back_inserter(points));
Triangulation t(D); // create triangulation Triangulation t(D); // create triangulation
CGAL_assertion(t.empty()); assert(t.empty());
t.insert(points.begin(), points.end()); // compute triangulation t.insert(points.begin(), points.end()); // compute triangulation
CGAL_assertion( t.is_valid() ); assert( t.is_valid() );
// - - - - - - - - - - - - - - - - - - - - - - - - STEP 2 // - - - - - - - - - - - - - - - - - - - - - - - - STEP 2
typedef Triangulation::Face Face; typedef Triangulation::Face Face;
typedef std::vector<Face> Faces; typedef std::vector<Face> Faces;
@ -41,4 +41,3 @@ int main()
return 0; return 0;
} }

View File

@ -1,5 +1,5 @@
#include <CGAL/Triangulation_data_structure.h> #include <CGAL/Triangulation_data_structure.h>
#include <CGAL/assertions.h> #include <cassert>
#include <vector> #include <vector>
@ -11,17 +11,17 @@ int main()
typedef TDS::Vertex_handle Vertex_handle; typedef TDS::Vertex_handle Vertex_handle;
TDS D(ddim); // the argument is taken into account. TDS D(ddim); // the argument is taken into account.
CGAL_assertion( ddim == D.maximal_dimension() ); assert( ddim == D.maximal_dimension() );
CGAL_assertion( -2 == D.current_dimension() ); assert( -2 == D.current_dimension() );
CGAL_assertion( D.is_valid() ); assert( D.is_valid() );
std::vector<Vertex_handle> V(5); std::vector<Vertex_handle> V(5);
V[0] = D.insert_increase_dimension(); V[0] = D.insert_increase_dimension();
V[1] = D.insert_increase_dimension(V[0]); V[1] = D.insert_increase_dimension(V[0]);
V[2] = D.insert_increase_dimension(V[0]); V[2] = D.insert_increase_dimension(V[0]);
V[3] = D.insert_increase_dimension(V[0]); V[3] = D.insert_increase_dimension(V[0]);
V[4] = D.insert_in_full_cell(V[3]->full_cell()); V[4] = D.insert_in_full_cell(V[3]->full_cell());
CGAL_assertion( 6 == D.number_of_full_cells() ); assert( 6 == D.number_of_full_cells() );
CGAL_assertion( 2 == D.current_dimension() ); assert( 2 == D.current_dimension() );
CGAL_assertion( D.is_valid() ); assert( D.is_valid() );
return 0; return 0;
} }

View File

@ -1,42 +1,42 @@
#include <CGAL/Triangulation_data_structure.h> #include <CGAL/Triangulation_data_structure.h>
#include <CGAL/assertions.h>
#include <vector> #include <vector>
#include <cassert>
int main() int main()
{ {
typedef CGAL::Triangulation_data_structure<CGAL::Dimension_tag<7> > TDS; typedef CGAL::Triangulation_data_structure<CGAL::Dimension_tag<7> > TDS;
TDS S; TDS S;
CGAL_assertion( 7 == S.maximal_dimension() ); assert( 7 == S.maximal_dimension() );
CGAL_assertion( -2 == S.current_dimension() ); assert( -2 == S.current_dimension() );
CGAL_assertion( S.is_valid() ); assert( S.is_valid() );
std::vector<TDS::Vertex_handle> V(10); std::vector<TDS::Vertex_handle> V(10);
V[0] = S.insert_increase_dimension(); //insert first vertex V[0] = S.insert_increase_dimension(); //insert first vertex
CGAL_assertion( -1 == S.current_dimension() ); assert( -1 == S.current_dimension() );
for( int i = 1; i <= 5; ++i ) for( int i = 1; i <= 5; ++i )
V[i] = S.insert_increase_dimension(V[0]); V[i] = S.insert_increase_dimension(V[0]);
// the first 6 vertices have created a triangulation // the first 6 vertices have created a triangulation
// of the 4-dimensional topological sphere // of the 4-dimensional topological sphere
// (the boundary of a five dimensional simplex). // (the boundary of a five dimensional simplex).
CGAL_assertion( 4 == S.current_dimension() ); assert( 4 == S.current_dimension() );
CGAL_assertion( 6 == S.number_of_vertices() ); assert( 6 == S.number_of_vertices() );
CGAL_assertion( 6 == S.number_of_full_cells() ); assert( 6 == S.number_of_full_cells() );
TDS::Full_cell_handle c = V[5]->full_cell(); TDS::Full_cell_handle c = V[5]->full_cell();
V[6] = S.insert_in_full_cell(c); V[6] = S.insert_in_full_cell(c);
// full cell c is split in 5 // full cell c is split in 5
CGAL_assertion( 7 == S.number_of_vertices() ); assert( 7 == S.number_of_vertices() );
CGAL_assertion( 10 == S.number_of_full_cells() ); assert( 10 == S.number_of_full_cells() );
c = V[3]->full_cell(); c = V[3]->full_cell();
TDS::Facet ft(c, 2); // the Facet opposite to vertex 2 in c TDS::Facet ft(c, 2); // the Facet opposite to vertex 2 in c
V[7] = S.insert_in_facet(ft); V[7] = S.insert_in_facet(ft);
// facet ft is split in 4 and the two incident cells are split accordingly // facet ft is split in 4 and the two incident cells are split accordingly
CGAL_assertion( 8 == S.number_of_vertices() ); assert( 8 == S.number_of_vertices() );
CGAL_assertion( 16 == S.number_of_full_cells() ); assert( 16 == S.number_of_full_cells() );
c = V[3]->full_cell(); c = V[3]->full_cell();
TDS::Face face(c); TDS::Face face(c);
@ -45,7 +45,7 @@ int main()
face.set_index(1, 4); // and vertex 4 face.set_index(1, 4); // and vertex 4
V[8] = S.insert_in_face(face); V[8] = S.insert_in_face(face);
// face is split in 2, and all incident full cells also // face is split in 2, and all incident full cells also
CGAL_assertion( S.is_valid() ); assert( S.is_valid() );
TDS::Full_cell_handle hole[2]; TDS::Full_cell_handle hole[2];
hole[0] = V[8]->full_cell(); hole[0] = V[8]->full_cell();
@ -54,6 +54,6 @@ int main()
ft = TDS::Facet(hole[0], 1); // a face on the boundary of hole[0] ft = TDS::Facet(hole[0], 1); // a face on the boundary of hole[0]
V[9] = S.insert_in_hole(hole, hole+2, ft); V[9] = S.insert_in_hole(hole, hole+2, ft);
// the hole is triangulated by linking a new vertex to its boundary // the hole is triangulated by linking a new vertex to its boundary
CGAL_assertion( S.is_valid() ); assert( S.is_valid() );
return 0; return 0;
} }

View File

@ -3,6 +3,7 @@
#include <CGAL/Delaunay_triangulation_2.h> #include <CGAL/Delaunay_triangulation_2.h>
#include <CGAL/point_generators_2.h> #include <CGAL/point_generators_2.h>
#include <cassert>
typedef CGAL::Exact_predicates_inexact_constructions_kernel EPIC; typedef CGAL::Exact_predicates_inexact_constructions_kernel EPIC;
typedef CGAL::Exact_predicates_exact_constructions_kernel EPEC; typedef CGAL::Exact_predicates_exact_constructions_kernel EPEC;
@ -44,5 +45,5 @@ int main()
dt2_epec.set_infinite_vertex( dt2_epec.set_infinite_vertex(
dt2_epec.tds().copy_tds( dt2_epic.tds(),dt2_epic.infinite_vertex(), Convert_vertex(), Convert_face() ) ); dt2_epec.tds().copy_tds( dt2_epic.tds(),dt2_epic.infinite_vertex(), Convert_vertex(), Convert_face() ) );
CGAL_assertion( dt2_epec.is_valid() ); assert( dt2_epec.is_valid() );
} }

View File

@ -24,8 +24,6 @@ int main()
Delaunay T; Delaunay T;
T.insert( points.begin(),points.end() ); T.insert( points.begin(),points.end() );
CGAL_assertion( T.number_of_vertices() == 6 );
// check that the info was correctly set. // check that the info was correctly set.
Delaunay::Finite_vertices_iterator vit; Delaunay::Finite_vertices_iterator vit;
for (Vertex_handle v : T.finite_vertex_handles()) for (Vertex_handle v : T.finite_vertex_handles())

View File

@ -28,8 +28,6 @@ int main()
Regular rt; Regular rt;
rt.insert( points.begin(),points.end() ); rt.insert( points.begin(),points.end() );
CGAL_assertion( rt.number_of_vertices() == 6 );
// check that the info was correctly set. // check that the info was correctly set.
for (Vertex_handle v : rt.finite_vertex_handles()) for (Vertex_handle v : rt.finite_vertex_handles())
if( points[ v->info() ].first != v->point() ){ if( points[ v->info() ].first != v->point() ){

View File

@ -37,8 +37,6 @@ int main()
T.insert( boost::make_transform_iterator(points.begin(),Auto_count()), T.insert( boost::make_transform_iterator(points.begin(),Auto_count()),
boost::make_transform_iterator(points.end(), Auto_count() ) ); boost::make_transform_iterator(points.end(), Auto_count() ) );
CGAL_assertion( T.number_of_vertices() == 6 );
// check that the info was correctly set. // check that the info was correctly set.
Delaunay::Finite_vertices_iterator vit; Delaunay::Finite_vertices_iterator vit;
for (Vertex_handle v : T.finite_vertex_handles()) for (Vertex_handle v : T.finite_vertex_handles())

View File

@ -36,9 +36,6 @@ int main()
T.insert( boost::make_zip_iterator(boost::make_tuple( points.begin(),indices.begin() )), T.insert( boost::make_zip_iterator(boost::make_tuple( points.begin(),indices.begin() )),
boost::make_zip_iterator(boost::make_tuple( points.end(),indices.end() ) ) ); boost::make_zip_iterator(boost::make_tuple( points.end(),indices.end() ) ) );
CGAL_assertion( T.number_of_vertices() == 6 );
// check that the info was correctly set. // check that the info was correctly set.
for (Vertex_handle v : T.finite_vertex_handles()) for (Vertex_handle v : T.finite_vertex_handles())

View File

@ -3,6 +3,7 @@
#include <CGAL/Delaunay_triangulation_3.h> #include <CGAL/Delaunay_triangulation_3.h>
#include <CGAL/point_generators_3.h> #include <CGAL/point_generators_3.h>
#include <cassert>
typedef CGAL::Exact_predicates_inexact_constructions_kernel EPIC; typedef CGAL::Exact_predicates_inexact_constructions_kernel EPIC;
typedef CGAL::Exact_predicates_exact_constructions_kernel EPEC; typedef CGAL::Exact_predicates_exact_constructions_kernel EPEC;
@ -43,5 +44,5 @@ int main()
dt3_epec.set_infinite_vertex( dt3_epec.set_infinite_vertex(
dt3_epec.tds().copy_tds( dt3_epic.tds(),dt3_epic.infinite_vertex(), Convert_vertex(), Convert_cell() ) ); dt3_epec.tds().copy_tds( dt3_epic.tds(),dt3_epic.infinite_vertex(), Convert_vertex(), Convert_cell() ) );
CGAL_assertion( dt3_epec.is_valid() ); assert( dt3_epec.is_valid() );
} }

View File

@ -26,8 +26,6 @@ int main()
Delaunay T( points.begin(),points.end() ); Delaunay T( points.begin(),points.end() );
CGAL_assertion( T.number_of_vertices() == 6 );
// check that the info was correctly set. // check that the info was correctly set.
for (Delaunay::Vertex_handle v : T.finite_vertex_handles()) for (Delaunay::Vertex_handle v : T.finite_vertex_handles())
if( points[ v->info() ].first != v->point() ){ if( points[ v->info() ].first != v->point() ){

View File

@ -26,8 +26,6 @@ int main()
Regular rt( points.begin(),points.end() ); Regular rt( points.begin(),points.end() );
CGAL_assertion( rt.number_of_vertices() == 6 );
// check that the info was correctly set. // check that the info was correctly set.
for (Regular::Vertex_handle v : rt.finite_vertex_handles()) for (Regular::Vertex_handle v : rt.finite_vertex_handles())
if( points[ v->info() ].first != v->point() ){ if( points[ v->info() ].first != v->point() ){

View File

@ -38,8 +38,6 @@ int main()
Delaunay T( boost::make_transform_iterator(points.begin(),Auto_count()), Delaunay T( boost::make_transform_iterator(points.begin(),Auto_count()),
boost::make_transform_iterator(points.end(), Auto_count() ) ); boost::make_transform_iterator(points.end(), Auto_count() ) );
CGAL_assertion( T.number_of_vertices() == 6 );
// check that the info was correctly set. // check that the info was correctly set.
for (Delaunay::Vertex_handle v : T.finite_vertex_handles()) for (Delaunay::Vertex_handle v : T.finite_vertex_handles())
if( points[ v->info() ] != v->point() ){ if( points[ v->info() ] != v->point() ){

View File

@ -37,8 +37,6 @@ int main()
Delaunay T( boost::make_zip_iterator(boost::make_tuple( points.begin(),indices.begin() )), Delaunay T( boost::make_zip_iterator(boost::make_tuple( points.begin(),indices.begin() )),
boost::make_zip_iterator(boost::make_tuple( points.end(),indices.end() ) ) ); boost::make_zip_iterator(boost::make_tuple( points.end(),indices.end() ) ) );
CGAL_assertion( T.number_of_vertices() == 6 );
// check that the info was correctly set. // check that the info was correctly set.
for (Delaunay::Vertex_handle v : T.finite_vertex_handles() ) for (Delaunay::Vertex_handle v : T.finite_vertex_handles() )
if( points[ v->info() ] != v->point() ){ if( points[ v->info() ] != v->point() ){