21 #ifndef _SCREENIMAGEMGR_HPP_ 22 #define _SCREENIMAGEMGR_HPP_ 25 #include "StelModule.hpp" 27 #include "VecMath.hpp" 31 #include <QStringList> 35 class QGraphicsPixmapItem;
37 class QGraphicsItemAnimation;
56 ScreenImage(
const QString& filename,
float x,
float y,
bool show=
false,
float scale=1.,
float alpha=1.,
float fadeDuration=1.);
63 virtual void update(
double deltaTime);
81 virtual void setXY(
float x,
float y,
float duration=0.);
87 virtual void addXY(
float x,
float y,
float duration=0.);
88 virtual int imageHeight(
void);
89 virtual int imageWidth(
void);
95 virtual void setScale(
float scaleX,
float scaleY,
float duration=0.);
96 virtual float imageScaleX(
void);
97 virtual float imageScaleY(
void);
100 QGraphicsPixmapItem* tex;
101 QTimeLine* moveTimer;
102 QTimeLine* fadeTimer;
103 QTimeLine* scaleTimer;
104 QGraphicsItemAnimation* anim;
105 QGraphicsItemAnimation* scaleAnim;
108 void setOpacity(qreal alpha);
135 virtual void update(
double deltaTime);
151 void createScreenImage(
const QString&
id,
152 const QString& filename,
158 float fadeDuration=1.);
163 bool getShowImage(
const QString&
id);
167 void showImage(
const QString&
id,
bool show);
170 int getImageWidth(
const QString&
id);
173 int getImageHeight(
const QString&
id);
180 void setImageScale(
const QString&
id,
float scaleX,
float scaleY,
float duration=0.);
183 float getImageScaleX(
const QString&
id);
186 float getImageScaleY(
const QString&
id);
190 void setImageAlpha(
const QString&
id,
float alpha);
196 void setImageXY(
const QString&
id,
float x,
float y,
float duration=0.);
202 void addImageXY(
const QString&
id,
float x,
float y,
float duration=0.);
205 void deleteImage(
const QString&
id);
207 void deleteAllImages(
void);
209 QStringList getAllImageIDs(
void);
212 QMap<QString, ScreenImage*> allScreenImages;
215 #endif // _SCREENIMAGEMGR_HPP_ virtual bool getFlagShow(void)
Get the displayed status of the image.
virtual void setScale(float scaleX, float scaleY, float duration=0.)
Set the image scale relative to the size originally loaded.
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 void setAlpha(float a)
Set the image alpha for when it is in full "on" (after fade in).
StelModuleActionName
Define the possible action for which an order is defined.
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)
Empty dummy. The various animations are updated by other means.