Crazy Eddies GUI System
0.6.0
|
Abstract interface for a generic 'dimension' class. More...
Inherited by CEGUI::AbsoluteDim, CEGUI::FontDim, CEGUI::ImageDim, CEGUI::PropertyDim, CEGUI::UnifiedDim, and CEGUI::WidgetDim.
Public Member Functions | |
float | getValue (const Window &wnd) const |
Return a value that represents this dimension as absolute pixels. More... | |
float | getValue (const Window &wnd, const Rect &container) const |
Return a value that represents this dimension as absolute pixels. More... | |
BaseDim * | clone () const |
Create an exact copy of the specialised class and return it as a pointer to a BaseDim object. More... | |
DimensionOperator | getDimensionOperator () const |
Return the DimensionOperator set for this BaseDim based object. More... | |
void | setDimensionOperator (DimensionOperator op) |
Set the DimensionOperator set for this BaseDim based object. More... | |
const BaseDim * | getOperand () const |
Return a pointer to the BaseDim set to be used as the other operand. More... | |
void | setOperand (const BaseDim &operand) |
Set the BaseDim set to be used as the other operand in calculations for this BaseDim. More... | |
void | writeXMLToStream (XMLSerializer &xml_stream) const |
Writes an xml representation of this BaseDim to out_stream. More... | |
Protected Member Functions | |
virtual float | getValue_impl (const Window &wnd) const =0 |
Implementataion method to return the base value for this BaseDim. This method should not attempt to apply the mathematical operator; this is handled automatically. | |
virtual float | getValue_impl (const Window &wnd, const Rect &container) const =0 |
Implementataion method to return the base value for this BaseDim. This method should not attempt to apply the mathematical operator; this is handled automatically by BaseDim. | |
virtual BaseDim * | clone_impl () const =0 |
Implementataion method to return a clone of this sub-class of BaseDim. This method should not attempt to clone the mathematical operator or operand; theis is handled automatically by BaseDim. | |
virtual void | writeXMLElementName_impl (XMLSerializer &xml_stream) const =0 |
Implementataion method to output real xml element name. | |
virtual void | writeXMLElementAttributes_impl (XMLSerializer &xml_stream) const =0 |
Implementataion method to create the element attributes. | |
Abstract interface for a generic 'dimension' class.
BaseDim * CEGUI::BaseDim::clone | ( | ) | const |
Create an exact copy of the specialised class and return it as a pointer to a BaseDim object.
Since the system needs to be able to copy objects derived from BaseDim, but only has knowledge of the BaseDim interface, this clone method is provided to prevent slicing issues.
References clone(), and clone_impl().
Referenced by clone(), CEGUI::Dimension::Dimension(), CEGUI::Dimension::operator=(), CEGUI::Dimension::setBaseDimension(), and setOperand().
DimensionOperator CEGUI::BaseDim::getDimensionOperator | ( | ) | const |
const BaseDim * CEGUI::BaseDim::getOperand | ( | ) | const |
float CEGUI::BaseDim::getValue | ( | const Window & | wnd | ) | const |
Return a value that represents this dimension as absolute pixels.
wnd | Window object that may be used by the specialised class to aid in calculating the final value. |
References CEGUI::DOP_ADD, CEGUI::DOP_DIVIDE, CEGUI::DOP_MULTIPLY, CEGUI::DOP_SUBTRACT, getValue(), and getValue_impl().
Referenced by CEGUI::ComponentArea::getPixelRect(), getValue(), CEGUI::ImageDim::getValue_impl(), CEGUI::WidgetDim::getValue_impl(), CEGUI::FontDim::getValue_impl(), and CEGUI::PropertyDim::getValue_impl().
Return a value that represents this dimension as absolute pixels.
wnd | Window object that may be used by the specialised class to aid in calculating the final value (typically would be used to obtain window/widget dimensions). |
container | Rect object which describes an area to be considered as the base area when calculating the final value. Basically this means that relative values are calculated from the dimensions of this Rect. |
References CEGUI::DOP_ADD, CEGUI::DOP_DIVIDE, CEGUI::DOP_MULTIPLY, CEGUI::DOP_SUBTRACT, getValue(), and getValue_impl().
void CEGUI::BaseDim::setDimensionOperator | ( | DimensionOperator | op | ) |
void CEGUI::BaseDim::setOperand | ( | const BaseDim & | operand | ) |
void CEGUI::BaseDim::writeXMLToStream | ( | XMLSerializer & | xml_stream | ) | const |
Writes an xml representation of this BaseDim to out_stream.
xml_stream | Stream where xml data should be output. |
References CEGUI::XMLSerializer::attribute(), CEGUI::XMLSerializer::closeTag(), CEGUI::XMLSerializer::openTag(), writeXMLElementAttributes_impl(), writeXMLElementName_impl(), and writeXMLToStream().
Referenced by writeXMLToStream(), and CEGUI::Dimension::writeXMLToStream().