Crazy Eddie's GUI System  0.8.7
CEGUI::ImagerySection Class Reference

Class that encapsulates a re-usable collection of imagery specifications. More...

+ Inheritance diagram for CEGUI::ImagerySection:
+ Collaboration diagram for CEGUI::ImagerySection:

Public Types

typedef std::vector< ImageryComponent *CEGUI_VECTOR_ALLOC(ImageryComponent *)> ImageryComponentPointerList
 Vector of ImageryComponent Pointers.
 
typedef std::vector< TextComponent *CEGUI_VECTOR_ALLOC(TextComponent *)> TextComponentPointerList
 Vector of TextComponent Pointers.
 
typedef std::vector< FrameComponent *CEGUI_VECTOR_ALLOC(FrameComponent *)> FrameComponentPointerList
 Vector of FrameComponent Pointers.
 
typedef ConstVectorIterator< ImageryList > ImageryComponentIterator
 
typedef ConstVectorIterator< TextList > TextComponentIterator
 
typedef ConstVectorIterator< FrameList > FrameComponentIterator
 

Public Member Functions

 ImagerySection ()
 Constructor.
 
 ImagerySection (const String &name)
 ImagerySection constructor. Name must be supplied, masterColours are set to 0xFFFFFFFF by default. More...
 
void render (Window &srcWindow, const CEGUI::ColourRect *modColours=0, const Rectf *clipper=0, bool clipToDisplay=false) const
 Render the ImagerySection. More...
 
void render (Window &srcWindow, const Rectf &baseRect, const CEGUI::ColourRect *modColours=0, const Rectf *clipper=0, bool clipToDisplay=false) const
 Render the ImagerySection. More...
 
void addImageryComponent (const ImageryComponent &imageryComponent)
 Add an ImageryComponent to this ImagerySection. More...
 
void removeImageryComponent (const ImageryComponent &imageryComponent)
 Removes an ImageryComponent from this ImagerySection. The supplied ImagerySection reference should be retrieved via the getImageryComponentPointers function. The check to find out which ImagerySection to remove is done using memory address comparison (identity check). More...
 
void clearImageryComponents ()
 Clear all ImageryComponents from this ImagerySection. More...
 
void addTextComponent (const TextComponent &textComponent)
 Add a TextComponent to this ImagerySection. More...
 
void removeTextComponent (const TextComponent &textComponent)
 Removes an TextComponent from this ImagerySection. The supplied TextComponent reference should be retrieved via the getTextComponentPointers function. The check to find out which TextComponent to remove is done using memory address comparison (identity check). More...
 
void clearTextComponents ()
 Clear all TextComponents from this ImagerySection. More...
 
void clearFrameComponents ()
 Clear all FrameComponents from this ImagerySection. More...
 
void addFrameComponent (const FrameComponent &frameComponent)
 Add a FrameComponent to this ImagerySection. More...
 
void removeFrameComponent (const FrameComponent &frameComponent)
 Removes an FrameComponent from this ImagerySection. The supplied FrameComponent reference should be retrieved via the getFrameComponentPointers function. The check to find out which FrameComponent to remove is done using memory address comparison (identity check). More...
 
const ColourRectgetMasterColours () const
 Return the current master colours set for this ImagerySection. More...
 
void setMasterColours (const ColourRect &cols)
 Set the master colours to be used for this ImagerySection. More...
 
const StringgetName () const
 Return the name of this ImagerySection. More...
 
void setName (const String &name)
 Sets the name of this ImagerySection. More...
 
const StringgetMasterColoursPropertySource () const
 Get the name of the property where master colour values can be obtained. More...
 
void setMasterColoursPropertySource (const String &property)
 Set the name of the property where master colour values can be obtained. More...
 
Rectf getBoundingRect (const Window &wnd) const
 Return smallest Rect that could contain all imagery within this section.
 
Rectf getBoundingRect (const Window &wnd, const Rectf &rect) const
 Return smallest Rect that could contain all imagery within this section.
 
void writeXMLToStream (XMLSerializer &xml_stream) const
 Writes an xml representation of this ImagerySection to out_stream. More...
 
bool handleFontRenderSizeChange (Window &window, const Font *font) const
 perform any processing required due to the given font having changed.
 
ImageryComponentPointerList getImageryComponentPointers ()
 Returns a vector of pointers to the ImageryComponents that are currently added to this ImagerySection. If an ImageryComponent is added or removed from this ImagerySection, then the pointers in this vector are not valid anymore. The function should then be called again to retrieve valid pointers. More...
 
TextComponentPointerList getTextComponentPointers ()
 Returns a vector of pointers to the TextComponents that are currently added to this ImagerySection. If a TextComponent is added or removed from this ImagerySection, then the pointers in this vector are not valid anymore. The function should then be called again to retrieve valid pointers. More...
 
FrameComponentPointerList getFrameComponentPointers ()
 Returns a vector of pointers to the FrameComponents that are currently added to this ImagerySection. If a FrameComponent is added or removed from this ImagerySection, then the pointers in this vector are not valid anymore. The function should then be called again to retrieve valid pointers. More...
 
ImageryComponentIterator getImageryComponentIterator () const
 Return a ImagerySection::ImageryComponentIterator object to iterate over the ImageryComponent elements currently added to the ImagerySection. More...
 
TextComponentIterator getTextComponentIterator () const
 Return a ImagerySection::TextComponentIterator object to iterate over the TextComponent elements currently added to the ImagerySection. More...
 
FrameComponentIterator getFrameComponentIterator () const
 Return a ImagerySection::FrameComponentIterator object to iterate over the FrameComponent elements currently added to the ImagerySection. More...
 

Protected Member Functions

void initMasterColourRect (const Window &wnd, ColourRect &cr) const
 Helper method to initialise a ColourRect with appropriate values according to the way the ImagerySection is set up. More...
 

Detailed Description

Class that encapsulates a re-usable collection of imagery specifications.

Member Typedef Documentation

Deprecated:
This iterator is deprecated because the function that uses the type is deprecated
Deprecated:
This iterator is deprecated because the function that uses the type is deprecated
Deprecated:
This iterator is deprecated because the function that uses the type is deprecated

Constructor & Destructor Documentation

CEGUI::ImagerySection::ImagerySection ( const String name)

ImagerySection constructor. Name must be supplied, masterColours are set to 0xFFFFFFFF by default.

Parameters
nameName of the new ImagerySection.

Member Function Documentation

void CEGUI::ImagerySection::addFrameComponent ( const FrameComponent frameComponent)

Add a FrameComponent to this ImagerySection.

Parameters
frameFrameComponent to be added to the section (a copy is made)
void CEGUI::ImagerySection::addImageryComponent ( const ImageryComponent imageryComponent)

Add an ImageryComponent to this ImagerySection.

Parameters
imageryComponentImageryComponent to be added to the section (a copy is made)
void CEGUI::ImagerySection::addTextComponent ( const TextComponent textComponent)

Add a TextComponent to this ImagerySection.

Parameters
textComponentTextComponent to be added to the section (a copy is made)
void CEGUI::ImagerySection::clearFrameComponents ( )

Clear all FrameComponents from this ImagerySection.

Returns
Nothing
void CEGUI::ImagerySection::clearImageryComponents ( )

Clear all ImageryComponents from this ImagerySection.

Returns
Nothing
void CEGUI::ImagerySection::clearTextComponents ( )

Clear all TextComponents from this ImagerySection.

Returns
Nothing
FrameComponentIterator CEGUI::ImagerySection::getFrameComponentIterator ( ) const

Return a ImagerySection::FrameComponentIterator object to iterate over the FrameComponent elements currently added to the ImagerySection.

Deprecated:
This iterator is deprecated because it will be replaced by the function getFrameComponents in the next version.
FrameComponentPointerList CEGUI::ImagerySection::getFrameComponentPointers ( )

Returns a vector of pointers to the FrameComponents that are currently added to this ImagerySection. If a FrameComponent is added or removed from this ImagerySection, then the pointers in this vector are not valid anymore. The function should then be called again to retrieve valid pointers.

Returns
A vector of pointers to the FrameComponents that are currently added to this ImagerySection
ImageryComponentIterator CEGUI::ImagerySection::getImageryComponentIterator ( ) const

Return a ImagerySection::ImageryComponentIterator object to iterate over the ImageryComponent elements currently added to the ImagerySection.

Deprecated:
This iterator is deprecated because it will be replaced by the function getImageryComponents in the next version.
ImageryComponentPointerList CEGUI::ImagerySection::getImageryComponentPointers ( )

Returns a vector of pointers to the ImageryComponents that are currently added to this ImagerySection. If an ImageryComponent is added or removed from this ImagerySection, then the pointers in this vector are not valid anymore. The function should then be called again to retrieve valid pointers.

Returns
A vector of pointers to the ImageryComponents that are currently added to this ImagerySection
const ColourRect& CEGUI::ImagerySection::getMasterColours ( ) const

Return the current master colours set for this ImagerySection.

Returns
ColourRect describing the master colour values in use for this ImagerySection.
const String& CEGUI::ImagerySection::getMasterColoursPropertySource ( ) const

Get the name of the property where master colour values can be obtained.

Returns
String containing the name of the property.
const String& CEGUI::ImagerySection::getName ( ) const

Return the name of this ImagerySection.

Returns
String object holding the name of the ImagerySection.
TextComponentIterator CEGUI::ImagerySection::getTextComponentIterator ( ) const

Return a ImagerySection::TextComponentIterator object to iterate over the TextComponent elements currently added to the ImagerySection.

Deprecated:
This iterator is deprecated because it will be replaced by the function getTextComponents in the next version.
TextComponentPointerList CEGUI::ImagerySection::getTextComponentPointers ( )

Returns a vector of pointers to the TextComponents that are currently added to this ImagerySection. If a TextComponent is added or removed from this ImagerySection, then the pointers in this vector are not valid anymore. The function should then be called again to retrieve valid pointers.

Returns
A vector of pointers to the TextComponents that are currently added to this ImagerySection
void CEGUI::ImagerySection::initMasterColourRect ( const Window wnd,
ColourRect cr 
) const
protected

Helper method to initialise a ColourRect with appropriate values according to the way the ImagerySection is set up.

This will try and get values from multiple places:

  • a property attached to wnd
  • or the integral d_masterColours value.
void CEGUI::ImagerySection::removeFrameComponent ( const FrameComponent frameComponent)

Removes an FrameComponent from this ImagerySection. The supplied FrameComponent reference should be retrieved via the getFrameComponentPointers function. The check to find out which FrameComponent to remove is done using memory address comparison (identity check).

Parameters
frameComponentA reference to the FrameComponent to be removed to the section
void CEGUI::ImagerySection::removeImageryComponent ( const ImageryComponent imageryComponent)

Removes an ImageryComponent from this ImagerySection. The supplied ImagerySection reference should be retrieved via the getImageryComponentPointers function. The check to find out which ImagerySection to remove is done using memory address comparison (identity check).

Parameters
imageryComponentA reference to the ImageryComponent to be removed to the section
void CEGUI::ImagerySection::removeTextComponent ( const TextComponent textComponent)

Removes an TextComponent from this ImagerySection. The supplied TextComponent reference should be retrieved via the getTextComponentPointers function. The check to find out which TextComponent to remove is done using memory address comparison (identity check).

Parameters
textComponentA reference to the TextComponent to be removed to the section
void CEGUI::ImagerySection::render ( Window srcWindow,
const CEGUI::ColourRect modColours = 0,
const Rectf clipper = 0,
bool  clipToDisplay = false 
) const

Render the ImagerySection.

Parameters
srcWindowWindow object to be used when calculating pixel values from BaseDim values.
modColoursColourRect specifying colours to be modulated with the ImagerySection's master colours. May be 0.
Returns
Nothing.
void CEGUI::ImagerySection::render ( Window srcWindow,
const Rectf baseRect,
const CEGUI::ColourRect modColours = 0,
const Rectf clipper = 0,
bool  clipToDisplay = false 
) const

Render the ImagerySection.

Parameters
srcWindowWindow object to be used when calculating pixel values from BaseDim values.
baseRectRect object to be used when calculating pixel values from BaseDim values.
modColoursColourRect specifying colours to be modulated with the ImagerySection's master colours. May be 0.
Returns
Nothing.
void CEGUI::ImagerySection::setMasterColours ( const ColourRect cols)

Set the master colours to be used for this ImagerySection.

Parameters
colsColourRect describing the colours to be set as the master colours for this ImagerySection.
Returns
Nothing.
void CEGUI::ImagerySection::setMasterColoursPropertySource ( const String property)

Set the name of the property where master colour values can be obtained.

Parameters
propertyString containing the name of the property.
Returns
Nothing.
void CEGUI::ImagerySection::setName ( const String name)

Sets the name of this ImagerySection.

Parameters
nameString object holding the name of the ImagerySection.
Returns
Nothing.
void CEGUI::ImagerySection::writeXMLToStream ( XMLSerializer xml_stream) const

Writes an xml representation of this ImagerySection to out_stream.

Parameters
xml_streamStream where xml data should be output.
Returns
Nothing.