00001
00002
00003
00004
00005
00006
00007
00008
00009
00010 #ifndef _UNIVERSE_H_
00011 #define _UNIVERSE_H_
00012
00013 #include <vector>
00014 #include <celmath/vecmath.h>
00015 #include <celmath/quaternion.h>
00016 #include <celengine/univcoord.h>
00017 #include <celengine/stardb.h>
00018 #include <celengine/dsodb.h>
00019 #include <celengine/solarsys.h>
00020 #include <celengine/deepskyobj.h>
00021 #include <celengine/asterism.h>
00022 #include <celengine/boundaries.h>
00023 #include <celengine/marker.h>
00024 #include <celengine/selection.h>
00025
00026
00027 class Universe
00028 {
00029 public:
00030 Universe();
00031 ~Universe();
00032
00033 StarDatabase* getStarCatalog() const;
00034 void setStarCatalog(StarDatabase*);
00035
00036 SolarSystemCatalog* getSolarSystemCatalog() const;
00037 void setSolarSystemCatalog(SolarSystemCatalog*);
00038
00039 DSODatabase* getDSOCatalog() const;
00040 void setDSOCatalog(DSODatabase*);
00041
00042 AsterismList* getAsterisms() const;
00043 void setAsterisms(AsterismList*);
00044
00045 ConstellationBoundaries* getBoundaries() const;
00046 void setBoundaries(ConstellationBoundaries*);
00047
00048 Selection pick(const UniversalCoord& origin,
00049 const Vec3f& direction,
00050 double when,
00051 float faintestMag,
00052 float tolerance = 0.0f);
00053
00054 Selection pickStar(const UniversalCoord&,
00055 const Vec3f&,
00056 double when,
00057 float faintest,
00058 float tolerance = 0.0f);
00059
00060 Selection pickDeepSkyObject(const UniversalCoord&,
00061 const Vec3f&,
00062 float faintest,
00063 float tolerance = 0.0f);
00064
00065 Selection find(const std::string& s,
00066 Selection* contexts = NULL,
00067 int nContexts = 0,
00068 bool i18n = false);
00069 Selection findPath(const std::string& s,
00070 Selection* contexts = NULL,
00071 int nContexts = 0,
00072 bool i18n = false);
00073 Selection findChildObject(const Selection& sel,
00074 const string& name,
00075 bool i18n = false) const;
00076 Selection findObjectInContext(const Selection& sel,
00077 const string& name,
00078 bool i18n = false) const;
00079
00080 std::vector<std::string> getCompletion(const std::string& s,
00081 Selection* contexts = NULL,
00082 int nContexts = 0,
00083 bool withLocations = false);
00084 std::vector<std::string> getCompletionPath(const std::string& s,
00085 Selection* contexts = NULL,
00086 int nContexts = 0,
00087 bool withLocations = false);
00088
00089
00090 SolarSystem* getNearestSolarSystem(const UniversalCoord& position) const;
00091 SolarSystem* getSolarSystem(const Star* star) const;
00092 SolarSystem* getSolarSystem(const Selection&) const;
00093 SolarSystem* createSolarSystem(Star* star) const;
00094
00095 void getNearStars(const UniversalCoord& position,
00096 float maxDistance,
00097 std::vector<const Star*>& stars) const;
00098
00099 void markObject(const Selection&,
00100 float size,
00101 Color color,
00102 Marker::Symbol symbol,
00103 int priority);
00104 void unmarkObject(const Selection&, int priority);
00105 void unmarkAll();
00106 bool isMarked(const Selection&, int priority) const;
00107 MarkerList* getMarkers() const;
00108
00109 private:
00110 Selection pickPlanet(SolarSystem& solarSystem,
00111 const UniversalCoord&,
00112 const Vec3f&,
00113 double when,
00114 float faintestMag,
00115 float tolerance);
00116
00117 private:
00118 StarDatabase* starCatalog;
00119 DSODatabase* dsoCatalog;
00120 SolarSystemCatalog* solarSystemCatalog;
00121 AsterismList* asterisms;
00122 ConstellationBoundaries* boundaries;
00123 MarkerList* markers;
00124
00125 std::vector<const Star*> closeStars;
00126 };
00127
00128 #endif // UNIVERSE_H_