#include <src/orxonox/overlays/notifications/NotificationOverlay.h>
Public Member Functions | |
NotificationOverlay (NotificationQueue *queue, Notification *notification) | |
Constructor. Initializes the class creates a graphical representation of the input Notification for the input Queue. | |
NotificationOverlay (BaseObject *creator) | |
Constructor. Intializes the class. | |
bool | processNotification (Notification *notification) |
Processes the input Notification. | |
void | setFontSize (float size) |
Sets the font size of this overlay's text. | |
virtual | ~NotificationOverlay () |
Destructor. | |
Protected Member Functions | |
std::string | clipMessage (const std::string &message) |
Clips the input message if too long. | |
Private Member Functions | |
void | defineOverlay (void) |
Sets some overlay-specific values. | |
void | initialize (void) |
Initializes the object. | |
Private Attributes | |
Notification * | notification_ |
The Notification this overlay displays. | |
NotificationQueue * | queue_ |
The NotificationQeue this overlay belongs to. |
orxonox::NotificationOverlay::NotificationOverlay | ( | BaseObject * | creator | ) |
orxonox::NotificationOverlay::NotificationOverlay | ( | NotificationQueue * | queue, | |
Notification * | notification | |||
) |
Constructor. Initializes the class creates a graphical representation of the input Notification for the input Queue.
queue | A pointer to the queue the NotificatonOverlay belongs to. | |
notification | A pointer to the Notification represented by this overlay. |
Argument | Throws an Argument-Exception if either no Notification or no NotificationQueue were input. |
> If either notification or queue are not given an Exception is thrown.
References defineOverlay(), initialize(), processNotification(), queue_, and ThrowException.
orxonox::NotificationOverlay::~NotificationOverlay | ( | ) | [virtual] |
Destructor.
std::string orxonox::NotificationOverlay::clipMessage | ( | const std::string & | message | ) | [protected] |
Clips the input message if too long.
Clips the input message so that it meets the requirements for the maximal length of Notifications given by the NotificationQueue.
< If the message is not too long.
References orxonox::NotificationQueue::getNotificationLength(), and queue_.
Referenced by processNotification().
void orxonox::NotificationOverlay::defineOverlay | ( | void | ) | [private] |
Sets some overlay-specific values.
Set some Overlay-specific values.
References orxonox::NotificationQueue::getFont(), orxonox::NotificationQueue::getFontSize(), orxonox::NotificationQueue::getPosition(), queue_, orxonox::OverlayText::setFont(), orxonox::OrxonoxOverlay::setPosition(), and orxonox::OverlayText::setTextSize().
Referenced by NotificationOverlay().
void orxonox::NotificationOverlay::initialize | ( | void | ) | [private] |
Initializes the object.
Initializes and Registers the object.
References queue_.
Referenced by NotificationOverlay().
bool orxonox::NotificationOverlay::processNotification | ( | Notification * | notification | ) |
Processes the input Notification.
Processes the input notification, resp. sees to it. that the NotificationOverlay displays the Notification message.
notification | A pointer to the notification that should be processed. |
References clipMessage(), orxonox::Notification::getMessage(), notification_, and orxonox::OverlayText::setCaption().
Referenced by NotificationOverlay().
void orxonox::NotificationOverlay::setFontSize | ( | float | size | ) | [inline] |
Sets the font size of this overlay's text.
size | The font size. |
The NotificationQeue this overlay belongs to.
Referenced by clipMessage(), defineOverlay(), initialize(), and NotificationOverlay().