Crazy Eddie's GUI System  0.8.4
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Pages
CEGUI::OperatorDim Class Reference

Dimension type that represents the result of an operation performed on two other dimension values. Implements BaseDim interface. More...

+ Inheritance diagram for CEGUI::OperatorDim:
+ Collaboration diagram for CEGUI::OperatorDim:

Public Member Functions

 OperatorDim (DimensionOperator op)
 
 OperatorDim (DimensionOperator op, BaseDim *left, BaseDim *right)
 
void setLeftOperand (const BaseDim *operand)
 set the left hand side operand (passed object is cloned)
 
BaseDimgetLeftOperand () const
 return pointer to the left hand side operand
 
void setRightOperand (const BaseDim *operand)
 set the right hand side operand (passed object is cloned)
 
BaseDimgetRightOperand () const
 return pointer to the right hand side operand
 
void setOperator (DimensionOperator op)
 Set the operation to be performed.
 
DimensionOperator getOperator () const
 Get the current operation that will be performed.
 
void setNextOperand (const BaseDim *operand)
 helper to set the next free operand, will throw after 2 are set
 
float getValue (const Window &wnd) const
 Return a value that represents this dimension as absolute pixels. More...
 
float getValue (const Window &wnd, const Rectf &container) const
 Return a value that represents this dimension as absolute pixels. More...
 
BaseDimclone () const
 Create an exact copy of the specialised object and return it as a pointer to a BaseDim object. More...
 
- Public Member Functions inherited from CEGUI::BaseDim
virtual bool handleFontRenderSizeChange (Window &window, const Font *font) const
 perform any processing required due to the given font having changed.
 

Protected Member Functions

float getValueImpl (const float lval, const float rval) const
 
void writeXMLToStream (XMLSerializer &xml_stream) const
 Writes an xml representation of this BaseDim to out_stream. More...
 
void writeXMLElementName_impl (XMLSerializer &xml_stream) const
 Implementataion method to output real xml element name.
 
void writeXMLElementAttributes_impl (XMLSerializer &xml_stream) const
 Implementataion method to create the element attributes.
 

Protected Attributes

BaseDimd_left
 
BaseDimd_right
 
DimensionOperator d_op
 

Detailed Description

Dimension type that represents the result of an operation performed on two other dimension values. Implements BaseDim interface.

Member Function Documentation

BaseDim* CEGUI::OperatorDim::clone ( ) const
virtual

Create an exact copy of the specialised object 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.

Implements CEGUI::BaseDim.

float CEGUI::OperatorDim::getValue ( const Window wnd) const
virtual

Return a value that represents this dimension as absolute pixels.

Parameters
wndWindow object that may be used by the specialised class to aid in calculating the final value.
Returns
float value which represents, in pixels, the same value as this BaseDim.

Implements CEGUI::BaseDim.

float CEGUI::OperatorDim::getValue ( const Window wnd,
const Rectf container 
) const
virtual

Return a value that represents this dimension as absolute pixels.

Parameters
wndWindow 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).
containerRect 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.
Returns
float value which represents, in pixels, the same value as this BaseDim.

Implements CEGUI::BaseDim.

void CEGUI::OperatorDim::writeXMLToStream ( XMLSerializer xml_stream) const
protectedvirtual

Writes an xml representation of this BaseDim to out_stream.

Parameters
xml_streamStream where xml data should be output.

Reimplemented from CEGUI::BaseDim.