grinliz::LineLoop Class Reference

A representation of a closed 2D polygon as a series of points. More...

#include <glgeometry.h>

List of all members.

Public Member Functions

 LineLoop ()
 Construct an empty loop.
void Clear ()
 Clear the loop and free the memory for the lines.
void Delete (LineNode *del)
 Delete a point.
void AddAtEnd (LineNode *node)
 Add a point at the end of the loop.
void AddAfter (LineNode *me, LineNode *add)
 Add a pointer after the point specified.
LineNodeFirst ()
 Return the first point - null if empty.
const LineNodeFirst () const
 Return the first point - null if empty.
void SortToTop ()
 Sort so the positive direction will the left edge, and the negitive direction the right.
void Bounds (grinliz::Rectangle2F *bounds)
 Compute the bounds of the loop.
void Render (float *surface, int width, int height, bool fill=false)
 Draw the lineloop to a floating point surface, using 'value' in the line node.


Detailed Description

A representation of a closed 2D polygon as a series of points.

The "loop" is a true circular list - there are no nulls or sentinels. The next pointer is positive (counter-clock) and the prev pointer is negative (clock).


Member Function Documentation

void grinliz::LineLoop::AddAtEnd ( LineNode node  ) 

Add a point at the end of the loop.

Normally a loop is created by:

frustum2D.Clear(); frustum2D.AddAtEnd( new LineNode( 0.0f, 0.0f ) ); frustum2D.AddAtEnd( new LineNode( (float)(VERTEXSIZE-1), 0.0f ) ); frustum2D.AddAtEnd( new LineNode( (float)(VERTEXSIZE-1), (float)(VERTEXSIZE-1) ) ); frustum2D.AddAtEnd( new LineNode( 0.0f, (float)(VERTEXSIZE-1) ) );

void grinliz::LineLoop::Render ( float *  surface,
int  width,
int  height,
bool  fill = false 
)

Draw the lineloop to a floating point surface, using 'value' in the line node.

Note that only fully included points will be drawn.

void grinliz::LineLoop::SortToTop (  ) 

Sort so the positive direction will the left edge, and the negitive direction the right.

First() will point to the first left edge.


The documentation for this class was generated from the following file:
Generated on Thu Jul 20 20:45:33 2006 for Kyra by  doxygen 1.4.7