class Polygon2D

This class is designed to handle a polygon in 2D

Inheritance:


Public Fields

[more]int n
number of vertex points
[more]Point2D* V
array of points with V[n]=V[0], V[n+1]=V[1]

Public Methods

[more] constructors
[more]virtual ~Polygon2D()
destructor
[more]virtual void saveXFile(XFile* file)
save the polygon
[more]virtual void loadXFile(XFile* file)
load a polygon
[more]virtual const char* sprint()
return the polygon into a string
[more]virtual void draw(Image* image_, Color color_)
draw the polygon on an image
[more]int wn_PnPoly(Point2D P_)
test the inclusion of a point into the polygon


Inherited from geomObject:

Public Fields

obool verbose

Public Methods

ovirtual void xdraw(Display* pDisplay_, Pixmap pixmap_, GC gc_, unsigned long color_, int line_width_ = 1, int line_style_ = LineSolid, bool fill_ = false, int fill_style_ = FillSolid)


Documentation

This class is designed to handle a polygon in 2D

oint n
number of vertex points

oPoint2D* V
array of points with V[n]=V[0], V[n+1]=V[1]

o constructors

o Polygon2D()

o Polygon2D(int n_)

o Polygon2D(int n_, Point2D* V_)

ovirtual ~Polygon2D()
destructor

ovirtual void saveXFile(XFile* file)
save the polygon

ovirtual void loadXFile(XFile* file)
load a polygon

ovirtual const char* sprint()
return the polygon into a string

ovirtual void draw(Image* image_, Color color_)
draw the polygon on an image

oint wn_PnPoly(Point2D P_)
test the inclusion of a point into the polygon

This method uses the winding number test. You can find the original algorithm here.

Parameters:
P_ - is a point,
Returns:
the winding number (=0 only if P_ is outside V)
Author:
Dan Sunday (http:www.softsurfer.com/)


This class has no child classes.
Author:
Sebastien Marcel (marcel@idiap.ch)
Version:
2.0 Wed 28 Jun 2006 05:19:32 PM CEST
Since:
1.0

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.