Aleph-w 3.0
A C++ Library for Data Structures and Algorithms
Loading...
Searching...
No Matches
polygon_intersection_example.cc File Reference

Convex polygon intersection demo (Sutherland-Hodgman). More...

#include <geom_algorithms.H>
#include <cassert>
#include <fstream>
#include <iomanip>
#include <iostream>
Include dependency graph for polygon_intersection_example.cc:

Go to the source code of this file.

Functions

static void print_banner (const char *title)
 
static Geom_Number polygon_area (const Polygon &poly)
 
static void write_polygon_wkt (ostream &out, const Polygon &poly)
 
static bool export_csv (const char *path, const Polygon &subject, const Polygon &clip, const Polygon &inter)
 
static void print_polygon (const char *name, const Polygon &poly)
 
int main (int argc, char **argv)
 

Detailed Description

Convex polygon intersection demo (Sutherland-Hodgman).

Demonstrates:

  • ConvexPolygonIntersectionBasic (Sutherland-Hodgman clipping)
  • Export of the intersection polygon (text formats)
See also
geom_algorithms.H
ConvexPolygonIntersectionBasic

Definition in file polygon_intersection_example.cc.

Function Documentation

◆ export_csv()

static bool export_csv ( const char *  path,
const Polygon subject,
const Polygon clip,
const Polygon inter 
)
static

◆ main()

◆ polygon_area()

◆ print_banner()

static void print_banner ( const char *  title)
static

Definition at line 54 of file polygon_intersection_example.cc.

Referenced by main().

◆ print_polygon()

◆ write_polygon_wkt()

static void write_polygon_wkt ( ostream &  out,
const Polygon poly 
)
static