CGAL 5.6 - 2D Polygons
Loading...
Searching...
No Matches
Polygon/draw_polygon.cpp
#include <CGAL/Exact_predicates_inexact_constructions_kernel.h>
#include <CGAL/Polygon_2.h>
#include <CGAL/draw_polygon_2.h>
typedef CGAL::Polygon_2<K> Polygon_2;
typedef CGAL::Point_2<K> Point;
int main()
{
// create a polygon and put some points in it
Polygon_2 p;
p.push_back(Point(0,0));
p.push_back(Point(4,0));
p.push_back(Point(4,4));
p.push_back(Point(2,2));
p.push_back(Point(0,4));
return EXIT_SUCCESS;
}
The class Polygon_2 implements polygons.
Definition: Polygon_2.h:64
void draw(const P &ap)
opens a new window and draws ap, an instance of the CGAL::Polygon_2 class.