class GmDrawable

The GmDrawable class is the base class for all render-able objects.

Inheritance:


Public Methods

[more] GmDrawable ()
Standard constructor
[more]virtual void applyLayout (float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
Repositions and resizes this component based on parameters passed into the method.
[more]virtual GlmColor4* getBaseColor ()
Gets the base color of the object.
[more]virtual GmTypes::CoordinateType getCoordType ()
Gets the coordinate type for this object.
[more]virtual float getDepth ()
Gets the depth of the drawable object.
[more]virtual float getGlDepth ()
Gets the OpenGL depth of the drawable object.
[more]virtual void getGlExtents (float& width, float& height)
Gets the ideal extents of the drawable in OpenGL units.
[more]virtual float getGlHeight ()
Gets the OpenGL height of the drawable object.
[more]virtual GlmPoint3* getGlPosition ()
Gets the OpenGL position of the drawable object.
[more]virtual float getGlWidth ()
Gets the OpenGL width of the drawable object.
[more]virtual float getHeight ()
Gets the height of the drawable object.
[more]virtual void getMinimumGeometry (float& width, float& height, float& depth)
Get the minimum dimensions of this drawable object.
[more]virtual GlmPoint3* getPosition ()
Gets the position of the drawable object.
[more]virtual bool getVisible ()
Gets the visibility status of this drawable object.
[more]virtual float getWidth ()
Gets the width of the drawable object.
[more]virtual void render (GmTypes::RenderOptionType renderOptions)
Renders the current drawable given the rendering options.
[more]virtual void setAbsoluteGeometry (float x, float y, float z, float width, float height, float depth)
Sets the absolute geometry to use for this drawable object.
[more]virtual void setBaseColor (GlmColor4* color)
Sets the base color of the object.
[more]virtual void setBaseColor (float r, float g, float b, float a)
Sets the base color of the object.
[more]virtual void setCoordType (GmTypes::CoordinateType coordType)
Sets the coordinate type for this object.
[more]virtual void setDepth (float depth)
Sets the depth of the drawable object in units.
[more]virtual void setHeight (float height)
Sets the height of the drawable object in units.
[more]virtual void setPosition (GlmPoint3* point)
Sets the position of the drawable.
[more]virtual void setPosition (float x, float y, float z)
Sets the position of the drawable.
[more]virtual void setRelativeGeometry (float x, float y, float width, float height)
Sets the relative geometry to use for this drawable object.
[more]virtual void setRelativeGeometry (float x, float y, float z, float width, float height, float depth)
Sets the relative geometry to use for this drawable object.
[more]virtual void setVisible (bool visible)
Sets the visibility of the drawable object.
[more]virtual void setWidth (float width)
Sets the width of the drawable object in units.
[more]virtual ~GmDrawable ()
Standard destructor

Protected Fields

[more]GlmColor4 mBaseColor
The base color of the drawable object
[more]GmTypes::CoordinateType mCoordType
The coordinate type to use CT_RELATIVE or CT_ABSOLUTE.
[more]float mDepth
The physical depth of the drawable object in units.
[more]bool mDisplayListGenerate
A flag to inform render methods of their displaylist's state.
[more]int mDisplayListId
An OpenGL-assigned displaylist id for this object.
[more]float mGlDepth
The depth of this drawable in OpenGL units.
[more]float mGlHeight
The height of this drawable in OpenGL units.
[more]GlmPoint3 mGlPosition
The OpenGL position of this object.
[more]float mGlWidth
The width of this drawable in OpenGL units.
[more]float mHeight
The physical height of the drawable object in units.
[more]GlmPoint3 mPosition
The position of the drawable object.
[more]bool mVisible
The visible status of the object, if true the drawable is visible and will be rendered.
[more]float mWidth
The physical width of the drawable object in units.

Protected Methods

[more]virtual bool getDisplayListGenerate ()
Gets the flag which informs the render functions that their display list needs to be generated.
[more]virtual int getDisplayListId ()
Gets the current displaylist id for the object.
[more]virtual void render2d (GmTypes::RenderOptionType renderOptions)
Renders this drawable to a 2D image buffer.
[more]virtual void render2dSelect (GmTypes::RenderOptionType renderOptions)
Renders this drawable to a selection buffer.
[more]virtual void setDisplayListGenerate (bool generate)
Sets the flag which informs the render functions that their display list needs to be generated.
[more]virtual void setDisplayListId (int id)
Sets the displaylist id for this component.


Inherited from GmObject:

Public Methods

ounsigned short getObjectId()

Protected Fields

oThe object ID is used to uniquely identify each GmObject unsigned short mObjectId


Documentation

The GmDrawable class is the base class for all render-able objects. It contains basic information such as the height and width of the drawable object as well as whether it is visible or not.
oGmTypes::CoordinateType mCoordType
The coordinate type to use CT_RELATIVE or CT_ABSOLUTE. Relative coordinates are relative to the position of the parent container. Absolute coordinates are usually used by top-level interface components.

oGlmColor4 mBaseColor
The base color of the drawable object

oGlmPoint3 mPosition
The position of the drawable object. If the coordinate type for this drawable is CT_RELATIVE, the value should be from 1-100% (0.0 to 1.0) and will be relative to the draw-able's parent container.

ofloat mWidth
The physical width of the drawable object in units. If the coordinate type for this drawable is CT_RELATIVE, the value should be from 1-100% (0.0 to 1.0) and will be relative to the drawable's parent container.

ofloat mHeight
The physical height of the drawable object in units. If the coordinate type for this drawable is CT_RELATIVE, the value should be from 1-100% (0.0 to 1.0) and will be relative to the drawable's parent container.

ofloat mDepth
The physical depth of the drawable object in units. If the coordinate type for this drawable is CT_RELATIVE, the value should be from 1-100% (0.0 to 1.0) and will be relative to the drawable's parent container.

oGlmPoint3 mGlPosition
The OpenGL position of this object. These are the OpenGL coordinates. They differ from the mPosition coordinates because this information is used by the rendering method. The mPosition object can be in either an absolute or relative coordinate referencing scheme, where mGlPosition is always absolute world coordinates.

ofloat mGlWidth
The width of this drawable in OpenGL units. This value differs from the mWidth variable in that it is used by the rendering method to place the drawable in OpenGL world coordinates. The mWidth variable can be in absolute or relative coordinates whereas this value is always in absolute world coordinates.

ofloat mGlHeight
The height of this drawable in OpenGL units. This value differs from the mHeight variable in that it is used by the rendering method to place the drawable in OpenGL world coordinates. The mHeight variable can be in absolute or relative coordinates whereas this value is always in absolute world coordinates.

ofloat mGlDepth
The depth of this drawable in OpenGL units. This value differs from the mDepth variable in that it is used by the rendering method to place the drawable in OpenGL world coordinates. The mDepth variable can be in absolute or relative coordinates whereas this value is always in absolute world coordinates.

obool mVisible
The visible status of the object, if true the drawable is visible and will be rendered. If the status if false, the drawable is invisible and will not be rendered to the screen.

oint mDisplayListId
An OpenGL-assigned displaylist id for this object. Defaults to -1 (i.e. no displaylist id).

obool mDisplayListGenerate
A flag to inform render methods of their displaylist's state. false = the diplaylist does not need to be generated true = the displaylist needs to be generated

o GmDrawable()
Standard constructor

ovirtual ~GmDrawable()
Standard destructor

ovirtual void render(GmTypes::RenderOptionType renderOptions)
Renders the current drawable given the rendering options. Some rendering options that can be implemented are 2D/3D rendering, selection mode rendering as well as many other types of rendering styles and methods.

Parameters:
renderOptions - the rendering options to use when rendering the drawable to the screen or image buffer.

ovirtual void setCoordType(GmTypes::CoordinateType coordType)
Sets the coordinate type for this object. The coordinate type can either be CT_ABSOLUTE or CT_RELATIVE. Absolute placement is where the object should be placed in world coordinates, where relative placement is done as a percentage of the parent container. For objects of container classes, the only coordinate type available are relative coordinates.

Parameters:
coordType - the coordinate type to set this drawable object to

ovirtual GmTypes::CoordinateType getCoordType()
Gets the coordinate type for this object. The coordinate type can either be CT_ABSOLUTE or CT_RELATIVE. Absolute placement is where the object should be placed in world coordinates, where relative placement is done as a percentage of the parent container. For objects of container classes, the only coordinate type available are relative coordinates.

Returns:
the coordinate type of this drawable object

ovirtual void setPosition(float x, float y, float z)
Sets the position of the drawable. The top-left most pixel of the rendered image will be located at the given point if the coordinate type is CT_ABSOLUTE. If the coordinate type for this drawable is CT_RELATIVE, the value should be from 0%-100% (0.0 to 1.0) and will be a relative to the drawable's parent container.

Parameters:
- x the X position of the drawable object
- y the Y position of the drawable object
z - the Z position of the drawable object

ovirtual void setPosition(GlmPoint3* point)
Sets the position of the drawable. The top-left most pixel of the rendered image will be located at the given point if the coordinate type is CT_ABSOLUTE. If the coordinate type for this drawable is CT_RELATIVE, the value should be from 0%-100% (0.0 to 1.0) and will be a relative to the drawable's parent container.

Parameters:
point - the point to use as the top-left rendering location of the drawable.

ovirtual GlmPoint3* getPosition()
Gets the position of the drawable object.

Returns:
the position of the drawable object

ovirtual GlmPoint3* getGlPosition()
Gets the OpenGL position of the drawable object.

Returns:
the position of the drawable object

ovirtual void setBaseColor(float r, float g, float b, float a)
Sets the base color of the object.

Parameters:
r - the red value
g - the green value
b - the blue value
a - the alpha value

ovirtual void setBaseColor(GlmColor4* color)
Sets the base color of the object.

Parameters:
color - the base color

ovirtual GlmColor4* getBaseColor()
Gets the base color of the object.

Returns:
the base color of the object, THIS IS A BORROWED POINTER, DO NOT DELETE

ovirtual void setWidth(float width)
Sets the width of the drawable object in units. If the coordinate type for this drawable is CT_RELATIVE, the value should be from 0%-100% (0.0 to 1.0) and will be a relative to the drawable's parent container.

Parameters:
width - the width to set the drawable object's width to.

ovirtual float getWidth()
Gets the width of the drawable object.

Returns:
the width of the drawable object.

ovirtual float getGlWidth()
Gets the OpenGL width of the drawable object.

Returns:
the width of the drawable object.

ovirtual void setHeight(float height)
Sets the height of the drawable object in units. If the coordinate type for this drawable is CT_RELATIVE, the value should be from 0%-100% (0.0 to 1.0) and will be a relative to the drawable's parent container.

Parameters:
height - the height to set the drawable object's height to.

ovirtual float getHeight()
Gets the height of the drawable object.

Returns:
the height of the drawable object.

ovirtual float getGlHeight()
Gets the OpenGL height of the drawable object.

Returns:
the height of the drawable object.

ovirtual void getGlExtents(float& width, float& height)
Gets the ideal extents of the drawable in OpenGL units. This is sometimes used by parent containers to determine the optimal layout strategy by taking each components extents into account.

Parameters:
width - the width of the drawable in OpenGL units
height - the height of the drawable in OpenGL units

ovirtual void setDepth(float depth)
Sets the depth of the drawable object in units. If the coordinate type for this drawable is CT_RELATIVE, the value should be from 0%-100% (0.0 to 1.0) and will be a relative to the drawable's parent container.

Parameters:
depth - the depth to set the drawable object's depth to.

ovirtual float getDepth()
Gets the depth of the drawable object.

Returns:
the depth of the drawable object.

ovirtual float getGlDepth()
Gets the OpenGL depth of the drawable object.

Returns:
the depth of the drawable object.

ovirtual void getMinimumGeometry(float& width, float& height, float& depth)
Get the minimum dimensions of this drawable object. Some widgets, such as those containing text, have minimum display-able sizes to remain useable. If a widget has a minimum use-able size, then it can implement this method to notify any interested containers of this restriction.

Parameters:
width - the minimum display-worthy width of the component
height - the minimum display-worthy height of the component
depth - the minimum display-worthy depth of the component

ovirtual void setVisible(bool visible)
Sets the visibility of the drawable object. If the visibility is set to false, the object is not drawn. If the visibility is set to true, the object will be drawn.

Parameters:
visible - the visibility status to set this drawable object to

ovirtual bool getVisible()
Gets the visibility status of this drawable object. If true, the object should be drawn, if false, the object should not be drawn.

Returns:
the visibility of this drawable object

ovirtual void setAbsoluteGeometry(float x, float y, float z, float width, float height, float depth)
Sets the absolute geometry to use for this drawable object. This method is provided merely for convenience.

Parameters:
- x the absolute X value for this drawable
- y the absolute Y value for this drawable
z - the absolute Z value for this drawable
width - the width of this drawable
height - the height of this drawable
depth - the depth of this drawable

ovirtual void setRelativeGeometry(float x, float y, float z, float width, float height, float depth)
Sets the relative geometry to use for this drawable object. This method is provided merely for convenience.

Parameters:
- x the absolute X value for this drawable
- y the absolute Y value for this drawable
z - the absolute Z value for this drawable
width - the width of this drawable
height - the height of this drawable
depth - the depth of this drawable

ovirtual void setRelativeGeometry(float x, float y, float width, float height)
Sets the relative geometry to use for this drawable object. This method is provided merely for convenience. This method should be used for 2d objects that will be in a container that uses a layout manager.

Parameters:
- x the absolute X value for this drawable
- y the absolute Y value for this drawable
width - the width of this drawable
height - the height of this drawable

ovirtual void applyLayout(float minX, float minY, float minZ, float maxX, float maxY, float maxZ)
Repositions and resizes this component based on parameters passed into the method. These parameters are usually passed in by the parent class.

Parameters:
minX - the starting X position of the constraint volume
minY - the starting Y position of the constraint volume
minZ - the starting Z position of the constraint volume
maxX - the ending X position of the constraint volume
maxY - the ending X position of the constraint volume
maxZ - the ending Z position of the constraint volume

ovirtual void render2d(GmTypes::RenderOptionType renderOptions)
Renders this drawable to a 2D image buffer.

Parameters:
renderOptions - the render options to use when rendering the drawable.

ovirtual void render2dSelect(GmTypes::RenderOptionType renderOptions)
Renders this drawable to a selection buffer.

Parameters:
renderOptions - the render options to use when rendering the drawable.

ovirtual void setDisplayListId(int id)
Sets the displaylist id for this component. Child objects then have the choice of creating/using their own displaylist.

Parameters:
id - the OpenGL assigned displaylist id

ovirtual int getDisplayListId()
Gets the current displaylist id for the object. If one exists, it is returned and the child object use it for rendering. If not, -1 is returned.

Returns:
the displaylist id if it exists, -1 if not

ovirtual void setDisplayListGenerate(bool generate)
Sets the flag which informs the render functions that their display list needs to be generated.

Parameters:
generate - true to generate, false to not

ovirtual bool getDisplayListGenerate()
Gets the flag which informs the render functions that their display list needs to be generated.

Returns:
true if generation needed, false if not


Direct child classes:
GmAnimatedWidget

Alphabetic index HTML hierarchy of classes or Java



This page was generated with the help of DOC++.