Add functionality for 3D browser: wwt messages and function to create an instance in lua api

This commit is contained in:
Ylva Selling
2021-05-19 12:01:20 +02:00
parent d2871392d7
commit 19d24e90d7
11 changed files with 400 additions and 268 deletions
+15 -1
View File
@@ -34,6 +34,7 @@
#include <openspace/engine/windowdelegate.h>
#include <openspace/engine/windowdelegate.h>
#include <openspace/rendering/renderengine.h>
#include <openspace/scene/scenegraphnode.h>
#include <openspace/interaction/navigationhandler.h>
#include <openspace/scene/scene.h>
#include <openspace/util/factorymanager.h>
@@ -144,6 +145,14 @@ namespace openspace {
"Add one or multiple exoplanet systems to the scene, as specified by the "
"input. An input string should be the name of the system host star"
},
{
"create3dSkyBrowser",
&skybrowser::luascriptfunctions::create3dSkyBrowser,
{},
"string or list of strings",
"Add one or multiple exoplanet systems to the scene, as specified by the "
"input. An input string should be the name of the system host star"
},
};
return res;
@@ -391,6 +400,10 @@ void SkyBrowserModule::addRenderable(ScreenSpaceRenderable* object) {
}
}
void SkyBrowserModule::add3dBrowser(SceneGraphNode* node) {
browsers3d.push_back(node);
}
ScreenSpaceSkyBrowser* SkyBrowserModule::to_browser(ScreenSpaceRenderable* ptr) {
return dynamic_cast<ScreenSpaceSkyBrowser*>(ptr);
}
@@ -468,9 +481,10 @@ int SkyBrowserModule::loadImages(const std::string& root, const std::string& dir
dataHandler->loadSpeckData(speckOpenClusters);
int nLoadedImages;
// Read from disc
bool loadedImages = dataHandler->loadWTMLCollectionsFromDirectory(directory);
// Reading from url if there is no directory
if (loadedImages) {
LINFO("Loading images from directory");