Renamed constants for dictionary keys

Created static creation method for Renderables
This commit is contained in:
Alexander Bock
2014-05-04 16:18:35 +02:00
parent fc291bfed0
commit e84c26aeb7
8 changed files with 122 additions and 81 deletions
+2
View File
@@ -36,6 +36,8 @@ namespace openspace {
class Renderable : public properties::PropertyOwner {
public:
static Renderable* createFromDictionary(const ghoul::Dictionary& dictionary);
// constructors & destructor
Renderable(const ghoul::Dictionary& dictionary);
virtual ~Renderable();
+36 -37
View File
@@ -42,61 +42,60 @@ namespace openspace {
class SceneGraphNode {
public:
// constructors & destructor
SceneGraphNode();
~SceneGraphNode();
// constructors & destructor
SceneGraphNode();
~SceneGraphNode();
static SceneGraphNode* createFromDictionary(const ghoul::Dictionary& dictionary);
bool initialize();
bool deinitialize();
// essential
void update();
void evaluate(const Camera *camera, const psc &parentPosition = psc());
void render(const Camera *camera, const psc &parentPosition = psc());
// essential
void update();
void evaluate(const Camera* camera, const psc& parentPosition = psc());
void render(const Camera* camera, const psc& parentPosition = psc());
// set & get
void addNode(SceneGraphNode* child);
void setName(const std::string &name);
void setParent(SceneGraphNode *parent);
const psc& getPosition() const;
psc getWorldPosition() const;
// set & get
void addNode(SceneGraphNode* child);
void setName(const std::string& name);
void setParent(SceneGraphNode* parent);
const psc& getPosition() const;
psc getWorldPosition() const;
std::string nodeName() const;
SceneGraphNode* parent() const;
const std::vector<SceneGraphNode*>& children() const;
// bounding sphere
pss calculateBoundingSphere();
// bounding sphere
pss calculateBoundingSphere();
SceneGraphNode* get(const std::string& name);
void print() const;
// renderable
void setRenderable(Renderable *renderable);
const Renderable * getRenderable() const;
// renderable
void setRenderable(Renderable* renderable);
const Renderable* getRenderable() const;
private:
// essential
std::vector<SceneGraphNode*> _children;
SceneGraphNode* _parent;
std::string _nodeName;
// essential
std::vector<SceneGraphNode*> _children;
SceneGraphNode* _parent;
std::string _nodeName;
PositionInformation* _position;
// renderable
Renderable *_renderable;
bool _renderableVisible;
// bounding sphere
bool _boundingSphereVisible;
pss _boundingSphere;
// private helper methods
bool sphereInsideFrustum(const psc s_pos, const pss & s_rad, const Camera *camera);
// renderable
Renderable* _renderable;
bool _renderableVisible;
// bounding sphere
bool _boundingSphereVisible;
pss _boundingSphere;
// private helper methods
bool sphereInsideFrustum(const psc s_pos, const pss& s_rad, const Camera* camera);
};
} // namespace openspace
+17 -13
View File
@@ -30,27 +30,31 @@
namespace openspace {
namespace constants {
namespace openspaceengine {
const std::string pathKey = "Paths";
const std::string scenePathKey = "Paths.SCENEPATH";
const std::string sgctConfigKey = "SGCTConfig";
const std::string sceneConfigurationKey = "Scene";
const std::string keyPaths = "Paths";
const std::string keyPathScene = "Paths.SCENEPATH";
const std::string keyConfigSgct = "SGCTConfig";
const std::string keyConfigScene = "Scene";
} // namespace openspaceengine
namespace scenegraph {
const std::string modulesKey = "Modules";
const std::string cameraKey = "Camera";
const std::string focusKey = "Focus";
const std::string positionKey = "Position";
const std::string modulePathKey = "ModulePath";
const std::string keyModules = "Modules";
const std::string keyCamera = "Camera";
const std::string keyFocusObject = "Focus";
const std::string keyPositionObject = "Position";
const std::string keyPathModule = "ModulePath";
} // namespace scenegraph
namespace scenegraphnode {
const std::string nameKey = "Name";
const std::string parentKey = "Parent";
const std::string renderableKey = "Renderable";
const std::string ephemerisKey = "Ephemeris";
const std::string keyName = "Name";
const std::string keyParentName = "Parent";
const std::string keyRenderable = "Renderable";
const std::string keyEphemeris = "Ephemeris";
} // namespace scenegraphnode
namespace renderable {
const std::string keyType = "Type";
}
} // namespace constants
} // namespace openspace