GL Studio SCECpp Runtime Library
Classes | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
GlsPolygon Class Reference

#include <gls_polygon.h>

Inheritance diagram for GlsPolygon:
GlsRenderObject GlsDisplayObject

Classes

struct  InitParameters
 

Public Member Functions

 GlsPolygon (const InitParameters &initParameters, GlsEventDispatcher *const eventDispatcher)
 
virtual void Draw (GlsStateManager &gl, const GlsFloat64 time)
 
virtual void OffsetTexture (const GlsVector2D &offset)
 
void SetVertex (const GlsUInt32 index, const GlsTextureVertex &vertex)
 
- Public Member Functions inherited from GlsRenderObject
virtual void SetAlphaMode (const GlsAlphaMode alphaMode)
 
virtual void SetFillColor (const GlsColor &fillColor)
 
virtual void SetLineColor (const GlsColor &lineColor)
 
virtual void SetLineWidth (const GlsFloat32 lineWidth)
 
virtual void SetPolygonMode (const GlsPolygonMode polygonMode)
 
virtual void SetTextureIndex (const GlsUInt32 textureIndex)
 
- Public Member Functions inherited from GlsDisplayObject
virtual void Calculate (const GlsFloat64 time)
 
virtual GlsDisplayObjectPickTest (const GlsVector2D &windowCoord, GlsInputManager &inputManager, const GlsMatrixAffineD::GLMatrixAffineF &parentDrawMatrix)
 
GlsDisplayObjectHandleEvent (GlsEvent &event)
 
ObjectType GetObjectType (void) const
 
void SetBlinking (const GlsBool blinking)
 
void SetBlinkRate (const GlsFloat32 blinkRate)
 
void SetDynamicRotation (const GlsVector3D &dynamicRotation)
 
void SetDynamicScale (const GlsVector3D &dynamicScale)
 
void SetDynamicTranslation (const GlsVector3D &dynamicTranslation)
 
void SetVisibility (const GlsBool visible)
 
void SetParent (GlsDisplayObject *const parent)
 
void SetPickMode (const PickMode pickMode)
 
GlsBool NeedCalculate (void) const
 
void InvalidatePickCache (void)
 

Protected Member Functions

virtual ~GlsPolygon ()
 
- Protected Member Functions inherited from GlsRenderObject
 GlsRenderObject (const InitParameters &initParameters, GlsEventDispatcher *const eventDispatcher)
 
GLint GlsTextureFilterModeToGL (const GlsTextureFilterMode mode) const
 
void SetupDepthTest (GlsStateManager &gl) const
 
void SetupAlpha (GlsStateManager &gl) const
 
GlsBool SetupTexture (GlsStateManager &gl, const GlsUInt32 textureIndex) const
 
void SetupTextureFilterSettings (GlsStateManager &gl) const
 
void SetupBackfaceCulling (GlsStateManager &gl) const
 
void SetupShading (GlsStateManager &gl) const
 
void SetupLineStyle (GlsStateManager &gl) const
 
void SetupAntiAlias (GlsStateManager &gl) const
 
virtual ~GlsRenderObject ()
 
- Protected Member Functions inherited from GlsDisplayObject
 GlsDisplayObject (const InitParameters &initParameters, const ObjectType objectType, GlsEventDispatcher *const eventDispatcher)
 
virtual ~GlsDisplayObject ()
 
GlsBool CalcDrawMatrix (const GlsMatrixAffineD *const additionalTransform, const GlsBool includeLocation)
 
virtual void CalcWindowPickRegion (GlsInputManager &inputManager, const GlsMatrixAffineD::GLMatrixAffineF &parentDrawMatrix)
 
GlsBool IsBlinkedOff (const GlsFloat64 time) const
 

Protected Attributes

GlsTextureVertexArray _vertices
 
- Protected Attributes inherited from GlsRenderObject
const GlsBool _antiAlias
 
const GlsTexturePalette_texturePalette
 
const GlsBool _textureRepeat
 
const GlsTextureMapMode _textureMapMode
 
const GlsTextureFilterMode _textureMagFilterMode
 
const GlsTextureFilterMode _textureMinFilterMode
 
const GlsBool _cullBackFace
 
const GlsDepthBufferMode _depthBufferMode
 
const GlsPolygonEndMode _polygonEndMode
 
const GlsShadingMode _shadingMode
 
GlsAlphaMode _alphaMode
 
GlsColor _lineColor
 
GlsUInt32 _textureIndex
 
GlsPolygonMode _polygonMode
 
GlsColor _fillColor
 
GlsFloat32 _lineWidth
 
- Protected Attributes inherited from GlsDisplayObject
const GlsMatrixAffineD _dcsMatrix
 
const GlsMatrixAffineD _dcsMatrixInverse
 
const GlsBool _dcsMatrixIsIdentity
 
const GlsVector3D _location
 
const GlsBool _needCalculate
 
const ObjectType _objectType
 
const PickRegion _pickRegion
 
GlsEventDispatcher *const _eventDispatcher
 
const GlsVector3D _rotationPoint
 
GlsBool _blinking
 
GlsFloat32 _blinkRate
 
GlsMatrixAffineD::GLMatrixAffineF _drawMatrix
 
GlsVector3D _dynamicRotation
 
GlsVector3D _dynamicScale
 
GlsBool _dynamicScaleIsUnity
 
GlsVector3D _dynamicTranslation
 
GlsBool _needCalcDrawMatrix
 
GlsBool _visible
 
PickMode _pickMode
 
GlsBool _windowPickRegionValid
 
GlsVector2D _windowPickLowerLeft
 
GlsVector2D _windowPickUpperRight
 
GlsVector2D _windowPickUpperLeft
 
GlsVector2D _windowPickLowerRight
 
GlsMatrixAffineD::GLMatrixAffineF _pickMatrix
 
GlsDisplayObject_parent
 

Additional Inherited Members

- Public Types inherited from GlsDisplayObject
enum  ObjectType { OBJECT_TYPE_COMPOSITE, OBJECT_TYPE_RENDERABLE }
 
enum  PickMode { PICK_MODE_NEVER, PICK_MODE_FIRST, PICK_MODE_ALWAYS }
 
- Static Protected Attributes inherited from GlsRenderObject
static const GLclampf ALPHA_MODE_2_LEVEL_REF
 

Detailed Description

The GlsPolygon abstracts an ordered set of two or more textured vertices.

Invariant
base class invariant holds, _vertices.Invariant()

Constructor & Destructor Documentation

GlsPolygon::GlsPolygon ( const InitParameters initParameters,
GlsEventDispatcher *const  eventDispatcher 
)

Constructor - create instance

Parameters
initParametersinitialization parametets
eventDispatcherevent dispatcher for this object else GLS_NULL
Precondition
initParameters.IsValid()
Postcondition
instance created
virtual GlsPolygon::~GlsPolygon ( )
protectedvirtual

Destructor - shall never be called

Precondition
none
Postcondition
none

Member Function Documentation

virtual void GlsPolygon::Draw ( GlsStateManager gl,
const GlsFloat64  time 
)
virtual

Draws this polygon

Parameters
glGL State manager for OpenGL into which polygon is drawn
timethe elaspsed time in seconds since program start
Precondition
time >= 0.0
Postcondition
polygon is drawn to OpenGL if visible and not blinked off

Implements GlsDisplayObject.

virtual void GlsPolygon::OffsetTexture ( const GlsVector2D offset)
virtual

Offset the texture on the object

Parameters
offsetx, y offset for texture
Precondition
offset.IsValid()
Postcondition
offset is added to the texture coordinates

Implements GlsRenderObject.

void GlsPolygon::SetVertex ( const GlsUInt32  index,
const GlsTextureVertex vertex 
)

Set one of the vertices in the polygon

Parameters
indexindex of desired vertex
vertexnew value of desired vertex
Precondition
index is less than the number of vertices in the polygon, vertex.IsValid()
Postcondition
vertex at desired index has new value

Member Data Documentation

GlsTextureVertexArray GlsPolygon::_vertices
protected

array of vertices for polygon