MezzanineEngine 
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Public Member Functions | Static Public Member Functions | Public Attributes | List of all members
Mezzanine::UI::UnifiedRect Class Reference

This class represents a 2D rect which can express the size and position of a renderable on screen. More...

#include <unifieddim.h>

+ Collaboration diagram for Mezzanine::UI::UnifiedRect:

Public Member Functions

 UnifiedRect ()
 Class constructor.
 
 UnifiedRect (const UnifiedVec2 &Pos, const UnifiedVec2 &Area)
 UnifiedVec2 constructor. More...
 
 UnifiedRect (const UnifiedDim &PositionX, const UnifiedDim &PositionY, const UnifiedDim &SizeX, const UnifiedDim &SizeY)
 UnifiedDim constructor. More...
 
 UnifiedRect (const Real &PositionXrel, const Real &PositionYrel, const Real &SizeXrel, const Real &SizeYrel, const Real &PositionXabs, const Real &PositionYabs, const Real &SizeXabs, const Real &SizeYabs)
 Real constructor. More...
 
 ~UnifiedRect ()
 Class destructor.
 
Rect CalculateActualDimensions (const Rect &Actual, bool AsChild=true) const
 Calculates the actual values when a Rect with actual dimensions has this unified rect applied to it. More...
 
bool operator!= (const UnifiedRect &Other) const
 Inequality comparison operator. More...
 
UnifiedRectoperator= (const UnifiedRect &Other)
 Assignment operator. More...
 
bool operator== (const UnifiedRect &Other) const
 Equality comparison operator. More...
 
void ProtoDeSerialize (const XML::Node &SelfRoot)
 Take the data stored in an XML Node and overwrite this object with it. More...
 
void ProtoSerialize (XML::Node &ParentNode) const
 Convert this class to an XML::Node ready for serialization. More...
 
void SetIdentity ()
 Sets all members of this unified rect to zero.
 
void SetValues (const UnifiedVec2 &Pos, const UnifiedVec2 &Area)
 Sets all data members of this unified rect explicitly. More...
 
void SetValues (const UnifiedDim &PositionX, const UnifiedDim &PositionY, const UnifiedDim &SizeX, const UnifiedDim &SizeY)
 Sets all data members of this unified rect explicitly. More...
 
void SetValues (const Real &PositionXrel, const Real &PositionYrel, const Real &SizeXrel, const Real &SizeYrel, const Real &PositionXabs, const Real &PositionYabs, const Real &SizeXabs, const Real &SizeYabs)
 Sets all data members of this unified rect explicitly. 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...
 

Public Attributes

UnifiedVec2 Position
 The top left position of this rect.
 
UnifiedVec2 Size
 The width and height of this rect.
 

Detailed Description

This class represents a 2D rect which can express the size and position of a renderable on screen.

Definition at line 652 of file unifieddim.h.

Constructor & Destructor Documentation

Mezzanine::UI::UnifiedRect::UnifiedRect ( const UnifiedVec2 Pos,
const UnifiedVec2 Area 
)
inline

UnifiedVec2 constructor.

Parameters
PosThe screen position of the rect.
AreaThe width and height of the rect.

Definition at line 675 of file unifieddim.h.

Mezzanine::UI::UnifiedRect::UnifiedRect ( const UnifiedDim PositionX,
const UnifiedDim PositionY,
const UnifiedDim SizeX,
const UnifiedDim SizeY 
)
inline

UnifiedDim constructor.

Parameters
PositionXThe position on the X plane.
PositionYThe position on the Y plane.
SizeXThe size on the X plane.
SizeYThe size on the Y plane.

Definition at line 682 of file unifieddim.h.

Mezzanine::UI::UnifiedRect::UnifiedRect ( const Real PositionXrel,
const Real PositionYrel,
const Real SizeXrel,
const Real SizeYrel,
const Real PositionXabs,
const Real PositionYabs,
const Real SizeXabs,
const Real SizeYabs 
)
inline

Real constructor.

Parameters
PositionXrelThe relative position portion of the X dimension.
PositionYrelThe relative position portion of the Y dimension.
SizeXrelThe relative size portion of the X dimension.
SizeYrelThe relative size portion of the Y dimension.
PositionXabsThe absolute position portion of the X dimension.
PositionYabsthe absolute position portion of the Y dimension.
SizeXabsThe absolute size portion of the X dimension.
SizeYabsthe absolute size portion of the Y dimension.

Definition at line 696 of file unifieddim.h.

Member Function Documentation

Rect Mezzanine::UI::UnifiedRect::CalculateActualDimensions ( const Rect Actual,
bool  AsChild = true 
) const
inline

Calculates the actual values when a Rect with actual dimensions has this unified rect applied to it.

Parameters
ActualA Rect containing the actual(pixel) position and size to use as a base for the calculation.
Returns
Returns a Rect containing the result position and size in actual (pixel) units.

Definition at line 751 of file unifieddim.h.

static String Mezzanine::UI::UnifiedRect::GetSerializableName ( )
inlinestatic

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 860 of file unifieddim.h.

bool Mezzanine::UI::UnifiedRect::operator!= ( const UnifiedRect Other) const
inline

Inequality comparison operator.

Parameters
OtherThe other UnifiedRect to compare to.
Returns
Returns true if these UnifiedRect's are not equal, false otherwise.

Definition at line 771 of file unifieddim.h.

UnifiedRect& Mezzanine::UI::UnifiedRect::operator= ( const UnifiedRect Other)
inline

Assignment operator.

Parameters
OtherThe other UnifiedRect to be assign values from.
Returns
Returns a reference to this.

Definition at line 782 of file unifieddim.h.

bool Mezzanine::UI::UnifiedRect::operator== ( const UnifiedRect Other) const
inline

Equality comparison operator.

Parameters
OtherThe other UnifiedRect to compare to.
Returns
Returns true if these UnifiedRect's are equal, false otherwise.

Definition at line 764 of file unifieddim.h.

void Mezzanine::UI::UnifiedRect::ProtoDeSerialize ( const XML::Node SelfRoot)
inline

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.

Definition at line 815 of file unifieddim.h.

void Mezzanine::UI::UnifiedRect::ProtoSerialize ( XML::Node ParentNode) const
inline

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.

Definition at line 794 of file unifieddim.h.

void Mezzanine::UI::UnifiedRect::SetValues ( const UnifiedVec2 Pos,
const UnifiedVec2 Area 
)
inline

Sets all data members of this unified rect explicitly.

Parameters
PositionThe screen position of the rect.
AreaThe width and height of the rect.

Definition at line 711 of file unifieddim.h.

void Mezzanine::UI::UnifiedRect::SetValues ( const UnifiedDim PositionX,
const UnifiedDim PositionY,
const UnifiedDim SizeX,
const UnifiedDim SizeY 
)
inline

Sets all data members of this unified rect explicitly.

Parameters
PositionXThe position on the X plane.
PositionYThe position on the Y plane.
SizeXThe size on the X plane.
SizeYThe size on the Y plane.

Definition at line 721 of file unifieddim.h.

void Mezzanine::UI::UnifiedRect::SetValues ( const Real PositionXrel,
const Real PositionYrel,
const Real SizeXrel,
const Real SizeYrel,
const Real PositionXabs,
const Real PositionYabs,
const Real SizeXabs,
const Real SizeYabs 
)
inline

Sets all data members of this unified rect explicitly.

Parameters
PositionXrelThe relative position portion of the X dimension.
PositionYrelThe relative position portion of the Y dimension.
SizeXrelThe relative size portion of the X dimension.
SizeYrelThe relative size portion of the Y dimension.
PositionXabsThe absolute position portion of the X dimension.
PositionYabsthe absolute position portion of the Y dimension.
SizeXabsThe absolute size portion of the X dimension.
SizeYabsthe absolute size portion of the Y dimension.

Definition at line 735 of file unifieddim.h.


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