#include <IGPolygon.h>
Public Methods | |
IGPolygon () | |
IGPolygon (const IGPolygon& P) | |
~IGPolygon () | |
IGPolygon& | operator= (const IGPolygon& P) |
void | Draw (void) const |
draws the polygon using OpenGL. | |
bool | IsOkForOpenGL (void) const |
returns whether the polygon can be used in OpenGL. | |
vector | Normal (void) const |
returns the normal vector of the polygon. | |
Private Methods | |
void | CheckForOpenGL (void) |
checks whether the polygon can be used in OpenGL: - computes the center of the polygon - computes the normal vector of the polygon - if the normal can be computed: > checks whether the largest bidimensional projection of the polygon into the planes of the coordinate system defines a simple and convex polygon > sets the flag okForOpenGL apropriately. | |
double | ComputeArea (const list<point>& L) const |
computes the (weighted) area defined by the points in the list. | |
void | ComputeCenter (void) |
computes the center of the polygon. | |
bool | ComputeNormal (void) |
computes the normal vector of the polygon returns false if it is not possible to compute the vector. | |
bool | IsBitonic (const list<double>& L) const |
checks whether the list of values defines a bitonic sequence. | |
bool | IsSimpleAndConvex (const list<point>& L) const |
returns whether the list of bidimensional points defines a simple-and-convex polygon. | |
bool | PointsInPlane (void) const |
checks whether the corners of the polygon are sufficiently close to the plane defined through the center and the normal. | |
Private Attributes | |
list<IGPoint> | corners |
the list of points specifying the corner points of the polygon. | |
d3_point | center |
the center of the polygon. | |
vector | normal |
the normal of the polygon. | |
bool | okForOpenGL |
the flag indicates whether the polygon is well-defined and simple-and-convex, hence it is ok for OpenGL. | |
Friends | |
istream& | operator >> (istream& in, IGPolygon& P) |
reads a polygon from the input stream NOTE: is not the inverse of the operator<<. | |
ostream& | operator<< (ostream& out, const IGPolygon& P) |
writes a polygon to the output stream NOTE: is not the inverse of the operator>>. |
|
Definition at line 25 of file IGPolygon.cpp.
|
Definition at line 31 of file IGPolygon.cpp.
|
Definition at line 41 of file IGPolygon.cpp.
|
checks whether the polygon can be used in OpenGL: - computes the center of the polygon - computes the normal vector of the polygon - if the normal can be computed: > checks whether the largest bidimensional projection of the polygon into the planes of the coordinate system defines a simple and convex polygon > sets the flag okForOpenGL apropriately.
Definition at line 57 of file IGPolygon.cpp.
Referenced by operator >>().
|
computes the (weighted) area defined by the points in the list.
Definition at line 92 of file IGPolygon.cpp.
Referenced by ComputeNormal().
|
computes the center of the polygon.
Definition at line 107 of file IGPolygon.cpp.
Referenced by CheckForOpenGL().
|
computes the normal vector of the polygon returns false if it is not possible to compute the vector.
Definition at line 117 of file IGPolygon.cpp.
Referenced by CheckForOpenGL().
|
draws the polygon using OpenGL.
Definition at line 148 of file IGPolygon.cpp.
Referenced by Display().
|
checks whether the list of values defines a bitonic sequence.
Definition at line 157 of file IGPolygon.cpp.
Referenced by IsSimpleAndConvex().
|
returns whether the polygon can be used in OpenGL.
Definition at line 73 of file IGPolygon.h.
Referenced by ReadFile().
|
returns whether the list of bidimensional points defines a simple-and-convex polygon.
Definition at line 176 of file IGPolygon.cpp.
Referenced by CheckForOpenGL().
|
|
checks whether the corners of the polygon are sufficiently close to the plane defined through the center and the normal.
Definition at line 191 of file IGPolygon.cpp.
Referenced by CheckForOpenGL().
|
Definition at line 45 of file IGPolygon.cpp.
|
reads a polygon from the input stream NOTE: is not the inverse of the operator<<.
Definition at line 205 of file IGPolygon.cpp.
|
writes a polygon to the output stream NOTE: is not the inverse of the operator>>.
Definition at line 224 of file IGPolygon.cpp.
|
|
the list of points specifying the corner points of the polygon.
Definition at line 31 of file IGPolygon.h.
|
|
the flag indicates whether the polygon is well-defined and simple-and-convex, hence it is ok for OpenGL.
Definition at line 38 of file IGPolygon.h.