mirror of https://github.com/CGAL/cgal
Rename more Polygon to Polygon_2 and remove an unused variable
This commit is contained in:
parent
be987dec40
commit
a69dd3f6c7
|
|
@ -21,7 +21,7 @@ int main()
|
|||
|
||||
#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 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;
|
||||
return -1;
|
||||
}
|
||||
Polygon P;
|
||||
Polygon_2 P;
|
||||
in_file >> P;
|
||||
in_file.close();
|
||||
std::cout << "Read an input polygon with " << P.size() << " vertices."
|
||||
|
|
|
|||
|
|
@ -21,9 +21,9 @@ int main()
|
|||
|
||||
#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 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[])
|
||||
{
|
||||
|
|
@ -34,7 +34,7 @@ int main(int argc, char* argv[])
|
|||
std::cerr << "Failed to open the input file." << std::endl;
|
||||
return -1;
|
||||
}
|
||||
Polygon P;
|
||||
Polygon_2 P;
|
||||
in_file >> P;
|
||||
in_file.close();
|
||||
std::cout << "Read an input polygon with " << P.size() << " vertices."
|
||||
|
|
@ -43,7 +43,7 @@ int main(int argc, char* argv[])
|
|||
// Compute the offset polygon.
|
||||
Traits traits;
|
||||
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();
|
||||
|
||||
std::cout << "The offset polygon has " << offset.outer_boundary().size()
|
||||
|
|
|
|||
|
|
@ -9,10 +9,10 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
// 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: (";
|
||||
typename Polygon::Vertex_const_iterator vit;
|
||||
typename Polygon_2::Vertex_const_iterator vit;
|
||||
for (vit = pgn.vertices_begin(); vit != pgn.vertices_end(); ++vit)
|
||||
std::cout << "(" << *vit << ')';
|
||||
std::cout << ") ]" << std::endl;
|
||||
|
|
|
|||
|
|
@ -12,8 +12,8 @@
|
|||
|
||||
typedef CGAL::Exact_predicates_exact_constructions_kernel Kernel;
|
||||
typedef Kernel::Point_2 Point;
|
||||
typedef CGAL::Polygon_2<Kernel> Polygon;
|
||||
typedef CGAL::Polygon_with_holes_2<Kernel> Polygon_with_holes;
|
||||
typedef CGAL::Polygon_2<Kernel> Polygon_2;
|
||||
typedef CGAL::Polygon_with_holes_2<Kernel> Polygon_with_holes_2;
|
||||
|
||||
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;
|
||||
return -1;
|
||||
}
|
||||
Polygon P, Q;
|
||||
Polygon_2 P, Q;
|
||||
in_file >> P >> Q;
|
||||
in_file.close();
|
||||
|
||||
// Compute the Minkowski sum using the decomposition approach.
|
||||
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);
|
||||
return 0;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -324,7 +324,7 @@ private:
|
|||
}
|
||||
|
||||
// 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
|
||||
{
|
||||
std::vector<Direction_2> directions;
|
||||
|
|
|
|||
Loading…
Reference in New Issue