2001-11-27 18:50:04 -07:00
|
|
|
// celestiacore.h
|
2018-03-11 07:12:58 -06:00
|
|
|
//
|
2009-01-26 13:49:35 -07:00
|
|
|
// Copyright (C) 2001-2009, the Celestia Development Team
|
2001-11-27 18:50:04 -07:00
|
|
|
//
|
|
|
|
// This program is free software; you can redistribute it and/or
|
|
|
|
// modify it under the terms of the GNU General Public License
|
|
|
|
// as published by the Free Software Foundation; either version 2
|
|
|
|
// of the License, or (at your option) any later version.
|
|
|
|
|
|
|
|
#ifndef _CELESTIACORE_H_
|
|
|
|
#define _CELESTIACORE_H_
|
|
|
|
|
2019-10-19 06:38:04 -06:00
|
|
|
#include <celutil/filetype.h>
|
2001-12-11 17:11:19 -07:00
|
|
|
#include <celutil/timer.h>
|
2002-06-04 23:27:53 -06:00
|
|
|
#include <celutil/watcher.h>
|
2002-06-14 09:34:22 -06:00
|
|
|
// #include <celutil/watchable.h>
|
2001-11-27 18:50:04 -07:00
|
|
|
#include <celengine/solarsys.h>
|
|
|
|
#include <celengine/overlay.h>
|
|
|
|
#include <celengine/texture.h>
|
2002-01-07 15:48:32 -07:00
|
|
|
#include <celengine/universe.h>
|
2001-11-27 18:50:04 -07:00
|
|
|
#include <celengine/render.h>
|
|
|
|
#include <celengine/simulation.h>
|
2019-10-08 14:00:19 -06:00
|
|
|
#include <celengine/overlayimage.h>
|
2001-11-27 18:50:04 -07:00
|
|
|
#include "configfile.h"
|
|
|
|
#include "favorites.h"
|
|
|
|
#include "destination.h"
|
2001-12-10 21:20:05 -07:00
|
|
|
#include "moviecapture.h"
|
2019-10-08 14:00:19 -06:00
|
|
|
#include "view.h"
|
2003-04-12 23:58:34 -06:00
|
|
|
#ifdef CELX
|
2019-10-14 11:06:06 -06:00
|
|
|
#include <celscript/lua/celx.h>
|
2019-10-18 14:10:40 -06:00
|
|
|
#include <celscript/lua/luascript.h>
|
2003-04-12 23:58:34 -06:00
|
|
|
#endif
|
2019-10-18 14:10:40 -06:00
|
|
|
#include <celscript/common/script.h>
|
2019-10-18 13:54:50 -06:00
|
|
|
#include <celscript/legacy/legacyscript.h>
|
2019-10-17 13:19:12 -06:00
|
|
|
#include <celscript/common/scriptmaps.h>
|
|
|
|
|
2003-01-23 15:42:43 -07:00
|
|
|
class Url;
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2002-06-04 23:27:53 -06:00
|
|
|
// class CelestiaWatcher;
|
|
|
|
class CelestiaCore;
|
2002-03-26 21:41:23 -07:00
|
|
|
|
2009-01-26 13:49:35 -07:00
|
|
|
// class astro::Date;
|
2008-01-07 16:27:43 -07:00
|
|
|
|
2002-06-04 23:27:53 -06:00
|
|
|
typedef Watcher<CelestiaCore> CelestiaWatcher;
|
|
|
|
|
2005-12-29 02:31:41 -07:00
|
|
|
class ProgressNotifier
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
ProgressNotifier() {};
|
|
|
|
virtual ~ProgressNotifier() {};
|
2018-03-11 07:12:58 -06:00
|
|
|
|
2005-12-29 02:31:41 -07:00
|
|
|
virtual void update(const std::string&) = 0;
|
|
|
|
};
|
|
|
|
|
2002-06-04 23:27:53 -06:00
|
|
|
class CelestiaCore // : public Watchable<CelestiaCore>
|
2001-11-27 18:50:04 -07:00
|
|
|
{
|
|
|
|
public:
|
2019-10-17 13:19:12 -06:00
|
|
|
enum
|
|
|
|
{
|
2001-11-27 18:50:04 -07:00
|
|
|
LeftButton = 0x01,
|
|
|
|
MiddleButton = 0x02,
|
|
|
|
RightButton = 0x04,
|
|
|
|
ShiftKey = 0x08,
|
|
|
|
ControlKey = 0x10,
|
|
|
|
};
|
|
|
|
|
2019-10-17 13:19:12 -06:00
|
|
|
enum CursorShape
|
|
|
|
{
|
2004-02-14 18:33:25 -07:00
|
|
|
ArrowCursor = 0,
|
|
|
|
UpArrowCursor = 1,
|
|
|
|
CrossCursor = 2,
|
|
|
|
InvertedCrossCursor = 3,
|
|
|
|
WaitCursor = 4,
|
|
|
|
BusyCursor = 5,
|
|
|
|
IbeamCursor = 6,
|
|
|
|
SizeVerCursor = 7,
|
|
|
|
SizeHorCursor = 8,
|
|
|
|
SizeBDiagCursor = 9,
|
|
|
|
SizeFDiagCursor = 10,
|
|
|
|
SizeAllCursor = 11,
|
|
|
|
SplitVCursor = 12,
|
|
|
|
SplitHCursor = 13,
|
|
|
|
PointingHandCursor = 14,
|
|
|
|
ForbiddenCursor = 15,
|
|
|
|
WhatsThisCursor = 16,
|
|
|
|
};
|
2018-03-11 07:12:58 -06:00
|
|
|
|
2019-10-17 13:19:12 -06:00
|
|
|
enum
|
|
|
|
{
|
2001-11-27 18:50:04 -07:00
|
|
|
Joy_XAxis = 0,
|
|
|
|
Joy_YAxis = 1,
|
|
|
|
Joy_ZAxis = 2,
|
|
|
|
};
|
|
|
|
|
2019-10-17 13:19:12 -06:00
|
|
|
enum
|
|
|
|
{
|
2001-11-27 18:50:04 -07:00
|
|
|
JoyButton1 = 0,
|
|
|
|
JoyButton2 = 1,
|
|
|
|
JoyButton3 = 2,
|
|
|
|
JoyButton4 = 3,
|
|
|
|
JoyButton5 = 4,
|
|
|
|
JoyButton6 = 5,
|
|
|
|
JoyButton7 = 6,
|
|
|
|
JoyButton8 = 7,
|
|
|
|
JoyButtonCount = 8,
|
|
|
|
};
|
|
|
|
|
2019-10-17 13:19:12 -06:00
|
|
|
enum
|
|
|
|
{
|
2001-11-27 18:50:04 -07:00
|
|
|
Key_Left = 1,
|
|
|
|
Key_Right = 2,
|
|
|
|
Key_Up = 3,
|
|
|
|
Key_Down = 4,
|
|
|
|
Key_Home = 5,
|
|
|
|
Key_End = 6,
|
|
|
|
Key_PageUp = 7,
|
|
|
|
Key_PageDown = 8,
|
|
|
|
Key_Insert = 9,
|
|
|
|
Key_Delete = 10,
|
|
|
|
Key_F1 = 11,
|
|
|
|
Key_F2 = 12,
|
|
|
|
Key_F3 = 13,
|
|
|
|
Key_F4 = 14,
|
|
|
|
Key_F5 = 15,
|
|
|
|
Key_F6 = 16,
|
|
|
|
Key_F7 = 17,
|
|
|
|
Key_F8 = 18,
|
|
|
|
Key_F9 = 19,
|
|
|
|
Key_F10 = 20,
|
2001-12-10 21:20:05 -07:00
|
|
|
Key_F11 = 21,
|
|
|
|
Key_F12 = 22,
|
|
|
|
Key_NumPadDecimal = 23,
|
|
|
|
Key_NumPad0 = 24,
|
|
|
|
Key_NumPad1 = 25,
|
|
|
|
Key_NumPad2 = 26,
|
|
|
|
Key_NumPad3 = 27,
|
|
|
|
Key_NumPad4 = 28,
|
|
|
|
Key_NumPad5 = 29,
|
|
|
|
Key_NumPad6 = 30,
|
|
|
|
Key_NumPad7 = 31,
|
|
|
|
Key_NumPad8 = 32,
|
|
|
|
Key_NumPad9 = 33,
|
2003-05-31 04:55:44 -06:00
|
|
|
Key_BackTab = 127,
|
2001-11-27 18:50:04 -07:00
|
|
|
KeyCount = 128,
|
|
|
|
};
|
|
|
|
|
2002-06-04 23:27:53 -06:00
|
|
|
enum
|
|
|
|
{
|
2005-12-04 23:42:43 -07:00
|
|
|
LabelFlagsChanged = 1,
|
|
|
|
RenderFlagsChanged = 2,
|
|
|
|
VerbosityLevelChanged = 4,
|
|
|
|
TimeZoneChanged = 8,
|
|
|
|
AmbientLightChanged = 16,
|
|
|
|
FaintestChanged = 32,
|
|
|
|
HistoryChanged = 64,
|
|
|
|
TextEnterModeChanged = 128,
|
|
|
|
GalaxyLightGainChanged = 256,
|
2002-06-04 23:27:53 -06:00
|
|
|
};
|
|
|
|
|
2004-01-09 13:19:47 -07:00
|
|
|
enum
|
|
|
|
{
|
|
|
|
KbNormal = 0,
|
|
|
|
KbAutoComplete = 1,
|
|
|
|
KbPassToScript = 2,
|
2018-03-11 07:12:58 -06:00
|
|
|
};
|
2004-01-09 13:19:47 -07:00
|
|
|
|
2006-11-21 14:26:59 -07:00
|
|
|
enum
|
|
|
|
{
|
2018-10-13 12:48:05 -06:00
|
|
|
ShowNoElement = 0x001,
|
|
|
|
ShowTime = 0x002,
|
2006-11-21 14:26:59 -07:00
|
|
|
ShowVelocity = 0x004,
|
2018-10-13 12:48:05 -06:00
|
|
|
ShowSelection = 0x008,
|
|
|
|
ShowFrame = 0x010,
|
2006-11-21 14:26:59 -07:00
|
|
|
};
|
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
public:
|
|
|
|
CelestiaCore();
|
|
|
|
~CelestiaCore();
|
|
|
|
|
2019-08-15 13:21:22 -06:00
|
|
|
bool initSimulation(const fs::path& configFileName = fs::path(),
|
|
|
|
const std::vector<fs::path>& extrasDirs = {},
|
2018-09-22 07:13:49 -06:00
|
|
|
ProgressNotifier* progressNotifier = nullptr);
|
2001-11-27 18:50:04 -07:00
|
|
|
bool initRenderer();
|
|
|
|
void start(double t);
|
2020-01-24 13:50:42 -07:00
|
|
|
void start();
|
2018-09-22 07:13:49 -06:00
|
|
|
void getLightTravelDelay(double distanceKm, int&, int&, float&);
|
|
|
|
void setLightTravelDelay(double distanceKm);
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2002-11-07 22:08:34 -07:00
|
|
|
// URLs and history navigation
|
|
|
|
void setStartURL(std::string url);
|
2020-03-06 06:18:40 -07:00
|
|
|
bool goToUrl(const std::string& urlStr);
|
2002-11-07 22:08:34 -07:00
|
|
|
void addToHistory();
|
|
|
|
void back();
|
|
|
|
void forward();
|
2009-07-25 16:18:51 -06:00
|
|
|
const std::vector<Url*>& getHistory() const;
|
|
|
|
std::vector<Url*>::size_type getHistoryCurrent() const;
|
|
|
|
void setHistoryCurrent(std::vector<Url*>::size_type curr);
|
2002-11-07 22:08:34 -07:00
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
// event processing methods
|
2004-03-12 03:36:51 -07:00
|
|
|
void charEntered(const char*, int modifiers = 0);
|
|
|
|
void charEntered(char, int modifiers = 0);
|
2003-07-18 23:46:57 -06:00
|
|
|
void keyDown(int key, int modifiers = 0);
|
|
|
|
void keyUp(int key, int modifiers = 0);
|
2001-11-27 18:50:04 -07:00
|
|
|
void mouseWheel(float, int);
|
|
|
|
void mouseButtonDown(float, float, int);
|
|
|
|
void mouseButtonUp(float, float, int);
|
|
|
|
void mouseMove(float, float, int);
|
2004-02-14 18:33:25 -07:00
|
|
|
void mouseMove(float, float);
|
|
|
|
void pickView(float, float);
|
2001-11-27 18:50:04 -07:00
|
|
|
void joystickAxis(int axis, float amount);
|
|
|
|
void joystickButton(int button, bool down);
|
2002-03-28 11:55:43 -07:00
|
|
|
void resize(GLsizei w, GLsizei h);
|
2001-11-27 18:50:04 -07:00
|
|
|
void draw();
|
2001-12-11 17:11:19 -07:00
|
|
|
void tick();
|
2001-11-27 18:50:04 -07:00
|
|
|
|
|
|
|
Simulation* getSimulation() const;
|
|
|
|
Renderer* getRenderer() const;
|
2002-09-22 03:24:45 -06:00
|
|
|
void showText(std::string s,
|
|
|
|
int horig = 0, int vorig = 0,
|
2018-03-11 07:12:58 -06:00
|
|
|
int hoff = 0, int voff = 0,
|
2002-09-22 03:24:45 -06:00
|
|
|
double duration = 1.0e9);
|
2005-04-03 13:39:52 -06:00
|
|
|
int getTextWidth(string s) const;
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2002-02-28 16:29:13 -07:00
|
|
|
void readFavoritesFile();
|
2001-11-27 18:50:04 -07:00
|
|
|
void writeFavoritesFile();
|
|
|
|
void activateFavorite(FavoritesEntry&);
|
2018-09-22 07:13:49 -06:00
|
|
|
void addFavorite(std::string, std::string, FavoritesList::iterator* iter=nullptr);
|
|
|
|
void addFavoriteFolder(std::string, FavoritesList::iterator* iter=nullptr);
|
2002-10-03 03:46:42 -06:00
|
|
|
FavoritesList* getFavorites();
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2007-11-15 13:22:46 -07:00
|
|
|
bool viewUpdateRequired() const;
|
|
|
|
void setViewChanged();
|
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
const DestinationList* getDestinations();
|
|
|
|
|
|
|
|
int getTimeZoneBias() const;
|
|
|
|
void setTimeZoneBias(int);
|
2002-01-04 17:35:40 -07:00
|
|
|
std::string getTimeZoneName() const;
|
|
|
|
void setTimeZoneName(const std::string&);
|
2004-01-09 13:19:47 -07:00
|
|
|
void setTextEnterMode(int);
|
2002-01-03 15:09:15 -07:00
|
|
|
int getTextEnterMode() const;
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2001-12-10 21:20:05 -07:00
|
|
|
void initMovieCapture(MovieCapture*);
|
|
|
|
void recordBegin();
|
|
|
|
void recordPause();
|
|
|
|
void recordEnd();
|
|
|
|
bool isCaptureActive();
|
|
|
|
bool isRecording();
|
|
|
|
|
2019-08-15 13:21:22 -06:00
|
|
|
void runScript(const fs::path& filename);
|
2002-03-26 18:50:54 -07:00
|
|
|
void cancelScript();
|
2003-04-12 23:58:34 -06:00
|
|
|
void resumeScript();
|
2002-03-26 18:50:54 -07:00
|
|
|
|
2001-12-07 19:53:08 -07:00
|
|
|
int getHudDetail();
|
2002-01-11 19:08:09 -07:00
|
|
|
void setHudDetail(int);
|
2009-11-01 12:18:35 -07:00
|
|
|
Color getTextColor();
|
|
|
|
void setTextColor(Color);
|
2008-01-07 16:27:43 -07:00
|
|
|
astro::Date::Format getDateFormat() const;
|
|
|
|
void setDateFormat(astro::Date::Format format);
|
2006-11-21 14:26:59 -07:00
|
|
|
int getOverlayElements() const;
|
|
|
|
void setOverlayElements(int);
|
2001-12-07 19:53:08 -07:00
|
|
|
|
2002-03-26 21:41:23 -07:00
|
|
|
void addWatcher(CelestiaWatcher*);
|
|
|
|
void removeWatcher(CelestiaWatcher*);
|
2018-03-11 07:12:58 -06:00
|
|
|
|
2002-04-02 03:14:59 -07:00
|
|
|
void setFaintest(float);
|
2002-09-22 08:48:27 -06:00
|
|
|
void setFaintestAutoMag();
|
2002-03-26 21:41:23 -07:00
|
|
|
|
2019-10-17 13:19:12 -06:00
|
|
|
std::vector<Observer*> getObservers() const;
|
|
|
|
View* getViewByObserver(const Observer*) const;
|
2018-09-22 07:13:49 -06:00
|
|
|
void splitView(View::Type type, View* av = nullptr, float splitPos = 0.5f);
|
|
|
|
void singleView(View* av = nullptr);
|
|
|
|
void deleteView(View* v = nullptr);
|
|
|
|
void setActiveView(View* v = nullptr);
|
2003-03-11 03:00:25 -07:00
|
|
|
bool getFramesVisible() const;
|
|
|
|
void setFramesVisible(bool);
|
2003-03-19 15:57:06 -07:00
|
|
|
bool getActiveFrameVisible() const;
|
|
|
|
void setActiveFrameVisible(bool);
|
2003-05-01 10:36:09 -06:00
|
|
|
bool getLightDelayActive() const;
|
|
|
|
void setLightDelayActive(bool);
|
2007-05-18 14:14:38 -06:00
|
|
|
bool getAltAzimuthMode() const;
|
|
|
|
void setAltAzimuthMode(bool);
|
2003-06-03 15:42:33 -06:00
|
|
|
int getScreenDpi() const;
|
|
|
|
void setScreenDpi(int);
|
|
|
|
int getDistanceToScreen() const;
|
|
|
|
void setDistanceToScreen(int);
|
|
|
|
|
|
|
|
void setFOVFromZoom();
|
|
|
|
void setZoomFromFOV();
|
2003-02-11 09:43:37 -07:00
|
|
|
|
2002-09-22 03:24:45 -06:00
|
|
|
void flash(const std::string&, double duration = 1.0);
|
|
|
|
|
2003-12-04 11:35:05 -07:00
|
|
|
CelestiaConfig* getConfig() const;
|
|
|
|
|
2004-04-23 05:47:01 -06:00
|
|
|
void notifyWatchers(int);
|
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
class Alerter
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~Alerter() {};
|
|
|
|
virtual void fatalError(const std::string&) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
void setAlerter(Alerter*);
|
2003-05-04 21:24:43 -06:00
|
|
|
Alerter* getAlerter() const;
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2004-02-14 18:33:25 -07:00
|
|
|
class CursorHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~CursorHandler() {};
|
|
|
|
virtual void setCursorShape(CursorShape) = 0;
|
|
|
|
virtual CursorShape getCursorShape() const = 0;
|
|
|
|
};
|
2018-03-11 07:12:58 -06:00
|
|
|
|
2004-02-14 18:33:25 -07:00
|
|
|
void setCursorHandler(CursorHandler*);
|
|
|
|
CursorHandler* getCursorHandler() const;
|
2008-03-20 15:36:17 -06:00
|
|
|
|
2019-08-25 00:13:29 -06:00
|
|
|
class ContextMenuHandler
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
virtual ~ContextMenuHandler() = default;
|
|
|
|
virtual void requestContextMenu(float, float, Selection) = 0;
|
|
|
|
};
|
|
|
|
|
|
|
|
void setContextMenuHandler(ContextMenuHandler*);
|
|
|
|
ContextMenuHandler* getContextMenuHandler() const;
|
|
|
|
|
2008-03-20 15:36:17 -06:00
|
|
|
void toggleReferenceMark(const std::string& refMark, Selection sel = Selection());
|
|
|
|
bool referenceMarkEnabled(const std::string& refMark, Selection sel = Selection()) const;
|
2018-03-11 07:12:58 -06:00
|
|
|
|
2018-07-25 13:44:16 -06:00
|
|
|
void fatalError(const std::string&, bool visual = true);
|
|
|
|
|
2019-10-08 14:00:19 -06:00
|
|
|
void setScriptImage(std::unique_ptr<OverlayImage>&&);
|
2018-10-13 12:48:05 -06:00
|
|
|
|
2019-03-27 14:58:04 -06:00
|
|
|
const std::string& getTypedText() const { return typedText; }
|
|
|
|
void setTypedText(const char *);
|
|
|
|
|
2019-10-18 14:10:40 -06:00
|
|
|
void setScriptHook(std::unique_ptr<celestia::scripts::IScriptHook> &&hook) { m_scriptHook = std::move(hook); }
|
2019-10-17 13:19:12 -06:00
|
|
|
const std::shared_ptr<celestia::scripts::ScriptMaps>& scriptMaps() const { return m_scriptMaps; }
|
|
|
|
|
2019-10-19 06:38:04 -06:00
|
|
|
bool saveScreenShot(const fs::path&, ContentType = Content_Unknown) const;
|
|
|
|
|
2018-07-25 13:44:16 -06:00
|
|
|
protected:
|
2005-12-29 02:31:41 -07:00
|
|
|
bool readStars(const CelestiaConfig&, ProgressNotifier*);
|
2001-11-27 18:50:04 -07:00
|
|
|
void renderOverlay();
|
2006-11-20 03:59:12 -07:00
|
|
|
#ifdef CELX
|
2006-11-20 15:38:31 -07:00
|
|
|
bool initLuaHook(ProgressNotifier*);
|
2006-11-20 03:59:12 -07:00
|
|
|
#endif // CELX
|
2001-11-27 18:50:04 -07:00
|
|
|
|
|
|
|
private:
|
2018-09-22 07:13:49 -06:00
|
|
|
CelestiaConfig* config{ nullptr };
|
2002-01-07 15:48:32 -07:00
|
|
|
|
2018-09-22 07:13:49 -06:00
|
|
|
Universe* universe{ nullptr };
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2018-09-22 07:13:49 -06:00
|
|
|
FavoritesList* favorites{ nullptr };
|
|
|
|
DestinationList* destinations{ nullptr };
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2018-09-22 07:13:49 -06:00
|
|
|
Simulation* sim{ nullptr };
|
|
|
|
Renderer* renderer{ nullptr };
|
|
|
|
Overlay* overlay{ nullptr };
|
|
|
|
int width{ 1 };
|
|
|
|
int height{ 1 };
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2018-09-22 07:13:49 -06:00
|
|
|
TextureFont* font{ nullptr };
|
|
|
|
TextureFont* titleFont{ nullptr };
|
2002-09-22 03:24:45 -06:00
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
std::string messageText;
|
2018-09-22 07:13:49 -06:00
|
|
|
int messageHOrigin{ 0 };
|
|
|
|
int messageVOrigin{ 0 };
|
|
|
|
int messageHOffset{ 0 };
|
|
|
|
int messageVOffset{ 0 };
|
|
|
|
double messageStart{ 0.0 };
|
|
|
|
double messageDuration{ 0.0 };
|
2019-08-02 04:38:19 -06:00
|
|
|
Color textColor{ 1.0f, 1.0f, 1.0f };
|
|
|
|
|
|
|
|
const Color frameColor{ 0.5f, 0.5f, 0.5f, 1.0f };
|
|
|
|
const Color activeFrameColor{ 0.5f, 0.5f, 1.0f, 1.0f };
|
|
|
|
const Color consoleColor{ 0.7f, 0.7f, 1.0f, 0.2f };
|
2018-09-22 07:13:49 -06:00
|
|
|
|
2019-10-08 14:00:19 -06:00
|
|
|
std::unique_ptr<OverlayImage> image;
|
2017-03-28 14:17:52 -06:00
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
std::string typedText;
|
2003-05-31 04:55:44 -06:00
|
|
|
std::vector<std::string> typedTextCompletion;
|
2018-09-22 07:13:49 -06:00
|
|
|
int typedTextCompletionIdx{ -1 };
|
|
|
|
int textEnterMode{ KbNormal };
|
|
|
|
int hudDetail{ 2 }; // def 1
|
|
|
|
astro::Date::Format dateFormat{ astro::Date::Locale };
|
|
|
|
int dateStrWidth{ 0 };
|
|
|
|
int overlayElements{ ShowTime | ShowVelocity | ShowSelection | ShowFrame };
|
|
|
|
bool wireframe{ false };
|
|
|
|
bool editMode{ false };
|
|
|
|
bool altAzimuthMode{ false };
|
|
|
|
bool showConsole{ false };
|
|
|
|
bool lightTravelFlag{ false };
|
|
|
|
double flashFrameStart{ 0.0 };
|
|
|
|
|
|
|
|
Timer* timer{ nullptr };
|
|
|
|
|
2019-10-18 13:54:50 -06:00
|
|
|
std::unique_ptr<celestia::scripts::IScript> m_script;
|
|
|
|
std::unique_ptr<celestia::scripts::IScriptHook> m_scriptHook;
|
|
|
|
std::unique_ptr<celestia::scripts::LegacyScriptPlugin> m_legacyPlugin;
|
2019-10-25 13:24:33 -06:00
|
|
|
#ifdef CELX
|
2019-10-18 13:54:50 -06:00
|
|
|
std::unique_ptr<celestia::scripts::LuaScriptPlugin> m_luaPlugin;
|
2019-10-25 13:24:33 -06:00
|
|
|
#endif
|
2019-10-18 13:54:50 -06:00
|
|
|
std::shared_ptr<celestia::scripts::ScriptMaps> m_scriptMaps;
|
2006-06-01 10:42:59 -06:00
|
|
|
|
|
|
|
enum ScriptState
|
|
|
|
{
|
|
|
|
ScriptCompleted,
|
|
|
|
ScriptRunning,
|
|
|
|
ScriptPaused,
|
|
|
|
};
|
2018-09-22 07:13:49 -06:00
|
|
|
ScriptState scriptState{ ScriptCompleted };
|
2003-04-12 23:58:34 -06:00
|
|
|
|
2018-09-22 07:13:49 -06:00
|
|
|
int timeZoneBias{ 0 }; // Diff in secs between local time and GMT
|
|
|
|
std::string timeZoneName; // Name of the current time zone
|
2001-11-27 18:50:04 -07:00
|
|
|
|
|
|
|
// Frame rate counter variables
|
2018-09-22 07:13:49 -06:00
|
|
|
bool showFPSCounter{ false };
|
|
|
|
int nFrames{ 0 };
|
|
|
|
double fps{ 0.0 };
|
|
|
|
double fpsCounterStartTime{ 0.0 };
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2002-06-22 09:19:39 -06:00
|
|
|
float oldFOV;
|
2018-09-22 07:13:49 -06:00
|
|
|
float mouseMotion{ 0.0f };
|
|
|
|
double dollyMotion{ 0.0 };
|
|
|
|
double dollyTime{ 0.0 };
|
|
|
|
double zoomMotion{ 0.0 };
|
|
|
|
double zoomTime{ 0.0 };
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2018-09-22 07:13:49 -06:00
|
|
|
double sysTime{ 0.0 };
|
|
|
|
double currentTime{ 0.0 };
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2018-09-22 07:13:49 -06:00
|
|
|
bool viewChanged{ true };
|
2007-11-15 13:22:46 -07:00
|
|
|
|
2018-10-28 14:17:06 -06:00
|
|
|
Eigen::Vector3f joystickRotation{ Eigen::Vector3f::Zero() };
|
2001-11-27 18:50:04 -07:00
|
|
|
bool joyButtonsPressed[JoyButtonCount];
|
|
|
|
bool keysPressed[KeyCount];
|
2003-07-18 23:46:57 -06:00
|
|
|
bool shiftKeysPressed[KeyCount];
|
2018-09-22 07:13:49 -06:00
|
|
|
double KeyAccel{ 1.0 };
|
2001-11-27 18:50:04 -07:00
|
|
|
|
2018-09-22 07:13:49 -06:00
|
|
|
MovieCapture* movieCapture{ nullptr };
|
|
|
|
bool recording{ false };
|
2001-12-10 21:20:05 -07:00
|
|
|
|
2018-09-22 07:13:49 -06:00
|
|
|
Alerter* alerter{ nullptr };
|
2002-03-26 21:41:23 -07:00
|
|
|
std::vector<CelestiaWatcher*> watchers;
|
2018-09-22 07:13:49 -06:00
|
|
|
CursorHandler* cursorHandler{ nullptr };
|
|
|
|
CursorShape defaultCursorShape{ CelestiaCore::CrossCursor };
|
2019-08-25 00:13:29 -06:00
|
|
|
ContextMenuHandler* contextMenuHandler{ nullptr };
|
2018-03-11 07:12:58 -06:00
|
|
|
|
2009-07-25 16:18:51 -06:00
|
|
|
std::vector<Url*> history;
|
2018-09-22 07:13:49 -06:00
|
|
|
std::vector<Url*>::size_type historyCurrent{ 0 };
|
2002-11-07 22:08:34 -07:00
|
|
|
std::string startURL;
|
2003-02-11 09:43:37 -07:00
|
|
|
|
2008-08-29 12:33:59 -06:00
|
|
|
std::list<View*> views;
|
2018-09-22 07:13:49 -06:00
|
|
|
std::list<View*>::iterator activeView{ views.begin() };
|
|
|
|
bool showActiveViewFrame{ false };
|
|
|
|
bool showViewFrames{ true };
|
|
|
|
View *resizeSplit{ nullptr };
|
2003-06-03 15:42:33 -06:00
|
|
|
|
2018-09-22 07:13:49 -06:00
|
|
|
int screenDpi{ 96 };
|
|
|
|
int distanceToScreen{ 400 };
|
2004-01-19 18:53:56 -07:00
|
|
|
|
2004-09-09 01:34:50 -06:00
|
|
|
Selection lastSelection;
|
|
|
|
string selectionNames;
|
|
|
|
|
2004-01-19 18:53:56 -07:00
|
|
|
#ifdef CELX
|
|
|
|
friend View* getViewByObserver(CelestiaCore*, Observer*);
|
|
|
|
friend void getObservers(CelestiaCore*, std::vector<Observer*>&);
|
2006-11-21 14:26:59 -07:00
|
|
|
friend TextureFont* getFont(CelestiaCore*);
|
2006-11-20 03:59:12 -07:00
|
|
|
friend TextureFont* getTitleFont(CelestiaCore*);
|
2004-01-19 18:53:56 -07:00
|
|
|
#endif
|
2002-03-26 21:41:23 -07:00
|
|
|
};
|
|
|
|
|
2001-11-27 18:50:04 -07:00
|
|
|
#endif // _CELESTIACORE_H_
|