diff --git a/data/scene/debugglobe/map_service_configs/TERRA_CR_B143_2016-04-12.wms b/data/scene/debugglobe/map_service_configs/TERRA_CR_B143_2016-04-12.wms new file mode 100644 index 0000000000..974c7da85f --- /dev/null +++ b/data/scene/debugglobe/map_service_configs/TERRA_CR_B143_2016-04-12.wms @@ -0,0 +1,8 @@ + + + http://map1.vis.earthdata.nasa.gov/twms-geo/twms.cgi? + MODIS TERRA tileset + 2016-04-12 + + 20 + diff --git a/modules/globebrowsing/globes/renderableglobe.cpp b/modules/globebrowsing/globes/renderableglobe.cpp index 5e9d3b4518..2e9d0f0f18 100644 --- a/modules/globebrowsing/globes/renderableglobe.cpp +++ b/modules/globebrowsing/globes/renderableglobe.cpp @@ -38,13 +38,13 @@ #include namespace { - const std::string _loggerCat = "RenderableGlobe"; + const std::string _loggerCat = "RenderableGlobe"; - const std::string keyFrame = "Frame"; - const std::string keyGeometry = "Geometry"; - const std::string keyShading = "PerformShading"; + const std::string keyFrame = "Frame"; + const std::string keyGeometry = "Geometry"; + const std::string keyShading = "PerformShading"; - const std::string keyBody = "Body"; + const std::string keyBody = "Body"; } namespace openspace { @@ -70,18 +70,16 @@ namespace openspace { //addSwitchValue(std::shared_ptr(new ClipMapGlobe(dictionary, _ellipsoid)), 1e9); addSwitchValue(std::shared_ptr(new ChunkLodGlobe(dictionary, _ellipsoid)), 1e9); addSwitchValue(std::shared_ptr(new GlobeMesh(dictionary)), 1e10); + } + RenderableGlobe::~RenderableGlobe() { + } - } - - RenderableGlobe::~RenderableGlobe() { - } - - void RenderableGlobe::update(const UpdateData& data) { - // set spice-orientation in accordance to timestamp - _stateMatrix = SpiceManager::ref().positionTransformMatrix(_frame, "GALACTIC", data.time); - _time = data.time; - DistanceSwitch::update(data); - } + void RenderableGlobe::update(const UpdateData& data) { + // set spice-orientation in accordance to timestamp + _stateMatrix = SpiceManager::ref().positionTransformMatrix(_frame, "GALACTIC", data.time); + _time = data.time; + DistanceSwitch::update(data); + } } // namespace openspace diff --git a/modules/globebrowsing/rendering/patchrenderer.h b/modules/globebrowsing/rendering/patchrenderer.h new file mode 100644 index 0000000000..feeda0bb6c --- /dev/null +++ b/modules/globebrowsing/rendering/patchrenderer.h @@ -0,0 +1,110 @@ +/***************************************************************************************** +* * +* OpenSpace * +* * +* Copyright (c) 2014-2016 * +* * +* Permission is hereby granted, free of charge, to any person obtaining a copy of this * +* software and associated documentation files (the "Software"), to deal in the Software * +* without restriction, including without limitation the rights to use, copy, modify, * +* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * +* permit persons to whom the Software is furnished to do so, subject to the following * +* conditions: * +* * +* The above copyright notice and this permission notice shall be included in all copies * +* or substantial portions of the Software. * +* * +* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * +* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * +* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * +* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * +* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * +* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * +****************************************************************************************/ + +#ifndef __LATLONPATCH_H__ +#define __LATLONPATCH_H__ + +#include +#include + +// open space includes +#include + +#include +#include +#include +#include +#include + +namespace ghoul { +namespace opengl { + class ProgramObject; +} +} + + +namespace openspace { + + class LonLatPatch; + class Geometry; + + using std::shared_ptr; + using std::unique_ptr; + using ghoul::opengl::ProgramObject; + + class PatchRenderer { + public: + + PatchRenderer(); + ~PatchRenderer(); + + protected: + + unique_ptr _programObject; + TextureTileSet _tileSet; + + }; + + + ////////////////////////////////////////////////////////////////////////////////////// + // PATCH RENDERER SUBCLASSES // + ////////////////////////////////////////////////////////////////////////////////////// + + class LatLonPatchRenderer : public PatchRenderer { + public: + LatLonPatchRenderer(shared_ptr grid); + + void renderPatch( + const LatLonPatch& patch, + const RenderData& data, + double radius); + + void renderPatch( + const LatLonPatch& patch, + const RenderData& data, + double radius, + const TileIndex& ti); + + private: + TwmsTileProvider tileProvider; + shared_ptr _grid; + + }; + + + + class ClipMapPatchRenderer : public PatchRenderer { + public: + ClipMapPatchRenderer(shared_ptr grid); + + void renderPatch( + const LatLon& patchSize, + const RenderData& data, + double radius); + private: + shared_ptr _grid; + }; +} // namespace openspace + +#endif // __LATLONPATCH_H__ \ No newline at end of file diff --git a/tests/main.cpp b/tests/main.cpp index 7c53b3a7f6..ce2c656228 100644 --- a/tests/main.cpp +++ b/tests/main.cpp @@ -38,6 +38,7 @@ //#include #include + //#include //#include //#include diff --git a/tests/test_gdalwms.inl b/tests/test_gdalwms.inl index 984895d6ed..b7561bbf55 100644 --- a/tests/test_gdalwms.inl +++ b/tests/test_gdalwms.inl @@ -25,38 +25,32 @@ #include "gtest/gtest.h" #include "gdal.h" - #include "gdal_priv.h" #include #include "cpl_conv.h" +#include "cpl_string.h" -//#include "wms/wmsdriver.h" +// Error: cannot open source file "wms/wmsdriver.h" +//#include "wms/wmsdriver.h" + +// Error: cannot open source file "wms/wmsmetadataset.h" //#include "wms/wmsmetadataset.h" class GdalWmsTest : public testing::Test {}; TEST_F(GdalWmsTest, Simple) { - //GDALRegister_WMS(); + GDALDataset *poDataset; + GDALAllRegister(); + + std::string testFile = absPath("../data/scene/debugglobe/map_service_configs/TERRA_CR_B143_2016-04-12.wms"); + poDataset = (GDALDataset *)GDALOpen(testFile.c_str(), GA_ReadOnly); - /* - GDALWMSDataset* wms_dataset = GDALOpen("../test.xml", GA_ReadOnly); - if (wms_dataset) - { - ; - } - */ + // This assertion fails + ASSERT_NE(poDataset, nullptr) << "Failed to load testFile"; - /* - GDALDataset *poDataset; - GDALAllRegister(); - poDataset = (GDALDataset *)GDALOpen("filename", GA_ReadOnly); - if (poDataset == NULL) - { - std::cout << "NULL" << std::endl; - }*/ }