Commit 30436e4b authored by Alexis Girault's avatar Alexis Girault
Browse files

ENH: Add interface to expose sceneManager module

parent 35dd3fb2
...@@ -40,8 +40,8 @@ SimulationManager::isSceneRegistered(std::string sceneName) const ...@@ -40,8 +40,8 @@ SimulationManager::isSceneRegistered(std::string sceneName) const
return m_sceneManagerMap.find(sceneName) != m_sceneManagerMap.end(); return m_sceneManagerMap.find(sceneName) != m_sceneManagerMap.end();
} }
std::shared_ptr<Scene> std::shared_ptr<SceneManager>
SimulationManager::getScene(std::string sceneName) const SimulationManager::getSceneManager(std::string sceneName) const
{ {
if (!this->isSceneRegistered(sceneName)) if (!this->isSceneRegistered(sceneName))
{ {
...@@ -50,7 +50,14 @@ SimulationManager::getScene(std::string sceneName) const ...@@ -50,7 +50,14 @@ SimulationManager::getScene(std::string sceneName) const
return nullptr; return nullptr;
} }
return m_sceneManagerMap.at(sceneName)->getScene(); return m_sceneManagerMap.at(sceneName);
}
std::shared_ptr<Scene>
SimulationManager::getScene(std::string sceneName) const
{
auto sceneManager = this->getSceneManager(sceneName);
return sceneManager ? sceneManager->getScene() : nullptr;
} }
std::shared_ptr<Scene> std::shared_ptr<Scene>
...@@ -134,6 +141,7 @@ SimulationManager::getModule(std::string moduleName) const ...@@ -134,6 +141,7 @@ SimulationManager::getModule(std::string moduleName) const
return m_modulesMap.at(moduleName); return m_modulesMap.at(moduleName);
} }
void void
SimulationManager::addModule(std::shared_ptr<Module> newModule) SimulationManager::addModule(std::shared_ptr<Module> newModule)
{ {
......
...@@ -73,6 +73,11 @@ public: ...@@ -73,6 +73,11 @@ public:
/// ///
bool isSceneRegistered(std::string sceneName) const; bool isSceneRegistered(std::string sceneName) const;
///
/// \brief
///
std::shared_ptr<SceneManager> getSceneManager(std::string sceneName) const;
/// ///
/// \brief /// \brief
/// ///
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment