Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

CEGUI::RenderableImage Class Reference

A higher order GUI entity that represents a renderable image with formatting options. More...

#include <CEGUIRenderableImage.h>

Inheritance diagram for CEGUI::RenderableImage:

Inheritance graph
[legend]
Collaboration diagram for CEGUI::RenderableImage:

Collaboration graph
[legend]
List of all members.

Public Types

enum  HorzFormatting {
  LeftAligned, RightAligned, HorzCentred, HorzStretched,
  HorzTiled
}
 Enumeration of horizontal formatting options for a RenderableImage. More...
enum  VertFormatting {
  TopAligned, BottomAligned, VertCentred, VertStretched,
  VertTiled
}
 Enumeration of vertical formatting options for a RenderableImage. More...

Public Member Functions

 RenderableImage (void)
 Default constructor for RenderableImage objects.
virtual ~RenderableImage (void)
 Destructor for RenderableImage objects.
void setImage (const Image *image)
 Set the Image object to be drawn by this RenderableImage.
void setHorzFormatting (HorzFormatting formatting)
 Set the required horizontal formatting.
void setVertFormatting (VertFormatting formatting)
 Set the required vertical formatting.
void setQuadSplitMode (QuadSplitMode split_mode)
 Set the required quad split mode.
const ImagegetImage (void) const
 Return the Image object currently set to be rendered.
HorzFormatting getHorzFormatting (void) const
 Return current horizontal formatting setting.
VertFormatting getVertFormatting (void) const
 Return current vertical formatting setting.
QuadSplitMode getQuadSplitMode (void) const
 Return current quad split mode setting.
void draw (const Vector3 &position, const Rect &clip_rect)
 Draw the element chain starting with this element.
void draw (RenderCache &renderCache) const
 Draw the element chain into the given RenderCache.
RenderableElementgetNextElement (void) const
 Return a pointer to the next RenderableElement in the chain.
const ColourRectgetColours (void) const
 Return the rendering colours set for this RenderableElement.
Point getPosition (void) const
 Return the offset position of this RenderableElement.
Size getSize (void) const
 Return the current size of the element.
const RectgetRect (void) const
 Return the area for the element.
bool isColourRectPerImage (bool setting) const
 return whether the element colours will be applied locally to each image drawn as part of the RenderableElement, or applied across the whole of the RenderableElement area.
void setNextElement (RenderableElement *element)
 Link another RenderableElement to this one.
void setColours (const ColourRect &colours)
 Sets the colours to be applied when rendering the element.
void setColours (const colour &top_left_colour, const colour &top_right_colour, const colour &bottom_left_colour, const colour &bottom_right_colour)
 Sets the colours to be applied when rendering the element.
void setPosition (const Point &position)
 Set the rendering offset position for this element.
void setSize (const Size &size)
 set the dimensions for the frame.
void setRect (const Rect &area)
 Set the area for the frame.
void setColourRectPerImage (bool setting)
 set whether the element colours should be applied locally to each image drawn as part of the RenderableElement, or applied across the whole of the RenderableElement area.

Protected Member Functions

void draw_impl (const Vector3 &position, const Rect &clip_rect) const
 Renders the imagery for a RenderableImage element.
void draw_impl (RenderCache &renderCache) const
 Implementation method to draw the element into the given RenderCache.
uint getHorzTileCount () const
 return number of horizontal tiles required.
uint getVertTileCount () const
 return number of vertical tiles required.
float getBaseXCoord (const Size &sz) const
 Return base x co-ord for first tile.
float getBaseYCoord (const Size &sz) const
 Return base y co-ord for first tile.
Size getDestinationSize () const
 Return target size to be used for each tile.

Protected Attributes

HorzFormatting d_horzFormat
 Currently set horizontal formatting option.
VertFormatting d_vertFormat
 Currently set vertical formatting option.
QuadSplitMode d_quadSplitMode
 Currently set quad split mode.
const Imaged_image
 Pointer to the actual Image to be displayed.
RenderableElementd_next
 Link to another RenderableElement.
ColourRect d_colours
 Colours to be used for this element;.
Rect d_area
 Currently defined area for this element.
bool d_useColoursPerImage
 true if d_colours should be applied separately to each Image drawn (false to interpolate across d_area).

Detailed Description

A higher order GUI entity that represents a renderable image with formatting options.

This class is intended to be used where a (usually top-level) GUI element needs to draw an image that requires some additional formatting. It is possible to specify the Image that is to be rendered, as well as the horizontal and vertical formatting required.

Definition at line 44 of file CEGUIRenderableImage.h.


Member Enumeration Documentation

enum CEGUI::RenderableImage::HorzFormatting
 

Enumeration of horizontal formatting options for a RenderableImage.

Enumerator:
LeftAligned  Image will be rendered at it's natural size and with it's left edge aligned with the left edge of the RenderableImage rect.
RightAligned  Image will be rendered at it's natural size and with it's right edge aligned with the right edge of the RenderableImage rect.
HorzCentred  Image will be rendered at it's natural size and horizontally centred within the RenderableImage rect.
HorzStretched  Image will be horizontally stretched to cover the entire width of the RenderableImage rect.
HorzTiled  Image will be tiled horizontally across the width of the RenderableImage rect. The rightmost tile will be clipped to remain within the rect.

Definition at line 54 of file CEGUIRenderableImage.h.

enum CEGUI::RenderableImage::VertFormatting
 

Enumeration of vertical formatting options for a RenderableImage.

Enumerator:
TopAligned  Image will be rendered at it's natural size and with it's top edge aligned with the top edge of the RenderableImage rect.
BottomAligned  Image will be rendered at it's natural size and with it's bottom edge aligned with the bottom edge of the RenderableImage rect.
VertCentred  Image will be rendered at it's natural size and vertically centred within the RenderableImage rect.
VertStretched  Image will be vertically stretched to cover the entire height of the RenderableImage rect.
VertTiled  Image will be tiled vertically down the height of the RenderableImage rect. The bottommost tile will be clipped to remain within the rect.

Definition at line 68 of file CEGUIRenderableImage.h.


Constructor & Destructor Documentation

CEGUI::RenderableImage::RenderableImage void   ) 
 

Default constructor for RenderableImage objects.

Definition at line 37 of file CEGUIRenderableImage.cpp.

CEGUI::RenderableImage::~RenderableImage void   )  [virtual]
 

Destructor for RenderableImage objects.

Definition at line 49 of file CEGUIRenderableImage.cpp.


Member Function Documentation

void CEGUI::RenderableElement::draw RenderCache renderCache  )  const [inherited]
 

Draw the element chain into the given RenderCache.

Parameters:
renderCache RenderCache object where element imagery is to be queued.
Returns:
Nothing.

Definition at line 84 of file CEGUIRenderableElement.cpp.

References CEGUI::RenderableElement::d_next, CEGUI::RenderableElement::draw(), and CEGUI::RenderableElement::draw_impl().

void CEGUI::RenderableElement::draw const Vector3 position,
const Rect clip_rect
[inherited]
 

Draw the element chain starting with this element.

Parameters:
position Vector3 object describing the base position to be used when rendering the element chain. Each element in the chain will be offset from this position by it's own internal position setting.
clip_rect Rect object describing the clipping area. No rendering will appear outside this area.

Definition at line 67 of file CEGUIRenderableElement.cpp.

References CEGUI::RenderableElement::d_area, CEGUI::Rect::d_left, CEGUI::RenderableElement::d_next, CEGUI::Rect::d_top, CEGUI::Vector3::d_x, CEGUI::Vector3::d_y, CEGUI::RenderableElement::draw(), and CEGUI::RenderableElement::draw_impl().

Referenced by CEGUI::RenderableElement::draw(), CEGUI::StaticImage::populateRenderCache(), and CEGUI::Static::populateRenderCache().

void CEGUI::RenderableImage::draw_impl RenderCache renderCache  )  const [protected, virtual]
 

Implementation method to draw the element into the given RenderCache.

Parameters:
renderCache RenderCache object where element imagery is to be queued.
Returns:
Nothing.

Implements CEGUI::RenderableElement.

Definition at line 107 of file CEGUIRenderableImage.cpp.

References CEGUI::RenderCache::cacheImage(), CEGUI::RenderableElement::d_area, CEGUI::Rect::d_bottom, CEGUI::RenderableElement::d_colours, CEGUI::Size::d_height, d_image, CEGUI::Rect::d_left, CEGUI::Rect::d_right, CEGUI::Rect::d_top, CEGUI::RenderableElement::d_useColoursPerImage, CEGUI::Size::d_width, getBaseXCoord(), getBaseYCoord(), getDestinationSize(), CEGUI::Rect::getHeight(), getHorzTileCount(), CEGUI::Image::getOffsetX(), CEGUI::Image::getOffsetY(), CEGUI::ColourRect::getSubRectangle(), getVertTileCount(), CEGUI::Rect::getWidth(), and CEGUI::ColourRect::isMonochromatic().

void CEGUI::RenderableImage::draw_impl const Vector3 position,
const Rect clip_rect
const [protected, virtual]
 

Renders the imagery for a RenderableImage element.

Parameters:
position Vector3 object describing the final rendering position for the object.
clip_rect Rect object describing the clipping area for the rendering. No rendering will be performed outside this area.
Returns:
Nothing.

Implements CEGUI::RenderableElement.

Definition at line 57 of file CEGUIRenderableImage.cpp.

References CEGUI::RenderableElement::d_area, CEGUI::RenderableElement::d_colours, CEGUI::Size::d_height, d_image, d_quadSplitMode, CEGUI::RenderableElement::d_useColoursPerImage, CEGUI::Size::d_width, CEGUI::Vector3::d_x, CEGUI::Vector3::d_y, CEGUI::Vector3::d_z, CEGUI::Image::draw(), getBaseXCoord(), getBaseYCoord(), getDestinationSize(), CEGUI::Rect::getHeight(), getHorzTileCount(), CEGUI::Rect::getIntersection(), CEGUI::Image::getOffsetX(), CEGUI::Image::getOffsetY(), CEGUI::Rect::getSize(), CEGUI::ColourRect::getSubRectangle(), getVertTileCount(), CEGUI::Rect::getWidth(), CEGUI::ColourRect::isMonochromatic(), and CEGUI::Rect::setSize().

float CEGUI::RenderableImage::getBaseXCoord const Size sz  )  const [protected]
 

Return base x co-ord for first tile.

Definition at line 173 of file CEGUIRenderableImage.cpp.

References CEGUI::RenderableElement::d_area, d_horzFormat, CEGUI::Size::d_width, CEGUI::Rect::getWidth(), HorzCentred, HorzStretched, HorzTiled, LeftAligned, PixelAligned, and RightAligned.

Referenced by draw_impl().

float CEGUI::RenderableImage::getBaseYCoord const Size sz  )  const [protected]
 

Return base y co-ord for first tile.

Definition at line 196 of file CEGUIRenderableImage.cpp.

References BottomAligned, CEGUI::RenderableElement::d_area, CEGUI::Size::d_height, d_vertFormat, CEGUI::Rect::getHeight(), PixelAligned, TopAligned, VertCentred, VertStretched, and VertTiled.

Referenced by draw_impl().

const ColourRect& CEGUI::RenderableElement::getColours void   )  const [inline, inherited]
 

Return the rendering colours set for this RenderableElement.

Returns:
ColourRect object describing the colours to be used when rendering this RenderableElement.

Definition at line 94 of file CEGUIRenderableElement.h.

Size CEGUI::RenderableImage::getDestinationSize  )  const [protected]
 

Return target size to be used for each tile.

Definition at line 219 of file CEGUIRenderableImage.cpp.

References CEGUI::RenderableElement::d_area, d_horzFormat, d_image, d_vertFormat, CEGUI::Image::getHeight(), CEGUI::Rect::getHeight(), CEGUI::Image::getWidth(), CEGUI::Rect::getWidth(), HorzStretched, and VertStretched.

Referenced by draw_impl().

HorzFormatting CEGUI::RenderableImage::getHorzFormatting void   )  const [inline]
 

Return current horizontal formatting setting.

Returns:
One of the HorzFormatting values specifying the formatting set.

Definition at line 167 of file CEGUIRenderableImage.h.

uint CEGUI::RenderableImage::getHorzTileCount  )  const [protected]
 

return number of horizontal tiles required.

Definition at line 163 of file CEGUIRenderableImage.cpp.

References CEGUI::RenderableElement::d_area, d_horzFormat, d_image, CEGUI::Image::getWidth(), CEGUI::Rect::getWidth(), and HorzTiled.

Referenced by draw_impl().

const Image* CEGUI::RenderableImage::getImage void   )  const [inline]
 

Return the Image object currently set to be rendered.

Returns:
Pointer to the current Image object set for this RenderableImage. May return NULL if no image is set.

Definition at line 157 of file CEGUIRenderableImage.h.

Referenced by CEGUI::PushButtonProperties::DisabledImage::get(), CEGUI::PushButtonProperties::HoverImage::get(), CEGUI::PushButtonProperties::PushedImage::get(), and CEGUI::PushButtonProperties::NormalImage::get().

RenderableElement* CEGUI::RenderableElement::getNextElement void   )  const [inline, inherited]
 

Return a pointer to the next RenderableElement in the chain.

Returns:
Pointer to a RenderableElement object that is linked this this one. May be NULL for none.

Definition at line 84 of file CEGUIRenderableElement.h.

Point CEGUI::RenderableElement::getPosition void   )  const [inline, inherited]
 

Return the offset position of this RenderableElement.

Returns:
Point object describing the offset position that this RenderableElement is to be rendered at. This value is added to whatever position is specified when the RenderableElement::draw method is called to obtain the final rendering position.

Definition at line 106 of file CEGUIRenderableElement.h.

QuadSplitMode CEGUI::RenderableImage::getQuadSplitMode void   )  const [inline]
 

Return current quad split mode setting.

Returns:
One of the QuadSplitMode values specifying the way quads are split into triangles.

Definition at line 187 of file CEGUIRenderableImage.h.

const Rect& CEGUI::RenderableElement::getRect void   )  const [inline, inherited]
 

Return the area for the element.

Returns:
Rect object describing the pixel area (offset from some unknown location) of the frame.

Definition at line 126 of file CEGUIRenderableElement.h.

Size CEGUI::RenderableElement::getSize void   )  const [inline, inherited]
 

Return the current size of the element.

Returns:
Size object describing the current size of the RenderableFrame.

Definition at line 116 of file CEGUIRenderableElement.h.

VertFormatting CEGUI::RenderableImage::getVertFormatting void   )  const [inline]
 

Return current vertical formatting setting.

Returns:
One of the VertFormatting values specifying the formatting set.

Definition at line 177 of file CEGUIRenderableImage.h.

uint CEGUI::RenderableImage::getVertTileCount  )  const [protected]
 

return number of vertical tiles required.

Definition at line 168 of file CEGUIRenderableImage.cpp.

References CEGUI::RenderableElement::d_area, d_image, d_vertFormat, CEGUI::Image::getHeight(), CEGUI::Rect::getHeight(), and VertTiled.

Referenced by draw_impl().

bool CEGUI::RenderableElement::isColourRectPerImage bool  setting  )  const [inline, inherited]
 

return whether the element colours will be applied locally to each image drawn as part of the RenderableElement, or applied across the whole of the RenderableElement area.

Returns:

Definition at line 138 of file CEGUIRenderableElement.h.

void CEGUI::RenderableElement::setColourRectPerImage bool  setting  )  [inline, inherited]
 

set whether the element colours should be applied locally to each image drawn as part of the RenderableElement, or applied across the whole of the RenderableElement area.

Parameters:
setting 
Returns:
Nothing.

Definition at line 246 of file CEGUIRenderableElement.h.

void CEGUI::RenderableElement::setColours const colour top_left_colour,
const colour top_right_colour,
const colour bottom_left_colour,
const colour bottom_right_colour
[inherited]
 

Sets the colours to be applied when rendering the element.

Parameters:
top_left_colour Colour to be applied to the top-left corner of each Image used in the element.
top_right_colour Colour to be applied to the top-right corner of each Image used in the element.
bottom_left_colour Colour to be applied to the bottom-left corner of each Image used in the element.
bottom_right_colour Colour to be applied to the bottom-right corner of each Image used in the element.
Returns:
Nothing.

Definition at line 55 of file CEGUIRenderableElement.cpp.

References CEGUI::ColourRect::d_bottom_left, CEGUI::ColourRect::d_bottom_right, CEGUI::RenderableElement::d_colours, CEGUI::ColourRect::d_top_left, and CEGUI::ColourRect::d_top_right.

void CEGUI::RenderableElement::setColours const ColourRect colours  )  [inline, inherited]
 

Sets the colours to be applied when rendering the element.

Parameters:
colours ColourRect object describing the colours to be used.
Returns:
Nothing.

Definition at line 171 of file CEGUIRenderableElement.h.

Referenced by CEGUI::Static::updateRenderableFrameColours(), and CEGUI::StaticImage::updateRenderableImageColours().

void CEGUI::RenderableImage::setHorzFormatting HorzFormatting  formatting  )  [inline]
 

Set the required horizontal formatting.

Parameters:
formatting One of the HorzFormatting values specifying the formatting required.
Returns:
Nothing

Definition at line 121 of file CEGUIRenderableImage.h.

Referenced by CEGUI::PushButtonProperties::DisabledImage::set(), CEGUI::PushButtonProperties::HoverImage::set(), CEGUI::PushButtonProperties::PushedImage::set(), CEGUI::PushButtonProperties::NormalImage::set(), CEGUI::StaticImage::setFormatting(), CEGUI::StaticImage::setHorizontalFormatting(), and CEGUI::StaticImage::StaticImage().

void CEGUI::RenderableImage::setImage const Image image  )  [inline]
 

Set the Image object to be drawn by this RenderableImage.

Parameters:
image Pointer to the Image object to be rendered. Can be NULL to specify no image is to be rendered.
Returns:
Nothing.

Definition at line 108 of file CEGUIRenderableImage.h.

Referenced by CEGUI::PushButtonProperties::DisabledImage::set(), CEGUI::PushButtonProperties::HoverImage::set(), CEGUI::PushButtonProperties::PushedImage::set(), CEGUI::PushButtonProperties::NormalImage::set(), and CEGUI::StaticImage::setImage().

void CEGUI::RenderableElement::setNextElement RenderableElement element  )  [inline, inherited]
 

Link another RenderableElement to this one.

The linked element will be drawn whenever this element is drawn using the same base position and clipping area as provided when the RenderableElement::draw method is called. Whole chains of Renderable Elements can be created using this system.

Parameters:
element Pointer to a RenderableElement object that will be linked to this element.
Returns:
Nothing.

Definition at line 158 of file CEGUIRenderableElement.h.

void CEGUI::RenderableElement::setPosition const Point position  )  [inline, inherited]
 

Set the rendering offset position for this element.

Parameters:
position Point object describing the offset position to use for this element. This value is added to whatever position is specified when the RenderableElement::draw method is called to obtain the final rendering position.
Returns:
Nothing.

Definition at line 208 of file CEGUIRenderableElement.h.

Referenced by CEGUI::StaticImage::onStaticFrameChanged().

void CEGUI::RenderableImage::setQuadSplitMode QuadSplitMode  split_mode  )  [inline]
 

Set the required quad split mode.

Parameters:
split_mode One of the QuadSplitMode values specifying the way quads are split into triangles.
Returns:
Nothing

Definition at line 147 of file CEGUIRenderableImage.h.

void CEGUI::RenderableElement::setRect const Rect area  )  [inline, inherited]
 

Set the area for the frame.

Parameters:
area Rect object describing the pixel area (offset from some unknown location) of the frame.
Returns:
None.

Definition at line 231 of file CEGUIRenderableElement.h.

Referenced by CEGUI::PushButton::onSized(), CEGUI::PushButton::setCustomImageryAutoSized(), CEGUI::PushButton::setDisabledImage(), CEGUI::PushButton::setHoverImage(), CEGUI::PushButton::setNormalImage(), and CEGUI::PushButton::setPushedImage().

void CEGUI::RenderableElement::setSize const Size size  )  [inline, inherited]
 

set the dimensions for the frame.

Parameters:
size Size object describing the new size for the frame (in pixels)

Definition at line 218 of file CEGUIRenderableElement.h.

Referenced by CEGUI::StaticImage::onSized(), CEGUI::Static::onSized(), and CEGUI::StaticImage::onStaticFrameChanged().

void CEGUI::RenderableImage::setVertFormatting VertFormatting  formatting  )  [inline]
 

Set the required vertical formatting.

Parameters:
formatting One of the VertFormatting values specifying the formatting required.
Returns:
Nothing

Definition at line 134 of file CEGUIRenderableImage.h.

Referenced by CEGUI::PushButtonProperties::DisabledImage::set(), CEGUI::PushButtonProperties::HoverImage::set(), CEGUI::PushButtonProperties::PushedImage::set(), CEGUI::PushButtonProperties::NormalImage::set(), CEGUI::StaticImage::setFormatting(), CEGUI::StaticImage::setVerticalFormatting(), and CEGUI::StaticImage::StaticImage().


Member Data Documentation

Rect CEGUI::RenderableElement::d_area [protected, inherited]
 

Currently defined area for this element.

Definition at line 304 of file CEGUIRenderableElement.h.

Referenced by CEGUI::RenderableElement::draw(), draw_impl(), CEGUI::RenderableFrame::draw_impl(), getBaseXCoord(), getBaseYCoord(), getDestinationSize(), getHorzTileCount(), and getVertTileCount().

ColourRect CEGUI::RenderableElement::d_colours [protected, inherited]
 

Colours to be used for this element;.

Definition at line 303 of file CEGUIRenderableElement.h.

Referenced by draw_impl(), CEGUI::RenderableFrame::draw_impl(), and CEGUI::RenderableElement::setColours().

HorzFormatting CEGUI::RenderableImage::d_horzFormat [protected]
 

Currently set horizontal formatting option.

Definition at line 245 of file CEGUIRenderableImage.h.

Referenced by getBaseXCoord(), getDestinationSize(), and getHorzTileCount().

const Image* CEGUI::RenderableImage::d_image [protected]
 

Pointer to the actual Image to be displayed.

Definition at line 248 of file CEGUIRenderableImage.h.

Referenced by draw_impl(), getDestinationSize(), getHorzTileCount(), and getVertTileCount().

RenderableElement* CEGUI::RenderableElement::d_next [protected, inherited]
 

Link to another RenderableElement.

Definition at line 302 of file CEGUIRenderableElement.h.

Referenced by CEGUI::RenderableElement::draw().

QuadSplitMode CEGUI::RenderableImage::d_quadSplitMode [protected]
 

Currently set quad split mode.

Definition at line 247 of file CEGUIRenderableImage.h.

Referenced by draw_impl().

bool CEGUI::RenderableElement::d_useColoursPerImage [protected, inherited]
 

true if d_colours should be applied separately to each Image drawn (false to interpolate across d_area).

Definition at line 305 of file CEGUIRenderableElement.h.

Referenced by draw_impl(), and CEGUI::RenderableFrame::draw_impl().

VertFormatting CEGUI::RenderableImage::d_vertFormat [protected]
 

Currently set vertical formatting option.

Definition at line 246 of file CEGUIRenderableImage.h.

Referenced by getBaseYCoord(), getDestinationSize(), and getVertTileCount().


The documentation for this class was generated from the following files:
Generated on Wed Sep 7 10:06:53 2005 for Crazy Eddies GUI System by  doxygen 1.4.3