Refactoring and fix of warnings.

This commit is contained in:
Andreas Haas 2015-05-07 21:49:44 +02:00
parent 72122edf77
commit 30fb891d11
8 changed files with 111 additions and 109 deletions

View File

@ -36,7 +36,7 @@ int main() {
Point_2 q(0.5, 2); Point_2 q(0.5, 2);
Arrangement_2::Face_const_handle * face; Arrangement_2::Face_const_handle * face;
CGAL::Arr_naive_point_location<Arrangement_2> pl(env); CGAL::Arr_naive_point_location<Arrangement_2> pl(env);
typename CGAL::Arr_point_location_result<Arrangement_2>::Type obj = pl.locate(q); CGAL::Arr_point_location_result<Arrangement_2>::Type obj = pl.locate(q);
// The query point locates in the interior of a face // The query point locates in the interior of a face
face = boost::get<Arrangement_2::Face_const_handle> (&obj); face = boost::get<Arrangement_2::Face_const_handle> (&obj);
@ -45,20 +45,24 @@ int main() {
typedef CGAL::Simple_polygon_visibility_2<Arrangement_2, CGAL::Tag_false> NSPV; typedef CGAL::Simple_polygon_visibility_2<Arrangement_2, CGAL::Tag_false> NSPV;
Arrangement_2 non_regular_output; Arrangement_2 non_regular_output;
NSPV non_regular_visibility(env); NSPV non_regular_visibility(env);
Face_handle non_regular_fh = non_regular_visibility.compute_visibility(q, *face, non_regular_output);
non_regular_visibility.compute_visibility(q, *face, non_regular_output);
std::cout << "Non-regularized visibility region of q has " std::cout << "Non-regularized visibility region of q has "
<< non_regular_output.number_of_edges() << non_regular_output.number_of_edges()
<< " edges:" << std::endl; << " edges:" << std::endl;
for (Edge_const_iterator eit = non_regular_output.edges_begin(); eit != non_regular_output.edges_end(); ++eit) for (Edge_const_iterator eit = non_regular_output.edges_begin(); eit != non_regular_output.edges_end(); ++eit)
std::cout << "[" << eit->source()->point() << " -> " << eit->target()->point() << "]" << std::endl; std::cout << "[" << eit->source()->point() << " -> " << eit->target()->point() << "]" << std::endl;
// compute non regularized visibility area // compute non regularized visibility area
// Define visibiliy object type that computes regularized visibility area // Define visibiliy object type that computes regularized visibility area
typedef CGAL::Simple_polygon_visibility_2<Arrangement_2, CGAL::Tag_true> RSPV; typedef CGAL::Simple_polygon_visibility_2<Arrangement_2, CGAL::Tag_true> RSPV;
Arrangement_2 regular_output; Arrangement_2 regular_output;
RSPV regular_visibility(env); RSPV regular_visibility(env);
Face_handle regular_fh = regular_visibility.compute_visibility(q, *face, regular_output);
Ccb_halfedge_circulator curr = regular_fh->outer_ccb(); regular_visibility.compute_visibility(q, *face, regular_output);
std::cout << "Regularized visibility region of q has " std::cout << "Regularized visibility region of q has "
<< regular_output.number_of_edges() << regular_output.number_of_edges()
<< " edges:" << std::endl; << " edges:" << std::endl;

View File

@ -203,7 +203,9 @@ private:
typedef CGAL::No_intersection_tag Itag; typedef CGAL::No_intersection_tag Itag;
typedef CGAL::Constrained_triangulation_2<K, TDS, Itag> CDT; typedef CGAL::Constrained_triangulation_2<K, TDS, Itag> CDT;
private: typedef std::vector<Point_2> Vertex_container;
typedef typename Vertex_container::size_type Size_type;
const Arrangement_2 *p_arr; const Arrangement_2 *p_arr;
const Geometry_traits_2 *traits; const Geometry_traits_2 *traits;
@ -215,9 +217,9 @@ private:
/*! Stack of visibile points; manipulated when going through the sequence /*! Stack of visibile points; manipulated when going through the sequence
of input vertices; contains the vertices of the visibility region after of input vertices; contains the vertices of the visibility region after
the run of the algorithm*/ the run of the algorithm*/
mutable std::stack<Point_2> s; mutable std::stack<Point_2> stack;
/*! Sequence of input vertices*/ /*! Sequence of input vertices*/
mutable std::vector<Point_2> vertices; mutable Vertex_container vertices;
/*! State of visibility region algorithm*/ /*! State of visibility region algorithm*/
mutable enum {LEFT, RIGHT, SCANA, SCANB, SCANC, SCAND, FINISH} upcase; mutable enum {LEFT, RIGHT, SCANA, SCANB, SCANC, SCAND, FINISH} upcase;
mutable bool query_pt_is_vertex; mutable bool query_pt_is_vertex;
@ -251,15 +253,15 @@ private:
output(const Point_2& q, VARR& out_arr) const { output(const Point_2& q, VARR& out_arr) const {
std::vector<Point_2> points; std::vector<Point_2> points;
while(!s.empty()) { while(!stack.empty()) {
const Point_2& top = s.top(); const Point_2& top = stack.top();
if (top != q) { if (top != q) {
points.push_back(top); points.push_back(top);
} }
else if (query_pt_is_vertex) { else if (query_pt_is_vertex) {
points.push_back(top); points.push_back(top);
} }
s.pop(); stack.pop();
} }
@ -279,7 +281,7 @@ private:
// traits, q, points, out_arr); // traits, q, points, out_arr);
CGAL_postcondition(out_arr.number_of_isolated_vertices() == 0); CGAL_postcondition(out_arr.number_of_isolated_vertices() == 0);
CGAL_postcondition(s.empty()); CGAL_postcondition(stack.empty());
Visibility_2::conditional_regularize(out_arr, Regularization_category()); Visibility_2::conditional_regularize(out_arr, Regularization_category());
vertices.clear(); vertices.clear();
@ -340,7 +342,7 @@ private:
'i' - current vertex' index 'i' - current vertex' index
'w' - endpoint of ray shot from query point */ 'w' - endpoint of ray shot from query point */
void visibility_region_impl(const Point_2& q) const { void visibility_region_impl(const Point_2& q) const {
int i = 0; Size_type i = 0;
Point_2 w; Point_2 w;
Orientation o = traits->orientation_2_object()(q, vertices[0], vertices[1]); Orientation o = traits->orientation_2_object()(q, vertices[0], vertices[1]);
@ -348,14 +350,14 @@ private:
upcase = LEFT; upcase = LEFT;
i = 1; i = 1;
w = vertices[1]; w = vertices[1];
s.push(vertices[0]); stack.push(vertices[0]);
s.push(vertices[1]); stack.push(vertices[1]);
} }
else { else {
upcase = SCANA; upcase = SCANA;
i = 1; i = 1;
w = vertices[1]; w = vertices[1];
s.push(vertices[0]); stack.push(vertices[0]);
} }
Ray_2 ray_origin( q, vertices[0] ); Ray_2 ray_origin( q, vertices[0] );
@ -383,15 +385,15 @@ private:
break; break;
} }
if ( upcase == LEFT ) { if ( upcase == LEFT ) {
Point_2 s_t = s.top(); Point_2 s_t = stack.top();
s.pop(); stack.pop();
if (traits->orientation_2_object()(q, vertices[0], s.top() ) if (traits->orientation_2_object()(q, vertices[0], stack.top() )
== RIGHT_TURN == RIGHT_TURN
&& &&
traits->orientation_2_object()(q, vertices[0], s_t) traits->orientation_2_object()(q, vertices[0], s_t)
== LEFT_TURN ) == LEFT_TURN )
{ {
Segment_2 seg( s.top(), s_t ); Segment_2 seg( stack.top(), s_t );
if (Object_2 result = Intersect_2()(seg, ray_origin) ) if (Object_2 result = Intersect_2()(seg, ray_origin) )
{ {
const Point_2 * ipoint = object_cast<Point_2>(&result); const Point_2 * ipoint = object_cast<Point_2>(&result);
@ -400,21 +402,21 @@ private:
upcase = SCANB; upcase = SCANB;
} }
} }
s.push( s_t ); stack.push( s_t );
} }
} while(upcase != FINISH); } while(upcase != FINISH);
} }
/*! Method that handles the left turns in the vertex algorithm */ /*! Method that handles the left turns in the vertex algorithm */
void left(int& i, Point_2& w, const Point_2& q) const { void left(Size_type& i, Point_2& w, const Point_2& q) const {
if (i >= vertices.size() - 1) { if (i >= vertices.size() - 1) {
upcase = FINISH; upcase = FINISH;
} }
else { else {
Point_2 s_t = s.top(); Point_2 s_t = stack.top();
s.pop(); stack.pop();
Point_2 s_t_prev = s.top(); Point_2 s_t_prev = stack.top();
s.push( s_t ); stack.push( s_t );
Orientation orient1 = traits->orientation_2_object()( Orientation orient1 = traits->orientation_2_object()(
q, q,
vertices[i], vertices[i],
@ -423,7 +425,7 @@ private:
if ( orient1 != RIGHT_TURN ) { if ( orient1 != RIGHT_TURN ) {
// Case L2 // Case L2
upcase = LEFT; upcase = LEFT;
s.push( vertices[i+1] ); stack.push( vertices[i+1] );
w = vertices[i+1]; w = vertices[i+1];
i++; i++;
} else { } else {
@ -449,21 +451,21 @@ private:
/*! Scans the stack such that all vertices that were pushed before to the /*! Scans the stack such that all vertices that were pushed before to the
stack and are now not visible anymore. */ stack and are now not visible anymore. */
void right(int& i, Point_2& w, const Point_2& q) const { void right(Size_type& i, Point_2& w, const Point_2& q) const {
Point_2 s_j; Point_2 s_j;
Point_2 s_j_prev; Point_2 s_j_prev;
Point_2 u; Point_2 u;
int mode = 0; int mode = 0;
Orientation orient1, orient2; Orientation orient1, orient2;
s_j_prev = s.top(); s_j_prev = stack.top();
orient2 = traits->orientation_2_object()( q, s_j_prev, vertices[i] ); orient2 = traits->orientation_2_object()( q, s_j_prev, vertices[i] );
while ( s.size() > 1 ) { while ( stack.size() > 1 ) {
s_j = s_j_prev; s_j = s_j_prev;
orient1 = orient2; orient1 = orient2;
s.pop(); stack.pop();
s_j_prev = s.top(); s_j_prev = stack.top();
orient2 = traits->orientation_2_object()( q, s_j_prev, vertices[i]); orient2 = traits->orientation_2_object()( q, s_j_prev, vertices[i]);
if ( orient1 != LEFT_TURN && orient2 != RIGHT_TURN ) { if ( orient1 != LEFT_TURN && orient2 != RIGHT_TURN ) {
@ -500,7 +502,7 @@ private:
// of (s_j,s_j_prev) and the ray (query_pt, vertices[i]), // of (s_j,s_j_prev) and the ray (query_pt, vertices[i]),
// thus, (s_j,s_j_prev) is not shortcutted, but it is harmless // thus, (s_j,s_j_prev) is not shortcutted, but it is harmless
upcase = RIGHT; upcase = RIGHT;
s.push( s_j ); stack.push( s_j );
w = vertices[i]; w = vertices[i];
i++; i++;
} else if ( orient2 == RIGHT_TURN ) { } else if ( orient2 == RIGHT_TURN ) {
@ -514,12 +516,12 @@ private:
assert( ipoint != NULL ); assert( ipoint != NULL );
u = *ipoint; u = *ipoint;
if ( s.top() != u ) { if ( stack.top() != u ) {
s.push( u ); stack.push( u );
} }
upcase = LEFT; upcase = LEFT;
s.push( vertices[i] ); stack.push( vertices[i] );
s.push( vertices[i+1] ); stack.push( vertices[i+1] );
w = vertices[i+1]; w = vertices[i+1];
i++; i++;
} else { } else {
@ -533,8 +535,8 @@ private:
assert( ipoint != NULL ); assert( ipoint != NULL );
u = *ipoint; u = *ipoint;
if ( s.top() != u ) { if ( stack.top() != u ) {
s.push( u ); stack.push( u );
} }
upcase = SCANC; upcase = SCANC;
w = vertices[i]; w = vertices[i];
@ -549,17 +551,17 @@ private:
/*! Scans the vertices starting from index 'i' for the first visible vertex /*! Scans the vertices starting from index 'i' for the first visible vertex
out of the back hidden window */ out of the back hidden window */
void scana(int& i, Point_2& w, const Point_2& q) const { void scana(Size_type& i, Point_2& w, const Point_2& q) const {
// Scan v_i, v_i+1, ..., v_n for the first edge to intersect (z, s_t) // Scan v_i, v_i+1, ..., v_n for the first edge to intersect (z, s_t)
Point_2 u; Point_2 u;
int k = scan_edges( i, q, s.top(), u, true ); Size_type k = scan_edges( i, q, stack.top(), u, true );
Orientation orient1 = Orientation orient1 =
traits->orientation_2_object()(q, vertices[k], vertices[k+1] ); traits->orientation_2_object()(q, vertices[k], vertices[k+1] );
if ( orient1 == RIGHT_TURN ) { if ( orient1 == RIGHT_TURN ) {
bool fwd = traits-> bool fwd = traits->
collinear_are_ordered_along_line_2_object()(q, s.top(), u ); collinear_are_ordered_along_line_2_object()(q, stack.top(), u );
if ( !fwd ) { if ( !fwd ) {
// Case A1 // Case A1
@ -576,26 +578,26 @@ private:
// Case A3 // Case A3
upcase = LEFT; upcase = LEFT;
i = k+1; i = k+1;
s.push( u ); stack.push( u );
if ( u != vertices[k+1] ) { if ( u != vertices[k+1] ) {
s.push( vertices[k+1] ); stack.push( vertices[k+1] );
} }
w = vertices[k+1]; w = vertices[k+1];
} }
} }
/*! Find the first edge interecting the segment (v_0, s_t) */ /*! Find the first edge interecting the segment (v_0, s_t) */
void scanb(int& i, Point_2& w) const { void scanb(Size_type& i, Point_2& w) const {
if ( i == vertices.size() - 1 ) { if ( i == vertices.size() - 1 ) {
upcase = FINISH; upcase = FINISH;
return; return;
} }
Point_2 u; Point_2 u;
int k = scan_edges( i, s.top(), vertices[0], u, false ); Size_type k = scan_edges( i, stack.top(), vertices[0], u, false );
if ( (k+1 == vertices.size()-1) && (vertices[0] == u) ) { if ( (k+1 == vertices.size()-1) && (vertices[0] == u) ) {
// Case B1 // Case B1
upcase = FINISH; upcase = FINISH;
s.push( vertices[0] ); stack.push( vertices[0] );
} else { } else {
// Case B2 // Case B2
upcase = RIGHT; upcase = RIGHT;
@ -606,23 +608,23 @@ private:
/*! Finds the exit from a general front hidden window by finding the first /*! Finds the exit from a general front hidden window by finding the first
vertex to the right of the ray defined by the query_point and w*/ vertex to the right of the ray defined by the query_point and w*/
void scanc(int& i, Point_2& w) const { void scanc(Size_type& i, Point_2& w) const {
Point_2 u; Point_2 u;
int k = scan_edges( i, s.top(), w, u, false ); Size_type k = scan_edges( i, stack.top(), w, u, false );
upcase = RIGHT; upcase = RIGHT;
i = k+1; i = k+1;
w = u; w = u;
} }
/*! find the first edge intersecting the given window (s_t, w) */ /*! find the first edge intersecting the given window (s_t, w) */
void scand(int& i, Point_2& w) const { void scand(Size_type& i, Point_2& w) const {
Point_2 u; Point_2 u;
int k = scan_edges( i, s.top(), w, u, false ); Size_type k = scan_edges( i, stack.top(), w, u, false );
upcase = LEFT; upcase = LEFT;
i = k+1; i = k+1;
s.push( u ); stack.push( u );
if ( u != vertices[k+1] ) { if ( u != vertices[k+1] ) {
s.push( vertices[k+1] ); stack.push( vertices[k+1] );
} }
w = vertices[k+1]; w = vertices[k+1];
} }
@ -630,7 +632,7 @@ private:
/*! Scan edges v_i,v_{i+1},...,v_n, until find an edge intersecting given ray /*! Scan edges v_i,v_{i+1},...,v_n, until find an edge intersecting given ray
or given segment. is_ray = true -> ray, false -> segment. or given segment. is_ray = true -> ray, false -> segment.
The intersection point is returned by u */ The intersection point is returned by u */
int scan_edges( int i, Size_type scan_edges( Size_type i,
const Point_2& ray_begin, const Point_2& ray_begin,
const Point_2& ray_end, const Point_2& ray_end,
Point_2& u, Point_2& u,
@ -639,7 +641,7 @@ private:
Orientation old_orient = RIGHT_TURN; Orientation old_orient = RIGHT_TURN;
Ray_2 ray( ray_begin, ray_end ); Ray_2 ray( ray_begin, ray_end );
Segment_2 s2( ray_begin, ray_end ); Segment_2 s2( ray_begin, ray_end );
int k; Size_type k;
Object_2 result; Object_2 result;
for ( k = i; k+1 < vertices.size(); k++ ) { for ( k = i; k+1 < vertices.size(); k++ ) {
Orientation curr_orient = traits->orientation_2_object()( Orientation curr_orient = traits->orientation_2_object()(

View File

@ -22,7 +22,6 @@
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Gmpq.h>
#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>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
@ -35,7 +34,6 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
typedef CGAL::Gmpq Number_type;
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2; typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2;
typedef Traits_2::Point_2 Point_2; typedef Traits_2::Point_2 Point_2;

View File

@ -23,7 +23,6 @@
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Gmpq.h>
#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>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
@ -36,7 +35,6 @@
#include <iostream> #include <iostream>
#include <fstream> #include <fstream>
typedef CGAL::Gmpq Number_type;
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2; typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2;
typedef Traits_2::Point_2 Point_2; typedef Traits_2::Point_2 Point_2;

View File

@ -21,7 +21,7 @@
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Gmpq.h> #include <CGAL/Exact_rational.h>
#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>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
@ -36,7 +36,7 @@
int main() { int main() {
{ {
typedef CGAL::Cartesian<CGAL::Gmpq> Kernel; typedef CGAL::Cartesian<CGAL::Exact_rational> Kernel;
typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2; typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2;
typedef CGAL::Arrangement_2<Traits_2> Arrangement_2; typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;
{ {

View File

@ -21,7 +21,7 @@
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Gmpq.h> #include <CGAL/Exact_rational.h>
#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>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
@ -36,12 +36,12 @@
int main() { int main() {
{ {
typedef CGAL::Gmpq Number_type; typedef CGAL::Exact_rational Number_type;
typedef CGAL::Cartesian<Number_type> Kernel; typedef CGAL::Cartesian<Number_type> Kernel;
typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2; typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2;
typedef CGAL::Arrangement_2<Traits_2> Arrangement_2; typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;
typedef CGAL::Simple_polygon_visibility_2<Arrangement_2, CGAL::Tag_false> typedef CGAL::Simple_polygon_visibility_2<
Simple_polygon_visibility_2; Arrangement_2, CGAL::Tag_false> Simple_polygon_visibility_2;
std::cout << "Running model tests - "; std::cout << "Running model tests - ";
CGAL::test_model_methods<Simple_polygon_visibility_2,Arrangement_2>(); CGAL::test_model_methods<Simple_polygon_visibility_2,Arrangement_2>();
std::cout << GREEN << "Done!" << RESET << std::endl; std::cout << GREEN << "Done!" << RESET << std::endl;
@ -53,8 +53,8 @@ int main() {
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2; typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2;
typedef CGAL::Arrangement_2<Traits_2> Arrangement_2; typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;
typedef CGAL::Simple_polygon_visibility_2<Arrangement_2, CGAL::Tag_false> typedef CGAL::Simple_polygon_visibility_2<
Simple_polygon_visibility_2; Arrangement_2, CGAL::Tag_false> Simple_polygon_visibility_2;
std::cout << "Running model tests - "; std::cout << "Running model tests - ";
CGAL::test_model_methods<Simple_polygon_visibility_2,Arrangement_2>(); CGAL::test_model_methods<Simple_polygon_visibility_2,Arrangement_2>();
std::cout << GREEN << "Done!" << RESET << std::endl; std::cout << GREEN << "Done!" << RESET << std::endl;

View File

@ -22,7 +22,7 @@
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Gmpq.h> #include <CGAL/Exact_rational.h>
#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>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
@ -37,12 +37,12 @@
int main(int argc, char* argv[]) { int main(int argc, char* argv[]) {
{ {
typedef CGAL::Gmpq Number_type; typedef CGAL::Exact_rational Number_type;
typedef CGAL::Cartesian<Number_type> Kernel; typedef CGAL::Cartesian<Number_type> Kernel;
typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2; typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2;
typedef CGAL::Arrangement_2<Traits_2> Arrangement_2; typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;
typedef CGAL::Simple_polygon_visibility_2<Arrangement_2, CGAL::Tag_false> typedef CGAL::Simple_polygon_visibility_2<
Simple_polygon_visibility_2; Arrangement_2, CGAL::Tag_false> Simple_polygon_visibility_2;
typedef CGAL::Triangular_expansion_visibility_2<Arrangement_2, CGAL::Tag_false> typedef CGAL::Triangular_expansion_visibility_2<Arrangement_2, CGAL::Tag_false>
Triangular_expansion_visibility_2; Triangular_expansion_visibility_2;

View File

@ -21,7 +21,7 @@
#include <CGAL/basic.h> #include <CGAL/basic.h>
#include <CGAL/Cartesian.h> #include <CGAL/Cartesian.h>
#include <CGAL/Gmpq.h> #include <CGAL/Exact_rational.h>
#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>
#include <CGAL/Arrangement_2.h> #include <CGAL/Arrangement_2.h>
@ -35,19 +35,19 @@
int main() { int main() {
{ {
typedef CGAL::Gmpq Number_type; typedef CGAL::Exact_rational Number_type;
typedef CGAL::Cartesian<Number_type> Kernel; typedef CGAL::Cartesian<Number_type> Kernel;
typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2; typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2;
typedef CGAL::Arrangement_2<Traits_2> Arrangement_2; typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;
{ {
typedef CGAL::Triangular_expansion_visibility_2<Arrangement_2 , CGAL::Tag_true> typedef CGAL::Triangular_expansion_visibility_2<
Visibility_2; Arrangement_2 , CGAL::Tag_true> Visibility_2;
CGAL::test_model_methods<Visibility_2,Arrangement_2>(); CGAL::test_model_methods<Visibility_2,Arrangement_2>();
CGAL::run_tests<Visibility_2,Arrangement_2>(22, 2); CGAL::run_tests<Visibility_2,Arrangement_2>(22, 2);
} }
{ {
typedef CGAL::Triangular_expansion_visibility_2<Arrangement_2 , CGAL::Tag_false> typedef CGAL::Triangular_expansion_visibility_2<
Visibility_2; Arrangement_2 , CGAL::Tag_false> Visibility_2;
CGAL::test_model_methods<Visibility_2,Arrangement_2>(); CGAL::test_model_methods<Visibility_2,Arrangement_2>();
CGAL::run_tests<Visibility_2,Arrangement_2>(22, 2); CGAL::run_tests<Visibility_2,Arrangement_2>(22, 2);
} }
@ -57,13 +57,13 @@ int main() {
typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2; typedef CGAL::Arr_segment_traits_2<Kernel> Traits_2;
typedef CGAL::Arrangement_2<Traits_2> Arrangement_2; typedef CGAL::Arrangement_2<Traits_2> Arrangement_2;
{ {
typedef CGAL::Triangular_expansion_visibility_2<Arrangement_2 , CGAL::Tag_true> typedef CGAL::Triangular_expansion_visibility_2<
Visibility_2; Arrangement_2 , CGAL::Tag_true> Visibility_2;
CGAL::test_model_methods<Visibility_2,Arrangement_2>(); CGAL::test_model_methods<Visibility_2,Arrangement_2>();
CGAL::run_tests<Visibility_2,Arrangement_2>(22, 2); CGAL::run_tests<Visibility_2,Arrangement_2>(22, 2);
}{ }{
typedef CGAL::Triangular_expansion_visibility_2<Arrangement_2 , CGAL::Tag_false> typedef CGAL::Triangular_expansion_visibility_2<
Visibility_2; Arrangement_2 , CGAL::Tag_false> Visibility_2;
CGAL::test_model_methods<Visibility_2,Arrangement_2>(); CGAL::test_model_methods<Visibility_2,Arrangement_2>();
CGAL::run_tests<Visibility_2,Arrangement_2>(22, 2); CGAL::run_tests<Visibility_2,Arrangement_2>(22, 2);
} }