Rename Ephemeris to Translation

This commit is contained in:
Alexander Bock
2016-09-26 13:34:22 +02:00
parent 568ebd51ff
commit a688a1eee9
44 changed files with 502 additions and 500 deletions

View File

@@ -4,12 +4,14 @@ return {
Name = "EarthBarycenter",
Parent = "SolarSystemBarycenter",
Static = true,
Ephemeris = {
Type = "Spice",
Body = "EARTH BARYCENTER",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
},
Transform = {
Translation = {
Type = "Spice",
Body = "EARTH BARYCENTER",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
},
}
},
-- Earth module
{

View File

@@ -31,7 +31,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "EARTH",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"

View File

@@ -24,7 +24,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "CALLISTO",
Observer = "JUPITER BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp"

View File

@@ -24,7 +24,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "EUROPA",
Observer = "JUPITER BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp"

View File

@@ -24,7 +24,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "GANYMEDE",
Observer = "JUPITER BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp"

View File

@@ -24,7 +24,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "IO",
Observer = "JUPITER BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/jup260.bsp"

View File

@@ -5,7 +5,7 @@ return {
Parent = "SolarSystemBarycenter",
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "JUPITER BARYCENTER",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
@@ -37,7 +37,7 @@ return {
},
Transform = {
Translation = {
Type = "StaticEphemeris",
Type = "StaticTranslation",
Position = {0, 0, 0}, -- jupiter is at its barycenter
},
Rotation = {

View File

@@ -6,7 +6,7 @@ return {
Parent = "SolarSystemBarycenter",
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "EARTH",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"

View File

@@ -6,7 +6,7 @@ return {
Parent = "SolarSystemBarycenter",
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "MARS BARYCENTER",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"

View File

@@ -5,7 +5,7 @@ return {
Parent = "SolarSystemBarycenter",
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "MERCURY",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"

View File

@@ -5,7 +5,7 @@ return {
Parent = "EarthBarycenter",
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "MOON",
Observer = "EARTH BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"

View File

@@ -29,7 +29,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "MARS BARYCENTER",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"

View File

@@ -29,7 +29,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "MERCURY",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"

View File

@@ -30,7 +30,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "MOON",
Observer = "EARTH BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"

View File

@@ -39,7 +39,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "CALLISTO",
Observer = "JUPITER BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
@@ -70,7 +70,7 @@ return {
]]
Transform = {
Translation = {
Type = "StaticEphemeris",
Type = "StaticTranslation",
Position = {0, -10000000, 0}
},
},

View File

@@ -39,7 +39,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "EUROPA",
Observer = "JUPITER BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
@@ -70,7 +70,7 @@ return {
]]
Transform = {
Translation = {
Type = "StaticEphemeris",
Type = "StaticTranslation",
Position = {0, -10000000, 0}
},
},

View File

@@ -39,7 +39,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "GANYMEDE",
Observer = "JUPITER BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
@@ -64,7 +64,7 @@ return {
},
Transform = {
Translation = {
Type = "StaticEphemeris",
Type = "StaticTranslation",
Position = {0, -10000000, 0}
},
},

View File

@@ -39,7 +39,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "IO",
Observer = "JUPITER BARYCENTER",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
@@ -80,7 +80,7 @@ return {
},
Transform = {
Translation = {
Type = "StaticEphemeris",
Type = "StaticTranslation",
Position = {0, -10000000, 0}
},
},

View File

@@ -5,7 +5,7 @@ return {
Parent = "SolarSystemBarycenter",
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "JUPITER BARYCENTER",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"
@@ -108,7 +108,7 @@ return {
},
Transform = {
Translation = {
Type = "StaticEphemeris",
Type = "StaticTranslation",
Position = {0, -100000000, 0}
},
},

View File

@@ -104,7 +104,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "NEW HORIZONS",
Observer = "SUN",
Kernels = NewHorizonsKernels

View File

@@ -58,7 +58,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "CHARON",
Observer = "PLUTO BARYCENTER",
Kernels = NewHorizonsKernels
@@ -83,7 +83,7 @@ return {
},
Transform = {
Translation = {
Type = "StaticEphemeris",
Type = "StaticTranslation",
Position = {0, -1000000, 0}
},
},

View File

@@ -29,7 +29,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "HYDRA",
Observer = "PLUTO BARYCENTER",
Kernels = NewHorizonsKernels
@@ -53,7 +53,7 @@ return {
},
Transform = {
Translation = {
Type = "StaticEphemeris",
Type = "StaticTranslation",
Position = {1000000, 0, 1000000},
},
},

View File

@@ -29,7 +29,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "KERBEROS",
Observer = "PLUTO BARYCENTER",
Kernels = NewHorizonsKernels
@@ -53,7 +53,7 @@ return {
},
Transform = {
Translation = {
Type = "StaticEphemeris",
Type = "StaticTranslation",
Position = {1000000, 0, 1000000},
},
},

View File

@@ -29,7 +29,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "NIX",
Observer = "PLUTO BARYCENTER",
Kernels = NewHorizonsKernels

View File

@@ -23,7 +23,7 @@ return {
Parent = "SolarSystemBarycenter",
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "PLUTO BARYCENTER",
Observer = "SUN",
Kernels = NewHorizonsKernels
@@ -157,7 +157,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "PLUTO",
Observer = "PLUTO BARYCENTER",
Kernels = NewHorizonsKernels
@@ -197,7 +197,7 @@ return {
},
Transform = {
Translation = {
Type = "StaticEphemeris",
Type = "StaticTranslation",
Position = {0, -2000000, 0}
},
},
@@ -215,7 +215,7 @@ return {
},
Transform = {
Translation = {
Type = "StaticEphemeris",
Type = "StaticTranslation",
Position = {0, -4000000, 0}
},
},

View File

@@ -29,7 +29,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "STYX",
Observer = "PLUTO BARYCENTER",
Kernels = NewHorizonsKernels
@@ -54,7 +54,7 @@ return {
},
Transform = {
Translation = {
Type = "StaticEphemeris",
Type = "StaticTranslation",
Position = {1000000, 0, 1000000}
},
},

View File

@@ -9,7 +9,7 @@ return {
Parent = "SolarSystemBarycenter",
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = BENNU_BODY,
Observer = "SUN",
},

View File

@@ -27,7 +27,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "OSIRIS-REX",
Observer = "SUN",
},
@@ -61,7 +61,7 @@ return {
},
Transform = {
Translation = {
Type = "StaticEphemeris",
Type = "StaticTranslation",
Position = {-0.2476, 0.2710, 0.3364},
},
Rotation = {
@@ -94,7 +94,7 @@ return {
},
Transform = {
Translation = {
Type = "StaticEphemeris",
Type = "StaticTranslation",
Position = {0, 0.3371, 0.2712},
},
Rotation = {

View File

@@ -5,7 +5,7 @@ return {
Parent = "SolarSystemBarycenter",
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "CHURYUMOV-GERASIMENKO",
Observer = "SUN",
},

View File

@@ -62,7 +62,7 @@ return {
Parent = "SolarSystemBarycenter",
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "ROSETTA",
Observer = "SUN",
Kernels = RosettaKernels
@@ -273,7 +273,7 @@ return {
-- translated
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "PHILAE",
Observer = "CHURYUMOV-GERASIMENKO",
Kernels = RosettaKernels

View File

@@ -30,7 +30,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "SATURN BARYCENTER",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"

View File

@@ -30,7 +30,7 @@ return {
},
Transform = {
Translation = {
Type = "SpiceEphemeris",
Type = "SpiceTranslation",
Body = "URANUS BARYCENTER",
Observer = "SUN",
Kernels = "${OPENSPACE_DATA}/spice/de430_1850-2150.bsp"

View File

@@ -34,11 +34,11 @@
namespace openspace {
class Ephemeris : public properties::PropertyOwner {
class Translation : public properties::PropertyOwner {
public:
static Ephemeris* createFromDictionary(const ghoul::Dictionary& dictionary);
static Translation* createFromDictionary(const ghoul::Dictionary& dictionary);
virtual ~Ephemeris();
virtual ~Translation();
virtual bool initialize();
virtual glm::dvec3 position() const = 0;
virtual void update(const UpdateData& data);

View File

@@ -103,9 +103,9 @@ public:
// @TODO Remove once the scalegraph is in effect ---abock
void setEphemeris(Ephemeris* eph) {
delete _ephemeris;
_ephemeris = eph;
void setEphemeris(Translation* eph) {
delete _translation;
_translation = eph;
}
static documentation::Documentation Documentation();
@@ -129,7 +129,7 @@ private:
PowerScaledScalar _boundingSphere;
// Transformation defined by ephemeris, rotation and scale
Ephemeris* _ephemeris;
Translation* _translation;
Rotation* _rotation;
Scale* _scale;

View File

@@ -108,11 +108,11 @@ void BaseModule::internalInitialize() {
fRenderable->registerClass<RenderableTrail>("RenderableTrail");
fRenderable->registerClass<RenderableTrailNew>("RenderableTrailNew");
auto fEphemeris = FactoryManager::ref().factory<Ephemeris>();
ghoul_assert(fEphemeris, "Ephemeris factory was not created");
auto fTranslation = FactoryManager::ref().factory<Translation>();
ghoul_assert(fTranslation, "Ephemeris factory was not created");
fEphemeris->registerClass<StaticEphemeris>("StaticEphemeris");
fEphemeris->registerClass<SpiceEphemeris>("SpiceEphemeris");
fTranslation->registerClass<StaticTranslation>("StaticTranslation");
fTranslation->registerClass<SpiceTranslation>("SpiceTranslation");
auto fRotation = FactoryManager::ref().factory<Rotation>();
ghoul_assert(fRotation, "Rotation factory was not created");
@@ -137,8 +137,8 @@ void BaseModule::internalInitialize() {
std::vector<Documentation> BaseModule::documentations() const {
return {
StaticScale::Documentation(),
StaticEphemeris::Documentation(),
SpiceEphemeris::Documentation()
StaticTranslation::Documentation(),
SpiceTranslation::Documentation()
};
}

View File

@@ -41,7 +41,7 @@ namespace {
namespace openspace {
Documentation SpiceEphemeris::Documentation() {
Documentation SpiceTranslation::Documentation() {
using namespace openspace::documentation;
return {
@@ -50,7 +50,7 @@ Documentation SpiceEphemeris::Documentation() {
{
{
"Type",
new StringEqualVerifier("SpiceEphemeris"),
new StringEqualVerifier("SpiceTranslation"),
"",
Optional::No
},
@@ -89,7 +89,7 @@ Documentation SpiceEphemeris::Documentation() {
};
}
SpiceEphemeris::SpiceEphemeris(const ghoul::Dictionary& dictionary)
SpiceTranslation::SpiceTranslation(const ghoul::Dictionary& dictionary)
: _target("target", "Target", "")
, _origin("origin", "Origin", "")
, _kernelsLoadedSuccessfully(true)
@@ -97,7 +97,7 @@ SpiceEphemeris::SpiceEphemeris(const ghoul::Dictionary& dictionary)
documentation::testSpecificationAndThrow(
Documentation(),
dictionary,
"SpiceEphemeris"
"SpiceTranslation"
);
_target = dictionary.value<std::string>(KeyBody);
@@ -132,11 +132,11 @@ SpiceEphemeris::SpiceEphemeris(const ghoul::Dictionary& dictionary)
}
}
glm::dvec3 SpiceEphemeris::position() const {
glm::dvec3 SpiceTranslation::position() const {
return _position;
}
void SpiceEphemeris::update(const UpdateData& data) {
void SpiceTranslation::update(const UpdateData& data) {
double lightTime = 0.0;
_position = SpiceManager::ref().targetPosition(
_target, _origin, ReferenceFrame, {}, data.time, lightTime

View File

@@ -32,9 +32,9 @@
namespace openspace {
class SpiceEphemeris : public Ephemeris {
class SpiceTranslation : public Translation {
public:
SpiceEphemeris(const ghoul::Dictionary& dictionary);
SpiceTranslation(const ghoul::Dictionary& dictionary);
glm::dvec3 position() const;
void update(const UpdateData& data) override;

View File

@@ -32,7 +32,7 @@ namespace {
namespace openspace {
Documentation StaticEphemeris::Documentation() {
Documentation StaticTranslation::Documentation() {
using namespace openspace::documentation;
return {
"Static Translation",
@@ -40,7 +40,7 @@ Documentation StaticEphemeris::Documentation() {
{
{
"Type",
new StringEqualVerifier("StaticEphemeris"),
new StringEqualVerifier("StaticTranslation"),
"",
Optional::No
},
@@ -57,7 +57,7 @@ Documentation StaticEphemeris::Documentation() {
}
StaticEphemeris::StaticEphemeris()
StaticTranslation::StaticTranslation()
: _position(
"position",
"Position",
@@ -69,8 +69,8 @@ StaticEphemeris::StaticEphemeris()
addProperty(_position);
}
StaticEphemeris::StaticEphemeris(const ghoul::Dictionary& dictionary)
: StaticEphemeris()
StaticTranslation::StaticTranslation(const ghoul::Dictionary& dictionary)
: StaticTranslation()
{
documentation::testSpecificationAndThrow(
Documentation(),
@@ -81,12 +81,12 @@ StaticEphemeris::StaticEphemeris(const ghoul::Dictionary& dictionary)
_position = dictionary.value<glm::dvec3>(KeyPosition);
}
StaticEphemeris::~StaticEphemeris() {}
StaticTranslation::~StaticTranslation() {}
glm::dvec3 StaticEphemeris::position() const {
glm::dvec3 StaticTranslation::position() const {
return _position;
}
void StaticEphemeris::update(const UpdateData&) {}
void StaticTranslation::update(const UpdateData&) {}
} // namespace openspace

View File

@@ -32,11 +32,11 @@
namespace openspace {
class StaticEphemeris : public Ephemeris {
class StaticTranslation : public Translation {
public:
StaticEphemeris();
StaticEphemeris(const ghoul::Dictionary& dictionary);
virtual ~StaticEphemeris();
StaticTranslation();
StaticTranslation(const ghoul::Dictionary& dictionary);
virtual ~StaticTranslation();
virtual glm::dvec3 position() const;
virtual void update(const UpdateData& data) override;

View File

@@ -42,7 +42,7 @@ namespace documentation {
void registerCoreClasses(documentation::DocumentationEngine& engine) {
engine.addDocumentation(ConfigurationManager::Documentation());
engine.addDocumentation(Ephemeris::Documentation());
engine.addDocumentation(Translation::Documentation());
engine.addDocumentation(Mission::Documentation());
engine.addDocumentation(Renderable::Documentation());
engine.addDocumentation(Rotation::Documentation());

View File

@@ -163,8 +163,8 @@ OpenSpaceEngine::OpenSpaceEngine(std::string programName,
"Renderable"
);
FactoryManager::ref().addFactory(
std::make_unique<ghoul::TemplateFactory<Ephemeris>>(),
"Ephemeris"
std::make_unique<ghoul::TemplateFactory<Translation>>(),
"Translation"
);
SpiceManager::initialize();
Time::initialize();

View File

@@ -814,391 +814,391 @@ performance::PerformanceManager* RenderEngine::performanceManager() {
// This method is temporary and will be removed once the scalegraph is in effect ---abock
void RenderEngine::changeViewPoint(std::string origin) {
SceneGraphNode* solarSystemBarycenterNode = scene()->sceneGraphNode("SolarSystemBarycenter");
SceneGraphNode* plutoBarycenterNode = scene()->sceneGraphNode("PlutoBarycenter");
SceneGraphNode* newHorizonsNode = scene()->sceneGraphNode("NewHorizons");
SceneGraphNode* newHorizonsPathNodeJ = scene()->sceneGraphNode("NewHorizonsPathJupiter");
SceneGraphNode* newHorizonsPathNodeP = scene()->sceneGraphNode("NewHorizonsPathPluto");
// SceneGraphNode* cg67pNode = scene()->sceneGraphNode("67P");
// SceneGraphNode* rosettaNode = scene()->sceneGraphNode("Rosetta");
RenderablePath* nhPath;
SceneGraphNode* jupiterBarycenterNode = scene()->sceneGraphNode("JupiterBarycenter");
//SceneGraphNode* newHorizonsGhostNode = scene()->sceneGraphNode("NewHorizonsGhost");
//SceneGraphNode* dawnNode = scene()->sceneGraphNode("Dawn");
//SceneGraphNode* vestaNode = scene()->sceneGraphNode("Vesta");
// if (solarSystemBarycenterNode == nullptr || plutoBarycenterNode == nullptr ||
//jupiterBarycenterNode == nullptr) {
// LERROR("Necessary nodes does not exist");
//return;
// }
if (origin == "Pluto") {
if (newHorizonsPathNodeP) {
Renderable* R = newHorizonsPathNodeP->renderable();
newHorizonsPathNodeP->setParent(plutoBarycenterNode);
nhPath = static_cast<RenderablePath*>(R);
nhPath->calculatePath("PLUTO BARYCENTER");
}
plutoBarycenterNode->setParent(scene()->sceneGraphNode("SolarSystem"));
plutoBarycenterNode->setEphemeris(new StaticEphemeris);
solarSystemBarycenterNode->setParent(plutoBarycenterNode);
newHorizonsNode->setParent(plutoBarycenterNode);
//newHorizonsGhostNode->setParent(plutoBarycenterNode);
//dawnNode->setParent(plutoBarycenterNode);
//vestaNode->setParent(plutoBarycenterNode);
//newHorizonsTrailNode->setParent(plutoBarycenterNode);
ghoul::Dictionary solarDictionary =
{
{ std::string("Type"), std::string("Spice") },
{ std::string("Body"), std::string("SUN") },
{ std::string("Reference"), std::string("GALACTIC") },
{ std::string("Observer"), std::string("PLUTO BARYCENTER") },
{ std::string("Kernels"), ghoul::Dictionary() }
};
ghoul::Dictionary jupiterDictionary =
{
{ std::string("Type"), std::string("Spice") },
{ std::string("Body"), std::string("JUPITER BARYCENTER") },
{ std::string("Reference"), std::string("GALACTIC") },
{ std::string("Observer"), std::string("PLUTO BARYCENTER") },
{ std::string("Kernels"), ghoul::Dictionary() }
};
ghoul::Dictionary newHorizonsDictionary =
{
{ std::string("Type"), std::string("Spice") },
{ std::string("Body"), std::string("NEW HORIZONS") },
{ std::string("Reference"), std::string("GALACTIC") },
{ std::string("Observer"), std::string("PLUTO BARYCENTER") },
{ std::string("Kernels"), ghoul::Dictionary() }
};
solarSystemBarycenterNode->setEphemeris(new SpiceEphemeris(solarDictionary));
jupiterBarycenterNode->setEphemeris(new SpiceEphemeris(jupiterDictionary));
newHorizonsNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
//newHorizonsTrailNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
//ghoul::Dictionary dawnDictionary =
//{
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("DAWN") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("PLUTO BARYCENTER") },
// { std::string("Kernels"), ghoul::Dictionary() }
//};
//dawnNode->setEphemeris(new SpiceEphemeris(dawnDictionary));
//
//ghoul::Dictionary vestaDictionary =
//{
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("VESTA") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("PLUTO BARYCENTER") },
// { std::string("Kernels"), ghoul::Dictionary() }
//};
//vestaNode->setEphemeris(new SpiceEphemeris(vestaDictionary));
//ghoul::Dictionary newHorizonsGhostDictionary =
//{
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("NEW HORIZONS") },
// { std::string("EphmerisGhosting"), std::string("TRUE") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("PLUTO BARYCENTER") },
// { std::string("Kernels"), ghoul::Dictionary() }
//};
//newHorizonsGhostNode->setEphemeris(new SpiceEphemeris(newHorizonsGhostDictionary));
return;
}
if (origin == "Sun") {
solarSystemBarycenterNode->setParent(scene()->sceneGraphNode("SolarSystem"));
if (plutoBarycenterNode)
plutoBarycenterNode->setParent(solarSystemBarycenterNode);
jupiterBarycenterNode->setParent(solarSystemBarycenterNode);
if (newHorizonsNode)
newHorizonsNode->setParent(solarSystemBarycenterNode);
//newHorizonsGhostNode->setParent(solarSystemBarycenterNode);
//newHorizonsTrailNode->setParent(solarSystemBarycenterNode);
//dawnNode->setParent(solarSystemBarycenterNode);
//vestaNode->setParent(solarSystemBarycenterNode);
ghoul::Dictionary plutoDictionary =
{
{ std::string("Type"), std::string("Spice") },
{ std::string("Body"), std::string("PLUTO BARYCENTER") },
{ std::string("Reference"), std::string("GALACTIC") },
{ std::string("Observer"), std::string("SUN") },
{ std::string("Kernels"), ghoul::Dictionary() }
};
ghoul::Dictionary jupiterDictionary =
{
{ std::string("Type"), std::string("Spice") },
{ std::string("Body"), std::string("JUPITER BARYCENTER") },
{ std::string("Reference"), std::string("GALACTIC") },
{ std::string("Observer"), std::string("SUN") },
{ std::string("Kernels"), ghoul::Dictionary() }
};
solarSystemBarycenterNode->setEphemeris(new StaticEphemeris);
jupiterBarycenterNode->setEphemeris(new SpiceEphemeris(jupiterDictionary));
if (plutoBarycenterNode)
plutoBarycenterNode->setEphemeris(new SpiceEphemeris(plutoDictionary));
ghoul::Dictionary newHorizonsDictionary =
{
{ std::string("Type"), std::string("Spice") },
{ std::string("Body"), std::string("NEW HORIZONS") },
{ std::string("Reference"), std::string("GALACTIC") },
{ std::string("Observer"), std::string("SUN") },
{ std::string("Kernels"), ghoul::Dictionary() }
};
if (newHorizonsNode)
newHorizonsNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
//newHorizonsTrailNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
//ghoul::Dictionary dawnDictionary =
//{
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("DAWN") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("SUN") },
// { std::string("Kernels"), ghoul::Dictionary() }
//};
//dawnNode->setEphemeris(new SpiceEphemeris(dawnDictionary));
//
//ghoul::Dictionary vestaDictionary =
//{
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("VESTA") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("SUN") },
// { std::string("Kernels"), ghoul::Dictionary() }
//};
//vestaNode->setEphemeris(new SpiceEphemeris(vestaDictionary));
//ghoul::Dictionary newHorizonsGhostDictionary =
//{
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("NEW HORIZONS") },
// { std::string("EphmerisGhosting"), std::string("TRUE") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("JUPITER BARYCENTER") },
// { std::string("Kernels"), ghoul::Dictionary() }
//};
//newHorizonsGhostNode->setEphemeris(new SpiceEphemeris(newHorizonsGhostDictionary));
return;
}
if (origin == "Jupiter") {
if (newHorizonsPathNodeJ) {
Renderable* R = newHorizonsPathNodeJ->renderable();
newHorizonsPathNodeJ->setParent(jupiterBarycenterNode);
nhPath = static_cast<RenderablePath*>(R);
nhPath->calculatePath("JUPITER BARYCENTER");
}
jupiterBarycenterNode->setParent(scene()->sceneGraphNode("SolarSystem"));
jupiterBarycenterNode->setEphemeris(new StaticEphemeris);
solarSystemBarycenterNode->setParent(jupiterBarycenterNode);
if (newHorizonsNode)
newHorizonsNode->setParent(jupiterBarycenterNode);
//newHorizonsTrailNode->setParent(jupiterBarycenterNode);
//dawnNode->setParent(jupiterBarycenterNode);
//vestaNode->setParent(jupiterBarycenterNode);
ghoul::Dictionary solarDictionary =
{
{ std::string("Type"), std::string("Spice") },
{ std::string("Body"), std::string("SUN") },
{ std::string("Reference"), std::string("GALACTIC") },
{ std::string("Observer"), std::string("JUPITER BARYCENTER") },
{ std::string("Kernels"), ghoul::Dictionary() }
};
ghoul::Dictionary plutoDictionary =
{
{ std::string("Type"), std::string("Spice") },
{ std::string("Body"), std::string("PlUTO BARYCENTER") },
{ std::string("Reference"), std::string("GALACTIC") },
{ std::string("Observer"), std::string("JUPITER BARYCENTER") },
{ std::string("Kernels"), ghoul::Dictionary() }
};
ghoul::Dictionary newHorizonsDictionary =
{
{ std::string("Type"), std::string("Spice") },
{ std::string("Body"), std::string("NEW HORIZONS") },
{ std::string("Reference"), std::string("GALACTIC") },
{ std::string("Observer"), std::string("JUPITER BARYCENTER") },
{ std::string("Kernels"), ghoul::Dictionary() }
};
solarSystemBarycenterNode->setEphemeris(new SpiceEphemeris(solarDictionary));
if (plutoBarycenterNode)
plutoBarycenterNode->setEphemeris(new SpiceEphemeris(plutoDictionary));
if (newHorizonsNode)
newHorizonsNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
//newHorizonsGhostNode->setParent(jupiterBarycenterNode);
//newHorizonsTrailNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
//ghoul::Dictionary dawnDictionary =
//{
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("DAWN") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("JUPITER BARYCENTER") },
// { std::string("Kernels"), ghoul::Dictionary() }
//};
//dawnNode->setEphemeris(new SpiceEphemeris(dawnDictionary));
//
//ghoul::Dictionary vestaDictionary =
//{
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("VESTA") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("JUPITER BARYCENTER") },
// { std::string("Kernels"), ghoul::Dictionary() }
//};
//vestaNode->setEphemeris(new SpiceEphemeris(vestaDictionary));
//ghoul::Dictionary newHorizonsGhostDictionary =
//{
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("NEW HORIZONS") },
// { std::string("EphmerisGhosting"), std::string("TRUE") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("JUPITER BARYCENTER") },
// { std::string("Kernels"), ghoul::Dictionary() }
//};
//newHorizonsGhostNode->setEphemeris(new SpiceEphemeris(newHorizonsGhostDictionary));
//newHorizonsGhostNode->setParent(jupiterBarycenterNode);
return;
}
//if (origin == "Vesta") {
//
// vestaNode->setParent(scene()->sceneGraphNode("SolarSystem"));
// vestaNode->setEphemeris(new StaticEphemeris);
//
// solarSystemBarycenterNode->setParent(vestaNode);
// newHorizonsNode->setParent(vestaNode);
//
// dawnNode->setParent(vestaNode);
// plutoBarycenterNode->setParent(vestaNode);
//
//
// ghoul::Dictionary plutoDictionary =
// {
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("PLUTO BARYCENTER") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("VESTA") },
// { std::string("Kernels"), ghoul::Dictionary() }
// };
// ghoul::Dictionary solarDictionary =
// {
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("SUN") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("VESTA") },
// { std::string("Kernels"), ghoul::Dictionary() }
// };
//
// ghoul::Dictionary jupiterDictionary =
// {
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("JUPITER BARYCENTER") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("VESTA") },
// { std::string("Kernels"), ghoul::Dictionary() }
// };
//
// solarSystemBarycenterNode->setEphemeris(new SpiceEphemeris(solarDictionary));
// plutoBarycenterNode->setEphemeris(new SpiceEphemeris(plutoDictionary));
// jupiterBarycenterNode->setEphemeris(new SpiceEphemeris(jupiterDictionary));
//
// ghoul::Dictionary newHorizonsDictionary =
// {
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("NEW HORIZONS") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("VESTA") },
// { std::string("Kernels"), ghoul::Dictionary() }
// };
// newHorizonsNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
//
// ghoul::Dictionary dawnDictionary =
// {
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("DAWN") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("VESTA") },
// { std::string("Kernels"), ghoul::Dictionary() }
// };
// dawnNode->setEphemeris(new SpiceEphemeris(dawnDictionary));
// vestaNode->setEphemeris(new StaticEphemeris);
//
// return;
//}
if (origin == "67P") {
SceneGraphNode* rosettaNode = scene()->sceneGraphNode("Rosetta");
SceneGraphNode* cgNode = scene()->sceneGraphNode("67P");
//jupiterBarycenterNode->setParent(solarSystemBarycenterNode);
//plutoBarycenterNode->setParent(solarSystemBarycenterNode);
solarSystemBarycenterNode->setParent(cgNode);
rosettaNode->setParent(cgNode);
ghoul::Dictionary solarDictionary =
{
{ std::string("Type"), std::string("Spice") },
{ std::string("Body"), std::string("SUN") },
{ std::string("Reference"), std::string("GALACTIC") },
{ std::string("Observer"), std::string("CHURYUMOV-GERASIMENKO") },
{ std::string("Kernels"), ghoul::Dictionary() }
};
solarSystemBarycenterNode->setEphemeris(new SpiceEphemeris(solarDictionary));
ghoul::Dictionary rosettaDictionary =
{
{ std::string("Type"), std::string("Spice") },
{ std::string("Body"), std::string("ROSETTA") },
{ std::string("Reference"), std::string("GALACTIC") },
{ std::string("Observer"), std::string("CHURYUMOV-GERASIMENKO") },
{ std::string("Kernels"), ghoul::Dictionary() }
};
cgNode->setParent(scene()->sceneGraphNode("SolarSystem"));
rosettaNode->setEphemeris(new SpiceEphemeris(rosettaDictionary));
cgNode->setEphemeris(new StaticEphemeris);
return;
}
LFATAL("This function is being misused with an argument of '" << origin << "'");
// SceneGraphNode* solarSystemBarycenterNode = scene()->sceneGraphNode("SolarSystemBarycenter");
// SceneGraphNode* plutoBarycenterNode = scene()->sceneGraphNode("PlutoBarycenter");
// SceneGraphNode* newHorizonsNode = scene()->sceneGraphNode("NewHorizons");
// SceneGraphNode* newHorizonsPathNodeJ = scene()->sceneGraphNode("NewHorizonsPathJupiter");
// SceneGraphNode* newHorizonsPathNodeP = scene()->sceneGraphNode("NewHorizonsPathPluto");
//// SceneGraphNode* cg67pNode = scene()->sceneGraphNode("67P");
//// SceneGraphNode* rosettaNode = scene()->sceneGraphNode("Rosetta");
//
// RenderablePath* nhPath;
//
// SceneGraphNode* jupiterBarycenterNode = scene()->sceneGraphNode("JupiterBarycenter");
//
// //SceneGraphNode* newHorizonsGhostNode = scene()->sceneGraphNode("NewHorizonsGhost");
// //SceneGraphNode* dawnNode = scene()->sceneGraphNode("Dawn");
// //SceneGraphNode* vestaNode = scene()->sceneGraphNode("Vesta");
//
// // if (solarSystemBarycenterNode == nullptr || plutoBarycenterNode == nullptr ||
// //jupiterBarycenterNode == nullptr) {
// // LERROR("Necessary nodes does not exist");
// //return;
// // }
//
// if (origin == "Pluto") {
// if (newHorizonsPathNodeP) {
// Renderable* R = newHorizonsPathNodeP->renderable();
// newHorizonsPathNodeP->setParent(plutoBarycenterNode);
// nhPath = static_cast<RenderablePath*>(R);
// nhPath->calculatePath("PLUTO BARYCENTER");
// }
//
// plutoBarycenterNode->setParent(scene()->sceneGraphNode("SolarSystem"));
// plutoBarycenterNode->setEphemeris(new StaticEphemeris);
//
// solarSystemBarycenterNode->setParent(plutoBarycenterNode);
// newHorizonsNode->setParent(plutoBarycenterNode);
// //newHorizonsGhostNode->setParent(plutoBarycenterNode);
//
// //dawnNode->setParent(plutoBarycenterNode);
// //vestaNode->setParent(plutoBarycenterNode);
//
// //newHorizonsTrailNode->setParent(plutoBarycenterNode);
// ghoul::Dictionary solarDictionary =
// {
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("SUN") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("PLUTO BARYCENTER") },
// { std::string("Kernels"), ghoul::Dictionary() }
// };
//
// ghoul::Dictionary jupiterDictionary =
// {
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("JUPITER BARYCENTER") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("PLUTO BARYCENTER") },
// { std::string("Kernels"), ghoul::Dictionary() }
// };
//
// ghoul::Dictionary newHorizonsDictionary =
// {
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("NEW HORIZONS") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("PLUTO BARYCENTER") },
// { std::string("Kernels"), ghoul::Dictionary() }
// };
//
// solarSystemBarycenterNode->setEphemeris(new SpiceEphemeris(solarDictionary));
// jupiterBarycenterNode->setEphemeris(new SpiceEphemeris(jupiterDictionary));
// newHorizonsNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
// //newHorizonsTrailNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
//
//
// //ghoul::Dictionary dawnDictionary =
// //{
// // { std::string("Type"), std::string("Spice") },
// // { std::string("Body"), std::string("DAWN") },
// // { std::string("Reference"), std::string("GALACTIC") },
// // { std::string("Observer"), std::string("PLUTO BARYCENTER") },
// // { std::string("Kernels"), ghoul::Dictionary() }
// //};
// //dawnNode->setEphemeris(new SpiceEphemeris(dawnDictionary));
// //
// //ghoul::Dictionary vestaDictionary =
// //{
// // { std::string("Type"), std::string("Spice") },
// // { std::string("Body"), std::string("VESTA") },
// // { std::string("Reference"), std::string("GALACTIC") },
// // { std::string("Observer"), std::string("PLUTO BARYCENTER") },
// // { std::string("Kernels"), ghoul::Dictionary() }
// //};
// //vestaNode->setEphemeris(new SpiceEphemeris(vestaDictionary));
//
//
// //ghoul::Dictionary newHorizonsGhostDictionary =
// //{
// // { std::string("Type"), std::string("Spice") },
// // { std::string("Body"), std::string("NEW HORIZONS") },
// // { std::string("EphmerisGhosting"), std::string("TRUE") },
// // { std::string("Reference"), std::string("GALACTIC") },
// // { std::string("Observer"), std::string("PLUTO BARYCENTER") },
// // { std::string("Kernels"), ghoul::Dictionary() }
// //};
// //newHorizonsGhostNode->setEphemeris(new SpiceEphemeris(newHorizonsGhostDictionary));
//
// return;
// }
// if (origin == "Sun") {
// solarSystemBarycenterNode->setParent(scene()->sceneGraphNode("SolarSystem"));
//
// if (plutoBarycenterNode)
// plutoBarycenterNode->setParent(solarSystemBarycenterNode);
// jupiterBarycenterNode->setParent(solarSystemBarycenterNode);
// if (newHorizonsNode)
// newHorizonsNode->setParent(solarSystemBarycenterNode);
// //newHorizonsGhostNode->setParent(solarSystemBarycenterNode);
//
// //newHorizonsTrailNode->setParent(solarSystemBarycenterNode);
// //dawnNode->setParent(solarSystemBarycenterNode);
// //vestaNode->setParent(solarSystemBarycenterNode);
//
// ghoul::Dictionary plutoDictionary =
// {
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("PLUTO BARYCENTER") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("SUN") },
// { std::string("Kernels"), ghoul::Dictionary() }
// };
// ghoul::Dictionary jupiterDictionary =
// {
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("JUPITER BARYCENTER") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("SUN") },
// { std::string("Kernels"), ghoul::Dictionary() }
// };
//
// solarSystemBarycenterNode->setEphemeris(new StaticEphemeris);
// jupiterBarycenterNode->setEphemeris(new SpiceEphemeris(jupiterDictionary));
// if (plutoBarycenterNode)
// plutoBarycenterNode->setEphemeris(new SpiceEphemeris(plutoDictionary));
//
// ghoul::Dictionary newHorizonsDictionary =
// {
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("NEW HORIZONS") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("SUN") },
// { std::string("Kernels"), ghoul::Dictionary() }
// };
// if (newHorizonsNode)
// newHorizonsNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
// //newHorizonsTrailNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
//
//
// //ghoul::Dictionary dawnDictionary =
// //{
// // { std::string("Type"), std::string("Spice") },
// // { std::string("Body"), std::string("DAWN") },
// // { std::string("Reference"), std::string("GALACTIC") },
// // { std::string("Observer"), std::string("SUN") },
// // { std::string("Kernels"), ghoul::Dictionary() }
// //};
// //dawnNode->setEphemeris(new SpiceEphemeris(dawnDictionary));
// //
// //ghoul::Dictionary vestaDictionary =
// //{
// // { std::string("Type"), std::string("Spice") },
// // { std::string("Body"), std::string("VESTA") },
// // { std::string("Reference"), std::string("GALACTIC") },
// // { std::string("Observer"), std::string("SUN") },
// // { std::string("Kernels"), ghoul::Dictionary() }
// //};
// //vestaNode->setEphemeris(new SpiceEphemeris(vestaDictionary));
//
//
// //ghoul::Dictionary newHorizonsGhostDictionary =
// //{
// // { std::string("Type"), std::string("Spice") },
// // { std::string("Body"), std::string("NEW HORIZONS") },
// // { std::string("EphmerisGhosting"), std::string("TRUE") },
// // { std::string("Reference"), std::string("GALACTIC") },
// // { std::string("Observer"), std::string("JUPITER BARYCENTER") },
// // { std::string("Kernels"), ghoul::Dictionary() }
// //};
// //newHorizonsGhostNode->setEphemeris(new SpiceEphemeris(newHorizonsGhostDictionary));
//
// return;
// }
// if (origin == "Jupiter") {
// if (newHorizonsPathNodeJ) {
// Renderable* R = newHorizonsPathNodeJ->renderable();
// newHorizonsPathNodeJ->setParent(jupiterBarycenterNode);
// nhPath = static_cast<RenderablePath*>(R);
// nhPath->calculatePath("JUPITER BARYCENTER");
// }
//
// jupiterBarycenterNode->setParent(scene()->sceneGraphNode("SolarSystem"));
// jupiterBarycenterNode->setEphemeris(new StaticEphemeris);
//
// solarSystemBarycenterNode->setParent(jupiterBarycenterNode);
// if (newHorizonsNode)
// newHorizonsNode->setParent(jupiterBarycenterNode);
// //newHorizonsTrailNode->setParent(jupiterBarycenterNode);
//
// //dawnNode->setParent(jupiterBarycenterNode);
// //vestaNode->setParent(jupiterBarycenterNode);
//
//
// ghoul::Dictionary solarDictionary =
// {
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("SUN") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("JUPITER BARYCENTER") },
// { std::string("Kernels"), ghoul::Dictionary() }
// };
//
// ghoul::Dictionary plutoDictionary =
// {
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("PlUTO BARYCENTER") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("JUPITER BARYCENTER") },
// { std::string("Kernels"), ghoul::Dictionary() }
// };
//
// ghoul::Dictionary newHorizonsDictionary =
// {
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("NEW HORIZONS") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("JUPITER BARYCENTER") },
// { std::string("Kernels"), ghoul::Dictionary() }
// };
// solarSystemBarycenterNode->setEphemeris(new SpiceEphemeris(solarDictionary));
// if (plutoBarycenterNode)
// plutoBarycenterNode->setEphemeris(new SpiceEphemeris(plutoDictionary));
// if (newHorizonsNode)
// newHorizonsNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
// //newHorizonsGhostNode->setParent(jupiterBarycenterNode);
// //newHorizonsTrailNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
//
//
// //ghoul::Dictionary dawnDictionary =
// //{
// // { std::string("Type"), std::string("Spice") },
// // { std::string("Body"), std::string("DAWN") },
// // { std::string("Reference"), std::string("GALACTIC") },
// // { std::string("Observer"), std::string("JUPITER BARYCENTER") },
// // { std::string("Kernels"), ghoul::Dictionary() }
// //};
// //dawnNode->setEphemeris(new SpiceEphemeris(dawnDictionary));
// //
// //ghoul::Dictionary vestaDictionary =
// //{
// // { std::string("Type"), std::string("Spice") },
// // { std::string("Body"), std::string("VESTA") },
// // { std::string("Reference"), std::string("GALACTIC") },
// // { std::string("Observer"), std::string("JUPITER BARYCENTER") },
// // { std::string("Kernels"), ghoul::Dictionary() }
// //};
// //vestaNode->setEphemeris(new SpiceEphemeris(vestaDictionary));
//
//
//
// //ghoul::Dictionary newHorizonsGhostDictionary =
// //{
// // { std::string("Type"), std::string("Spice") },
// // { std::string("Body"), std::string("NEW HORIZONS") },
// // { std::string("EphmerisGhosting"), std::string("TRUE") },
// // { std::string("Reference"), std::string("GALACTIC") },
// // { std::string("Observer"), std::string("JUPITER BARYCENTER") },
// // { std::string("Kernels"), ghoul::Dictionary() }
// //};
// //newHorizonsGhostNode->setEphemeris(new SpiceEphemeris(newHorizonsGhostDictionary));
// //newHorizonsGhostNode->setParent(jupiterBarycenterNode);
//
//
// return;
// }
// //if (origin == "Vesta") {
// //
// // vestaNode->setParent(scene()->sceneGraphNode("SolarSystem"));
// // vestaNode->setEphemeris(new StaticEphemeris);
// //
// // solarSystemBarycenterNode->setParent(vestaNode);
// // newHorizonsNode->setParent(vestaNode);
// //
// // dawnNode->setParent(vestaNode);
// // plutoBarycenterNode->setParent(vestaNode);
// //
// //
// // ghoul::Dictionary plutoDictionary =
// // {
// // { std::string("Type"), std::string("Spice") },
// // { std::string("Body"), std::string("PLUTO BARYCENTER") },
// // { std::string("Reference"), std::string("GALACTIC") },
// // { std::string("Observer"), std::string("VESTA") },
// // { std::string("Kernels"), ghoul::Dictionary() }
// // };
// // ghoul::Dictionary solarDictionary =
// // {
// // { std::string("Type"), std::string("Spice") },
// // { std::string("Body"), std::string("SUN") },
// // { std::string("Reference"), std::string("GALACTIC") },
// // { std::string("Observer"), std::string("VESTA") },
// // { std::string("Kernels"), ghoul::Dictionary() }
// // };
// //
// // ghoul::Dictionary jupiterDictionary =
// // {
// // { std::string("Type"), std::string("Spice") },
// // { std::string("Body"), std::string("JUPITER BARYCENTER") },
// // { std::string("Reference"), std::string("GALACTIC") },
// // { std::string("Observer"), std::string("VESTA") },
// // { std::string("Kernels"), ghoul::Dictionary() }
// // };
// //
// // solarSystemBarycenterNode->setEphemeris(new SpiceEphemeris(solarDictionary));
// // plutoBarycenterNode->setEphemeris(new SpiceEphemeris(plutoDictionary));
// // jupiterBarycenterNode->setEphemeris(new SpiceEphemeris(jupiterDictionary));
// //
// // ghoul::Dictionary newHorizonsDictionary =
// // {
// // { std::string("Type"), std::string("Spice") },
// // { std::string("Body"), std::string("NEW HORIZONS") },
// // { std::string("Reference"), std::string("GALACTIC") },
// // { std::string("Observer"), std::string("VESTA") },
// // { std::string("Kernels"), ghoul::Dictionary() }
// // };
// // newHorizonsNode->setEphemeris(new SpiceEphemeris(newHorizonsDictionary));
// //
// // ghoul::Dictionary dawnDictionary =
// // {
// // { std::string("Type"), std::string("Spice") },
// // { std::string("Body"), std::string("DAWN") },
// // { std::string("Reference"), std::string("GALACTIC") },
// // { std::string("Observer"), std::string("VESTA") },
// // { std::string("Kernels"), ghoul::Dictionary() }
// // };
// // dawnNode->setEphemeris(new SpiceEphemeris(dawnDictionary));
// // vestaNode->setEphemeris(new StaticEphemeris);
// //
// // return;
// //}
//
// if (origin == "67P") {
// SceneGraphNode* rosettaNode = scene()->sceneGraphNode("Rosetta");
// SceneGraphNode* cgNode = scene()->sceneGraphNode("67P");
// //jupiterBarycenterNode->setParent(solarSystemBarycenterNode);
// //plutoBarycenterNode->setParent(solarSystemBarycenterNode);
// solarSystemBarycenterNode->setParent(cgNode);
// rosettaNode->setParent(cgNode);
//
// ghoul::Dictionary solarDictionary =
// {
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("SUN") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("CHURYUMOV-GERASIMENKO") },
// { std::string("Kernels"), ghoul::Dictionary() }
// };
// solarSystemBarycenterNode->setEphemeris(new SpiceEphemeris(solarDictionary));
//
// ghoul::Dictionary rosettaDictionary =
// {
// { std::string("Type"), std::string("Spice") },
// { std::string("Body"), std::string("ROSETTA") },
// { std::string("Reference"), std::string("GALACTIC") },
// { std::string("Observer"), std::string("CHURYUMOV-GERASIMENKO") },
// { std::string("Kernels"), ghoul::Dictionary() }
// };
//
// cgNode->setParent(scene()->sceneGraphNode("SolarSystem"));
// rosettaNode->setEphemeris(new SpiceEphemeris(rosettaDictionary));
// cgNode->setEphemeris(new StaticEphemeris);
//
// return;
//
// }
//
// LFATAL("This function is being misused with an argument of '" << origin << "'");
}
void RenderEngine::setShowFrameNumber(bool enabled){

View File

@@ -29,13 +29,13 @@
#include <openspace/documentation/verifier.h>
namespace {
const std::string _loggerCat = "Ephemeris";
const std::string _loggerCat = "Translation";
const std::string KeyType = "Type";
}
namespace openspace {
Documentation Ephemeris::Documentation() {
Documentation Translation::Documentation() {
using namespace openspace::documentation;
return{
@@ -56,31 +56,31 @@ Documentation Ephemeris::Documentation() {
};
}
Ephemeris* Ephemeris::createFromDictionary(const ghoul::Dictionary& dictionary) {
Translation* Translation::createFromDictionary(const ghoul::Dictionary& dictionary) {
if (!dictionary.hasValue<std::string>(KeyType)) {
LERROR("Ephemeris did not have key '" << KeyType << "'");
LERROR("Translation did not have key '" << KeyType << "'");
return nullptr;
}
std::string ephemerisType;
dictionary.getValue(KeyType, ephemerisType);
ghoul::TemplateFactory<Ephemeris>* factory
= FactoryManager::ref().factory<Ephemeris>();
Ephemeris* result = factory->create(ephemerisType, dictionary);
std::string translationType;
dictionary.getValue(KeyType, translationType);
ghoul::TemplateFactory<Translation>* factory
= FactoryManager::ref().factory<Translation>();
Translation* result = factory->create(translationType, dictionary);
if (result == nullptr) {
LERROR("Failed creating Ephemeris object of type '" << ephemerisType << "'");
LERROR("Failed creating Translation object of type '" << translationType << "'");
return nullptr;
}
return result;
}
Ephemeris::~Ephemeris() {}
Translation::~Translation() {}
bool Ephemeris::initialize() {
bool Translation::initialize() {
return true;
}
void Ephemeris::update(const UpdateData& data) {}
void Translation::update(const UpdateData& data) {}
} // namespace openspace

View File

@@ -106,9 +106,9 @@ SceneGraphNode* SceneGraphNode::createFromDictionary(const ghoul::Dictionary& di
if (dictionary.hasKey(keyTransformTranslation)) {
ghoul::Dictionary translationDictionary;
dictionary.getValue(keyTransformTranslation, translationDictionary);
result->_ephemeris =
(Ephemeris::createFromDictionary(translationDictionary));
if (result->_ephemeris == nullptr) {
result->_translation =
(Translation::createFromDictionary(translationDictionary));
if (result->_translation == nullptr) {
LERROR("Failed to create ephemeris for SceneGraphNode '"
<< result->name() << "'");
delete result;
@@ -167,7 +167,7 @@ SceneGraphNode* SceneGraphNode::createFromDictionary(const ghoul::Dictionary& di
SceneGraphNode::SceneGraphNode()
: _parent(nullptr)
, _ephemeris(new StaticEphemeris())
, _translation(new StaticTranslation())
, _rotation(new StaticRotation())
, _scale(new StaticScale())
, _performanceRecord({0, 0, 0})
@@ -185,8 +185,8 @@ bool SceneGraphNode::initialize() {
if (_renderable)
_renderable->initialize();
if (_ephemeris)
_ephemeris->initialize();
if (_translation)
_translation->initialize();
if (_rotation)
_rotation->initialize();
if (_scale)
@@ -203,9 +203,9 @@ bool SceneGraphNode::deinitialize() {
delete _renderable;
_renderable = nullptr;
}
if (_ephemeris) {
delete _ephemeris;
_ephemeris = nullptr;
if (_translation) {
delete _translation;
_translation = nullptr;
}
if (_rotation) {
delete _rotation;
@@ -235,19 +235,19 @@ bool SceneGraphNode::deinitialize() {
}
void SceneGraphNode::update(const UpdateData& data) {
if (_ephemeris) {
if (_translation) {
if (data.doPerformanceMeasurement) {
glFinish();
auto start = std::chrono::high_resolution_clock::now();
_ephemeris->update(data);
_translation->update(data);
glFinish();
auto end = std::chrono::high_resolution_clock::now();
_performanceRecord.updateTimeEphemeris = (end - start).count();
}
else
_ephemeris->update(data);
_translation->update(data);
}
if (_rotation) {
@@ -431,7 +431,7 @@ void SceneGraphNode::addChild(SceneGraphNode* child) {
glm::dvec3 SceneGraphNode::position() const
{
return _ephemeris->position();
return _translation->position();
}
const glm::dmat3& SceneGraphNode::rotationMatrix() const