Add working way of instantiating ScreenSpaceBrowser from LuaScript

This commit is contained in:
Ylva Selling
2021-02-23 14:40:48 +01:00
parent 7d58cf40c2
commit 7c83c4e3da
5 changed files with 12 additions and 9 deletions
-3
View File
@@ -24,8 +24,6 @@
include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake)
set(HEADER_FILES
skybrowsermodule.h
@@ -37,7 +35,6 @@ set(SOURCE_FILES
skybrowsermodule.cpp
skybrowsermodule_lua.inl
)
source_group("Source Files" FILES ${SOURCE_FILES})
+4
View File
@@ -0,0 +1,4 @@
set(DEFAULT_MODULE ON)
set(OPENSPACE_DEPENDENCIES
webbrowser
)
+4 -1
View File
@@ -23,6 +23,8 @@
****************************************************************************************/
#include <modules/skybrowser/skybrowsermodule.h>
//#include <modules/webbrowser/webbrowsermodule.h>
//#include <modules/webbrowser/include/screenspacebrowser.h>
#include <openspace/engine/globals.h>
@@ -87,10 +89,11 @@ scripting::LuaLibrary SkybrowserModule::luaLibrary() const {
void SkybrowserModule::internalInitialize(const ghoul::Dictionary& dict) {
const Parameters p = codegen::bake<Parameters>(dict);
_testProperty = p.testString.value_or(_testProperty);
/*
auto fBrowser = FactoryManager::ref().factory<ScreenSpaceBrowser>();
ghoul_assert(fBrowser, "No browser factory existed :'-(");
fBrowser->registerClass<ScreenSpaceBrowser>("ScreenSpaceBrowser");
*/
}
/*
std::vector<documentation::Documentation> SkybrowserModule::documentations() const {
+1 -2
View File
@@ -27,8 +27,7 @@
#include <openspace/util/openspacemodule.h>
#include <modules/webbrowser/webbrowsermodule.h>
#include <modules/webbrowser/include/screenspacebrowser.h>
#include <openspace/documentation/documentation.h>
#include <openspace/properties/scalar/boolproperty.h>
+3 -3
View File
@@ -64,12 +64,12 @@ namespace openspace::skybrowser::luascriptfunctions {
node.setValue("Renderable", renderable);
node.setValue("GUI", gui);
*/
openspace::global::scriptEngine->queueScript(
"openspace.addSceneGraphNode(" + ghoul::formatLua(node) + ")",
"openspace.addScreenSpaceRenderable(" + ghoul::formatLua(node) + ")",
scripting::ScriptEngine::RemoteScripting::Yes
);
*/
return 1;
}