Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

url.h

Go to the documentation of this file.
00001 /***************************************************************************
00002                           url.h  -  description
00003                              -------------------
00004     begin                : Wed Aug 7 2002
00005     copyright            : (C) 2002 by chris
00006     email                : chris@tux.teyssier.org
00007  ***************************************************************************/
00008 
00009 /***************************************************************************
00010  *                                                                         *
00011  *   This program is free software; you can redistribute it and/or modify  *
00012  *   it under the terms of the GNU General Public License as published by  *
00013  *   the Free Software Foundation; either version 2 of the License, or     *
00014  *   (at your option) any later version.                                   *
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     // parses str
00038     Url(const std::string& str, CelestiaCore *core);
00039     // current url of appCore
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     // Variables specific to Global Urls
00079     UniversalCoord coord;
00080     astro::Date date;
00081     Quatf orientation;
00082     
00083     // Variables specific to Relative Urls
00084     double distance, longitude, latitude;
00085 };
00086 
00087 #endif

Generated on Sat Jan 14 22:30:31 2006 for Celestia by  doxygen 1.4.1