Orxonox: orxonox::HUDBar Class Reference

# orxonox::HUDBar Class Reference

`#include <src/orxonox/overlays/hud/HUDBar.h>`

Inheritance diagram for orxonox::HUDBar:

List of all members.

## Public Member Functions

void | clearColours ()
bool | getAutoColour () const
const std::string & | getBarTexture () const
const ColourValue & | getCurrentBarColour () const
bool | getRightToLeft () const
float | getValue () const
| HUDBar (BaseObject *creator)
void | setAutoColour (bool val)
void | setBarTexture (const std::string &texture)
void | setRightToLeft (bool r2l)
void | setValue (float value)
virtual void | XMLPort (Element &xmlElement, XMLPort::Mode mode)
| Loads the OrxonoxOverlay.
virtual | ~HUDBar ()

## Protected Member Functions

virtual void | valueChanged ()

## Private Member Functions

void | addColour (BarColour *colour)
BarColour * | getColour (unsigned int index)

## Private Attributes

bool | autoColour_
| whether bar changes colour automatically
Ogre::PanelOverlayElement * | bar_
std::vector< BarColour * > | barColours_
std::map< float, ColourValue > | colours_
ColourValue | currentColour_
bool | right2Left_
Ogre::TextureUnitState * | textureUnitState_
float | value_
| progress of bar

## Static Private Attributes

static unsigned int | materialcount_s = 0

## Constructor & Destructor Documentation

orxonox::HUDBar::HUDBar | ( | BaseObject * | creator | ) |

References orxonox::OrxonoxOverlay::background_, bar_, orxonox::MT_Type::ColourValue, currentColour_, orxonox::getUniqueNumberString(), materialcount_s, orxonox::multi_cast(), RegisterObject, setAutoColour(), setRightToLeft(), setValue(), textureUnitState_, and value_.

orxonox::HUDBar::~HUDBar | ( |  | ) | `[virtual]`

References bar_, and orxonox::BaseObject::isInitialized().

## Member Function Documentation

void orxonox::HUDBar::addColour | ( | BarColour * | colour | ) | `[private]`

References barColours_, colours_, orxonox::BarColour::getColour(), and orxonox::BarColour::getPosition().

Referenced by XMLPort().

void orxonox::HUDBar::clearColours | ( |  | ) |

References colours_.

bool orxonox::HUDBar::getAutoColour | ( |  | ) | const`[inline]`

Referenced by XMLPort().

const std::string & orxonox::HUDBar::getBarTexture | ( |  | ) | const

References textureUnitState_.

Referenced by XMLPort().

BarColour * orxonox::HUDBar::getColour | ( | unsigned int | index | ) | `[private]`

References barColours_.

Referenced by XMLPort().

const ColourValue& orxonox::HUDBar::getCurrentBarColour | ( |  | ) | const`[inline]`

Referenced by orxonox::HUDHealthBar::tick().

bool orxonox::HUDBar::getRightToLeft | ( |  | ) | const`[inline]`

Referenced by XMLPort().

float orxonox::HUDBar::getValue | ( |  | ) | const`[inline]`

Referenced by XMLPort().

void orxonox::HUDBar::setAutoColour | ( | bool | val | ) | `[inline]`

Referenced by HUDBar(), and XMLPort().

void orxonox::HUDBar::setBarTexture | ( | const std::string & | texture | ) |

References textureUnitState_.

Referenced by XMLPort().

void orxonox::HUDBar::setRightToLeft | ( | bool | r2l | ) | `[inline]`

Referenced by HUDBar(), and XMLPort().

void orxonox::HUDBar::setValue | ( | float | value | ) | `[inline]`

References orxonox::clamp().

Referenced by HUDBar(), orxonox::HUDSpeedBar::tick(), orxonox::HUDHealthBar::tick(), and XMLPort().

void orxonox::HUDBar::valueChanged | ( |  | ) | `[protected, virtual]`

References autoColour_, bar_, colours_, orxonox::MT_Type::ColourValue, currentColour_, orxonox::interpolateSmooth(), right2Left_, textureUnitState_, and value_.

void orxonox::HUDBar::XMLPort | ( | Element & | xmlElement,
|  | XMLPort::Mode | mode |
| ) |  |  | `[virtual]`

Loads the OrxonoxOverlay.

This has to be called before usage, otherwise strange behaviour is guaranteed! (there should be no segfaults however). XML loading and saving.

Parameters:

  | xmlelement | The XML-element
  | loading | Loading (true) or saving (false)

Returns:
  The XML-element

Reimplemented from orxonox::OrxonoxOverlay.

Reimplemented in orxonox::HUDHealthBar, and orxonox::UnderAttackHealthBar.

References addColour(), getAutoColour(), getBarTexture(), getColour(), getRightToLeft(), getValue(), setAutoColour(), setBarTexture(), setRightToLeft(), setValue(), SUPER, XMLPortObject, and XMLPortParam.

## Member Data Documentation

bool orxonox::HUDBar::autoColour_`[private]`

whether bar changes colour automatically

Referenced by valueChanged().

Ogre::PanelOverlayElement* orxonox::HUDBar::bar_`[private]`

Referenced by HUDBar(), valueChanged(), and ~HUDBar().

std::vector<BarColour*> orxonox::HUDBar::barColours_`[private]`

Referenced by addColour(), and getColour().

std::map<float, ColourValue> orxonox::HUDBar::colours_`[private]`

Referenced by addColour(), clearColours(), and valueChanged().

ColourValue orxonox::HUDBar::currentColour_`[private]`

Referenced by HUDBar(), and valueChanged().

unsigned int orxonox::HUDBar::materialcount_s = 0`[static, private]`

Referenced by HUDBar().

bool orxonox::HUDBar::right2Left_`[private]`

Referenced by valueChanged().

Ogre::TextureUnitState* orxonox::HUDBar::textureUnitState_`[private]`

Referenced by getBarTexture(), HUDBar(), setBarTexture(), and valueChanged().

float orxonox::HUDBar::value_`[private]`

progress of bar

Referenced by HUDBar(), and valueChanged().

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

- src/orxonox/overlays/hud/HUDBar.h
- src/orxonox/overlays/hud/HUDBar.cc