00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef _STELMAINSCRIPTAPI_HPP_
00021 #define _STELMAINSCRIPTAPI_HPP_
00022
00023 #include <QObject>
00024 #include <QVariant>
00025 #include <QStringList>
00026
00027 class QScriptEngine;
00028
00035 class StelMainScriptAPI : public QObject
00036 {
00037 Q_OBJECT
00038 Q_PROPERTY(double JDay READ getJDay WRITE setJDay)
00039 Q_PROPERTY(double timeSpeed READ getTimeRate WRITE setTimeRate)
00040
00041 public:
00042 StelMainScriptAPI(QObject *parent = 0);
00043 ~StelMainScriptAPI();
00044
00045
00046 public slots:
00049 void setJDay(double JD);
00052 double getJDay() const;
00053
00071 void setDate(const QString& dt, const QString& spec="utc");
00072
00078 QString getDate(const QString& spec="utc");
00079
00083 QString getDeltaT() const;
00084
00090 void setTimeRate(double ts);
00093 double getTimeRate() const;
00094
00098 bool isRealTime();
00099
00101 void setRealTime();
00102
00108 void selectObjectByName(const QString& name, bool pointer=false);
00109
00123 QVariantMap getObjectPosition(const QString& name);
00124
00143 QVariantMap getObjectInfo(const QString& name);
00144
00152 void clear(const QString& state="natural");
00153
00157 double getViewAltitudeAngle();
00158
00162 double getViewAzimuthAngle();
00163
00167 double getViewRaAngle();
00168
00172 double getViewDecAngle();
00173
00176 double getViewRaJ2000Angle();
00177
00180 double getViewDecJ2000Angle();
00181
00187 void moveToAltAzi(const QString& alt, const QString& azi, float duration=1.);
00188
00194 void moveToRaDec(const QString& ra, const QString& dec, float duration=1.);
00195
00201 void moveToRaDecJ2000(const QString& ra, const QString& dec, float duration=1.);
00202
00220 void setObserverLocation(double longitude, double latitude, double altitude, double duration=1., const QString& name="", const QString& planet="");
00221
00227 void setObserverLocation(const QString id, float duration=1.);
00228
00230 QString getObserverLocation();
00231
00242 QVariantMap getObserverLocationInfo();
00243
00249 void screenshot(const QString& prefix, bool invert=false, const QString& dir="");
00250
00254 void setGuiVisible(bool b);
00255
00261 void setMinFps(float m);
00262
00265 float getMinFps();
00266
00269 void setMaxFps(float m);
00270
00273 float getMaxFps();
00274
00277 QString getMountMode();
00278
00281 void setMountMode(const QString& mode);
00282
00285 bool getNightMode();
00286
00289 void setNightMode(bool b);
00290
00294 QString getProjectionMode();
00295
00307 void setProjectionMode(const QString& id);
00308
00311 bool getDiskViewport();
00312
00315 void setDiskViewport(bool b);
00316
00319 QStringList getAllSkyCultureIDs();
00320
00324 QString getSkyCulture();
00325
00328 void setSkyCulture(const QString& id);
00329
00332 bool getFlagGravityLabels();
00333
00336 void setFlagGravityLabels(bool b);
00337
00356 void loadSkyImage(const QString& id, const QString& filename,
00357 double ra0, double dec0,
00358 double ra1, double dec1,
00359 double ra2, double dec2,
00360 double ra3, double dec3,
00361 double minRes=2.5, double maxBright=14, bool visible=true);
00362
00363
00367 void loadSkyImage(const QString& id, const QString& filename,
00368 const QString& ra0, const QString& dec0,
00369 const QString& ra1, const QString& dec1,
00370 const QString& ra2, const QString& dec2,
00371 const QString& ra3, const QString& dec3,
00372 double minRes=2.5, double maxBright=14, bool visible=true);
00373
00388 void loadSkyImage(const QString& id, const QString& filename,
00389 double ra, double dec, double angSize, double rotation,
00390 double minRes=2.5, double maxBright=14, bool visible=true);
00391
00396 void loadSkyImage(const QString& id, const QString& filename,
00397 const QString& ra, const QString& dec, double angSize, double rotation,
00398 double minRes=2.5, double maxBright=14, bool visible=true);
00399
00418 void loadSkyImageAltAz(const QString& id, const QString& filename,
00419 double alt0, double azi0,
00420 double alt1, double azi1,
00421 double alt2, double azi2,
00422 double alt3, double azi3,
00423 double minRes=2.5, double maxBright=14, bool visible=true);
00424
00439 void loadSkyImageAltAz(const QString& id, const QString& filename,
00440 double alt, double azi, double angSize, double rotation,
00441 double minRes=2.5, double maxBright=14, bool visible=true);
00442
00445 void removeSkyImage(const QString& id);
00446
00451 void loadSound(const QString& filename, const QString& id);
00452
00455 void playSound(const QString& id);
00456
00460 void pauseSound(const QString& id);
00461
00466 void stopSound(const QString& id);
00467
00471 void dropSound(const QString& id);
00472
00481 void loadVideo(const QString& filename, const QString& id, float x, float y, bool show, float alpha);
00482
00485 void playVideo(const QString& id);
00486
00490 void pauseVideo(const QString& id);
00491
00496 void stopVideo(const QString& id);
00497
00501 void dropVideo(const QString& id);
00502
00506 void seekVideo(const QString& id, qint64 ms);
00507
00512 void setVideoXY(const QString& id, float x, float y);
00513
00517 void setVideoAlpha(const QString& id, float alpha);
00518
00523 void resizeVideo(const QString& id, float w, float h);
00524
00528 void showVideo(const QString& id, bool show);
00529
00532 int getScreenWidth();
00535 int getScreenHeight();
00536
00539 double getScriptRate();
00544 void setScriptRate(double r);
00545
00548 void pauseScript();
00549
00552 void setSelectedObjectInfo(const QString& level);
00553
00555 void exit();
00556
00558 void quitStellarium();
00559
00562 void debug(const QString& s);
00563
00566 QString getAppLanguage();
00567
00570 void setAppLanguage(QString langCode);
00571
00574 QString getSkyLanguage();
00575
00578 void setSkyLanguage(QString langCode);
00579
00581 void goHome();
00582
00585 void setMilkyWayVisible(bool b);
00586
00589 void setMilkyWayIntensity(float i);
00590
00593 float getMilkyWayIntensity();
00594
00598 double jdFromDateString(const QString& dt, const QString& spec);
00599
00600 signals:
00601 void requestLoadSkyImage(const QString& id, const QString& filename,
00602 double c1, double c2,
00603 double c3, double c4,
00604 double c5, double c6,
00605 double c7, double c8,
00606 double minRes, double maxBright, bool visible);
00607 void requestLoadSkyImageAltAz(const QString& id, const QString& filename,
00608 double c1, double c2,
00609 double c3, double c4,
00610 double c5, double c6,
00611 double c7, double c8,
00612 double minRes, double maxBright, bool visible);
00613
00614
00615 void requestRemoveSkyImage(const QString& id);
00616
00617 void requestLoadSound(const QString& filename, const QString& id);
00618 void requestPlaySound(const QString& id);
00619 void requestPauseSound(const QString& id);
00620 void requestStopSound(const QString& id);
00621 void requestDropSound(const QString& id);
00622 void requestLoadVideo(const QString& filename, const QString& id, float x, float y, bool show, float alpha);
00623 void requestPlayVideo(const QString& id);
00624 void requestPauseVideo(const QString& id);
00625 void requestStopVideo(const QString& id);
00626 void requestDropVideo(const QString& id);
00627 void requestSeekVideo(const QString& id, qint64 ms);
00628 void requestSetVideoXY(const QString& id, float x, float y);
00629 void requestSetVideoAlpha(const QString& id, float alpha);
00630 void requestResizeVideo(const QString& id, float w, float h);
00631 void requestShowVideo(const QString& id, bool show);
00632
00633 void requestSetNightMode(bool b);
00634 void requestSetProjectionMode(QString id);
00635 void requestSetSkyCulture(QString id);
00636 void requestSetDiskViewport(bool b);
00637 void requestExit();
00638 void requestSetHomePosition();
00639 };
00640
00641 #endif // _STELMAINSCRIPTAPI_HPP_
00642