mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 11:39:49 -06:00
Feature/gb gui (#390)
Implemented new GUI component to handle WMS servers * Add Lua scripts to support adding GIBS datasets (closes #222) * Add Lua function to load WMS servers from a predefined file * Workaround for Visual Studio 15.3 compile fix in Windows headers * Initial support for parsing GetCapabilities file and automatically add layers * Add a Trigger property to remove a layer * Support default servers * Add default file * Move WMS server code from GUI component into GlobeBrowsingModule * Add Lua scripts for loading and removing WMS servers Automatically load default servers on startup * Reset tile provider before removing a layer tolimit the crash risk Add "From focus" button to switch globebrowsing gui to the same node as the focus * Remove warnings Remove compile error with nonexisting GDALOpenEx function
This commit is contained in:
@@ -24,6 +24,7 @@
|
||||
|
||||
#include <modules/globebrowsing/rendering/layer/layer.h>
|
||||
|
||||
#include <modules/globebrowsing/rendering/layer/layergroup.h>
|
||||
#include <modules/globebrowsing/rendering/layer/layermanager.h>
|
||||
#include <modules/globebrowsing/tile/tileprovider/tileprovider.h>
|
||||
#include <modules/globebrowsing/tile/tiletextureinitdata.h>
|
||||
@@ -71,6 +72,13 @@ namespace {
|
||||
"local cache for this layer and will trigger a fresh load of all tiles."
|
||||
};
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo RemoveInfo = {
|
||||
"Remove",
|
||||
"Remove",
|
||||
"If this value is triggered, a script will be executed that will remove this "
|
||||
"layer before the next frame."
|
||||
};
|
||||
|
||||
static const openspace::properties::Property::PropertyInfo ColorInfo = {
|
||||
"Color",
|
||||
"Color",
|
||||
@@ -79,15 +87,18 @@ namespace {
|
||||
};
|
||||
} // namespace
|
||||
|
||||
Layer::Layer(layergroupid::GroupID id, const ghoul::Dictionary& layerDict)
|
||||
Layer::Layer(layergroupid::GroupID id, const ghoul::Dictionary& layerDict,
|
||||
LayerGroup& parent)
|
||||
: properties::PropertyOwner({
|
||||
layerDict.value<std::string>(keyName),
|
||||
layerDict.hasKey(keyDescription) ? layerDict.value<std::string>(keyDescription) : ""
|
||||
})
|
||||
, _parent(parent)
|
||||
, _typeOption(TypeInfo, properties::OptionProperty::DisplayType::Dropdown)
|
||||
, _blendModeOption(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown)
|
||||
, _enabled(EnabledInfo, false)
|
||||
, _reset(ResetInfo)
|
||||
, _remove(RemoveInfo)
|
||||
, _tileProvider(nullptr)
|
||||
, _otherTypesProperties({
|
||||
{ ColorInfo, glm::vec4(1.f), glm::vec4(0.f), glm::vec4(1.f) }
|
||||
@@ -160,6 +171,14 @@ Layer::Layer(layergroupid::GroupID id, const ghoul::Dictionary& layerDict)
|
||||
}
|
||||
});
|
||||
|
||||
_remove.onChange([&](){
|
||||
if (_tileProvider) {
|
||||
_tileProvider->reset();
|
||||
}
|
||||
|
||||
_parent.deleteLayer(name());
|
||||
});
|
||||
|
||||
_typeOption.onChange([&](){
|
||||
removeVisibleProperties();
|
||||
_type = static_cast<layergroupid::TypeID>(_typeOption.value());
|
||||
@@ -190,6 +209,7 @@ Layer::Layer(layergroupid::GroupID id, const ghoul::Dictionary& layerDict)
|
||||
addProperty(_blendModeOption);
|
||||
addProperty(_enabled);
|
||||
addProperty(_reset);
|
||||
addProperty(_remove);
|
||||
|
||||
_otherTypesProperties.color.setViewOption(properties::Property::ViewOptions::Color);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user