20 #ifndef _SCREENIMAGEMGR_HPP_
21 #define _SCREENIMAGEMGR_HPP_
24 #include "StelModule.hpp"
26 #include "VecMath.hpp"
30 #include <QStringList>
34 class QGraphicsPixmapItem;
36 class QGraphicsItemAnimation;
52 ScreenImage(
const QString& filename,
float x,
float y,
bool show=
false,
float scale=1.,
float alpha=1.,
float fadeDuration=1.);
59 virtual void update(
double deltaTime);
75 virtual void setXY(
float x,
float y,
float duration=0.);
80 virtual void addXY(
float x,
float y,
float duration=0.);
81 virtual int imageHeight(
void);
82 virtual int imageWidth(
void);
85 QGraphicsPixmapItem* tex;
88 QGraphicsItemAnimation* anim;
91 void setOpacity(qreal alpha);
118 virtual void update(
double deltaTime);
133 const QString& filename,
139 float fadeDuration=1.);
148 int getImageHeight(
const QString&
id);
149 void showImage(
const QString&
id,
bool show);
159 void setImageXY(
const QString&
id,
float x,
float y,
float duration=0.);
169 QMap<QString, ScreenImage*> allScreenImages;
172 #endif // _SCREENIMAGEMGR_HPP_
QStringList getAllImageIDs(void)
Get a list of currently loaded image IDs.
void deleteAllImages(void)
Delete all images currently managed by ScreenImageMgr.
virtual bool getFlagShow(void)
Get the displayed status of the image.
void deleteImage(const QString &id)
Delete an image.
Module for managing images for scripting.
virtual bool draw(const StelCore *core)
Draw the image.
Define the StelTextureSP type.
virtual void setFadeDuration(float duration)
Set the duration used for the fade in / fade out of the image.
Main class for Stellarium core processing.
virtual void setXY(float x, float y, float duration=0.)
Set the x, y position of the image.
virtual void setFlagShow(bool b)
Show or hide the image (it will fade in/out)
virtual void addXY(float x, float y, float duration=0.)
Set the x, y position of the image relative to the current position.
virtual double getCallOrder(StelModuleActionName actionName) const
Defines the order in which the various modules are drawn.
virtual void draw(StelCore *core)
Execute all the drawing functions for this module.
virtual void setAlpha(float a)
Set the image alpha for when it is in full "on" (after fade in).
virtual void init()
Initialize itself.
void setImageXY(const QString &id, float x, float y, float duration=0.)
Set the x and y coordinates for the specified image.
void setImageAlpha(const QString &id, float alpha)
Set an image's alpha value when visible.
StelModuleActionName
Define the possible action for which an order is defined.
void createScreenImage(const QString &id, const QString &filename, float x, float y, float scale=1., bool visible=true, float alpha=1., float fadeDuration=1.)
Create an image from a file and display on the screen at x,y coordinates.
bool getShowImage(const QString &id)
Find out if an image is currently visible.
ScreenImageMgr()
Construct a LabelMgr object.
virtual void update(double deltaTime)
Update time-dependent parts of the module.
int getImageWidth(const QString &id)
Set an image's visible status.
ScreenImage(const QString &filename, float x, float y, bool show=false, float scale=1., float alpha=1., float fadeDuration=1.)
Load an image.
This is the common base class for all the main components of stellarium.
virtual void update(double deltaTime)
update fade for on/off action