2001-12-08 17:49:50 -07:00
|
|
|
// universe.h
|
2006-12-05 10:38:14 -07:00
|
|
|
//
|
2009-07-14 21:06:30 -06:00
|
|
|
// Copyright (C) 2001-2009, the Celestia Development Team
|
|
|
|
// Original version by Chris Laurel <claurel@gmail.com>
|
2001-12-08 17:49:50 -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.
|
|
|
|
|
2009-07-15 20:28:00 -06:00
|
|
|
#ifndef _CELENGINE_UNIVERSE_H_
|
|
|
|
#define _CELENGINE_UNIVERSE_H_
|
2001-12-08 17:49:50 -07:00
|
|
|
|
2002-01-07 15:48:32 -07:00
|
|
|
#include <celengine/univcoord.h>
|
2001-12-08 17:49:50 -07:00
|
|
|
#include <celengine/stardb.h>
|
2005-11-18 02:00:39 -07:00
|
|
|
#include <celengine/dsodb.h>
|
2001-12-08 17:49:50 -07:00
|
|
|
#include <celengine/solarsys.h>
|
2003-01-28 22:47:50 -07:00
|
|
|
#include <celengine/deepskyobj.h>
|
2003-01-31 21:42:21 -07:00
|
|
|
#include <celengine/marker.h>
|
2001-12-08 17:49:50 -07:00
|
|
|
#include <celengine/selection.h>
|
2018-11-03 12:22:14 -06:00
|
|
|
#include <celengine/asterism.h>
|
2009-07-14 21:06:30 -06:00
|
|
|
#include <vector>
|
|
|
|
|
2001-12-08 17:49:50 -07:00
|
|
|
|
2009-07-14 21:06:30 -06:00
|
|
|
class ConstellationBoundaries;
|
2001-12-08 17:49:50 -07:00
|
|
|
|
|
|
|
class Universe
|
|
|
|
{
|
|
|
|
public:
|
|
|
|
Universe();
|
|
|
|
~Universe();
|
|
|
|
|
|
|
|
StarDatabase* getStarCatalog() const;
|
|
|
|
void setStarCatalog(StarDatabase*);
|
2005-11-18 02:00:39 -07:00
|
|
|
|
2001-12-08 17:49:50 -07:00
|
|
|
SolarSystemCatalog* getSolarSystemCatalog() const;
|
|
|
|
void setSolarSystemCatalog(SolarSystemCatalog*);
|
2005-11-18 02:00:39 -07:00
|
|
|
|
|
|
|
DSODatabase* getDSOCatalog() const;
|
|
|
|
void setDSOCatalog(DSODatabase*);
|
|
|
|
|
2018-11-03 12:22:14 -06:00
|
|
|
AsterismList* getAsterisms() const;
|
|
|
|
void setAsterisms(AsterismList*);
|
2005-11-18 02:00:39 -07:00
|
|
|
|
2002-06-21 15:14:51 -06:00
|
|
|
ConstellationBoundaries* getBoundaries() const;
|
|
|
|
void setBoundaries(ConstellationBoundaries*);
|
2001-12-08 17:49:50 -07:00
|
|
|
|
|
|
|
Selection pick(const UniversalCoord& origin,
|
2009-07-21 22:53:15 -06:00
|
|
|
const Eigen::Vector3f& direction,
|
2001-12-17 13:42:57 -07:00
|
|
|
double when,
|
2018-11-13 13:31:07 -07:00
|
|
|
uint64_t renderFlags,
|
2002-01-23 17:50:47 -07:00
|
|
|
float faintestMag,
|
|
|
|
float tolerance = 0.0f);
|
2005-11-18 02:00:39 -07:00
|
|
|
|
|
|
|
|
2001-12-08 22:09:17 -07:00
|
|
|
Selection find(const std::string& s,
|
2018-09-22 07:13:49 -06:00
|
|
|
Selection* contexts = nullptr,
|
2005-07-19 15:31:04 -06:00
|
|
|
int nContexts = 0,
|
2006-10-25 01:19:58 -06:00
|
|
|
bool i18n = false) const;
|
2001-12-08 22:09:17 -07:00
|
|
|
Selection findPath(const std::string& s,
|
2018-09-22 07:13:49 -06:00
|
|
|
Selection* contexts = nullptr,
|
2005-07-19 15:31:04 -06:00
|
|
|
int nContexts = 0,
|
2006-10-25 01:19:58 -06:00
|
|
|
bool i18n = false) const;
|
2003-08-11 02:12:28 -06:00
|
|
|
Selection findChildObject(const Selection& sel,
|
2021-03-03 11:34:35 -07:00
|
|
|
const std::string& name,
|
2005-07-19 15:31:04 -06:00
|
|
|
bool i18n = false) const;
|
2003-08-11 02:12:28 -06:00
|
|
|
Selection findObjectInContext(const Selection& sel,
|
2021-03-03 11:34:35 -07:00
|
|
|
const std::string& name,
|
2005-07-19 15:31:04 -06:00
|
|
|
bool i18n = false) const;
|
2001-12-08 17:49:50 -07:00
|
|
|
|
2003-08-11 02:51:50 -06:00
|
|
|
std::vector<std::string> getCompletion(const std::string& s,
|
2021-05-12 23:39:40 -06:00
|
|
|
bool i18n,
|
2018-09-22 07:13:49 -06:00
|
|
|
Selection* contexts = nullptr,
|
2004-01-11 10:15:26 -07:00
|
|
|
int nContexts = 0,
|
|
|
|
bool withLocations = false);
|
2003-08-11 02:51:50 -06:00
|
|
|
std::vector<std::string> getCompletionPath(const std::string& s,
|
2021-05-12 23:39:40 -06:00
|
|
|
bool i18n,
|
2018-09-22 07:13:49 -06:00
|
|
|
Selection* contexts = nullptr,
|
2004-01-11 10:15:26 -07:00
|
|
|
int nContexts = 0,
|
|
|
|
bool withLocations = false);
|
2003-08-11 02:51:50 -06:00
|
|
|
|
|
|
|
|
2002-01-07 15:48:32 -07:00
|
|
|
SolarSystem* getNearestSolarSystem(const UniversalCoord& position) const;
|
|
|
|
SolarSystem* getSolarSystem(const Star* star) const;
|
2003-07-29 23:34:04 -06:00
|
|
|
SolarSystem* getSolarSystem(const Selection&) const;
|
2002-03-14 14:48:51 -07:00
|
|
|
SolarSystem* createSolarSystem(Star* star) const;
|
2001-12-08 17:49:50 -07:00
|
|
|
|
2004-10-02 04:44:49 -06:00
|
|
|
void getNearStars(const UniversalCoord& position,
|
|
|
|
float maxDistance,
|
|
|
|
std::vector<const Star*>& stars) const;
|
|
|
|
|
2003-02-25 01:03:27 -07:00
|
|
|
void markObject(const Selection&,
|
2021-05-22 01:10:05 -06:00
|
|
|
const celestia::MarkerRepresentation& rep,
|
2008-01-02 16:52:31 -07:00
|
|
|
int priority,
|
2008-09-22 15:03:43 -06:00
|
|
|
bool occludable = true,
|
2021-05-22 01:10:05 -06:00
|
|
|
celestia::MarkerSizing sizing = celestia::ConstantSize);
|
2003-02-04 03:39:38 -07:00
|
|
|
void unmarkObject(const Selection&, int priority);
|
2003-05-05 23:48:25 -06:00
|
|
|
void unmarkAll();
|
2003-02-04 03:39:38 -07:00
|
|
|
bool isMarked(const Selection&, int priority) const;
|
2021-05-22 01:10:05 -06:00
|
|
|
celestia::MarkerList* getMarkers() const;
|
2003-01-31 21:42:21 -07:00
|
|
|
|
2001-12-08 17:49:50 -07:00
|
|
|
private:
|
2001-12-08 22:09:17 -07:00
|
|
|
Selection pickPlanet(SolarSystem& solarSystem,
|
2009-07-15 20:28:00 -06:00
|
|
|
const UniversalCoord& origin,
|
|
|
|
const Eigen::Vector3f& direction,
|
2001-12-17 13:42:57 -07:00
|
|
|
double when,
|
2002-01-23 17:50:47 -07:00
|
|
|
float faintestMag,
|
|
|
|
float tolerance);
|
2001-12-08 17:49:50 -07:00
|
|
|
|
2009-07-15 20:28:00 -06:00
|
|
|
Selection pickStar(const UniversalCoord& origin,
|
|
|
|
const Eigen::Vector3f& direction,
|
|
|
|
double when,
|
|
|
|
float faintest,
|
|
|
|
float tolerance = 0.0f);
|
|
|
|
|
|
|
|
Selection pickDeepSkyObject(const UniversalCoord& origin,
|
|
|
|
const Eigen::Vector3f& direction,
|
2018-11-13 13:31:07 -07:00
|
|
|
uint64_t renderFlags,
|
2009-07-15 20:28:00 -06:00
|
|
|
float faintest,
|
|
|
|
float tolerance = 0.0f);
|
|
|
|
|
2001-12-08 17:49:50 -07:00
|
|
|
private:
|
2018-09-22 07:13:49 -06:00
|
|
|
StarDatabase* starCatalog{nullptr};
|
|
|
|
DSODatabase* dsoCatalog{nullptr};
|
|
|
|
SolarSystemCatalog* solarSystemCatalog{nullptr};
|
2018-11-03 12:22:14 -06:00
|
|
|
AsterismList* asterisms{nullptr};
|
2018-09-22 07:13:49 -06:00
|
|
|
ConstellationBoundaries* boundaries{nullptr};
|
2021-05-22 01:10:05 -06:00
|
|
|
celestia::MarkerList* markers;
|
2004-10-20 01:55:50 -06:00
|
|
|
|
|
|
|
std::vector<const Star*> closeStars;
|
2001-12-08 17:49:50 -07:00
|
|
|
};
|
|
|
|
|
2009-07-15 20:28:00 -06:00
|
|
|
#endif // _CELENGINE_UNIVERSE_H_
|