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

A simple class providing basic methods to generate vertices with. More...

#include <simplerenderer.h>

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

Public Member Functions

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...
 
virtual void _MarkDirty ()=0
 Marks this renderable as well as all parent objects as dirty. More...
 
void _Redraw (Boole Force)
 Regenerates the verticies in this renderable. More...
 
virtual String GetDerivedSerializableName () const
 Gets the most derived serializable name of 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 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 ProtoSerialize (XML::Node &ParentNode) const
 Convert this class to an XML::Node ready for serialization. More...
 
virtual void ProtoSerializeProperties (XML::Node &SelfRoot) const
 Convert the properties of 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...
 

Protected Member Functions

 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

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

A simple class providing basic methods to generate vertices with.

Definition at line 55 of file simplerenderer.h.

Member Function Documentation

void Mezzanine::UI::SimpleRenderer::_AppendVertices ( std::vector< VertexData > &  Vertices)

Appends the vertices of this renderable to another vector.

Parameters
VerticesThe vector of vertex's to append to.

Definition at line 156 of file simplerenderer.cpp.

Boole Mezzanine::UI::SimpleRenderer::_IsDirty ( )

Gets whether or not this renderer is dirty.

Returns
Returns true if this renderer is dirty, false otherwise.

Definition at line 142 of file simplerenderer.cpp.

virtual void Mezzanine::UI::SimpleRenderer::_MarkDirty ( )
pure virtual

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

Implemented in Mezzanine::UI::RenderLayer, and Mezzanine::UI::LineListRenderer.

void Mezzanine::UI::SimpleRenderer::_Redraw ( Boole  Force)

Regenerates the verticies in this renderable.

Parameters
ForceIf true this will force this object to redraw it's verticies regardless of whether it is dirty.

Definition at line 147 of file simplerenderer.cpp.

String Mezzanine::UI::SimpleRenderer::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 in Mezzanine::UI::TextLayer, Mezzanine::UI::MultiImageLayer, Mezzanine::UI::RenderLayer, Mezzanine::UI::ImageLayer, Mezzanine::UI::SingleImageLayer, Mezzanine::UI::SingleLineTextLayer, Mezzanine::UI::MultiLineTextLayer, and Mezzanine::UI::QuadRenderer.

Definition at line 133 of file simplerenderer.cpp.

String Mezzanine::UI::SimpleRenderer::GetPrimaryAtlas ( ) const
virtual

Gets the currently set primary atlas.

Returns
Returns a string containing the name of the primary atlas that is set, or an empty string if none.

Definition at line 84 of file simplerenderer.cpp.

String Mezzanine::UI::SimpleRenderer::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 136 of file simplerenderer.cpp.

void Mezzanine::UI::SimpleRenderer::ProtoDeSerialize ( const XML::Node SelfRoot)
virtual

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

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

Reimplemented in Mezzanine::UI::TextLayer.

Definition at line 110 of file simplerenderer.cpp.

void Mezzanine::UI::SimpleRenderer::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 in Mezzanine::UI::TextLayer, Mezzanine::UI::MultiImageLayer, Mezzanine::UI::RenderLayer, Mezzanine::UI::ImageLayer, Mezzanine::UI::SingleImageLayer, Mezzanine::UI::SingleLineTextLayer, Mezzanine::UI::MultiLineTextLayer, and Mezzanine::UI::QuadRenderer.

Definition at line 115 of file simplerenderer.cpp.

void Mezzanine::UI::SimpleRenderer::ProtoSerialize ( XML::Node ParentNode) const
virtual

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

Parameters
ParentNodeThe point in the XML hierarchy that all this renderable should be appended to.

Reimplemented in Mezzanine::UI::TextLayer.

Definition at line 90 of file simplerenderer.cpp.

void Mezzanine::UI::SimpleRenderer::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 in Mezzanine::UI::TextLayer, Mezzanine::UI::MultiImageLayer, Mezzanine::UI::RenderLayer, Mezzanine::UI::ImageLayer, Mezzanine::UI::SingleImageLayer, Mezzanine::UI::SingleLineTextLayer, Mezzanine::UI::MultiLineTextLayer, and Mezzanine::UI::QuadRenderer.

Definition at line 97 of file simplerenderer.cpp.

void Mezzanine::UI::SimpleRenderer::PushTriangle ( const Vector2 A,
const Vector2 B,
const Vector2 C,
const Vector2 UV,
const ColourValue Colour,
const String Atlas 
)
protectedvirtual

Pushes vertex information for a triangle to a vector. Equivalent to calling "PushVertex" three times.

Note
This is primarily useful when your Vertices aren't using an actual image for their rendering due to the reuse of the UV.
Parameters
AThe position of the first vertex.
BThe position of the second vertex.
CThe position of the third vertex.
UVThe texture coordinates to be appended to all three vertices.
ColourThe colour for all 3 vertices to be appended.
AtlasThe name of the Atlas to use for the UV coordinates.

Definition at line 71 of file simplerenderer.cpp.

void Mezzanine::UI::SimpleRenderer::PushVertex ( const Real X,
const Real Y,
const Vector2 UV,
const ColourValue Colour,
const String Atlas 
)
protectedvirtual

Collects all the relevant information for a single vertex and pushes it to a vector.

Parameters
XThe vertex position on the X axis.
YThe vertex position on the Y axis.
UVThe Vertex texture coordinates.
ColourThe Vertex colour.
AtlasThe name of the Atlas to use for the UV coordinates.

Definition at line 59 of file simplerenderer.cpp.

virtual void Mezzanine::UI::SimpleRenderer::RedrawImpl ( Boole  Force)
protectedpure virtual

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.

Implemented in Mezzanine::UI::TextLayer, Mezzanine::UI::MultiImageLayer, Mezzanine::UI::LineListRenderer, and Mezzanine::UI::SingleImageLayer.

void Mezzanine::UI::SimpleRenderer::SetPrimaryAtlas ( const String Atlas)
virtual

Sets the Atlas to be assumed when one isn't provided for atlas related tasks.

Parameters
AtlasThe name of the atlas to be used.

Definition at line 81 of file simplerenderer.cpp.

Member Data Documentation

Boole Mezzanine::UI::SimpleRenderer::Dirty
protected

This determines whether or not the vertices in this renderer need to be refreshed.

Definition at line 60 of file simplerenderer.h.

String Mezzanine::UI::SimpleRenderer::PriAtlas
protected

This contains the name of the atlas that will be used as default when one isn't specified.

Definition at line 63 of file simplerenderer.h.

std::vector<VertexData> Mezzanine::UI::SimpleRenderer::RenderVertices
protected

This is a container storing all the vertices generated by this renderer.

Definition at line 66 of file simplerenderer.h.


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