Om  1.0.0
A universal framework for multimedia simulation
Classes | Public Types | Public Member Functions | Static Public Member Functions | List of all members
om::graphics::gui::base::GUIImage Class Reference

A class that represents a rectangular region containing an image drawn by an arbitrary process. More...

#include <omGraphicsGUIImage.h>

Classes

class  Delegate
 A class that contains function objects that recieve GUIImage events. More...
 

Public Types

enum  Type {
  CHECK, CHECK_CIRCLE, CIRCLE, CLOCK,
  EDIT, ET_CETERA, EYE, FOLDER,
  HARD_DISK, MINIMIZE, OPEN_IN_WINDOW, PLUS,
  PLUS_CIRCLE, POWER, SEARCH, SHARED,
  TAG, TIMES, TIMES_CIRCLE, TRIANGLE_LEFT,
  TRIANGLE_RIGHT, TRIANGLE_UP, TRIANGLE_DOWN, WINDOW
}
 An enum containing standard GUI image types. More...
 

Public Member Functions

 GUIImage ()
 Create a new GUI image with a width and height of 0. More...
 
 GUIImage (const Vector2f &newSize)
 Create a new GUI image with the specified displayed size in pixels. More...
 
const Vector2fgetSize () const
 Return a 2D vector representing the displayed size of this image in pixels. More...
 
void setSize (const Vector2f &newSize)
 Set a 2D vector representing the displayed size of this image in pixels. More...
 
const AABB2fgetBounds () const
 Return a 2D bounding box within the image's normalized coordinates (0 to 1) where the image is located. More...
 
void setBounds (const AABB2f &newBounds)
 Set a 2D bounding box within the image's normalized coordinates (0 to 1) where the image is located. More...
 
const Color4f & getColor () const
 Return a color that should be used to tint the image's appearance. More...
 
void setColor (const Color4f &newColor)
 Set a color that should be used to tint the image's appearance. More...
 
Image * getImage () const
 Return a pointer to this image's raster representation. More...
 
void setImage (Image *newImage)
 Set a pointer to this image's raster representation. More...
 
const DelegategetDelegate () const
 Return an object that contains functions that respond to GUI image events. More...
 
void setDelegate (const Delegate &newDelegate)
 Set an object that contains functions that respond to GUI image events. More...
 

Static Public Member Functions

static Bool get (Type imageType, const Vector2f &size, const Color4f &color, GUIImage &image)
 Get an image object that represents the specified standard image type. More...
 
static GUIImage get (Type imageType, const Vector2f &size, const Color4f &color)
 Return an image object that represents the specified standard image type. More...
 

Detailed Description

A class that represents a rectangular region containing an image drawn by an arbitrary process.

This abstraction allows GUIs to use pixel-based or vector-based images (via an external callback interface).

Member Enumeration Documentation

An enum containing standard GUI image types.

Enumerator
CHECK 

A check mark icon.

CHECK_CIRCLE 

A check mark icon that is cut out from a circular area.

CIRCLE 

A solid circle icon.

CLOCK 

An icon that looks like an analogue clock.

EDIT 

An icon that looks like a pen and paper and is used to indicate editing something.

ET_CETERA 

An icon that looks a few dots, indicate there are more options.

EYE 

An eye icon, usually representing the visibility of something.

FOLDER 

A folder icon that represents a directory or grouping.

HARD_DISK 

An icon that represents computer hard drive storage.

MINIMIZE 

An icon that represents the action of minimizing a window.

OPEN_IN_WINDOW 

An icon that represents the action of opening something in a new window.

PLUS 

A plus (addition) symbol icon.

PLUS_CIRCLE 

A plus symbol icon that is cut out from a circular area.

POWER 

A power symbol icon, used to turn something on or off.

SEARCH 

A magnifying glass icon that is used to represent searching.

SHARED 

A chain icon indicating that something is shared or linked.

TAG 

An icon that represents a tag, e.g. semantic metadata.

TIMES 

An 'X' (multiplication) symbol icon.

TIMES_CIRCLE 

An 'X' (multiplication) symbol icon that is cut out from a circular area.

TRIANGLE_LEFT 

A triangle icon that is pointing toward the left.

TRIANGLE_RIGHT 

A triangle icon that is pointing toward the right.

TRIANGLE_UP 

A triangle icon that is pointing up.

TRIANGLE_DOWN 

A triangle icon that is pointing down.

WINDOW 

An icon that represents a window in a GUI system.

Constructor & Destructor Documentation

om::graphics::gui::base::GUIImage::GUIImage ( )
inline

Create a new GUI image with a width and height of 0.

om::graphics::gui::base::GUIImage::GUIImage ( const Vector2f newSize)
inline

Create a new GUI image with the specified displayed size in pixels.

Member Function Documentation

const Vector2f& om::graphics::gui::base::GUIImage::getSize ( ) const
inline

Return a 2D vector representing the displayed size of this image in pixels.

This is the size that the image is scaled to (neglecting any parent scaling) when it is displayed. This size also determines the aspect ratio of the image.

void om::graphics::gui::base::GUIImage::setSize ( const Vector2f newSize)
inline

Set a 2D vector representing the displayed size of this image in pixels.

This is the size that the image is scaled to (neglecting any parent scaling) when it is displayed. This size also determines the aspect ratio of the image.

const AABB2f& om::graphics::gui::base::GUIImage::getBounds ( ) const
inline

Return a 2D bounding box within the image's normalized coordinates (0 to 1) where the image is located.

void om::graphics::gui::base::GUIImage::setBounds ( const AABB2f newBounds)
inline

Set a 2D bounding box within the image's normalized coordinates (0 to 1) where the image is located.

const Color4f& om::graphics::gui::base::GUIImage::getColor ( ) const
inline

Return a color that should be used to tint the image's appearance.

void om::graphics::gui::base::GUIImage::setColor ( const Color4f &  newColor)
inline

Set a color that should be used to tint the image's appearance.

Image* om::graphics::gui::base::GUIImage::getImage ( ) const
inline

Return a pointer to this image's raster representation.

If the image's delegate does not have a valid draw function set, this representation is used to draw the image using the default method.

void om::graphics::gui::base::GUIImage::setImage ( Image *  newImage)
inline

Set a pointer to this image's raster representation.

If the image's delegate does not have a valid draw function set, this representation is used to draw the image using the default method.

const Delegate& om::graphics::gui::base::GUIImage::getDelegate ( ) const
inline

Return an object that contains functions that respond to GUI image events.

void om::graphics::gui::base::GUIImage::setDelegate ( const Delegate newDelegate)
inline

Set an object that contains functions that respond to GUI image events.

static Bool om::graphics::gui::base::GUIImage::get ( Type  imageType,
const Vector2f size,
const Color4f &  color,
GUIImage image 
)
static

Get an image object that represents the specified standard image type.

The image is created with the given size and tint color. The method returns whether or not an image for that type was found.

static GUIImage om::graphics::gui::base::GUIImage::get ( Type  imageType,
const Vector2f size,
const Color4f &  color 
)
static

Return an image object that represents the specified standard image type.

The image is created with the given size and tint color.


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