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

This is an image layer that supports rendering of multiple images within it's space. More...

#include <multiimagelayer.h>

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

Public Types

typedef ImageDataContainer::const_iterator ConstImageDataIterator
 ConstIterator type for image metadata being stored by this class.
 
typedef std::vector< MultiImageDataImageDataContainer
 Container type for the image metadata storage in this class.
 
typedef ImageDataContainer::iterator ImageDataIterator
 Iterator type for image metadata being stored by this class.
 

Public Member Functions

 MultiImageLayer (QuadRenderable *ParentRenderable)
 Class constructor. More...
 
virtual ~MultiImageLayer ()
 Class destructor.
 
virtual const ColourValueGetColour (const Whole Index, const UI::QuadCorner Corner) const
 Gets the colour of a corner of this layer. More...
 
virtual String GetDerivedSerializableName () const
 Gets the most derived serializable name of this Renderable. More...
 
virtual const UnifiedVec2GetImagePosition (const Whole Index) const
 Gets the Unified position of the image at the specified index. More...
 
virtual const UnifiedRectGetImageRect (const Whole Index) const
 Gets the Unified position and size of the image at the specified index. More...
 
virtual const UnifiedVec2GetImageSize (const Whole Index) const
 Gets the Unified size of the image at the specified index. More...
 
virtual UI::RenderLayerType GetLayerType () const
 Gets the type of render layer this is. More...
 
virtual MultiImageDataGetMultiImageData (const Whole Index)
 Gets a MultiImageData in this layer by index. More...
 
virtual const MultiImageDataGetMultiImageData (const Whole Index) const
 Gets a MultiImageData in this layer by index. More...
 
virtual Whole GetNumMultiImageData () const
 Gets the number of MultiImageData instances currently in this layer. More...
 
virtual Boole IsCompletelyTransparent (const Whole Index) const
 Gets whether or not this layer is entirely transparent. 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 ReserveMultiImageData (const Whole NumImages)
 Creates space for the specified number of MultiImageData instances to be populated. More...
 
virtual void SetColour (const Whole Index, const ColourValue &Colour)
 Sets the colour of the layer. More...
 
virtual void SetColour (const Whole Index, const UI::QuadCorner Corner, const ColourValue &Colour)
 Sets the colour for one corner the layer. More...
 
virtual void SetGradient (const Whole Index, const UI::Gradient Grad, const ColourValue &ColourA, const ColourValue &ColourB)
 Sets a colour gradient to be applied to this layer. More...
 
virtual void SetImagePosition (const Whole Index, const UnifiedVec2 &Position)
 Sets the Unified position of the image at the specified index. More...
 
virtual void SetImageRect (const Whole Index, const UnifiedRect &Trans)
 Sets the Unified position and size of the image at the specified index. More...
 
virtual void SetImageSize (const Whole Index, const UnifiedVec2 &Size)
 Sets the Unified size of the image at the specified index. More...
 
virtual void SetSprite (const Whole Index, Sprite *NewSprite)
 Sets the fill image(if provided in the atlas) of the layer. More...
 
virtual void SetSprite (const Whole Index, const String &SpriteName)
 Sets the fill image(if provided in the atlas) of the layer. More...
 
virtual void SetSprite (const Whole Index, const String &SpriteName, const String &Atlas)
 Sets the fill image(if provided in the atlas) of the layer. More...
 
- Public Member Functions inherited from Mezzanine::UI::ImageLayer
 ImageLayer (QuadRenderable *ParentRenderable)
 Class constructor. More...
 
virtual ~ImageLayer ()
 Class destructor.
 
virtual const ColourValueGetBorderColour (const UI::Border Side) const
 Gets the colour of a border on this renderable. More...
 
virtual Real GetBorderWidth () const
 Gets the border width of this renderable. More...
 
virtual void NoBorder ()
 Disables any border set on this renderable if one is currently set.
 
virtual void SetBorder (const Real Width, const ColourValue &Colour)
 Sets all parameters for enabling a border. More...
 
virtual void SetBorder (const Real Width, const ColourValue &North, const ColourValue &South, const ColourValue &East, const ColourValue &West)
 Sets all parameters for enabling a border. More...
 
virtual void SetBorderColour (const ColourValue &Colour)
 Sets the colour of the border for this renderable. More...
 
virtual void SetBorderColour (const UI::Border Side, const ColourValue &Colour)
 Sets the colour of one side of the border for this renderable. More...
 
virtual void SetBorderWidth (const Real Width)
 Sets the width of the border for this renderable. More...
 
- Public Member Functions inherited from Mezzanine::UI::RenderLayer
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 Whole GetIndex () const
 Gets the index position of this RenderLayer in it's parent. 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 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::ImageLayer
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::RenderLayer
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

virtual void RedrawImpl (Boole Force)
 Provides the class specific implementation for regenerating vertices for this renderable. More...
 
- Protected Member Functions inherited from Mezzanine::UI::ImageLayer
void DrawBorder (const Vector2 *InnerRect, const Vector2 *OuterRect)
 Draws the border, if any is set. More...
 
void DrawFill (const Vector2 *FillRect, const Sprite *FillSprite, const ColourValue *FillColours)
 Draws the main rectangle. More...
 
- Protected Member Functions inherited from Mezzanine::UI::RenderLayer
 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...
 

Protected Attributes

ImageDataContainer LayerImages
 Container storing all of the images/sprites that will be rendered by this layer. More...
 
- Protected Attributes inherited from Mezzanine::UI::ImageLayer
ColourValue BorderColours [4]
 An array of colours to be used for each corner section of the border being rendered with this layer. More...
 
Real BorderWidth
 The width of the border to render around this layer in pixels. More...
 
- Protected Attributes inherited from Mezzanine::UI::RenderLayer
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 an image layer that supports rendering of multiple images within it's space.

Definition at line 94 of file multiimagelayer.h.

Constructor & Destructor Documentation

Mezzanine::UI::MultiImageLayer::MultiImageLayer ( QuadRenderable ParentRenderable)

Class constructor.

Parameters
ParentRenderableThe renderable that created this layer.

Definition at line 142 of file multiimagelayer.cpp.

Member Function Documentation

const ColourValue & Mezzanine::UI::MultiImageLayer::GetColour ( const Whole  Index,
const UI::QuadCorner  Corner 
) const
virtual

Gets the colour of a corner of this layer.

Parameters
IndexThe index of the MultiImageData to update.
CornerThe corner to get the colour for.
Returns
Returns the colour of the specified corner.

Definition at line 266 of file multiimagelayer.cpp.

String Mezzanine::UI::MultiImageLayer::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::ImageLayer.

Definition at line 467 of file multiimagelayer.cpp.

const UnifiedVec2 & Mezzanine::UI::MultiImageLayer::GetImagePosition ( const Whole  Index) const
virtual

Gets the Unified position of the image at the specified index.

Parameters
IndexThe index of the MultiImageData to update.
Returns
Returns a const Reference to the Unified position to be applied to the image at the specified index.

Definition at line 234 of file multiimagelayer.cpp.

const UnifiedRect & Mezzanine::UI::MultiImageLayer::GetImageRect ( const Whole  Index) const
virtual

Gets the Unified position and size of the image at the specified index.

Parameters
IndexThe index of the MultiImageData to update.
Returns
Returns a const Reference to the UnifiedRect to be applied to the image at the specified index.

Definition at line 223 of file multiimagelayer.cpp.

const UnifiedVec2 & Mezzanine::UI::MultiImageLayer::GetImageSize ( const Whole  Index) const
virtual

Gets the Unified size of the image at the specified index.

Parameters
IndexThe index of the MultiImageData to update.
Returns
Returns a const Reference to the Unified size to be applied to the image at the specified index.

Definition at line 245 of file multiimagelayer.cpp.

UI::RenderLayerType Mezzanine::UI::MultiImageLayer::GetLayerType ( ) const
virtual

Gets the type of render layer this is.

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

Implements Mezzanine::UI::RenderLayer.

Definition at line 196 of file multiimagelayer.cpp.

MultiImageData & Mezzanine::UI::MultiImageLayer::GetMultiImageData ( const Whole  Index)
virtual

Gets a MultiImageData in this layer by index.

Parameters
IndexThe index of the MultiImageData to retrieve.
Returns
Returns a reference to the MultiImageData at the specified index.

Definition at line 205 of file multiimagelayer.cpp.

const MultiImageData & Mezzanine::UI::MultiImageLayer::GetMultiImageData ( const Whole  Index) const
virtual

Gets a MultiImageData in this layer by index.

Parameters
IndexThe index of the MultiImageData to retrieve.
Returns
Returns a const reference to the MultiImageData at the specified index.

Definition at line 208 of file multiimagelayer.cpp.

Whole Mezzanine::UI::MultiImageLayer::GetNumMultiImageData ( ) const
virtual

Gets the number of MultiImageData instances currently in this layer.

Returns
Returns the number of images this layer is currently configured to support.

Definition at line 211 of file multiimagelayer.cpp.

String Mezzanine::UI::MultiImageLayer::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 470 of file multiimagelayer.cpp.

Boole Mezzanine::UI::MultiImageLayer::IsCompletelyTransparent ( const Whole  Index) const
virtual

Gets whether or not this layer is entirely transparent.

Parameters
IndexThe index of the MultiImageData to update.
Returns
Returns true if all quad corners of this layer have their value set to zero, false otherwise.

Definition at line 271 of file multiimagelayer.cpp.

void Mezzanine::UI::MultiImageLayer::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.
Todo:
This loop expects the listed order in the XML to match the order in which they were serialized. Within PugiXML at least this shouldn't be a problem, however if Images start appearing out of order it may be worthwhile to investigate or add some ordering redundancy.

Reimplemented from Mezzanine::UI::ImageLayer.

Definition at line 401 of file multiimagelayer.cpp.

void Mezzanine::UI::MultiImageLayer::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::ImageLayer.

Definition at line 355 of file multiimagelayer.cpp.

void Mezzanine::UI::MultiImageLayer::RedrawImpl ( Boole  Force)
protectedvirtual

Provides the class specific implementation for regenerating vertices for this renderable.

Parameters
ForceWhether or not to force the regenerating of vertices regardless of whether or not the data is dirty.

Implements Mezzanine::UI::SimpleRenderer.

Definition at line 149 of file multiimagelayer.cpp.

void Mezzanine::UI::MultiImageLayer::ReserveMultiImageData ( const Whole  NumImages)
virtual

Creates space for the specified number of MultiImageData instances to be populated.

Parameters
NumImagesThe number of images to reserve space in this layer for.

Definition at line 202 of file multiimagelayer.cpp.

void Mezzanine::UI::MultiImageLayer::SetColour ( const Whole  Index,
const ColourValue Colour 
)
virtual

Sets the colour of the layer.

Parameters
IndexThe index of the MultiImageData to update.
ColourA colour value representing the colour to be set.

Definition at line 250 of file multiimagelayer.cpp.

void Mezzanine::UI::MultiImageLayer::SetColour ( const Whole  Index,
const UI::QuadCorner  Corner,
const ColourValue Colour 
)
virtual

Sets the colour for one corner the layer.

Parameters
IndexThe index of the MultiImageData to update.
CornerWhich corner the colour should be applied to.
ColourA colour value representing the colour to be set.

Definition at line 260 of file multiimagelayer.cpp.

void Mezzanine::UI::MultiImageLayer::SetGradient ( const Whole  Index,
const UI::Gradient  Grad,
const ColourValue ColourA,
const ColourValue ColourB 
)
virtual

Sets a colour gradient to be applied to this layer.

Parameters
IndexThe index of the MultiImageData to update.
GradThe direction/style of gradient to enable.
ColourAThe colour to apply to the first side of the gradient.
ColourBThe colour to apply to the second side of the gradient.

Definition at line 301 of file multiimagelayer.cpp.

void Mezzanine::UI::MultiImageLayer::SetImagePosition ( const Whole  Index,
const UnifiedVec2 Position 
)
virtual

Sets the Unified position of the image at the specified index.

Parameters
IndexThe index of the MultiImageData to update.
PositionThe UnifiedVec2 describing the position to be applied to the image at the specified index.

Definition at line 228 of file multiimagelayer.cpp.

void Mezzanine::UI::MultiImageLayer::SetImageRect ( const Whole  Index,
const UnifiedRect Trans 
)
virtual

Sets the Unified position and size of the image at the specified index.

Parameters
IndexThe index of the MultiImageData to update.
TransThe UnifiedRect to be applied to the Image at the specified index.

Definition at line 217 of file multiimagelayer.cpp.

void Mezzanine::UI::MultiImageLayer::SetImageSize ( const Whole  Index,
const UnifiedVec2 Size 
)
virtual

Sets the Unified size of the image at the specified index.

Parameters
IndexThe index of the MultiImageData to update.
SizeThe UnifiedVec2 describing the size to be applied to the image at the specified index.

Definition at line 239 of file multiimagelayer.cpp.

void Mezzanine::UI::MultiImageLayer::SetSprite ( const Whole  Index,
Sprite NewSprite 
)
virtual

Sets the fill image(if provided in the atlas) of the layer.

Parameters
IndexThe index of the MultiImageData to update.
NewSpriteA pointer to the sprite to set as the fill.

Definition at line 280 of file multiimagelayer.cpp.

void Mezzanine::UI::MultiImageLayer::SetSprite ( const Whole  Index,
const String SpriteName 
)
virtual

Sets the fill image(if provided in the atlas) of the layer.

Parameters
IndexThe index of the MultiImageData to update.
SpriteNameThe name of the sprite to set as the fill.

Definition at line 289 of file multiimagelayer.cpp.

void Mezzanine::UI::MultiImageLayer::SetSprite ( const Whole  Index,
const String SpriteName,
const String Atlas 
)
virtual

Sets the fill image(if provided in the atlas) of the layer.

Parameters
IndexThe index of the MultiImageData to update.
SpriteNameThe name of the sprite to set as the fill.
AtlasThe Atlas to load the sprite from.

Definition at line 295 of file multiimagelayer.cpp.

Member Data Documentation

ImageDataContainer Mezzanine::UI::MultiImageLayer::LayerImages
protected

Container storing all of the images/sprites that will be rendered by this layer.

Definition at line 106 of file multiimagelayer.h.


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