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:
Alexander Bock
2017-08-19 20:23:08 -04:00
committed by GitHub
parent 09a94e6bf5
commit 222bbe22ab
17 changed files with 813 additions and 28 deletions

View File

@@ -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);