Main Page | Class Hierarchy | Class List | File List | Class Members | File Members

CUI_PolyEdgeBorder Class Reference

Simple implementation of IUI_Border. More...

#include <CUI_PolyEdgeBorder.h>

Inheritance diagram for CUI_PolyEdgeBorder:

IUI_Border CUI_Resource List of all members.

Public Member Functions

 CUI_PolyEdgeBorder (v2_f *vlist=NULL, int numvert=0)
 constructor

virtual ~CUI_PolyEdgeBorder ()
 destructor - deallocate vertex list

virtual bool GetBorder (double dtime, v2_fp &vlist, int &numvert, unsigned short &primitivetype)
 returns a list of 2d vertices and UI_POLYGON

virtual bool GetOutline (double dtime, v2_fp &vlist, int &numvert)
 returna list of 2d vertices that if drawn with UI_LINE_LOOP will produce the outline

virtual bool SetBorder (v2_f *vlist, int numvert)
 Defines the border by a list of vertices in counter-clockwise order.

virtual bool AddPoint (v2_f point)
 Add a point to the border (used during file loading).

virtual bool TestHit (float x, float y)
 Test to see if a given point is within this boundary.


Protected Attributes

v2_fm_vlist
 a list of the vertices defining this border

int m_numvert
 the number of vertices in the list


Detailed Description

Simple implementation of IUI_Border.

A simple convex polygonal edge border


Constructor & Destructor Documentation

CUI_PolyEdgeBorder::CUI_PolyEdgeBorder v2_f vlist = NULL,
int  numvert = 0
 

constructor

Parameters:
vlist list of vertices defining a 2d polygon
numvert the number of vertices in vlist


Member Function Documentation

bool CUI_PolyEdgeBorder::GetBorder double  dtime,
v2_fp vlist,
int &  numvert,
unsigned short &  primitivetype
[virtual]
 

returns a list of 2d vertices and UI_POLYGON

This should do as a general purpose primitive, but a more sophisticated tesselating algorithm may be required for more complex shapes.

Parameters:
dtime current time (for animation)
vlist pointer to hold the list of vertices
numvert integer to hold the number of vertices in the list
primitivetype to hold the type of primitive needed to render the list
See also:
UI_TRIANGLE_STRIP

UI_QUAD_STRIP

UI_TRIANGLE_FAN

UI_POLYGON

Implements IUI_Border.

bool CUI_PolyEdgeBorder::GetOutline double  dtime,
v2_fp vlist,
int &  numvert
[virtual]
 

returna list of 2d vertices that if drawn with UI_LINE_LOOP will produce the outline

See also:
GetBorder

UI_LINE_LOOP

Implements IUI_Border.

bool CUI_PolyEdgeBorder::SetBorder v2_f vlist,
int  numvert
[virtual]
 

Defines the border by a list of vertices in counter-clockwise order.

Assumes that vertices are in counter-clockwise order and form a convex polygon.

Parameters:
vlist array of 2d vertices (x, y in local space)
numvert number of vertices in vlist

Implements IUI_Border.

bool CUI_PolyEdgeBorder::TestHit float  x,
float  y
[virtual]
 

Test to see if a given point is within this boundary.

Parameters:
x x position (in local space)
y y position (in local space)
Returns:
true if the point is within the boundary

Implements IUI_Border.


The documentation for this class was generated from the following files:
Generated on Mon Sep 29 23:07:04 2003 for glGUI by doxygen 1.3.4