Rename more Polygon to Polygon_2 and remove an unused variable

This commit is contained in:
Sebastian Morr 2015-05-14 09:19:50 +02:00
parent be987dec40
commit a69dd3f6c7
5 changed files with 13 additions and 13 deletions

View File

@ -21,7 +21,7 @@ int main()
#include "arr_conics.h" #include "arr_conics.h"
typedef CGAL::Polygon_2<Rat_kernel> Polygon; typedef CGAL::Polygon_2<Rat_kernel> Polygon_2;
typedef CGAL::Gps_traits_2<Traits> Gps_traits; typedef CGAL::Gps_traits_2<Traits> Gps_traits;
typedef Gps_traits::Polygon_2 Offset_polygon; typedef Gps_traits::Polygon_2 Offset_polygon;
@ -34,7 +34,7 @@ int main(int argc, char* argv[])
std::cerr << "Failed to open the input file." << std::endl; std::cerr << "Failed to open the input file." << std::endl;
return -1; return -1;
} }
Polygon P; Polygon_2 P;
in_file >> P; in_file >> P;
in_file.close(); in_file.close();
std::cout << "Read an input polygon with " << P.size() << " vertices." std::cout << "Read an input polygon with " << P.size() << " vertices."

View File

@ -21,9 +21,9 @@ int main()
#include "arr_conics.h" #include "arr_conics.h"
typedef CGAL::Polygon_2<Rat_kernel> Polygon; typedef CGAL::Polygon_2<Rat_kernel> Polygon_2;
typedef CGAL::Gps_traits_2<Traits> Gps_traits; typedef CGAL::Gps_traits_2<Traits> Gps_traits;
typedef Gps_traits::Polygon_with_holes_2 Offset_polygon_with_holes; typedef Gps_traits::Polygon_with_holes_2 Offset_polygon_with_holes_2;
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
@ -34,7 +34,7 @@ int main(int argc, char* argv[])
std::cerr << "Failed to open the input file." << std::endl; std::cerr << "Failed to open the input file." << std::endl;
return -1; return -1;
} }
Polygon P; Polygon_2 P;
in_file >> P; in_file >> P;
in_file.close(); in_file.close();
std::cout << "Read an input polygon with " << P.size() << " vertices." std::cout << "Read an input polygon with " << P.size() << " vertices."
@ -43,7 +43,7 @@ int main(int argc, char* argv[])
// Compute the offset polygon. // Compute the offset polygon.
Traits traits; Traits traits;
boost::timer timer; boost::timer timer;
Offset_polygon_with_holes offset = CGAL::offset_polygon_2(P, 5, traits); Offset_polygon_with_holes_2 offset = CGAL::offset_polygon_2(P, 5, traits);
double secs = timer.elapsed(); double secs = timer.elapsed();
std::cout << "The offset polygon has " << offset.outer_boundary().size() std::cout << "The offset polygon has " << offset.outer_boundary().size()

View File

@ -9,10 +9,10 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// Pretty-print a CGAL polygon. // Pretty-print a CGAL polygon.
// //
template <typename Polygon> void print_polygon(const Polygon & pgn) template <typename Polygon_2> void print_polygon(const Polygon_2 & pgn)
{ {
std::cout << "[ " << pgn.size() << " vertices: ("; std::cout << "[ " << pgn.size() << " vertices: (";
typename Polygon::Vertex_const_iterator vit; typename Polygon_2::Vertex_const_iterator vit;
for (vit = pgn.vertices_begin(); vit != pgn.vertices_end(); ++vit) for (vit = pgn.vertices_begin(); vit != pgn.vertices_end(); ++vit)
std::cout << "(" << *vit << ')'; std::cout << "(" << *vit << ')';
std::cout << ") ]" << std::endl; std::cout << ") ]" << std::endl;

View File

@ -12,8 +12,8 @@
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel; typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
typedef Kernel::Point_2 Point; typedef Kernel::Point_2 Point;
typedef CGAL::Polygon_2<Kernel> Polygon; typedef CGAL::Polygon_2<Kernel> Polygon_2;
typedef CGAL::Polygon_with_holes_2<Kernel> Polygon_with_holes; typedef CGAL::Polygon_with_holes_2<Kernel> Polygon_with_holes_2;
int main(int argc, char* argv[]) int main(int argc, char* argv[])
{ {
@ -24,13 +24,13 @@ int main(int argc, char* argv[])
std::cerr << "Failed to open the input file." << std::endl; std::cerr << "Failed to open the input file." << std::endl;
return -1; return -1;
} }
Polygon P, Q; Polygon_2 P, Q;
in_file >> P >> Q; in_file >> P >> Q;
in_file.close(); in_file.close();
// Compute the Minkowski sum using the decomposition approach. // Compute the Minkowski sum using the decomposition approach.
CGAL::Small_side_angle_bisector_decomposition_2<Kernel> ssab_decomp; CGAL::Small_side_angle_bisector_decomposition_2<Kernel> ssab_decomp;
Polygon_with_holes sum = CGAL::minkowski_sum_2(P, Q, ssab_decomp); Polygon_with_holes_2 sum = CGAL::minkowski_sum_2(P, Q, ssab_decomp);
std::cout << "P (+) Q = "; print_polygon_with_holes(sum); std::cout << "P (+) Q = "; print_polygon_with_holes(sum);
return 0; return 0;
} }

View File

@ -324,7 +324,7 @@ private:
} }
// Returns a sorted list of the polygon's edges // Returns a sorted list of the polygon's edges
std::vector<Direction_2> directions_of_polygon(const Polygon_2& p, std::vector<Direction_2> directions_of_polygon(
const std::vector<Point_2>& points) const const std::vector<Point_2>& points) const
{ {
std::vector<Direction_2> directions; std::vector<Direction_2> directions;