00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017 #ifndef _URL_H_
00018 #define _URL_H_
00019
00020 #include <string>
00021 #include "celestiacore.h"
00022 #include "celengine/astro.h"
00023
00024 class CelestiaCore;
00025
00026 class Url
00027 {
00028 public:
00029 enum UrlType {
00030 Absolute = 0,
00031 Relative = 1,
00032 Settings = 2,
00033 };
00034
00035 Url();
00036
00037
00038 Url(const std::string& str, CelestiaCore *core);
00039
00040 Url(CelestiaCore* appCore, UrlType type = Absolute);
00041 ~Url();
00042
00043 std::string getAsString() const;
00044 std::string getName() const;
00045 void goTo();
00046
00047
00048 private:
00049 std::string urlStr, name;
00050 std::string modeStr;
00051 std::string body1, body2, selectedStr, trackedStr;
00052
00053 CelestiaCore *appCore;
00054
00055 FrameOfReference ref;
00056 Selection selected;
00057 Selection tracked;
00058
00059 astro::CoordinateSystem mode;
00060 int nbBodies;
00061 float fieldOfView;
00062 float timeScale;
00063 int renderFlags;
00064 int labelMode;
00065 bool lightTimeDelay;
00066
00067 std::map<std::string, std::string> parseUrlParams(const std::string& url) const;
00068 std::string getCoordSysName(astro::CoordinateSystem mode) const;
00069 std::string getSelectionName(const Selection& selection) const;
00070 std::string getBodyShortName(const std::string& body) const;
00071 static std::string decode_string(const std::string& str);
00072
00073 bool fromString;
00074 UrlType type;
00075
00076 void evalName();
00077
00078
00079 UniversalCoord coord;
00080 astro::Date date;
00081 Quatf orientation;
00082
00083
00084 double distance, longitude, latitude;
00085 };
00086
00087 #endif