Spinning Topp Logo BlackTopp Studios
inc
Public Member Functions | Static Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Mezzanine::UI::RenderLayer Class Referenceabstract

This is the base class for the types of layers that can be added to a renderable. More...

#include <renderlayer.h>

+ Inheritance diagram for Mezzanine::UI::RenderLayer:
+ Collaboration diagram for Mezzanine::UI::RenderLayer:

Public Member Functions

virtual ~RenderLayer ()
 Class destructor.
 
virtual void _MarkDirty ()
 Marks this renderable as well as all parent objects as dirty. More...
 
virtual void _UpdateIndex (const Whole Index)
 Notifies this RenderLayer that it's index in the parent QuadRenderable has been updated. More...
 
virtual Rect GetAreaRect () const
 Gets a rect containing the actual position and size of this layer. More...
 
virtual String GetDerivedSerializableName () const
 Gets the most derived serializable name of this Renderable. More...
 
virtual Whole GetIndex () const
 Gets the index position of this RenderLayer in it's parent. More...
 
virtual UI::RenderLayerType GetLayerType () const =0
 Gets the type of render layer this is. More...
 
virtual QuadRenderableGetParent () const
 Gets the parent of this render layer. More...
 
virtual Real GetRotationDegrees () const
 Gets the current rotation applied to this renderable in degrees. More...
 
virtual Real GetRotationRadians () const
 Gets the current rotation applied to this renderable in radians. More...
 
virtual Vector2 GetScale () const
 Gets the scaling currently applied to this render layer. More...
 
virtual ScreenGetScreen () const
 Gets the screen the parent renderable is being rendered on. More...
 
virtual Boole IsImageLayer () const
 Gets whether or not this is an ImageLayer. More...
 
virtual Boole IsLineLayer () const
 Gets whether or not this is an LineLayer. More...
 
virtual Boole IsMultiImageLayer () const
 Gets whether or not this is a MultiImageLayer. More...
 
virtual Boole IsMultiLineTextLayer () const
 Gets whether or not this is a MultiLineTextLayer. More...
 
virtual Boole IsSingleImageLayer () const
 Gets whether or not this is a SingleImageLayer. More...
 
virtual Boole IsSingleLineTextLayer () const
 Gets whether or not this is a SingleLineTextLayer. More...
 
virtual Boole IsTextLayer () const
 Gets whether or not this is a TextLayer. More...
 
virtual void NotifyActive ()
 Notifies this RenderLayer that the group this layer belongs to has become the active group. More...
 
virtual void NotifyInactive ()
 Notifies this RenderLayer that the group this layer belongs to is no longer the active group. More...
 
virtual void ProtoDeSerializeProperties (const XML::Node &SelfRoot)
 Take the data stored in an XML Node and overwrite the properties of this object with it. More...
 
virtual void ProtoSerializeProperties (XML::Node &SelfRoot) const
 Convert the properties of this class to an XML::Node ready for serialization. More...
 
virtual void SetRotationDegrees (const Real &Degrees)
 Sets the rotation to be applied to this renderable. More...
 
virtual void SetRotationRadians (const Real &Radians)
 Sets the rotation to be applied to this renderable. More...
 
virtual void SetScale (const Vector2 &Scaling)
 Sets the scaling to be applied to this render layer. More...
 
- Public Member Functions inherited from Mezzanine::UI::SimpleRenderer
void _AppendVertices (std::vector< VertexData > &Vertices)
 Appends the vertices of this renderable to another vector. More...
 
Boole _IsDirty ()
 Gets whether or not this renderer is dirty. More...
 
void _Redraw (Boole Force)
 Regenerates the verticies in this renderable. More...
 
virtual String GetPrimaryAtlas () const
 Gets the currently set primary atlas. More...
 
virtual void ProtoDeSerialize (const XML::Node &SelfRoot)
 Take the data stored in an XML Node and overwrite this object with it. More...
 
virtual void ProtoSerialize (XML::Node &ParentNode) const
 Convert this class to an XML::Node ready for serialization. More...
 
virtual void SetPrimaryAtlas (const String &Atlas)
 Sets the Atlas to be assumed when one isn't provided for atlas related tasks. More...
 

Static Public Member Functions

static String GetSerializableName ()
 Get the name of the the XML tag the Renderable class will leave behind as its instances are serialized. More...
 
- Static Public Member Functions inherited from Mezzanine::UI::QuadRenderer
static String GetSerializableName ()
 Get the name of the the XML tag the Renderable class will leave behind as its instances are serialized. More...
 
- Static Public Member Functions inherited from Mezzanine::UI::SimpleRenderer
static String GetSerializableName ()
 Get the name of the the XML tag the Renderable class will leave behind as its instances are serialized. More...
 

Protected Member Functions

 RenderLayer (QuadRenderable *ParentRenderable)
 Class constructor. More...
 
virtual void RotationTransform (Vector2 &Point, const Vector2 &RotationCenter)
 Applies rotation to a point in 2D space. More...
 
virtual void RotationTransform (Vector2 &TopLeft, Vector2 &TopRight, Vector2 &BottomLeft, Vector2 &BottomRight)
 Applies rotation to a quad in 2D space. More...
 
virtual void RotationTransform (Vector2 &TopLeft, Vector2 &TopRight, Vector2 &BottomLeft, Vector2 &BottomRight, const Vector2 &RotationCenter)
 Applies rotation to a quad in 2D space. More...
 
virtual void RotationTransform (Vector2 *RotRect)
 Applies rotation to a quad in 2D space. More...
 
virtual void RotationTransform (Vector2 *RotRect, const Vector2 &RotationCenter)
 Applies rotation to a quad in 2D space. More...
 
- Protected Member Functions inherited from Mezzanine::UI::QuadRenderer
 QuadRenderer ()
 Class constructor.
 
virtual ~QuadRenderer ()
 Class destructor.
 
virtual void PushQuad (Vector2 *Positions, Vector2 *UVs, ColourValue *Colours, const String &Atlas)
 Pushes vertex information for a quad to a vector. Equivalent to calling "PushTriangle" twice.
 
virtual void PushQuad2 (Vector2 *Positions, Vector2 *UVs, const ColourValue &Colour, const String &Atlas)
 Pushes vertex information for a quad to a vector. Equivalent to calling "PushTriangle" twice.
 
- Protected Member Functions inherited from Mezzanine::UI::SimpleRenderer
 SimpleRenderer ()
 Class constructor.
 
virtual ~SimpleRenderer ()
 Class destructor.
 
virtual void PushTriangle (const Vector2 &A, const Vector2 &B, const Vector2 &C, const Vector2 &UV, const ColourValue &Colour, const String &Atlas)
 Pushes vertex information for a triangle to a vector. Equivalent to calling "PushVertex" three times. More...
 
virtual void PushVertex (const Real &X, const Real &Y, const Vector2 &UV, const ColourValue &Colour, const String &Atlas)
 Collects all the relevant information for a single vertex and pushes it to a vector. More...
 
virtual void RedrawImpl (Boole Force)=0
 Provides the class specific implementation for regenerating vertices for this renderable. More...
 

Protected Attributes

Whole IndexID
 Stores the index of this RenderLayer in it's parent QuadRenderable. More...
 
QuadRenderableParent
 A pointer to the parent of this RenderLayer. More...
 
Real RotAngle
 The amount of rotation to be applied to this RenderLayer in radians. More...
 
Vector2 Scale
 The scaling applied to this RenderLayer. More...
 
- Protected Attributes inherited from Mezzanine::UI::SimpleRenderer
Boole Dirty
 This determines whether or not the vertices in this renderer need to be refreshed. More...
 
String PriAtlas
 This contains the name of the atlas that will be used as default when one isn't specified. More...
 
std::vector< VertexDataRenderVertices
 This is a container storing all the vertices generated by this renderer. More...
 

Detailed Description

This is the base class for the types of layers that can be added to a renderable.

Definition at line 58 of file renderlayer.h.

Constructor & Destructor Documentation

Mezzanine::UI::RenderLayer::RenderLayer ( QuadRenderable ParentRenderable)
protected

Class constructor.

Parameters
ParentRenderableThe renderable that created this layer.

Definition at line 52 of file renderlayer.cpp.

Member Function Documentation

void Mezzanine::UI::RenderLayer::_MarkDirty ( )
virtual

Marks this renderable as well as all parent objects as dirty.

Implements Mezzanine::UI::SimpleRenderer.

Definition at line 272 of file renderlayer.cpp.

void Mezzanine::UI::RenderLayer::_UpdateIndex ( const Whole  Index)
virtual

Notifies this RenderLayer that it's index in the parent QuadRenderable has been updated.

Parameters
IndexThe new index being given to this RenderLayer.

Definition at line 278 of file renderlayer.cpp.

Rect Mezzanine::UI::RenderLayer::GetAreaRect ( ) const
virtual

Gets a rect containing the actual position and size of this layer.

Note
This Rect does have scaling applied, but not any set rotation of the layer.
Returns
Returns a Rect containing the area of this layer in pixels.

Definition at line 144 of file renderlayer.cpp.

String Mezzanine::UI::RenderLayer::GetDerivedSerializableName ( ) const
virtual

Gets the most derived serializable name of this Renderable.

Note
When creating a new Renderable class verify this method has a valid return for it in order for serialization to work properly.
Returns
Returns the name of the XML tag from the most derived class of "this".

Reimplemented from Mezzanine::UI::QuadRenderer.

Reimplemented in Mezzanine::UI::TextLayer, Mezzanine::UI::MultiImageLayer, Mezzanine::UI::ImageLayer, Mezzanine::UI::SingleImageLayer, Mezzanine::UI::SingleLineTextLayer, and Mezzanine::UI::MultiLineTextLayer.

Definition at line 259 of file renderlayer.cpp.

Whole Mezzanine::UI::RenderLayer::GetIndex ( ) const
virtual

Gets the index position of this RenderLayer in it's parent.

Returns
Returns a Whole representing the index position of this RenderLayer in the parent QuadRenderable.

Definition at line 127 of file renderlayer.cpp.

virtual UI::RenderLayerType Mezzanine::UI::RenderLayer::GetLayerType ( ) const
pure virtual

Gets the type of render layer this is.

Returns
Returns a RenderLayerType describing the type of layer this is.

Implemented in Mezzanine::UI::MultiImageLayer, Mezzanine::UI::SingleLineTextLayer, Mezzanine::UI::MultiLineTextLayer, and Mezzanine::UI::SingleImageLayer.

QuadRenderable * Mezzanine::UI::RenderLayer::GetParent ( ) const
virtual

Gets the parent of this render layer.

Returns
Returns a pointer to the parent of this render layer.

Definition at line 210 of file renderlayer.cpp.

Real Mezzanine::UI::RenderLayer::GetRotationDegrees ( ) const
virtual

Gets the current rotation applied to this renderable in degrees.

Returns
Returns a Real with the current rotation.

Definition at line 201 of file renderlayer.cpp.

Real Mezzanine::UI::RenderLayer::GetRotationRadians ( ) const
virtual

Gets the current rotation applied to this renderable in radians.

Returns
Returns a Real with the current rotation.

Definition at line 204 of file renderlayer.cpp.

Vector2 Mezzanine::UI::RenderLayer::GetScale ( ) const
virtual

Gets the scaling currently applied to this render layer.

Returns
Returns a Vector2 containing the X and Y scaling applied to this render layer.

Definition at line 160 of file renderlayer.cpp.

Screen * Mezzanine::UI::RenderLayer::GetScreen ( ) const
virtual

Gets the screen the parent renderable is being rendered on.

Returns
Returns a pointer to the screen this layer belongs to.

Definition at line 213 of file renderlayer.cpp.

String Mezzanine::UI::RenderLayer::GetSerializableName ( )
static

Get the name of the the XML tag the Renderable class will leave behind as its instances are serialized.

Returns
A string containing the name of this class.

Definition at line 264 of file renderlayer.cpp.

Boole Mezzanine::UI::RenderLayer::IsImageLayer ( ) const
virtual

Gets whether or not this is an ImageLayer.

Returns
Returns true if this is an ImageLayer, false otherwise.

Definition at line 168 of file renderlayer.cpp.

Boole Mezzanine::UI::RenderLayer::IsLineLayer ( ) const
virtual

Gets whether or not this is an LineLayer.

Returns
Returns true if this is an LineLayer, false otherwise.

Definition at line 165 of file renderlayer.cpp.

Boole Mezzanine::UI::RenderLayer::IsMultiImageLayer ( ) const
virtual

Gets whether or not this is a MultiImageLayer.

Returns
Returns true if this is a MultiImageLayer, false otherwise.

Definition at line 174 of file renderlayer.cpp.

Boole Mezzanine::UI::RenderLayer::IsMultiLineTextLayer ( ) const
virtual

Gets whether or not this is a MultiLineTextLayer.

Returns
Returns true if this is a MultiLineTextLayer, false otherwise.

Definition at line 183 of file renderlayer.cpp.

Boole Mezzanine::UI::RenderLayer::IsSingleImageLayer ( ) const
virtual

Gets whether or not this is a SingleImageLayer.

Returns
Returns true if this is a SingleImageLayer, false otherwise.

Definition at line 171 of file renderlayer.cpp.

Boole Mezzanine::UI::RenderLayer::IsSingleLineTextLayer ( ) const
virtual

Gets whether or not this is a SingleLineTextLayer.

Returns
Returns true if this is a SingleLineTextLayer, false otherwise.

Definition at line 180 of file renderlayer.cpp.

Boole Mezzanine::UI::RenderLayer::IsTextLayer ( ) const
virtual

Gets whether or not this is a TextLayer.

Returns
Returns true if this is a TextLayer, false otherwise.

Definition at line 177 of file renderlayer.cpp.

void Mezzanine::UI::RenderLayer::NotifyActive ( )
virtual

Notifies this RenderLayer that the group this layer belongs to has become the active group.

Remarks
This shouldn't need to ever be called manually and is automatically called when a QuadRenderable sets the parent group as the active RenderLayerGroup. This method exists to reset the state of a layer (or group of layers) if necessary to achieve the visual effect desired.
Todo:
As settings are added that need may need to be modified, this method should be updated. Prime candidate for this is Animations.

Definition at line 132 of file renderlayer.cpp.

void Mezzanine::UI::RenderLayer::NotifyInactive ( )
virtual

Notifies this RenderLayer that the group this layer belongs to is no longer the active group.

Remarks
This shouldn't need to ever be called manually and is automatically called when a QuadRenderable removes the parent group as the active RenderLayerGroup. This method exists to reset the state of a layer (or group of layers) if necessary to achieve the visual effect desired.
Todo:
As settings are added that need may need to be modified, this method should be updated. Prime candidate for this is Animations.

Definition at line 138 of file renderlayer.cpp.

void Mezzanine::UI::RenderLayer::ProtoDeSerializeProperties ( const XML::Node SelfRoot)
virtual

Take the data stored in an XML Node and overwrite the properties of this object with it.

Parameters
SelfRootAn XML::Node containing the data to populate this class with.

Reimplemented from Mezzanine::UI::QuadRenderer.

Reimplemented in Mezzanine::UI::TextLayer, Mezzanine::UI::MultiImageLayer, Mezzanine::UI::ImageLayer, Mezzanine::UI::SingleImageLayer, Mezzanine::UI::SingleLineTextLayer, and Mezzanine::UI::MultiLineTextLayer.

Definition at line 236 of file renderlayer.cpp.

void Mezzanine::UI::RenderLayer::ProtoSerializeProperties ( XML::Node SelfRoot) const
virtual

Convert the properties of this class to an XML::Node ready for serialization.

Parameters
SelfRootThe root node containing all the serialized data for this instance.

Reimplemented from Mezzanine::UI::QuadRenderer.

Reimplemented in Mezzanine::UI::TextLayer, Mezzanine::UI::MultiImageLayer, Mezzanine::UI::ImageLayer, Mezzanine::UI::SingleImageLayer, Mezzanine::UI::SingleLineTextLayer, and Mezzanine::UI::MultiLineTextLayer.

Definition at line 219 of file renderlayer.cpp.

void Mezzanine::UI::RenderLayer::RotationTransform ( Vector2 Point,
const Vector2 RotationCenter 
)
protectedvirtual

Applies rotation to a point in 2D space.

Parameters
PointA point in 2D space that will be rotated around another point.
RotationCenterThe point that will be rotated around.

Definition at line 64 of file renderlayer.cpp.

void Mezzanine::UI::RenderLayer::RotationTransform ( Vector2 TopLeft,
Vector2 TopRight,
Vector2 BottomLeft,
Vector2 BottomRight 
)
protectedvirtual

Applies rotation to a quad in 2D space.

Note
This overload will use the center of the quad defined by the 4 points as the point to be rotated around.
Parameters
TopLeftThe top left corner of the quad to be rotated.
TopRightThe top right corner of the quad to be rotated.
BottomLeftThe bottom left corner of the quad to be rotated.
BottomRightThe bottom right corner of the quad to be rotated.

Definition at line 81 of file renderlayer.cpp.

void Mezzanine::UI::RenderLayer::RotationTransform ( Vector2 TopLeft,
Vector2 TopRight,
Vector2 BottomLeft,
Vector2 BottomRight,
const Vector2 RotationCenter 
)
protectedvirtual

Applies rotation to a quad in 2D space.

Parameters
TopLeftThe top left corner of the quad to be rotated.
TopRightThe top right corner of the quad to be rotated.
BottomLeftThe bottom left corner of the quad to be rotated.
BottomRightThe bottom right corner of the quad to be rotated.
RotationCenterThe point that will be rotated around.

Definition at line 92 of file renderlayer.cpp.

void Mezzanine::UI::RenderLayer::RotationTransform ( Vector2 RotRect)
protectedvirtual

Applies rotation to a quad in 2D space.

Note
This overload will use the center of the quad defined by the 4 points as the point to be rotated around.
Parameters
RotRectAn array of 4 Vector2s storing the quad corners to be rotated.

Definition at line 102 of file renderlayer.cpp.

void Mezzanine::UI::RenderLayer::RotationTransform ( Vector2 RotRect,
const Vector2 RotationCenter 
)
protectedvirtual

Applies rotation to a quad in 2D space.

Parameters
RotRectAn array of 4 Vector2s storing the quad corners to be rotated.
RotationCenterThe point that will be rotated around.

Definition at line 114 of file renderlayer.cpp.

void Mezzanine::UI::RenderLayer::SetRotationDegrees ( const Real Degrees)
virtual

Sets the rotation to be applied to this renderable.

Parameters
DegreesThe angle of rotation in degrees.

Definition at line 189 of file renderlayer.cpp.

void Mezzanine::UI::RenderLayer::SetRotationRadians ( const Real Radians)
virtual

Sets the rotation to be applied to this renderable.

Parameters
RadiansThe angle of rotation in radians.

Definition at line 195 of file renderlayer.cpp.

void Mezzanine::UI::RenderLayer::SetScale ( const Vector2 Scaling)
virtual

Sets the scaling to be applied to this render layer.

Parameters
ScalingA Vector2 representing the X and Y scaling to be applied to this render layer.

Definition at line 151 of file renderlayer.cpp.

Member Data Documentation

Whole Mezzanine::UI::RenderLayer::IndexID
protected

Stores the index of this RenderLayer in it's parent QuadRenderable.

Definition at line 70 of file renderlayer.h.

QuadRenderable* Mezzanine::UI::RenderLayer::Parent
protected

A pointer to the parent of this RenderLayer.

Definition at line 67 of file renderlayer.h.

Real Mezzanine::UI::RenderLayer::RotAngle
protected

The amount of rotation to be applied to this RenderLayer in radians.

Definition at line 73 of file renderlayer.h.

Vector2 Mezzanine::UI::RenderLayer::Scale
protected

The scaling applied to this RenderLayer.

Definition at line 64 of file renderlayer.h.


The documentation for this class was generated from the following files: