Main Page   Class Hierarchy   Alphabetical List   Compound List   File List   Compound Members   File Members  

IGPolygon Class Reference

#include <IGPolygon.h>

List of all members.

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<IGPointcorners
 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>>.


Constructor & Destructor Documentation

IGPolygon::IGPolygon ( )

Definition at line 25 of file IGPolygon.cpp.

IGPolygon::IGPolygon ( const IGPolygon & P )

Definition at line 31 of file IGPolygon.cpp.

IGPolygon::~IGPolygon ( )

Definition at line 41 of file IGPolygon.cpp.


Member Function Documentation

void IGPolygon::CheckForOpenGL ( void ) [private]

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 >>().

double IGPolygon::ComputeArea ( const list< point >& L ) const [private]

computes the (weighted) area defined by the points in the list.

Definition at line 92 of file IGPolygon.cpp.

Referenced by ComputeNormal().

void IGPolygon::ComputeCenter ( void ) [private]

computes the center of the polygon.

Definition at line 107 of file IGPolygon.cpp.

Referenced by CheckForOpenGL().

bool IGPolygon::ComputeNormal ( void ) [private]

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().

void IGPolygon::Draw ( void ) const

draws the polygon using OpenGL.

Definition at line 148 of file IGPolygon.cpp.

Referenced by Display().

bool IGPolygon::IsBitonic ( const list< double >& L ) const [private]

checks whether the list of values defines a bitonic sequence.

Definition at line 157 of file IGPolygon.cpp.

Referenced by IsSimpleAndConvex().

bool IGPolygon::IsOkForOpenGL ( void ) const [inline]

returns whether the polygon can be used in OpenGL.

Definition at line 73 of file IGPolygon.h.

Referenced by ReadFile().

bool IGPolygon::IsSimpleAndConvex ( const list< point >& L ) const [private]

returns whether the list of bidimensional points defines a simple-and-convex polygon.

Definition at line 176 of file IGPolygon.cpp.

Referenced by CheckForOpenGL().

vector IGPolygon::Normal ( void ) const [inline]

returns the normal vector of the polygon.

Definition at line 75 of file IGPolygon.h.

bool IGPolygon::PointsInPlane ( void ) const [private]

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().

IGPolygon & IGPolygon::operator= ( const IGPolygon & P )

Definition at line 45 of file IGPolygon.cpp.


Friends And Related Function Documentation

istream & operator >> ( istream & in,
IGPolygon & P ) [friend]

reads a polygon from the input stream NOTE: is not the inverse of the operator<<.

Definition at line 205 of file IGPolygon.cpp.

ostream & operator<< ( ostream & out,
const IGPolygon & P ) [friend]

writes a polygon to the output stream NOTE: is not the inverse of the operator>>.

Definition at line 224 of file IGPolygon.cpp.


Member Data Documentation

d3_point IGPolygon::center [private]

the center of the polygon.

Definition at line 33 of file IGPolygon.h.

list< IGPoint > IGPolygon::corners [private]

the list of points specifying the corner points of the polygon.

Definition at line 31 of file IGPolygon.h.

vector IGPolygon::normal [private]

the normal of the polygon.

Definition at line 35 of file IGPolygon.h.

bool IGPolygon::okForOpenGL [private]

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.


The documentation for this class was generated from the following files:
Generated at Wed May 30 11:16:29 2001 for Computer Graphics Course by doxygen1.1.5 written by Dimitri van Heesch, © 1997-2000