29#ifndef __OverlayElement_H__
30#define __OverlayElement_H__
35#include "OgreUTFString.h"
49#if OGRE_UNICODE_SUPPORT
51# define OGRE_DEREF_DISPLAYSTRING_ITERATOR(it) it.getCharacter()
54# define OGRE_DEREF_DISPLAYSTRING_ITERATOR(it) *it
357 bool debugRenderables =
false);
#define _OgreOverlayExport
A viewpoint from which the scene will be rendered.
Class representing colour.
Class encapsulating a standard 4x4 homogeneous matrix.
A 2D element which contains other OverlayElement instances.
Command object for OverlayElement - see ParamCommand.
Command object for OverlayElement - see ParamCommand.
Command object for OverlayElement - see ParamCommand.
Command object for OverlayElement - see ParamCommand.
Command object for OverlayElement - see ParamCommand.
Command object for OverlayElement - see ParamCommand.
Command object for OverlayElement - see ParamCommand.
Command object for OverlayElement - see ParamCommand.
Command object for OverlayElement - see ParamCommand.
Command object for OverlayElement - see ParamCommand.
static OverlayElementCommands::CmdMetricsMode msMetricsModeCmd
void _setPosition(Real left, Real top)
Sets the left and top of this element in relation to the screen (where 1.0 = screen width)
const OverlayElement * getSourceTemplate() const
Returns the SourceTemplate for this element.
static OverlayElementCommands::CmdTop msTopCmd
virtual bool isCloneable() const
GuiVerticalAlignment mVertAlign
bool mEnabled
Is element enabled?
virtual OverlayElement * clone(const String &instanceName)
virtual Real _getDerivedTop(void)
Gets the 'top' position as derived from own left and that of parents.
Real getWidth(void) const
Gets the width of this element in relation to the screen (where 1.0 = screen width)
virtual void setEnabled(bool b)
static OverlayElementCommands::CmdVerticalAlign msVerticalAlignCmd
virtual const String & getTypeName(void) const =0
Gets the type name of the element.
void _setTop(Real top)
Sets the top of this element in relation to the screen (where 1.0 = screen width)
void setPosition(Real left, Real top)
Sets the position of the top-left corner of the element, relative to the screen size (1....
virtual void updateTextureGeometry(void)=0
Internal method which is triggered when the UVs of the element get updated, meaning the element shoul...
Real getHeight(void) const
Gets the height of this element in relation to the screen (where 1.0 = screen height)
virtual GuiMetricsMode getMetricsMode(void) const
Retrieves the current settings of how the element metrics are interpreted.
virtual void _updateRenderQueue(RenderQueue *queue)
Internal method to put the contents onto the render queue.
static OverlayElementCommands::CmdCaption msCaptionCmd
virtual void setColour(const ColourValue &col)
Sets the colour on elements that support it.
const MaterialPtr & getMaterial(void) const
See Renderable.
virtual void _notifyParent(OverlayContainer *parent, Overlay *overlay)
Internal method for notifying the GUI element of it's parent and ultimate overlay.
virtual void _positionsOutOfDate(void)
Tell the object to recalculate.
virtual void hide(void)
Hides this element if it was visible.
static OverlayElementCommands::CmdVisible msVisibleCmd
virtual void setHorizontalAlignment(GuiHorizontalAlignment gha)
Sets the horizontal origin for this element.
OverlayContainer * mParent
Parent pointer.
const LightList & getLights(void) const
Gets a list of lights, ordered relative to how close they are to this renderable.
void setTop(Real Top)
Sets the top of this element in relation to the screen (where 0 = top, 1.0 = bottom)
void setDimensions(Real width, Real height)
Sets the dimensions of this element in relation to the screen (1.0 = screen width/height).
virtual const ColourValue & getColour(void) const
Gets the colour for this element.
void setWidth(Real width)
Sets the width of this element in relation to the screen (where 1.0 = screen width)
virtual void setCloneable(bool c)
void _setLeft(Real left)
Sets the left of this element in relation to the screen (where 1.0 = screen width)
GuiMetricsMode mMetricsMode
virtual void initialise(void)=0
Initialise gui element.
bool isVisible(void) const
Returns whether or not the element is visible.
void _setWidth(Real width)
Sets the width of this element in relation to the screen (where 1.0 = screen width)
virtual void _notifyViewport()
Internal method to notify the element when the viewport of parent overlay has changed.
static OverlayElementCommands::CmdMaterial msMaterialCmd
OverlayElement * mSourceTemplate
Used to see if this element is created from a Template.
Real _getWidth(void) const
Gets the width of this element in relation to the screen (where 1.0 = screen width)
virtual ushort _notifyZOrder(ushort newZOrder)
Internal method to notify the element when Z-order of parent overlay has changed.
bool mGeomPositionsOutOfDate
Flag indicating if the vertex positions need recalculating.
void _setDimensions(Real width, Real height)
Sets the width and height of this element in relation to the screen (where 1.0 = screen width)
Real _getTop(void) const
Gets the top of this element in relation to the screen (where 0 = far left, 1.0 = far right)
Matrix4 mXForm
World transforms.
virtual bool isKeyEnabled() const
ushort mZOrder
Zorder for when sending to render queue.
virtual ~OverlayElement()
static OverlayElementCommands::CmdHorizontalAlign msHorizontalAlignCmd
virtual const String & getMaterialName(void) const
Gets the name of the material this element uses.
virtual void show(void)
Shows this element if it was hidden.
void setHeight(Real height)
Sets the height of this element in relation to the screen (where 1.0 = screen height)
static OverlayElementCommands::CmdWidth msWidthCmd
void _setParent(OverlayContainer *parent)
virtual void _getClippingRegion(RealRect &clippingRegion)
Gets the clipping region of the element.
virtual void _updateFromParent(void)
Updates this elements transform based on it's parent.
bool mInitialised
Is element initialised?
virtual Real _getRelativeHeight(void)
Gets the 'height' as derived from own height and metrics mode.
virtual bool contains(Real x, Real y) const
Returns true if xy is within the constraints of the component.
void getWorldTransforms(Matrix4 *xform) const
See Renderable.
virtual void setMetricsMode(GuiMetricsMode gmm)
Tells this element how to interpret the position and dimension values it is given.
static OverlayElementCommands::CmdLeft msLeftCmd
Real getLeft(void) const
Gets the left of this element in relation to the screen (where 0 = far left, 1.0 = far right)
virtual void updatePositionGeometry(void)=0
Internal method which is triggered when the positions of the element get updated, meaning the element...
virtual OverlayElement * findElementAt(Real x, Real y)
Returns true if xy is within the constraints of the component.
virtual Real _getDerivedLeft(void)
Gets the 'left' position as derived from own left and that of parents.
virtual void setCaption(const DisplayString &text)
Sets the caption on elements that support it.
virtual GuiVerticalAlignment getVerticalAlignment(void) const
Gets the vertical alignment for this element.
virtual void _update(void)
Internal method to update the element based on transforms applied.
Real _getHeight(void) const
Gets the height of this element in relation to the screen (where 1.0 = screen height)
bool mGeomUVsOutOfDate
Flag indicating if the vertex uvs need recalculating.
virtual void copyFromTemplate(OverlayElement *templateOverlay)
OverlayContainer * getParent()
Returns the parent container.
ushort getZOrder() const
Returns the zOrder of the element.
virtual Real _getRelativeWidth(void)
Gets the 'width' as derived from own width and metrics mode.
virtual void setVerticalAlignment(GuiVerticalAlignment gva)
Sets the vertical origin for this element.
Real getSquaredViewDepth(const Camera *cam) const
Overridden from Renderable.
virtual GuiHorizontalAlignment getHorizontalAlignment(void) const
Gets the horizontal alignment for this element.
OverlayElement(const String &name)
Constructor: do not call direct, use OverlayManager::createElement.
virtual void setMaterialName(const String &matName)
Sets the name of the material this element will use.
const String & getName(void) const
Gets the name of this overlay.
void setLeft(Real left)
Sets the left of this element in relation to the screen (where 0 = far left, 1.0 = far right)
Real getTop(void) const
Gets the top of this element in relation to the screen (where 0 = top, 1.0 = bottom)
virtual void addBaseParameters(void)
Internal method for setting up the basic parameter definitions for a subclass.
virtual void _notifyWorldTransforms(const Matrix4 &xform)
Internal method to notify the element when it's world transform of parent overlay has changed.
void visitRenderables(Renderable::Visitor *visitor, bool debugRenderables=false)
Method to allow a caller to abstractly iterate over the Renderable instances that this MovableObject ...
GuiHorizontalAlignment mHorzAlign
Overlay * mOverlay
Overlay attached to.
virtual const DisplayString & getCaption(void) const
Gets the caption for this element.
static OverlayElementCommands::CmdHeight msHeightCmd
void _setHeight(Real height)
Sets the height of this element in relation to the screen (where 1.0 = screen width)
virtual bool isContainer() const
returns false as this class is not a container type
Real _getLeft(void) const
Gets the left of this element in relation to the screen (where 0 = far left, 1.0 = far right)
Represents a layer which is rendered on top of the 'normal' scene contents.
Class to manage the scene object rendering queue.
Visitor object that can be used to iterate over a collection of Renderable instances abstractly.
TRect< Real > RealRect
Structure used to define a rectangle in a 2-D floating point space, subject to double / single floati...
HashedVector< Light * > LightList
GuiHorizontalAlignment
Enum describing where '0' is in relation to the parent in the horizontal dimension.
GuiMetricsMode
Enum describing how the position / size of an element is to be recorded.
GuiVerticalAlignment
Enum describing where '0' is in relation to the parent in the vertical dimension.
@ GMM_PIXELS
Positions & sizes are in absolute pixels.
@ GMM_RELATIVE_ASPECT_ADJUSTED
Positions & sizes are in virtual pixels.
@ GMM_RELATIVE
'left', 'top', 'height' and 'width' are parametrics from 0.0 to 1.0
SharedPtr< Material > MaterialPtr
float Real
Software floating point type.
SceneObjAllocatedObject OverlayAlloc