mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-04-29 15:29:26 -05:00
Replaced RuntimeData with separate, temporary structs that are passed around
This commit is contained in:
@@ -27,8 +27,7 @@
|
||||
|
||||
#include <openspace/util/powerscaledcoordinate.h>
|
||||
#include <ghoul/misc/dictionary.h>
|
||||
#include <openspace/util/runtimedata.h>
|
||||
|
||||
#include <openspace/util/updatestructures.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
@@ -40,14 +39,10 @@ public:
|
||||
virtual ~Ephemeris();
|
||||
virtual bool initialize();
|
||||
virtual const psc& position() const = 0;
|
||||
virtual void update(RuntimeData* runtimeData) = 0;
|
||||
virtual void update();
|
||||
virtual void update(const UpdateData& data);
|
||||
|
||||
protected:
|
||||
Ephemeris();
|
||||
|
||||
private:
|
||||
RuntimeData* _runtimeData;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -30,13 +30,12 @@
|
||||
#include <map>
|
||||
|
||||
#include <openspace/util/camera.h>
|
||||
|
||||
#include <openspace/util/updatestructures.h>
|
||||
#include <openspace/scripting/scriptengine.h>
|
||||
|
||||
// ghoul includes
|
||||
#include <ghoul/opengl/programobject.h>
|
||||
#include <ghoul/misc/dictionary.h>
|
||||
#include <openspace/util/runtimedata.h>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
@@ -49,8 +48,6 @@ public:
|
||||
SceneGraph();
|
||||
~SceneGraph();
|
||||
|
||||
void setRuntimeData(RuntimeData* runtimeData);
|
||||
|
||||
/**
|
||||
* Initalizes the SceneGraph by loading modules from the ${SCENEPATH} directory
|
||||
*/
|
||||
@@ -72,7 +69,7 @@ public:
|
||||
/*
|
||||
* Updates all SceneGraphNodes relative positions
|
||||
*/
|
||||
void update();
|
||||
void update(const UpdateData& data);
|
||||
|
||||
/*
|
||||
* Evaluates if the SceneGraphNodes are visible to the provided camera
|
||||
@@ -82,7 +79,7 @@ public:
|
||||
/*
|
||||
* Render visible SceneGraphNodes using the provided camera
|
||||
*/
|
||||
void render(Camera* camera);
|
||||
void render(const RenderData& data);
|
||||
|
||||
/*
|
||||
* Prints the SceneGraph tree. For debugging purposes
|
||||
@@ -119,7 +116,6 @@ private:
|
||||
SceneGraphNode* _root;
|
||||
std::vector<SceneGraphNode*> _nodes;
|
||||
std::map<std::string, SceneGraphNode*> _allNodes;
|
||||
RuntimeData* _runtimeData;
|
||||
|
||||
std::string _sceneGraphToLoad;
|
||||
};
|
||||
|
||||
@@ -32,7 +32,7 @@
|
||||
|
||||
#include <openspace/scenegraph/scenegraph.h>
|
||||
#include <ghoul/misc/dictionary.h>
|
||||
#include <openspace/util/runtimedata.h>
|
||||
#include <openspace/util/updatestructures.h>
|
||||
|
||||
// std includes
|
||||
#include <iostream>
|
||||
@@ -52,13 +52,13 @@ public:
|
||||
|
||||
static SceneGraphNode* createFromDictionary(const ghoul::Dictionary& dictionary);
|
||||
|
||||
bool initialize(RuntimeData* runtimeData);
|
||||
bool initialize();
|
||||
bool deinitialize();
|
||||
|
||||
// essential
|
||||
void update();
|
||||
void update(const UpdateData& data);
|
||||
void evaluate(const Camera* camera, const psc& parentPosition = psc());
|
||||
void render(const Camera* camera, const psc& parentPosition = psc());
|
||||
void render(const RenderData& data);
|
||||
|
||||
// set & get
|
||||
void addNode(SceneGraphNode* child);
|
||||
@@ -88,7 +88,6 @@ private:
|
||||
std::vector<SceneGraphNode*> _children;
|
||||
SceneGraphNode* _parent;
|
||||
Ephemeris* _ephemeris;
|
||||
RuntimeData* _runtimeData;
|
||||
|
||||
// renderable
|
||||
Renderable* _renderable;
|
||||
|
||||
@@ -34,10 +34,10 @@ namespace openspace {
|
||||
class SpiceEphemeris : public Ephemeris {
|
||||
public:
|
||||
SpiceEphemeris(const ghoul::Dictionary& dictionary);
|
||||
virtual ~SpiceEphemeris();
|
||||
virtual bool initialize();
|
||||
virtual const psc& position() const;
|
||||
virtual void update(RuntimeData* runtimeData);
|
||||
~SpiceEphemeris();
|
||||
bool initialize();
|
||||
const psc& position() const;
|
||||
void update(const UpdateData& data) override;
|
||||
|
||||
private:
|
||||
std::string _targetName;
|
||||
@@ -45,8 +45,6 @@ private:
|
||||
int _target;
|
||||
int _origin;
|
||||
psc _position;
|
||||
double _currentEphemerisTime = -1;
|
||||
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -35,7 +35,7 @@ public:
|
||||
= ghoul::Dictionary());
|
||||
virtual ~StaticEphemeris();
|
||||
virtual const psc& position() const;
|
||||
virtual void update(RuntimeData* runtimeData);
|
||||
virtual void update(const UpdateData& data) override;
|
||||
private:
|
||||
psc _position;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user