From b581b49c4399f46556d6e213eead4c929deb0f73 Mon Sep 17 00:00:00 2001 From: Glenn Waldron Date: Thu, 19 Oct 2023 15:37:50 -0400 Subject: [PATCH] Updates to layers UI and test earth files --- src/osgEarth/ImGui/EnvironmentGUI | 27 ++- src/osgEarth/ImGui/ImGui | 9 + src/osgEarth/ImGui/LayersGUI | 300 ++++++++++++++-------------- src/osgEarth/Layer | 3 + src/osgEarth/Status | 3 + src/osgEarth/TerrainMeshLayer.cpp | 14 +- src/osgEarth/VisibleLayer | 1 + src/osgEarth/VisibleLayer.cpp | 22 +- tests/boston_viewpoints.xml | 4 - tests/bumpmap.earth | 28 --- tests/copernicus_land_cover.xml | 8 - tests/copernicus_splat.earth | 45 ----- tests/day_night.earth | 3 +- tests/detail_texture.earth | 20 -- tests/esa_land_cover.xml | 11 - tests/fractal_elevation.earth | 75 ------- tests/land_cover_dictionary.xml | 23 --- tests/ldb.earth | 21 -- tests/mapbox.earth | 174 ---------------- tests/mercator_to_plate_carre.earth | 19 -- tests/openstreetmap.earth | 20 -- tests/osm.earth | 13 +- tests/osm_roads.xml | 2 +- tests/readymap_template.earth | 10 +- 24 files changed, 223 insertions(+), 632 deletions(-) delete mode 100644 tests/boston_viewpoints.xml delete mode 100644 tests/bumpmap.earth delete mode 100644 tests/copernicus_land_cover.xml delete mode 100644 tests/copernicus_splat.earth delete mode 100644 tests/detail_texture.earth delete mode 100644 tests/esa_land_cover.xml delete mode 100644 tests/fractal_elevation.earth delete mode 100644 tests/land_cover_dictionary.xml delete mode 100644 tests/ldb.earth delete mode 100644 tests/mapbox.earth delete mode 100644 tests/mercator_to_plate_carre.earth delete mode 100644 tests/openstreetmap.earth diff --git a/src/osgEarth/ImGui/EnvironmentGUI b/src/osgEarth/ImGui/EnvironmentGUI index 6bcdf4c569..c50ac3d02f 100644 --- a/src/osgEarth/ImGui/EnvironmentGUI +++ b/src/osgEarth/ImGui/EnvironmentGUI @@ -185,23 +185,36 @@ namespace osgEarth ImGui::SameLine(); if (ImGui::Checkbox("Details", &_showDetails)) dirtySettings(); + ImGui::SameLine(); + if (ImGui::Button("Now")) { + _skyNode->setDateTime(DateTime()); + dirtySettings(); + } + ImGui::Separator(); if (ImGuiLTable::Begin("Environment")) { ImGuiLTable::Section("Date & Time:"); - if (ImGuiLTable::SliderFloat("Hour", &_hour, 0.0f, 24.0f)) + auto mark = _skyNode->getDateTime(); + auto day = mark.day(); + auto month = mark.month(); + auto year = mark.year(); + auto hour = mark.hours(); + + if (ImGuiLTable::SliderDouble("Hour", &hour, 0.0f, 24.0f)) dirtySettings(); if (_showDetails) { - if (ImGuiLTable::SliderInt("Day", &_day, 1, 31)) dirtySettings(); - if (ImGuiLTable::SliderInt("Month", &_month, 1, 12)) dirtySettings(); - if (ImGuiLTable::SliderInt("Year", &_year, 1970, 2061)) dirtySettings(); + if (ImGuiLTable::SliderInt("Day", &day, 1, 31)) + dirtySettings(); + if (ImGuiLTable::SliderInt("Month", &month, 1, 12)) + dirtySettings(); + if (ImGuiLTable::SliderInt("Year", &year, 1970, 2061)) + dirtySettings(); } - - DateTime mark(_year, _month, _day, _hour); - _skyNode->setDateTime(mark); + _skyNode->setDateTime(DateTime(year, month, day, hour)); if (lighting) { diff --git a/src/osgEarth/ImGui/ImGui b/src/osgEarth/ImGui/ImGui index e8e29c1b7e..e6682582f5 100644 --- a/src/osgEarth/ImGui/ImGui +++ b/src/osgEarth/ImGui/ImGui @@ -393,6 +393,15 @@ namespace ImGuiLTable namespace ImGuiUtil { + template + static void TextCentered(const char* format, Args&&... args) + { + char buf[1024]; + sprintf(buf, format, args...); + ImGui::SetCursorPosX((ImGui::GetWindowSize().x - ImGui::CalcTextSize(buf).x) * 0.5f); + ImGui::Text(buf); + } + static void Texture(osg::Texture2D* texture, osg::RenderInfo& renderInfo, unsigned int width = 0, unsigned int height = 0) { // Get the context id diff --git a/src/osgEarth/ImGui/LayersGUI b/src/osgEarth/ImGui/LayersGUI index c9093e798b..bda0af1156 100644 --- a/src/osgEarth/ImGui/LayersGUI +++ b/src/osgEarth/ImGui/LayersGUI @@ -32,6 +32,7 @@ #include #include #include +#include #include #ifdef HAVE_OSGEARTHCESIUM @@ -576,7 +577,8 @@ namespace osgEarth else if (!layer->isOpen()) ImGui::PushStyleColor(ImGuiCol_Text, ImVec4(ImColor(127, 127, 127))), stylePushed = true; - osgEarth::VisibleLayer* visibleLayer = dynamic_cast(layer); + auto visibleLayer = dynamic_cast(layer); + if (visibleLayer) { if (layer->isOpen()) @@ -630,178 +632,170 @@ namespace osgEarth if (layer->isOpen()) { + auto visibleLayer = dynamic_cast(layer); + auto tileLayer = dynamic_cast(layer); + auto imageLayer = dynamic_cast(layer); auto elevationLayer = dynamic_cast(layer); - if (visibleLayer && !elevationLayer) + + if (tileLayer) { - if (ImGuiLTable::Begin("Layer")) + const Profile* profile = tileLayer->getProfile(); + if (profile) { - float opacity = visibleLayer->getOpacity(); - if (ImGuiLTable::SliderFloat("Opacity", &opacity, 0.0f, 1.0f)) - visibleLayer->setOpacity(opacity); - - if (visibleLayer->options().maxVisibleRange().isSet()) - { - float value = visibleLayer->getMaxVisibleRange(); - if (value < FLT_MAX) { - if (ImGuiLTable::SliderFloat("Max range", &value, 0.0f, _maxMaxRanges[layer])) - visibleLayer->setMaxVisibleRange(value); - } - } + std::string srsname = profile->getSRS()->getName(); + if (srsname == "unknown") + srsname = profile->getSRS()->getHorizInitString(); + ImGui::TextColored(ImVec4(.8, .8, .8, 1), "%s", srsname.c_str()); - if (visibleLayer->options().minVisibleRange().isSet()) + if (elevationLayer) { - float value = visibleLayer->getMinVisibleRange(); - if (ImGuiLTable::SliderFloat("Min range", &value, 0.0f, _maxMinRanges[layer])) - visibleLayer->setMinVisibleRange(value); + ImGui::SameLine(); + auto vdatum = profile->getSRS()->getVertInitString(); + if (vdatum.empty()) vdatum = "geodetic"; + ImGui::TextColored(ImVec4(1, .8, .8, 1), " (vdatum = %s)", vdatum.c_str()); } + } + } - if (visibleLayer->options().attenuationRange().isSet()) - { - float value = visibleLayer->getAttenuationRange(); - if (ImGuiLTable::SliderFloat("Attenuation range", &value, 0.0f, _maxAttenRanges[layer])) - visibleLayer->setAttenuationRange(value); - } + const GeoExtent& extent = layer->getExtent(); + if (extent.isValid()) + { + const std::string fmt[] = { "%5.1f", "%4.1f * %4.1f", "%1.f", "%.1f * %.1f" }; + int i = _mapNode->getMapSRS()->isGeographic() ? 0 : 2; + ImGuiUtil::TextCentered(fmt[i].c_str(), extent.north()); + ImGuiUtil::TextCentered(fmt[i + 1].c_str(), extent.west(), extent.east()); + ImGuiUtil::TextCentered(fmt[i].c_str(), extent.south()); + } - bool debugView = visibleLayer->getEnableDebugView(); - if (ImGuiLTable::Checkbox("Highlight", &debugView)) { - visibleLayer->setEnableDebugView(debugView); - } + ImGuiLTable::Begin("Layer"); - bool modulate = visibleLayer->getColorBlending() == BLEND_MODULATE; - if (ImGuiLTable::Checkbox("Modulate", &modulate)) - visibleLayer->setColorBlending(modulate ? BLEND_MODULATE : BLEND_INTERPOLATE); - } + if (visibleLayer && !elevationLayer) + { + float opacity = visibleLayer->getOpacity(); + if (ImGuiLTable::SliderFloat("Opacity", &opacity, 0.0f, 1.0f)) + visibleLayer->setOpacity(opacity); -#ifdef HAVE_OSGEARTHCESIUM - auto cesiumNativeLayer = dynamic_cast(layer); - if (cesiumNativeLayer) + if (visibleLayer->options().maxVisibleRange().isSet()) { - if (ImGuiLTable::Begin("Cesium Native")) - { - float sse = cesiumNativeLayer->getMaximumScreenSpaceError(); - ImGui::PushID("sse"); - ImGuiLTable::SliderFloat("SSE", &sse, 0.0f, 50.0f); - cesiumNativeLayer->setMaximumScreenSpaceError(sse); - ImGui::PopID(); - - ImGuiLTable::End(); + float value = visibleLayer->getMaxVisibleRange(); + if (value < FLT_MAX) { + if (ImGuiLTable::SliderFloat("Max range", &value, 0.0f, _maxMaxRanges[layer])) + visibleLayer->setMaxVisibleRange(value); } } -#endif - auto threedTiles = dynamic_cast(layer); - if (threedTiles) + if (visibleLayer->options().minVisibleRange().isSet()) { - if (ImGuiLTable::Begin("3DT")) - { - float sse = threedTiles->getMaximumScreenSpaceError(); - ImGui::PushID("sse"); - ImGuiLTable::SliderFloat("SSE", &sse, 0.0f, 50.0f); - threedTiles->setMaximumScreenSpaceError(sse); - ImGui::PopID(); - - ImGuiLTable::End(); - } - - ImGui::PushID("debugVolumes"); - bool showBoundingVolumes = threedTiles->getTilesetNode()->getShowBoundingVolumes(); - ImGuiLTable::Checkbox("Show debug volumes", &showBoundingVolumes); - threedTiles->getTilesetNode()->setShowBoundingVolumes(showBoundingVolumes); - ImGui::PopID(); - - ImGui::PushID("debugColors"); - bool colorPerTile = threedTiles->getTilesetNode()->getColorPerTile(); - ImGuiLTable::Checkbox("Show color per tile", &colorPerTile); - threedTiles->getTilesetNode()->setColorPerTile(colorPerTile); - ImGui::PopID(); + float value = visibleLayer->getMinVisibleRange(); + if (ImGuiLTable::SliderFloat("Min range", &value, 0.0f, _maxMinRanges[layer])) + visibleLayer->setMinVisibleRange(value); } -# - - auto mapboxGLLayer = dynamic_cast(layer); - if (mapboxGLLayer) + if (visibleLayer->options().attenuationRange().isSet()) { - bool disableText = mapboxGLLayer->getDisableText(); - if (ImGuiLTable::Checkbox("Disable text", &disableText)) - { - mapboxGLLayer->setDisableText(disableText); - } + float value = visibleLayer->getAttenuationRange(); + if (ImGuiLTable::SliderFloat("Attenuation range", &value, 0.0f, _maxAttenRanges[layer])) + visibleLayer->setAttenuationRange(value); + } - float pixelScale = mapboxGLLayer->getPixelScale(); - if (ImGuiLTable::InputFloat("Pixel Scale", &pixelScale)) - { - mapboxGLLayer->setPixelScale(pixelScale); - } + bool debugView = visibleLayer->getEnableDebugView(); + if (ImGuiLTable::Checkbox("Highlight", &debugView)) { + visibleLayer->setEnableDebugView(debugView); } - ImGuiLTable::End(); + bool modulate = visibleLayer->getColorBlending() == BLEND_MODULATE; + if (ImGuiLTable::Checkbox("Modulate", &modulate)) + visibleLayer->setColorBlending(modulate ? BLEND_MODULATE : BLEND_INTERPOLATE); + } + +#ifdef HAVE_OSGEARTHCESIUM + auto cesiumNativeLayer = dynamic_cast(layer); + if (cesiumNativeLayer) + { + float sse = cesiumNativeLayer->getMaximumScreenSpaceError(); + ImGui::PushID("sse"); + ImGuiLTable::SliderFloat("SSE", &sse, 0.0f, 50.0f); + cesiumNativeLayer->setMaximumScreenSpaceError(sse); + ImGui::PopID(); } +#endif + auto threedTiles = dynamic_cast(layer); + if (threedTiles) + { + float sse = threedTiles->getMaximumScreenSpaceError(); + ImGui::PushID("sse"); + ImGuiLTable::SliderFloat("SSE", &sse, 0.0f, 50.0f); + threedTiles->setMaximumScreenSpaceError(sse); + ImGui::PopID(); + + ImGui::PushID("debugVolumes"); + bool showBoundingVolumes = threedTiles->getTilesetNode()->getShowBoundingVolumes(); + ImGuiLTable::Checkbox("Show debug volumes", &showBoundingVolumes); + threedTiles->getTilesetNode()->setShowBoundingVolumes(showBoundingVolumes); + ImGui::PopID(); + + ImGui::PushID("debugColors"); + bool colorPerTile = threedTiles->getTilesetNode()->getColorPerTile(); + ImGuiLTable::Checkbox("Show color per tile", &colorPerTile); + threedTiles->getTilesetNode()->setColorPerTile(colorPerTile); + ImGui::PopID(); + } - auto tileLayer = dynamic_cast(layer); - if (tileLayer) + auto mapboxGLLayer = dynamic_cast(layer); + if (mapboxGLLayer) { - const Profile* profile = tileLayer->getProfile(); - if (profile) + bool disableText = mapboxGLLayer->getDisableText(); + if (ImGuiLTable::Checkbox("Disable text", &disableText)) { - std::string srsname = profile->getSRS()->getName(); - if (srsname == "unknown") - srsname = profile->getSRS()->getHorizInitString(); - ImGui::TextColored(ImVec4(.8, .8, .8, 1), "%s", srsname.c_str()); + mapboxGLLayer->setDisableText(disableText); + } - if (elevationLayer) - { - auto vdatum = profile->getSRS()->getVertInitString(); - if (vdatum.empty()) vdatum = "geodetic (hae)"; - ImGui::TextColored(ImVec4(1, .8, .8, 1), "Vertical datum: %s", vdatum.c_str()); - } + float pixelScale = mapboxGLLayer->getPixelScale(); + if (ImGuiLTable::InputFloat("Pixel Scale", &pixelScale)) + { + mapboxGLLayer->setPixelScale(pixelScale); } + } + if (tileLayer) + { if (tileLayer->options().minLevel().isSet()) { - ImGui::Text("Min level: %d", tileLayer->getMinLevel()); + ImGuiLTable::Text("Min level", "%d", tileLayer->getMinLevel()); } if (tileLayer->options().maxLevel().isSet()) { - ImGui::Text("Max level: %d", tileLayer->getMaxLevel()); + ImGuiLTable::Text("Max level", "%d", tileLayer->getMaxLevel()); } if (tileLayer->options().maxDataLevel().isSet()) { - ImGui::Text("Max data level: %d", tileLayer->getMaxDataLevel()); + ImGuiLTable::Text("Max data level", "%d", tileLayer->getMaxDataLevel()); } - if (tileLayer->options().upsample().isSetTo(true)) - { - ImGui::Text("Upsampling is ON"); - } - else if (tileLayer->options().upsample().isSetTo(false)) + if (tileLayer->options().upsample().isSet()) { - ImGui::Text("Upsampling is OFF"); + bool upsampling = tileLayer->options().upsample().value(); + ImGuiLTable::Text("Upsampling", "%s", (upsampling ? "ON" : "off")); } - } + } auto report = layer->reportStats(); for (auto& kv : report) { - ImGui::Text((kv.first + ": " + kv.second).c_str()); - } - - const GeoExtent& extent = layer->getExtent(); - if (extent.isValid()) - { - ImGui::TextWrapped("W:%.1f E:%.1f S:%.1f N:%.1f", - extent.west(), extent.east(), extent.south(), extent.north()); + ImGuiLTable::Text(kv.first.c_str(), "%s", kv.second.c_str()); // (kv.first + ": " + kv.second).c_str()); } const DateTimeExtent& dtextent = layer->getDateTimeExtent(); if (dtextent.valid()) { - ImGui::Text("Time Series:"); - ImGui::Text(" Start = %s", dtextent.getStart().asISO8601().c_str()); - ImGui::Text(" End = %s", dtextent.getEnd().asISO8601().c_str()); + //ImGui::Text("Time Series:"); + ImGuiLTable::Text("Start time", "%s", dtextent.getStart().asISO8601().c_str()); + ImGuiLTable::Text("End time", "%s", dtextent.getEnd().asISO8601().c_str()); } - auto imageLayer = dynamic_cast(layer); + ImGuiLTable::End(); + if (imageLayer) { bool queryOn = (_mouseOverImageLayer == imageLayer); @@ -866,42 +860,54 @@ namespace osgEarth } } - if (extent.isValid() || - (layer->getNode() && layer->getNode()->getBound().valid())) + if (visibleLayer) { - if (ImGui::Button("Find")) + if ((extent.isValid() && !extent.isWholeEarth()) || + (layer->getNode() && layer->getNode()->getBound().valid()) || + (dtextent.valid())) { - if (extent.isValid()) + if (ImGui::Button("Zoom")) { - std::vector points; - points.push_back(GeoPoint(extent.getSRS(), extent.west(), extent.south())); - points.push_back(GeoPoint(extent.getSRS(), extent.east(), extent.north())); + if (extent.isValid()) + { + std::vector points; + points.push_back(GeoPoint(extent.getSRS(), extent.west(), extent.south())); + points.push_back(GeoPoint(extent.getSRS(), extent.east(), extent.north())); - ViewFitter fitter(_mapNode->getMap()->getSRS(), camera); - Viewpoint vp; - if (fitter.createViewpoint(points, vp)) + ViewFitter fitter(_mapNode->getMap()->getSRS(), camera); + Viewpoint vp; + if (fitter.createViewpoint(points, vp)) + { + auto manip = dynamic_cast(view(ri)->getCameraManipulator()); + if (manip) manip->setViewpoint(vp, 2.0); + } + } + else if (layer->getNode()) { - auto manip = dynamic_cast(view(ri)->getCameraManipulator()); - if (manip) manip->setViewpoint(vp, 2.0); + ViewFitter fitter(map->getSRS(), camera); + Viewpoint vp; + if (fitter.createViewpoint(layer->getNode(), vp)) + { + auto manip = dynamic_cast(view(ri)->getCameraManipulator()); + if (manip) manip->setViewpoint(vp, 2.0); + } } - } - else if (layer->getNode()) - { - ViewFitter fitter(map->getSRS(), camera); - Viewpoint vp; - if (fitter.createViewpoint(layer->getNode(), vp)) + + if (dtextent.valid()) { - auto manip = dynamic_cast(view(ri)->getCameraManipulator()); - if (manip) manip->setViewpoint(vp, 2.0); + auto sky = osgEarth::findRelativeNodeOfType(_mapNode.get()); + if (sky) + { + sky->setDateTime(dtextent.getStart()); + } } } + + ImGui::SameLine(); } - } - if (visibleLayer) - { - if (ImGui::Button("Invalidate")) - { + if (ImGui::Button("Refresh")) + { layer->dirty(); auto cp = layer->getCachePolicy(); cp.minTime() = DateTime().asTimeStamp(); @@ -920,7 +926,7 @@ namespace osgEarth } ImGui::SameLine(); - if (ImGui::Button("Dump")) + if (ImGui::Button("JSON")) { auto conf = layer->getConfig(); std::cout << conf.toJSON(true) << std::endl; diff --git a/src/osgEarth/Layer b/src/osgEarth/Layer index 0bfd4db17c..66df1aae38 100644 --- a/src/osgEarth/Layer +++ b/src/osgEarth/Layer @@ -47,6 +47,7 @@ namespace osgDB { SUPERCLASS ::mergeConfig(conf); \ fromConfig(conf); \ } \ + using super = SUPERCLASS; \ public: \ OE_COMMENT("Construct empty layer options") \ MYCLASS () : SUPERCLASS() { fromConfig(_conf); } \ @@ -66,6 +67,7 @@ namespace osgDB { const OPTIONS * _options0; \ const OPTIONS _optionsConcrete0; \ MYCLASS ( const MYCLASS& rhs, const osg::CopyOp& op ) { } \ + using super = SUPERCLASS; \ protected: \ OE_COMMENT("Construct a new layer with default options") \ MYCLASS (OPTIONS* optr, const OPTIONS* optr0) : \ @@ -125,6 +127,7 @@ namespace osgDB { _options(optr), \ _options0(optr0) { } \ MYCLASS () : SUPERCLASS () { } \ + using super = SUPERCLASS; \ public: \ OE_COMMENT("Mutable options for this layer") \ OPTIONS& options() { return *_options; } \ diff --git a/src/osgEarth/Status b/src/osgEarth/Status index 1754598070..47143ad410 100644 --- a/src/osgEarth/Status +++ b/src/osgEarth/Status @@ -89,4 +89,7 @@ namespace osgEarth }; } +#define OE_RETURN_STATUS_ON_ERROR(F) \ + { osgEarth::Status s = F; if (s.isError()) return s; } + #endif // OSGEARTH_STATUS_H diff --git a/src/osgEarth/TerrainMeshLayer.cpp b/src/osgEarth/TerrainMeshLayer.cpp index ea516f4882..cd413906f4 100644 --- a/src/osgEarth/TerrainMeshLayer.cpp +++ b/src/osgEarth/TerrainMeshLayer.cpp @@ -45,7 +45,7 @@ void TerrainMeshLayer::Options::fromConfig(const Config& conf) Config TerrainMeshLayer::Options::getConfig() const { - Config conf = TileLayer::Options::getConfig(); + Config conf = super::getConfig(); conf.set("url", uri()); conf.set("invert_y", invertY()); return conf; @@ -56,16 +56,18 @@ TerrainMeshLayer::Options::getConfig() const void TerrainMeshLayer::init() { - TileLayer::init(); + super::init(); setRenderType(RENDERTYPE_NONE); + + // layer is always visible: + _canSetVisible = false; } Status TerrainMeshLayer::openImplementation() { - auto s = TileLayer::openImplementation(); - if (s.isError()) return s; + OE_RETURN_STATUS_ON_ERROR(super::openImplementation()); return STATUS_OK; } @@ -73,14 +75,14 @@ TerrainMeshLayer::openImplementation() void TerrainMeshLayer::addedToMap(const Map* map) { - TileLayer::addedToMap(map); + super::addedToMap(map); _map = map; } void TerrainMeshLayer::removedFromMap(const Map* map) { - TileLayer::removedFromMap(map); + super::removedFromMap(map); _map = nullptr; } diff --git a/src/osgEarth/VisibleLayer b/src/osgEarth/VisibleLayer index 03da834016..adeb758c02 100644 --- a/src/osgEarth/VisibleLayer +++ b/src/osgEarth/VisibleLayer @@ -117,6 +117,7 @@ namespace osgEarth void fireCallback(VisibleLayerCallback::MethodPtr); bool _visibleTiedToOpen = false; + bool _canSetVisible = true; private: osg::ref_ptr _opacityU; diff --git a/src/osgEarth/VisibleLayer.cpp b/src/osgEarth/VisibleLayer.cpp index 0656d92fec..14d69b8609 100644 --- a/src/osgEarth/VisibleLayer.cpp +++ b/src/osgEarth/VisibleLayer.cpp @@ -205,7 +205,6 @@ VisibleLayer::init() VirtualProgram* vp = VirtualProgram::getOrCreate(getOrCreateStateSet()); vp->setName(className()); vp->setFunction("oe_VisibleLayer_setOpacity", opacityInterpolateFS, VirtualProgram::LOCATION_FRAGMENT_COLORING, 1.1f); - //vp->setFunction("oe_VisibleLayer_setOpacity", opacityInterpolateFS, VirtualProgram::LOCATION_FRAGMENT_COLORING, FLT_MAX); } } @@ -240,18 +239,21 @@ VisibleLayer::prepareForRendering(TerrainEngine* engine) void VisibleLayer::setVisible(bool value) { - options().visible() = value; + if (_canSetVisible) + { + options().visible() = value; - updateNodeMasks(); + updateNodeMasks(); - fireCallback(&VisibleLayerCallback::onVisibleChanged); + fireCallback(&VisibleLayerCallback::onVisibleChanged); - if (_visibleTiedToOpen) - { - if (value && !isOpen()) - open(); - else if (!value && isOpen()) - close(); + if (_visibleTiedToOpen) + { + if (value && !isOpen()) + open(); + else if (!value && isOpen()) + close(); + } } } diff --git a/tests/boston_viewpoints.xml b/tests/boston_viewpoints.xml deleted file mode 100644 index 9fd062effc..0000000000 --- a/tests/boston_viewpoints.xml +++ /dev/null @@ -1,4 +0,0 @@ - - - - diff --git a/tests/bumpmap.earth b/tests/bumpmap.earth deleted file mode 100644 index be1d462882..0000000000 --- a/tests/bumpmap.earth +++ /dev/null @@ -1,28 +0,0 @@ - - - - - - - - - ../data/rock_hard.jpg - 8 - 2.5 - - - - - 15.2667 - -22.6195 - 5583.51m - -121.7536965189191 - 46.83712924004765 - 3472.802966509946 - +proj=longlat +datum=WGS84 +no_defs - - - diff --git a/tests/copernicus_land_cover.xml b/tests/copernicus_land_cover.xml deleted file mode 100644 index 83e9763967..0000000000 --- a/tests/copernicus_land_cover.xml +++ /dev/null @@ -1,8 +0,0 @@ - - - - - http://readymap.org/readymap/tiles/1.0.0/141/ - - - diff --git a/tests/copernicus_splat.earth b/tests/copernicus_splat.earth deleted file mode 100644 index 6a40cbb3c9..0000000000 --- a/tests/copernicus_splat.earth +++ /dev/null @@ -1,45 +0,0 @@ - - - - - - - - osgEarthSplat - - - - - - - - - - - ../data/splat/splat_catalog.xml - - - - - - http://readymap.org/readymap/tiles/1.0.0/22/ - - - - - - 13 - true - - - - - - - - - - diff --git a/tests/day_night.earth b/tests/day_night.earth index 3a95364942..c9fa965123 100644 --- a/tests/day_night.earth +++ b/tests/day_night.earth @@ -14,8 +14,7 @@ http://readymap.org/readymap/tiles/1.0.0/26/ - - - - - - - - ../data/noise3.png - 21 - 6000 - 2000 - - diff --git a/tests/esa_land_cover.xml b/tests/esa_land_cover.xml deleted file mode 100644 index ddabfd2c46..0000000000 --- a/tests/esa_land_cover.xml +++ /dev/null @@ -1,11 +0,0 @@ - - - - - - D:/data/esa/GLOBCOVER_L4_200901_200912_V2.3_Ant_tiled.tif - global-geodetic - - - - diff --git a/tests/fractal_elevation.earth b/tests/fractal_elevation.earth deleted file mode 100644 index b6ba5313d0..0000000000 --- a/tests/fractal_elevation.earth +++ /dev/null @@ -1,75 +0,0 @@ - - - - - - - - - - - H:/data/textures/seamless-noise-1.png - 8 - - - - - - - roads-data - - - - - - - - 20.0616 - -10.5897 - 8568.71m - -121.8132467079796 - 46.75415816484834 - 884.2401606887579 - +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs - - - - 8.88942 - -13.3873 - 814.424m - -121.8306682896568 - 46.7268954550194 - 768.5787042481825 - +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs - - - - -11.0209 - -13.723 - 1738.75m - -122.2281684156838 - 46.77304632999795 - 354.0491745267063 - +proj=longlat +ellps=WGS84 +towgs84=0,0,0,0,0,0,0 +no_defs - - - - - http://readymap.org/readymap/mbtiles/osm/ - 14 - 14 - spherical-mercator - pbf - - - - - diff --git a/tests/land_cover_dictionary.xml b/tests/land_cover_dictionary.xml deleted file mode 100644 index a915738645..0000000000 --- a/tests/land_cover_dictionary.xml +++ /dev/null @@ -1,23 +0,0 @@ - - - 1 - - - - - - - - - - - - - - - diff --git a/tests/ldb.earth b/tests/ldb.earth deleted file mode 100644 index 017e5f1d25..0000000000 --- a/tests/ldb.earth +++ /dev/null @@ -1,21 +0,0 @@ - - - - - - - - - - - - - ../data/cessna.osgb.100.scale.(-90,-45,0).rot - - - - - - diff --git a/tests/mapbox.earth b/tests/mapbox.earth deleted file mode 100644 index ea39c82abb..0000000000 --- a/tests/mapbox.earth +++ /dev/null @@ -1,174 +0,0 @@ - - - - - - - http://a.tiles.mapbox.com/v4/mapbox.satellite/{z}/{x}/{y}.jpg?access_token=YOUR_TOKEN_HERE - spherical-mercator - - - - - http://api.mapbox.com/v4/mapbox.terrain-rgb/{z}/{x}/{y}.pngraw?access_token=YOUR_TOKEN_HERE - spherical-mercator - mapbox - - - - - - - http://[abcd].tiles.mapbox.com/v4/mapbox.mapbox-streets-v7/{z}/{x}/{y}.vector.pbf?access_token=YOUR_TOKEN_HERE - - 15 - 15 - spherical-mercator - pbf - - - - - - - - ../data/resources/textures_us/catalog.xml - - - - - - - - - - - - - - - - - - diff --git a/tests/mercator_to_plate_carre.earth b/tests/mercator_to_plate_carre.earth deleted file mode 100644 index 153b96efa6..0000000000 --- a/tests/mercator_to_plate_carre.earth +++ /dev/null @@ -1,19 +0,0 @@ - - - - - - plate-carre - - - - - http://[abc].tile.openstreetmap.org/{z}/{x}/{y}.png - spherical-mercator - - - - diff --git a/tests/openstreetmap.earth b/tests/openstreetmap.earth deleted file mode 100644 index a98870045b..0000000000 --- a/tests/openstreetmap.earth +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - http://[abc].tile.openstreetmap.org/{z}/{x}/{y}.png - spherical-mercator - - ©OpenStreetMap contributors - - - - - - - diff --git a/tests/osm.earth b/tests/osm.earth index 3d7c5f5035..1d4d9d19a0 100644 --- a/tests/osm.earth +++ b/tests/osm.earth @@ -3,13 +3,22 @@ osgEarth Sample - OpenStreetMap Features --> - + + http://[abc].tile.openstreetmap.org/{z}/{x}/{y}.png + spherical-mercator + + ©OpenStreetMap contributors + + - + + + + diff --git a/tests/osm_roads.xml b/tests/osm_roads.xml index a5ac44ca95..b3acfd69e0 100644 --- a/tests/osm_roads.xml +++ b/tests/osm_roads.xml @@ -1,5 +1,5 @@ - + data:osm diff --git a/tests/readymap_template.earth b/tests/readymap_template.earth index cbe26f206e..b645b6ff6d 100644 --- a/tests/readymap_template.earth +++ b/tests/readymap_template.earth @@ -7,17 +7,9 @@ Run with osgearth_viewer readymap_template.earth.template to invoke the psuedolo --> - - + {% include readymap_imagery.xml %} - {% include readymap_elevation.xml %} - - - {% include boston_viewpoints.xml %} - {% include dc_viewpoints.xml %} - -