Home · All Namespaces · All Classes · Functions · Coding Style · Scripting · Plugins · File Structure

ScreenImageMgr Class Reference

Module for managing images for scripting. More...

#include <ScreenImageMgr.hpp>

Inherits StelModule.

List of all members.

Public Slots

void createScreenImage (const QString &id, const QString &filename, float x, float y, float scale=1., bool visible=true, float alpha=1., float fadeDuration=1.)
bool getShowImage (const QString &id)
int getImageWidth (const QString &id)
int getImageHeight (const QString &id)
void showImage (const QString &id, bool show)
void setImageAlpha (const QString &id, float alpha)
void setImageXY (const QString &id, float x, float y, float duration=0.)
void deleteImage (const QString &id)
void deleteAllImages (void)
QStringList getAllImageIDs (void)

Public Member Functions

 ScreenImageMgr ()
virtual void init ()
virtual void draw (StelCore *core)
virtual void update (double deltaTime)
virtual double getCallOrder (StelModuleActionName actionName) const


Detailed Description

Module for managing images for scripting.

Images are identified by a string ID which is passed to ScreenImageMgr members when it is necessary to specify an image to work with. Member functions in this class which modify the state of the class are all mediated through the signal/slot mechanism to ensure such operations happen in the main thread where images are drawn, and not in the script thread.


Constructor & Destructor Documentation

ScreenImageMgr::ScreenImageMgr (  ) 

Construct a LabelMgr object.


Member Function Documentation

virtual void ScreenImageMgr::init (  )  [virtual]

Initialize itself.

If the initialization takes significant time, the progress should be displayed on the loading bar.

Implements StelModule.

virtual void ScreenImageMgr::draw ( StelCore core  )  [virtual]

Execute all the drawing functions for this module.

Parameters:
core the core to use for the drawing

Reimplemented from StelModule.

virtual void ScreenImageMgr::update ( double  deltaTime  )  [virtual]

Update time-dependent parts of the module.

Implements StelModule.

virtual double ScreenImageMgr::getCallOrder ( StelModuleActionName  actionName  )  const [virtual]

Defines the order in which the various modules are drawn.

Reimplemented from StelModule.

void ScreenImageMgr::createScreenImage ( const QString &  id,
const QString &  filename,
float  x,
float  y,
float  scale = 1.,
bool  visible = true,
float  alpha = 1.,
float  fadeDuration = 1. 
) [slot]

Create an image from a file and display on the screen at x,y coordinates.

Parameters:
id the ID to use when referring to this image (an arbitrary string).
filename the partial path of the file to load. This will be searched for using StelFileMgr, with "scripts/" prefixed to the filename.
x The x-coordinate for the image (0 = left of screen)
y The y-coordinate for the image (0 = bottom of screen)
visible The initial visible state of the image
alpha The initial alpha (transparancy) value for the image (range 0.0 to 1.0)
fadeDuration the time it takes for screen images to fade in/out/change alpha in seconds.

bool ScreenImageMgr::getShowImage ( const QString &  id  )  [slot]

Find out if an image is currently visible.

Parameters:
id the ID for the desired image.

int ScreenImageMgr::getImageWidth ( const QString &  id  )  [slot]

Set an image's visible status.

Parameters:
id the ID for the desired image.
show the new visible state to set.

void ScreenImageMgr::setImageAlpha ( const QString &  id,
float  alpha 
) [slot]

Set an image's alpha value when visible.

Parameters:
id the ID for the desired image.
alpha the new alpha value to set.

void ScreenImageMgr::setImageXY ( const QString &  id,
float  x,
float  y,
float  duration = 0. 
) [slot]

Set the x and y coordinates for the specified image.

Parameters:
id the ID for the desired image.
x The new x-coordinate for the image.
y The new y-coordinate for the image.
duration The time for the change to take place, in seconds.

void ScreenImageMgr::deleteImage ( const QString &  id  )  [slot]

Delete an image.

Parameters:
id the ID for the desired image.

void ScreenImageMgr::deleteAllImages ( void   )  [slot]

Delete all images currently managed by ScreenImageMgr.

QStringList ScreenImageMgr::getAllImageIDs ( void   )  [slot]

Get a list of currently loaded image IDs.


Generated on Wed Jun 2 13:11:13 2010 for Stellarium by  doxygen 1.5.5