mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-08 20:50:19 -06:00
Solved iSWA name problem
This commit is contained in:
@@ -98,10 +98,9 @@ IswaCygnet::IswaCygnet(const ghoul::Dictionary& dictionary)
|
||||
// std::cout << std::to_string(_data->min) << std::endl;
|
||||
// std::cout << std::to_string(_data->spatialScale) << std::endl;
|
||||
|
||||
_delete.onChange([this](){IswaManager::ref().deleteIswaCygnet(name());});
|
||||
|
||||
// _textures.push_back(nullptr);
|
||||
// _transferFunctions.push_back(nullptr);
|
||||
_delete.onChange([this](){
|
||||
OsEng.scriptEngine().queueScript("openspace.removeSceneGraphNode('" + name() + "')");
|
||||
});
|
||||
}
|
||||
|
||||
IswaCygnet::~IswaCygnet(){}
|
||||
|
||||
@@ -181,8 +181,8 @@ void IswaGroup::unregisterProperties(){
|
||||
|
||||
void IswaGroup::clearGroup(){
|
||||
for(auto it = _cygnets.begin(); it != _cygnets.end();){
|
||||
IswaManager::ref().deleteIswaCygnet((*it)->name());
|
||||
it = _cygnets.erase(it);
|
||||
OsEng.scriptEngine().queueScript("openspace.removeSceneGraphNode('" + (*it)->name() + "')");
|
||||
it = _cygnets.erase(it);
|
||||
}
|
||||
unregisterProperties();
|
||||
}
|
||||
|
||||
@@ -31,6 +31,8 @@
|
||||
#include <modules/iswa/rendering/iswagroup.h>
|
||||
|
||||
#include <fstream>
|
||||
#include <algorithm>
|
||||
|
||||
#include <ghoul/filesystem/filesystem>
|
||||
#include <modules/kameleon/include/kameleonwrapper.h>
|
||||
#include <openspace/util/time.h>
|
||||
@@ -170,10 +172,6 @@ void IswaManager::addIswaCygnet(int id, std::string info, int group){
|
||||
}
|
||||
}
|
||||
|
||||
void IswaManager::deleteIswaCygnet(std::string name){
|
||||
OsEng.scriptEngine().queueScript("openspace.removeSceneGraphNode('" + name + "')");
|
||||
}
|
||||
|
||||
std::future<DownloadManager::MemoryFile> IswaManager::fetchImageCygnet(int id){
|
||||
return std::move( DlManager.fetchFile(
|
||||
iswaUrl(id, "image"),
|
||||
@@ -371,8 +369,11 @@ void IswaManager::fillCygnetInfo(std::string jsonString){
|
||||
for(int i=0; i<jCygnets.size(); i++){
|
||||
json jCygnet = jCygnets.at(i);
|
||||
|
||||
std::string name = jCygnet["cygnetDisplayTitle"];
|
||||
std::replace(name.begin(), name.end(),'.', ',');
|
||||
|
||||
CygnetInfo info = {
|
||||
jCygnet["cygnetDisplayTitle"],
|
||||
name,
|
||||
jCygnet["cygnetDescription"],
|
||||
jCygnet["cygnetUpdateInterval"],
|
||||
false
|
||||
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
|
||||
void addIswaCygnet(std::string info);
|
||||
void addIswaCygnet(int id, std::string info = "Texture", int group = -1);
|
||||
void deleteIswaCygnet(std::string);
|
||||
// void deleteIswaCygnet(std::string);
|
||||
|
||||
std::future<DownloadManager::MemoryFile> fetchImageCygnet(int id);
|
||||
std::future<DownloadManager::MemoryFile> fetchDataCygnet(int id);
|
||||
|
||||
@@ -78,8 +78,9 @@ int iswa_addScreenSpaceCygnet(lua_State* L){
|
||||
}
|
||||
|
||||
int iswa_removeCygnet(lua_State* L){
|
||||
std::string s = luaL_checkstring(L, -1);
|
||||
IswaManager::ref().deleteIswaCygnet(s);
|
||||
std::string name = luaL_checkstring(L, -1);
|
||||
OsEng.scriptEngine().queueScript("openspace.removeSceneGraphNode('" + name + "')");
|
||||
// IswaManager::ref().deleteIswaCygnet(s);
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -96,7 +97,7 @@ int iswa_removeScrenSpaceCygnet(lua_State* L){
|
||||
|
||||
auto info = cygnetInformation[id];
|
||||
info->selected = false;
|
||||
|
||||
|
||||
std::string script = "openspace.unregisterScreenSpaceRenderable('" + cygnetInformation[id]->name + "');";
|
||||
OsEng.scriptEngine().queueScript(script);
|
||||
return 0;
|
||||
|
||||
Reference in New Issue
Block a user