Spinning Topp Logo BlackTopp Studios
inc
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)
 Relative Real 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, Boole AsChild=true) const
 Calculates the actual values when a Rect with actual dimensions has this unified rect applied to it. More...
 
Boole operator!= (const UnifiedRect &Other) const
 Inequality comparison operator. More...
 
UnifiedRectoperator= (const UnifiedRect &Other)
 Assignment operator. More...
 
Boole 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 661 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 684 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 691 of file unifieddim.h.

Mezzanine::UI::UnifiedRect::UnifiedRect ( const Real PositionXrel,
const Real PositionYrel,
const Real SizeXrel,
const Real SizeYrel 
)
inline

Relative 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.

Definition at line 701 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 715 of file unifieddim.h.

Member Function Documentation

Rect Mezzanine::UI::UnifiedRect::CalculateActualDimensions ( const Rect Actual,
Boole  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.
AsChildWhether or not the dimensions should be calculated assuming this is a child rect.
Returns
Returns a Rect containing the result position and size in actual (pixel) units.

Definition at line 771 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 880 of file unifieddim.h.

Boole 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 791 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 802 of file unifieddim.h.

Boole 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 784 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 835 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 814 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
PosThe screen position of the rect.
AreaThe width and height of the rect.

Definition at line 730 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 740 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 754 of file unifieddim.h.


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