Add Lua functions to add and remove SceneGraphNodes

This commit is contained in:
Alexander Bock
2016-04-08 13:35:04 +02:00
parent 21276f2cd8
commit 8c354e5e37
3 changed files with 106 additions and 34 deletions
+17 -15
View File
@@ -65,7 +65,7 @@ public:
* Load the scenegraph from the provided folder
*/
void scheduleLoadSceneFile(const std::string& sceneDescriptionFilePath);
void clearSceneGraph();
void clearSceneGraph();
void loadModule(const std::string& modulePath);
@@ -95,20 +95,22 @@ public:
*/
SceneGraphNode* sceneGraphNode(const std::string& name) const;
std::vector<SceneGraphNode*> allSceneGraphNodes();
std::vector<SceneGraphNode*> allSceneGraphNodes();
/**
* Returns the Lua library that contains all Lua functions available to change the
* scene graph. The functions contained are
* - openspace::luascriptfunctions::property_setValue
* - openspace::luascriptfunctions::property_getValue
* \return The Lua library that contains all Lua functions available to change the
* scene graph
*/
static scripting::ScriptEngine::LuaLibrary luaLibrary();
SceneGraph& sceneGraph();
/**
* Returns the Lua library that contains all Lua functions available to change the
* scene graph. The functions contained are
* - openspace::luascriptfunctions::property_setValue
* - openspace::luascriptfunctions::property_getValue
* \return The Lua library that contains all Lua functions available to change the
* scene graph
*/
static scripting::ScriptEngine::LuaLibrary luaLibrary();
private:
bool loadSceneInternal(const std::string& sceneDescriptionFilePath);
bool loadSceneInternal(const std::string& sceneDescriptionFilePath);
void writePropertyDocumentation(const std::string& filename, const std::string& type);
@@ -120,10 +122,10 @@ private:
//std::vector<SceneGraphNode*> _nodes;
//std::map<std::string, SceneGraphNode*> _allNodes;
std::string _sceneGraphToLoad;
std::string _sceneGraphToLoad;
std::mutex _programUpdateLock;
std::set<ghoul::opengl::ProgramObject*> _programsToUpdate;
std::mutex _programUpdateLock;
std::set<ghoul::opengl::ProgramObject*> _programsToUpdate;
std::vector<std::unique_ptr<ghoul::opengl::ProgramObject>> _programs;
typedef std::map<std::string, ghoul::Dictionary> NodeMap;