#include <glgeometry.h>
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. | |
| LineNode * | First () |
| Return the first point - null if empty. | |
| const LineNode * | First () 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. | |
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).
| 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.
1.4.7