From ab6a95219318a783a2f55cc702daa4c5895c4aff Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 4 Dec 2016 11:23:41 +0100 Subject: [PATCH] Some more code cleanup --- modules/globebrowsing/CMakeLists.txt | 2 + modules/globebrowsing/chunk/chunk.h | 6 +- .../globebrowsing/chunk/chunklevelevaluator.h | 6 +- modules/globebrowsing/chunk/chunknode.h | 6 +- modules/globebrowsing/chunk/culling.h | 6 +- modules/globebrowsing/geometry/aabb.h | 6 +- modules/globebrowsing/geometry/angle.h | 29 +-- modules/globebrowsing/geometry/convexhull.h | 6 +- modules/globebrowsing/geometry/ellipsoid.h | 6 +- modules/globebrowsing/geometry/geodetic2.h | 6 +- modules/globebrowsing/globebrowsingmodule.h | 6 +- .../globebrowsing/globes/chunkedlodglobe.h | 6 +- modules/globebrowsing/globes/pointglobe.h | 6 +- .../globebrowsing/globes/renderableglobe.h | 6 +- modules/globebrowsing/meshes/basicgrid.h | 6 +- modules/globebrowsing/meshes/grid.h | 6 +- modules/globebrowsing/meshes/skirtedgrid.h | 6 +- modules/globebrowsing/meshes/trianglesoup.h | 6 +- .../other/concurrentjobmanager.h | 99 +++----- .../other/concurrentjobmanager.inl | 54 +++- modules/globebrowsing/other/concurrentqueue.h | 58 +---- .../globebrowsing/other/concurrentqueue.inl | 75 ++++++ modules/globebrowsing/other/distanceswitch.h | 6 +- modules/globebrowsing/other/lrucache.h | 47 ++-- modules/globebrowsing/other/lrucache.inl | 115 ++++----- modules/globebrowsing/other/statscollector.h | 6 +- modules/globebrowsing/other/threadpool.h | 6 +- .../globebrowsing/rendering/chunkrenderer.cpp | 1 + .../globebrowsing/rendering/chunkrenderer.h | 6 +- .../globebrowsing/rendering/gpulayermanager.h | 6 +- .../globebrowsing/rendering/layermanager.h | 6 +- .../rendering/layershadermanager.cpp | 234 +++++++++--------- .../rendering/layershadermanager.h | 169 +++++++------ modules/globebrowsing/tile/asynctilereader.h | 6 +- modules/globebrowsing/tile/chunktile.h | 6 +- modules/globebrowsing/tile/pixelregion.h | 6 +- modules/globebrowsing/tile/tile.h | 6 +- modules/globebrowsing/tile/tiledataset.h | 6 +- modules/globebrowsing/tile/tiledatatype.h | 6 +- .../globebrowsing/tile/tiledepthtransform.h | 6 +- modules/globebrowsing/tile/tilediskcache.h | 6 +- modules/globebrowsing/tile/tileindex.h | 6 +- .../tile/tileprovider/cachingtileprovider.h | 6 +- .../tile/tileprovider/singleimageprovider.h | 6 +- .../tile/tileprovider/temporaltileprovider.h | 9 +- .../tile/tileprovider/texttileprovider.h | 6 +- .../tile/tileprovider/tileprovider.h | 6 +- .../tile/tileprovider/tileproviderbyindex.h | 6 +- .../tile/tileprovider/tileproviderbylevel.h | 6 +- modules/globebrowsing/tile/tileselector.h | 6 +- 50 files changed, 556 insertions(+), 564 deletions(-) create mode 100644 modules/globebrowsing/other/concurrentqueue.inl diff --git a/modules/globebrowsing/CMakeLists.txt b/modules/globebrowsing/CMakeLists.txt index b89f697377..35d48a1d1d 100644 --- a/modules/globebrowsing/CMakeLists.txt +++ b/modules/globebrowsing/CMakeLists.txt @@ -72,7 +72,9 @@ set(HEADER_FILES ${CMAKE_CURRENT_SOURCE_DIR}/other/distanceswitch.h ${CMAKE_CURRENT_SOURCE_DIR}/other/lrucache.h ${CMAKE_CURRENT_SOURCE_DIR}/other/concurrentjobmanager.h + ${CMAKE_CURRENT_SOURCE_DIR}/other/concurrentjobmanager.inl ${CMAKE_CURRENT_SOURCE_DIR}/other/concurrentqueue.h + ${CMAKE_CURRENT_SOURCE_DIR}/other/concurrentqueue.inl ${CMAKE_CURRENT_SOURCE_DIR}/other/statscollector.h ${CMAKE_CURRENT_SOURCE_DIR}/other/threadpool.h ) diff --git a/modules/globebrowsing/chunk/chunk.h b/modules/globebrowsing/chunk/chunk.h index 3fa2b88002..d32955adf7 100644 --- a/modules/globebrowsing/chunk/chunk.h +++ b/modules/globebrowsing/chunk/chunk.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_CHUNK_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_CHUNK_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CHUNK___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___CHUNK___H__ #include #include @@ -104,4 +104,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_CHUNK_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNK___H__ diff --git a/modules/globebrowsing/chunk/chunklevelevaluator.h b/modules/globebrowsing/chunk/chunklevelevaluator.h index bf4e2887c9..f8998a0cbf 100644 --- a/modules/globebrowsing/chunk/chunklevelevaluator.h +++ b/modules/globebrowsing/chunk/chunklevelevaluator.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_CHUNKLEVELEVALUATOR_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_CHUNKLEVELEVALUATOR_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKLEVELEVALUATOR___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKLEVELEVALUATOR___H__ namespace openspace { @@ -79,4 +79,4 @@ public: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_CHUNKLEVELEVALUATOR_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKLEVELEVALUATOR___H__ diff --git a/modules/globebrowsing/chunk/chunknode.h b/modules/globebrowsing/chunk/chunknode.h index 7cab5cd6b1..8f4d59f023 100644 --- a/modules/globebrowsing/chunk/chunknode.h +++ b/modules/globebrowsing/chunk/chunknode.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_CHUNKNODE_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_CHUNKNODE_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKNODE___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKNODE___H__ #include @@ -86,4 +86,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_CHUNKNODE_H__ \ No newline at end of file +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKNODE___H__ diff --git a/modules/globebrowsing/chunk/culling.h b/modules/globebrowsing/chunk/culling.h index 50b978149f..36105980ef 100644 --- a/modules/globebrowsing/chunk/culling.h +++ b/modules/globebrowsing/chunk/culling.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_CULLING_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_CULLING_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CULLING___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___CULLING___H__ #include @@ -85,4 +85,4 @@ public: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_CULLING_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CULLING___H__ diff --git a/modules/globebrowsing/geometry/aabb.h b/modules/globebrowsing/geometry/aabb.h index 991c44138d..a50ea6a6c1 100644 --- a/modules/globebrowsing/geometry/aabb.h +++ b/modules/globebrowsing/geometry/aabb.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_AABB_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_AABB_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___AABB___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___AABB___H__ #include @@ -88,4 +88,4 @@ struct AABB3 { } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_AABB_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___AABB___H__ diff --git a/modules/globebrowsing/geometry/angle.h b/modules/globebrowsing/geometry/angle.h index d80ccfea8b..3af8e78cde 100644 --- a/modules/globebrowsing/geometry/angle.h +++ b/modules/globebrowsing/geometry/angle.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __ANGLE_H__ -#define __ANGLE_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___ANGLE___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___ANGLE___H__ #include #include @@ -35,10 +35,6 @@ namespace globebrowsing { template class Angle { public: - ////////////////////////////////////////////////////////////////////////////////////// - // STATIC CONSTANTS // - ////////////////////////////////////////////////////////////////////////////////////// - static const T PI; static const T EPSILON; @@ -54,10 +50,6 @@ public: /** = 2PI radians = 360 degrees = a full revolution */ static const Angle FULL; - ////////////////////////////////////////////////////////////////////////////////////// - // Factory Methods // - ////////////////////////////////////////////////////////////////////////////////////// - static Angle fromRadians(T radians); static Angle fromDegrees(T degrees); static Angle fromRevolutions(T revs); @@ -70,18 +62,11 @@ private: /** Private constructor. Use factory methods to avoid unit confusion */ Angle(T rad); - ////////////////////////////////////////////////////////////////////////////////////// - // Conversions // - ////////////////////////////////////////////////////////////////////////////////////// public: inline T asRadians() const; inline T asDegrees() const; inline T asRevolutions() const; - ////////////////////////////////////////////////////////////////////////////////////// - // Operators (boilerplate, I know.. /eb) // - ////////////////////////////////////////////////////////////////////////////////////// - Angle operator+(const Angle& rhs) const; Angle operator-(const Angle& rhs) const; Angle operator*(T rhs) const; @@ -101,10 +86,6 @@ public: bool operator==(const Angle& rhs) const; bool operator!=(const Angle& rhs) const; - ////////////////////////////////////////////////////////////////////////////////////// - // Chainable Relative Mutators // - ////////////////////////////////////////////////////////////////////////////////////// - /** * Normalizes the angle to the interval [0, 2pi[ */ @@ -123,10 +104,6 @@ public: Angle& abs(); - ////////////////////////////////////////////////////////////////////////////////////// - // Chainable Relative Factory Methods // - ////////////////////////////////////////////////////////////////////////////////////// - /** * Returns a new angle normalized to the interval [0, 2pi[ */ @@ -157,4 +134,4 @@ using fAngle = Angle; #include -#endif // __ANGLE_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___ANGLE___H__ diff --git a/modules/globebrowsing/geometry/convexhull.h b/modules/globebrowsing/geometry/convexhull.h index 8619627a0c..7fc1da2c86 100644 --- a/modules/globebrowsing/geometry/convexhull.h +++ b/modules/globebrowsing/geometry/convexhull.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_CONVEX_HULL_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_CONVEX_HULL_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CONVEX_HULL___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___CONVEX_HULL___H__ #include @@ -69,4 +69,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_CONVEX_HULL_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CONVEX_HULL___H__ diff --git a/modules/globebrowsing/geometry/ellipsoid.h b/modules/globebrowsing/geometry/ellipsoid.h index 1fea7d0751..f4931a85d9 100644 --- a/modules/globebrowsing/geometry/ellipsoid.h +++ b/modules/globebrowsing/geometry/ellipsoid.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_ELLIPSOID_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_ELLIPSOID_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___ELLIPSOID___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___ELLIPSOID___H__ #include @@ -101,4 +101,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_ELLIPSOID_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___ELLIPSOID___H__ diff --git a/modules/globebrowsing/geometry/geodetic2.h b/modules/globebrowsing/geometry/geodetic2.h index db02e3bc83..d9732077c7 100644 --- a/modules/globebrowsing/geometry/geodetic2.h +++ b/modules/globebrowsing/geometry/geodetic2.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_GEODETIC2_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_GEODETIC2_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GEODETIC2___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GEODETIC2___H__ #include @@ -141,4 +141,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_GEODETIC2_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GEODETIC2___H__ diff --git a/modules/globebrowsing/globebrowsingmodule.h b/modules/globebrowsing/globebrowsingmodule.h index 95c0ef2039..9431aa8bce 100644 --- a/modules/globebrowsing/globebrowsingmodule.h +++ b/modules/globebrowsing/globebrowsingmodule.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __GLOBEBROWSING_H__ -#define __GLOBEBROWSING_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GLOBEBROWSING___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GLOBEBROWSING___H__ #include @@ -39,4 +39,4 @@ protected: } // namespace openspace -#endif // __GLOBEBROWSING_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GLOBEBROWSING___H__ diff --git a/modules/globebrowsing/globes/chunkedlodglobe.h b/modules/globebrowsing/globes/chunkedlodglobe.h index 31ce52b18a..e12f940d9d 100644 --- a/modules/globebrowsing/globes/chunkedlodglobe.h +++ b/modules/globebrowsing/globes/chunkedlodglobe.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_CHUNKED_LOD_GLOBE_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_CHUNKED_LOD_GLOBE_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKED_LOD_GLOBE___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKED_LOD_GLOBE___H__ #include @@ -136,4 +136,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_CHUNKED_LOD_GLOBE_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKED_LOD_GLOBE___H__ diff --git a/modules/globebrowsing/globes/pointglobe.h b/modules/globebrowsing/globes/pointglobe.h index 1ccb73dbe0..a377ad27e2 100644 --- a/modules/globebrowsing/globes/pointglobe.h +++ b/modules/globebrowsing/globes/pointglobe.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_POINTGLOBE_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_POINTGLOBE_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___POINTGLOBE___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___POINTGLOBE___H__ #include @@ -59,4 +59,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_POINTGLOBE_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___POINTGLOBE___H__ diff --git a/modules/globebrowsing/globes/renderableglobe.h b/modules/globebrowsing/globes/renderableglobe.h index 232e249f65..2305f9246c 100644 --- a/modules/globebrowsing/globes/renderableglobe.h +++ b/modules/globebrowsing/globes/renderableglobe.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_RENDERABLEGLOBE_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_RENDERABLEGLOBE_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___RENDERABLEGLOBE___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___RENDERABLEGLOBE___H__ #include @@ -128,4 +128,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_RENDERABLEGLOBE_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___RENDERABLEGLOBE___H__ diff --git a/modules/globebrowsing/meshes/basicgrid.h b/modules/globebrowsing/meshes/basicgrid.h index 96b78c7b68..648d423daf 100644 --- a/modules/globebrowsing/meshes/basicgrid.h +++ b/modules/globebrowsing/meshes/basicgrid.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_BASICGRIDGEOMETRY_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_BASICGRIDGEOMETRY_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___BASICGRIDGEOMETRY___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___BASICGRIDGEOMETRY___H__ #include @@ -69,4 +69,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_BASICGRIDGEOMETRY_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___BASICGRIDGEOMETRY___H__ diff --git a/modules/globebrowsing/meshes/grid.h b/modules/globebrowsing/meshes/grid.h index 97ce61756d..37d169d696 100644 --- a/modules/globebrowsing/meshes/grid.h +++ b/modules/globebrowsing/meshes/grid.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_GRIDGEOMETRY_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_GRIDGEOMETRY_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GRIDGEOMETRY___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GRIDGEOMETRY___H__ #include @@ -104,4 +104,4 @@ protected: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_GRIDGEOMETRY_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GRIDGEOMETRY___H__ diff --git a/modules/globebrowsing/meshes/skirtedgrid.h b/modules/globebrowsing/meshes/skirtedgrid.h index 424c856116..1119c206f9 100644 --- a/modules/globebrowsing/meshes/skirtedgrid.h +++ b/modules/globebrowsing/meshes/skirtedgrid.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_SKIRTEDGRID_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_SKIRTEDGRID_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___SKIRTEDGRID___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___SKIRTEDGRID___H__ #include @@ -75,4 +75,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_SKIRTEDGRID_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___SKIRTEDGRID___H__ diff --git a/modules/globebrowsing/meshes/trianglesoup.h b/modules/globebrowsing/meshes/trianglesoup.h index 58e74b46c4..dd84ef078f 100644 --- a/modules/globebrowsing/meshes/trianglesoup.h +++ b/modules/globebrowsing/meshes/trianglesoup.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_TRIANGLESOUP_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_TRIANGLESOUP_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TRIANGLESOUP___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TRIANGLESOUP___H__ #include #include @@ -105,4 +105,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_TRIANGLESOUP_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TRIANGLESOUP___H__ diff --git a/modules/globebrowsing/other/concurrentjobmanager.h b/modules/globebrowsing/other/concurrentjobmanager.h index 11896cd19f..5020d0682e 100644 --- a/modules/globebrowsing/other/concurrentjobmanager.h +++ b/modules/globebrowsing/other/concurrentjobmanager.h @@ -22,90 +22,53 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __CONCURRENT_JOB_MANAGER_H__ -#define __CONCURRENT_JOB_MANAGER_H__ - -#include -#include -#include -#include -#include +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CONCURRENT_JOB_MANAGER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___CONCURRENT_JOB_MANAGER___H__ #include #include -//#include - -#include namespace openspace { namespace globebrowsing { - // Templated abstract base class representing a job to be done. - // Client code derive from this class and implement the virtual execute() method - template - struct Job { +// Templated abstract base class representing a job to be done. +// Client code derive from this class and implement the virtual execute() method +template +struct Job { + Job(); + virtual ~Job(); - Job() { } - virtual ~Job() { } + virtual void execute() = 0; + virtual std::shared_ptr

product() const = 0; +}; - virtual void execute() = 0; - virtual std::shared_ptr

product() const = 0; - - }; +/* + * Templated Concurrent Job Manager + * This class is used execute specific jobs on one (1) parallell thread + */ +template +class ConcurrentJobManager { +public: + ConcurrentJobManager(std::shared_ptr pool); - /* - * Templated Concurrent Job Manager - * This class is used execute specific jobs on one (1) parallell thread - */ - template - class ConcurrentJobManager{ - public: - ConcurrentJobManager(std::shared_ptr pool) : threadPool(pool) - { + void enqueueJob(std::shared_ptr> job); - } + void clearEnqueuedJobs(); - ~ConcurrentJobManager() { + std::shared_ptr> popFinishedJob(); - } + size_t numFinishedJobs() const; - void enqueueJob(std::shared_ptr> job) { - //threadPool->queue([this, job]() { - // job->execute(); - // _finishedJobs.push(job); - //}); - threadPool->enqueue([this, job]() { - job->execute(); - _finishedJobs.push(job); - }); - } + void reset(); - void clearEnqueuedJobs() { - //threadPool->clearRemainingTasks(); - threadPool->clearTasks(); - } - - std::shared_ptr> popFinishedJob() { - ghoul_assert(_finishedJobs.size() > 0, "There is no finished job to pop!"); - return _finishedJobs.pop(); - } - - size_t numFinishedJobs() const{ - return _finishedJobs.size(); - } - - void reset() { - //threadPool->clearRemainingTasks(); - threadPool->clearTasks(); - } - - private: - - ConcurrentQueue>> _finishedJobs; - std::shared_ptr threadPool; - }; +private: + ConcurrentQueue>> _finishedJobs; + std::shared_ptr threadPool; +}; } // namespace globebrowsing } // namespace openspace -#endif // __CONCURRENT_JOB_MANAGER_H__ \ No newline at end of file +#include "concurrentjobmanager.inl" + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CONCURRENT_JOB_MANAGER___H__ diff --git a/modules/globebrowsing/other/concurrentjobmanager.inl b/modules/globebrowsing/other/concurrentjobmanager.inl index fdb6301f32..58c75a7a9c 100644 --- a/modules/globebrowsing/other/concurrentjobmanager.inl +++ b/modules/globebrowsing/other/concurrentjobmanager.inl @@ -22,17 +22,57 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __LRU_CACHE__ -#define __LRU_CACHE__ - - #include -//#include namespace openspace { namespace globebrowsing { +template +Job

::Job() {} + +template +Job

::~Job() {} + +template +ConcurrentJobManager

::ConcurrentJobManager(std::shared_ptr pool) : threadPool(pool) { + +} + +template +void ConcurrentJobManager

::enqueueJob(std::shared_ptr> job) { + //threadPool->queue([this, job]() { + // job->execute(); + // _finishedJobs.push(job); + //}); + threadPool->enqueue([this, job]() { + job->execute(); + _finishedJobs.push(job); + }); +} + +template +void ConcurrentJobManager

::clearEnqueuedJobs() { + //threadPool->clearRemainingTasks(); + threadPool->clearTasks(); +} + +template +std::shared_ptr> ConcurrentJobManager

::popFinishedJob() { + ghoul_assert(_finishedJobs.size() > 0, "There is no finished job to pop!"); + return _finishedJobs.pop(); +} + +template +size_t ConcurrentJobManager

::numFinishedJobs() const { + return _finishedJobs.size(); +} + +template +void ConcurrentJobManager

::reset() { + //threadPool->clearRemainingTasks(); + threadPool->clearTasks(); +} + + } // namespace globebrowsing } // namespace openspace - -#endif // \ No newline at end of file diff --git a/modules/globebrowsing/other/concurrentqueue.h b/modules/globebrowsing/other/concurrentqueue.h index 5d51ae294b..7495b0124d 100644 --- a/modules/globebrowsing/other/concurrentqueue.h +++ b/modules/globebrowsing/other/concurrentqueue.h @@ -22,16 +22,12 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __CONCURRENT_QUEUE_H__ -#define __CONCURRENT_QUEUE_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CONCURRENT_QUEUE___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___CONCURRENT_QUEUE___H__ -#include -#include -#include -#include -#include -#include #include +#include +#include namespace openspace { namespace globebrowsing { @@ -42,47 +38,15 @@ namespace globebrowsing { template class ConcurrentQueue { public: + T pop(); - T pop() { - std::unique_lock mlock(_mutex); - while (_queue.empty()) { - _cond.wait(mlock); - } - auto item = _queue.front(); - _queue.pop(); - return item; - } + void pop(T& item); - void pop(T& item) { - std::unique_lock mlock(_mutex); - while (_queue.empty()) { - _cond.wait(mlock); - } - item = _queue.front(); - _queue.pop(); - } + void push(const T& item); - void push(const T& item) { - std::unique_lock mlock(_mutex); - _queue.push(item); - mlock.unlock(); - _cond.notify_one(); - } + void push(T&& item); - void push(T&& item) { - std::unique_lock mlock(_mutex); - _queue.push(std::move(item)); - mlock.unlock(); - _cond.notify_one(); - } - - size_t size() const{ - std::unique_lock mlock(_mutex); - size_t s = _queue.size(); - mlock.unlock(); - _cond.notify_one(); - return s; - } + size_t size() const; private: std::queue _queue; @@ -93,4 +57,6 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __CONCURRENT_QUEUE_H__ +#include "concurrentqueue.inl" + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CONCURRENT_QUEUE___H__ diff --git a/modules/globebrowsing/other/concurrentqueue.inl b/modules/globebrowsing/other/concurrentqueue.inl new file mode 100644 index 0000000000..17b610c997 --- /dev/null +++ b/modules/globebrowsing/other/concurrentqueue.inl @@ -0,0 +1,75 @@ +/***************************************************************************************** + * * + * 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. * + ****************************************************************************************/ + +namespace openspace { +namespace globebrowsing { + +template +T ConcurrentQueue::pop() { + std::unique_lock mlock(_mutex); + while (_queue.empty()) { + _cond.wait(mlock); + } + auto item = _queue.front(); + _queue.pop(); + return item; +} + +template +void ConcurrentQueue::pop(T& item) { + std::unique_lock mlock(_mutex); + while (_queue.empty()) { + _cond.wait(mlock); + } + item = _queue.front(); + _queue.pop(); +} + +template +void ConcurrentQueue::push(const T& item) { + std::unique_lock mlock(_mutex); + _queue.push(item); + mlock.unlock(); + _cond.notify_one(); +} + +template +void ConcurrentQueue::push(T&& item) { + std::unique_lock mlock(_mutex); + _queue.push(std::move(item)); + mlock.unlock(); + _cond.notify_one(); +} + +template +size_t ConcurrentQueue::size() const { + std::unique_lock mlock(_mutex); + size_t s = _queue.size(); + mlock.unlock(); + _cond.notify_one(); + return s; +} + +} // namespace globebrowsing +} // namespace openspace diff --git a/modules/globebrowsing/other/distanceswitch.h b/modules/globebrowsing/other/distanceswitch.h index 51e13ed8f6..009a3300ae 100644 --- a/modules/globebrowsing/other/distanceswitch.h +++ b/modules/globebrowsing/other/distanceswitch.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_DISTANCESWITCH_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_DISTANCESWITCH_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___DISTANCESWITCH___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___DISTANCESWITCH___H__ #include @@ -67,4 +67,4 @@ private: } // namespace globebrowsing } // openspace -#endif //__OPENSPACE_MODULE_GLOBEBROWSING_DISTANCESWITCH_H__ +#endif //__OPENSPACE_MODULE_GLOBEBROWSING___DISTANCESWITCH___H__ diff --git a/modules/globebrowsing/other/lrucache.h b/modules/globebrowsing/other/lrucache.h index f34ac514b3..039a732fa4 100644 --- a/modules/globebrowsing/other/lrucache.h +++ b/modules/globebrowsing/other/lrucache.h @@ -22,44 +22,39 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __LRU_CACHE_H__ -#define __LRU_CACHE_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___LRU_CACHE___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___LRU_CACHE___H__ -#include -#include -#include #include -#include namespace openspace { namespace globebrowsing { - // Templated class implementing a Least-Recently-Used Cache - template - class LRUCache { - public: - LRUCache(size_t size); - ~LRUCache(); +// Templated class implementing a Least-Recently-Used Cache +template +class LRUCache { +public: + LRUCache(size_t size); - void put(const KeyType& key, const ValueType& value); - void clear(); - bool exist(const KeyType& key) const; - ValueType get(const KeyType& key); - size_t size() const; + void put(const KeyType& key, const ValueType& value); + void clear(); + bool exist(const KeyType& key) const; + ValueType get(const KeyType& key); + size_t size() const; - private: - void clean(); +private: + void clean(); - // Member varialbes - private: - std::list> _itemList; - std::unordered_map _itemMap; - size_t _cacheSize; - }; +// Member varialbes +private: + std::list> _itemList; + std::unordered_map _itemMap; + size_t _cacheSize; +}; } // namespace globebrowsing } // namespace openspace #include -#endif // __LRU_CACHE_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___LRU_CACHE___H__ diff --git a/modules/globebrowsing/other/lrucache.inl b/modules/globebrowsing/other/lrucache.inl index b15842d995..83c37bbc88 100644 --- a/modules/globebrowsing/other/lrucache.inl +++ b/modules/globebrowsing/other/lrucache.inl @@ -22,86 +22,61 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __LRU_CACHE__ -#define __LRU_CACHE__ - - #include -//#include - namespace openspace { namespace globebrowsing { - template - LRUCache::LRUCache(size_t size) - : _cacheSize(size) { } +template +LRUCache::LRUCache(size_t size) + : _cacheSize(size) +{} - template - LRUCache::~LRUCache() { - // Clean up list and map! +template +void LRUCache::clear() { + _itemList.erase(_itemList.begin(), _itemList.end()); + _itemMap.erase(_itemMap.begin(), _itemMap.end()); +} + +template +void LRUCache::put(const KeyType& key, const ValueType& value) { + auto it = _itemMap.find(key); + if (it != _itemMap.end()) { + _itemList.erase(it->second); + _itemMap.erase(it); } + _itemList.push_front(std::make_pair(key, value)); + _itemMap.insert(std::make_pair(key, _itemList.begin())); + clean(); +} - ////////////////////////////// - // PUBLIC INTERFACE // - ////////////////////////////// +template +bool LRUCache::exist(const KeyType& key) const { + return _itemMap.count(key) > 0; +} - template - void LRUCache::clear() - { - _itemList.erase(_itemList.begin(), _itemList.end()); - _itemMap.erase(_itemMap.begin(), _itemMap.end()); - } - - template - void LRUCache::put(const KeyType& key, const ValueType& value) - { - auto it = _itemMap.find(key); - if (it != _itemMap.end()) { - _itemList.erase(it->second); - _itemMap.erase(it); - } - _itemList.push_front(std::make_pair(key, value)); - _itemMap.insert(std::make_pair(key, _itemList.begin())); - clean(); - } - - template - bool LRUCache::exist(const KeyType& key) const - { - return _itemMap.count(key) > 0; - } - - template - ValueType LRUCache::get(const KeyType& key) - { - //ghoul_assert(exist(key), "Key " << key << " must exist"); - auto it = _itemMap.find(key); - // Move list iterator pointing to value - _itemList.splice(_itemList.begin(), _itemList, it->second); - return it->second->second; - } - - template - size_t LRUCache::size() const - { - return _itemMap.size(); - } - - ////////////////////////////// - // PRIVATE HELPERS // - ////////////////////////////// - template - void LRUCache::clean() - { - while (_itemMap.size() > _cacheSize) { - auto last_it = _itemList.end(); last_it--; - _itemMap.erase(last_it->first); - _itemList.pop_back(); - } +template +ValueType LRUCache::get(const KeyType& key) { + //ghoul_assert(exist(key), "Key " << key << " must exist"); + auto it = _itemMap.find(key); + // Move list iterator pointing to value + _itemList.splice(_itemList.begin(), _itemList, it->second); + return it->second->second; +} + +template +size_t LRUCache::size() const { + return _itemMap.size(); +} + +template +void LRUCache::clean() { + while (_itemMap.size() > _cacheSize) { + auto last_it = _itemList.end(); last_it--; + _itemMap.erase(last_it->first); + _itemList.pop_back(); } +} } // namespace globebrowsing } // namespace openspace - -#endif // __LRU_CACHE__ \ No newline at end of file diff --git a/modules/globebrowsing/other/statscollector.h b/modules/globebrowsing/other/statscollector.h index ec38393504..80fe510333 100644 --- a/modules/globebrowsing/other/statscollector.h +++ b/modules/globebrowsing/other/statscollector.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_STATS_TRACKER_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_STATS_TRACKER_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___STATS_TRACKER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___STATS_TRACKER___H__ #include @@ -120,4 +120,4 @@ private: #include "statscollector.inl" -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_STATS_TRACKER_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___STATS_TRACKER___H__ diff --git a/modules/globebrowsing/other/threadpool.h b/modules/globebrowsing/other/threadpool.h index 81e1cdc83c..d5cd05a4a3 100644 --- a/modules/globebrowsing/other/threadpool.h +++ b/modules/globebrowsing/other/threadpool.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_THREAD_POOL_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_THREAD_POOL_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___THREAD_POOL___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___THREAD_POOL___H__ #include #include @@ -70,4 +70,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_THREAD_POOL_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___THREAD_POOL___H__ diff --git a/modules/globebrowsing/rendering/chunkrenderer.cpp b/modules/globebrowsing/rendering/chunkrenderer.cpp index 2e5c25d363..cca9bd191c 100644 --- a/modules/globebrowsing/rendering/chunkrenderer.cpp +++ b/modules/globebrowsing/rendering/chunkrenderer.cpp @@ -28,6 +28,7 @@ #include #include #include +#include namespace { const char* keyFrame = "Frame"; diff --git a/modules/globebrowsing/rendering/chunkrenderer.h b/modules/globebrowsing/rendering/chunkrenderer.h index 0e0372ecef..2086f29d2d 100644 --- a/modules/globebrowsing/rendering/chunkrenderer.h +++ b/modules/globebrowsing/rendering/chunkrenderer.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_CHUNK_RENDERER_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_CHUNK_RENDERER_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CHUNK_RENDERER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___CHUNK_RENDERER___H__ #include @@ -100,4 +100,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_CHUNK_RENDERER_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNK_RENDERER___H__ diff --git a/modules/globebrowsing/rendering/gpulayermanager.h b/modules/globebrowsing/rendering/gpulayermanager.h index ec1448b498..ec9834a610 100644 --- a/modules/globebrowsing/rendering/gpulayermanager.h +++ b/modules/globebrowsing/rendering/gpulayermanager.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_GPU_LAYER_MANAGER_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_GPU_LAYER_MANAGER_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GPU_LAYER_MANAGER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GPU_LAYER_MANAGER___H__ #include @@ -317,4 +317,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_GPU_LAYER_MANAGER_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPU_LAYER_MANAGER___H__ diff --git a/modules/globebrowsing/rendering/layermanager.h b/modules/globebrowsing/rendering/layermanager.h index 9569640db4..6626f52d2f 100644 --- a/modules/globebrowsing/rendering/layermanager.h +++ b/modules/globebrowsing/rendering/layermanager.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_LAYERMANAGER_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_LAYERMANAGER_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___LAYERMANAGER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___LAYERMANAGER___H__ #include @@ -129,4 +129,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_LAYERMANAGER_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___LAYERMANAGER___H__ diff --git a/modules/globebrowsing/rendering/layershadermanager.cpp b/modules/globebrowsing/rendering/layershadermanager.cpp index 2ba79e94e1..f43b73068a 100644 --- a/modules/globebrowsing/rendering/layershadermanager.cpp +++ b/modules/globebrowsing/rendering/layershadermanager.cpp @@ -1,138 +1,140 @@ /***************************************************************************************** -* * -* 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. * -****************************************************************************************/ + * * + * 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. * + ****************************************************************************************/ #include -#include -#include #include +#include -#include "ghoul/misc/dictionary.h" - -#include - -namespace { - const std::string _loggerCat = "LayerShaderManager"; -} +#include namespace openspace { namespace globebrowsing { - bool LayerGroupPreprocessingData::operator==( - const LayerGroupPreprocessingData& other) const { - return lastLayerIdx == other.lastLayerIdx && - layerBlendingEnabled == other.layerBlendingEnabled; +bool LayerGroupPreprocessingData::operator==( + const LayerGroupPreprocessingData& other) const { + return lastLayerIdx == other.lastLayerIdx && + layerBlendingEnabled == other.layerBlendingEnabled; +} + +bool LayerShaderPreprocessingData::operator==( + const LayerShaderPreprocessingData& other) const { + if (layeredTextureInfo.size() != other.layeredTextureInfo.size() || + keyValuePairs.size() != other.keyValuePairs.size()) { + return false; } - - bool LayerShaderPreprocessingData::operator==( - const LayerShaderPreprocessingData& other) const { - if (layeredTextureInfo.size() != other.layeredTextureInfo.size() || - keyValuePairs.size() != other.keyValuePairs.size()) { - return false; + else { + bool equal = true; + for (size_t i = 0; i < layeredTextureInfo.size(); i++) { + equal &= (layeredTextureInfo[i] == other.layeredTextureInfo[i]); } - else { - bool equal = true; - for (size_t i = 0; i < layeredTextureInfo.size(); i++) { - equal &= (layeredTextureInfo[i] == other.layeredTextureInfo[i]); - } - for (size_t i = 0; i < keyValuePairs.size(); i++) { - equal &= (keyValuePairs[i] == other.keyValuePairs[i]); - } - return equal; - } - } - - LayerShaderManager::LayerShaderManager( - const std::string& shaderName, - const std::string& vsPath, - const std::string& fsPath) - : _shaderName(shaderName) - , _vsPath(vsPath) - , _fsPath(fsPath) - , _updatedOnLastCall(false) { } - - LayerShaderManager::~LayerShaderManager() { - if (_programObject) { - RenderEngine& renderEngine = OsEng.renderEngine(); - renderEngine.removeRenderProgram(_programObject); - _programObject = nullptr; - } - } - - ProgramObject* LayerShaderManager::programObject( - LayerShaderPreprocessingData preprocessingData) { - _updatedOnLastCall = false; - if (!(preprocessingData == _preprocessingData) || _programObject == nullptr) { - recompileShaderProgram(preprocessingData); - _updatedOnLastCall = true; - } - return _programObject.get(); - } - - void LayerShaderManager::recompileShaderProgram( - LayerShaderPreprocessingData preprocessingData) { - _preprocessingData = preprocessingData; - ghoul::Dictionary shaderDictionary; - - // Different layer types can be height layers or color layers for example. - // These are used differently within the shaders. - auto textureTypes = _preprocessingData.layeredTextureInfo; - for (size_t i = 0; i < textureTypes.size(); i++) { - // lastLayerIndex must be at least 0 for the shader to compile, - // the layer type is inactivated by setting use to false - std::string groupName = LayerManager::LAYER_GROUP_NAMES[i]; - shaderDictionary.setValue( - "lastLayerIndex" + groupName, glm::max(textureTypes[i].lastLayerIdx, 0)); - shaderDictionary.setValue( - "use" + groupName, textureTypes[i].lastLayerIdx >= 0); - shaderDictionary.setValue( - "blend" + groupName, textureTypes[i].layerBlendingEnabled); - } - - // Other settings such as "useAtmosphere" - auto keyValuePairs = _preprocessingData.keyValuePairs; for (size_t i = 0; i < keyValuePairs.size(); i++) { - shaderDictionary.setValue(keyValuePairs[i].first, keyValuePairs[i].second); + equal &= (keyValuePairs[i] == other.keyValuePairs[i]); } + return equal; + } +} - // Remove old program - OsEng.renderEngine().removeRenderProgram(_programObject); +LayerShaderManager::LayerShaderManager(const std::string& shaderName, + const std::string& vsPath, + const std::string& fsPath) + : _shaderName(shaderName) + , _vsPath(vsPath) + , _fsPath(fsPath) + , _updatedOnLastCall(false) +{} + +LayerShaderManager::~LayerShaderManager() { + if (_programObject) { + RenderEngine& renderEngine = OsEng.renderEngine(); + renderEngine.removeRenderProgram(_programObject); + _programObject = nullptr; + } +} - _programObject = OsEng.renderEngine().buildRenderProgram( - _shaderName, - _vsPath, - _fsPath, - shaderDictionary); +ProgramObject* LayerShaderManager::programObject( + LayerShaderPreprocessingData preprocessingData) +{ + _updatedOnLastCall = false; + if (!(preprocessingData == _preprocessingData) || _programObject == nullptr) { + recompileShaderProgram(preprocessingData); + _updatedOnLastCall = true; + } + return _programObject.get(); +} - ghoul_assert(_programObject != nullptr, "Failed to initialize programObject!"); - using IgnoreError = ProgramObject::IgnoreError; - _programObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); +void LayerShaderManager::recompileShaderProgram( + LayerShaderPreprocessingData preprocessingData) +{ + _preprocessingData = preprocessingData; + ghoul::Dictionary shaderDictionary; + + // Different layer types can be height layers or color layers for example. + // These are used differently within the shaders. + auto textureTypes = _preprocessingData.layeredTextureInfo; + for (size_t i = 0; i < textureTypes.size(); i++) { + // lastLayerIndex must be at least 0 for the shader to compile, + // the layer type is inactivated by setting use to false + std::string groupName = LayerManager::LAYER_GROUP_NAMES[i]; + shaderDictionary.setValue( + "lastLayerIndex" + groupName, + glm::max(textureTypes[i].lastLayerIdx, 0) + ); + shaderDictionary.setValue( + "use" + groupName, + textureTypes[i].lastLayerIdx >= 0 + ); + shaderDictionary.setValue( + "blend" + groupName, + textureTypes[i].layerBlendingEnabled + ); } - bool LayerShaderManager::updatedOnLastCall() { - return _updatedOnLastCall; + // Other settings such as "useAtmosphere" + auto keyValuePairs = _preprocessingData.keyValuePairs; + for (size_t i = 0; i < keyValuePairs.size(); i++) { + shaderDictionary.setValue(keyValuePairs[i].first, keyValuePairs[i].second); } + // Remove old program + OsEng.renderEngine().removeRenderProgram(_programObject); + + _programObject = OsEng.renderEngine().buildRenderProgram( + _shaderName, + _vsPath, + _fsPath, + shaderDictionary + ); + + ghoul_assert(_programObject != nullptr, "Failed to initialize programObject!"); + using IgnoreError = ProgramObject::IgnoreError; + _programObject->setIgnoreSubroutineUniformLocationError(IgnoreError::Yes); +} + +bool LayerShaderManager::updatedOnLastCall() { + return _updatedOnLastCall; +} + } // namespace globebrowsing -} // namespace openspace \ No newline at end of file +} // namespace openspace diff --git a/modules/globebrowsing/rendering/layershadermanager.h b/modules/globebrowsing/rendering/layershadermanager.h index 75c1e177fb..4138bdd55b 100644 --- a/modules/globebrowsing/rendering/layershadermanager.h +++ b/modules/globebrowsing/rendering/layershadermanager.h @@ -1,110 +1,107 @@ /***************************************************************************************** -* * -* 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. * -****************************************************************************************/ + * * + * 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 __LAYER_SHADER_MANAGER_H__ -#define __LAYER_SHADER_MANAGER_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___LAYER_SHADER_MANAGER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___LAYER_SHADER_MANAGER___H__ #include -#include -#include "ghoul/opengl/programobject.h" - -#include #include #include +namespace ghoul { +namespace opengl { +class ProgramObject; +} +} namespace openspace { namespace globebrowsing { - using namespace ghoul::opengl; +/** + * Settings per texture group that contains shader preprocessing information. + */ +struct LayerGroupPreprocessingData { + int lastLayerIdx; + bool layerBlendingEnabled; + bool operator==(const LayerGroupPreprocessingData& other) const; +}; - class LayerManager; +/** + * Data needed for shader preprocessing before compiling a layered texture shader + * program. + * + * If a LayerShaderPreprocessingData is compared with another it can + * be determined wheter or not a LayerShaderManager needs to + * recompile its shader program. For each TextureGroup there is + * information about how many layers it has and whether or not to blend the texture + * levels. + */ +struct LayerShaderPreprocessingData { + std::array + layeredTextureInfo; + std::vector > keyValuePairs; + bool operator==(const LayerShaderPreprocessingData& other) const; +}; + +/** + * This class has ownership of an updated shader program for rendering tiles. + */ +class LayerShaderManager { +public: + LayerShaderManager( + const std::string& shaderName, + const std::string& vsPath, + const std::string& fsPath); + ~LayerShaderManager(); /** - * Settings per texture group that contains shader preprocessing information. - */ - struct LayerGroupPreprocessingData { - int lastLayerIdx; - bool layerBlendingEnabled; - bool operator==(const LayerGroupPreprocessingData& other) const; - }; + * Returns a pointer to a ProgramObject for rendering tiles. + * \param preprocessingData determines wherer or not the shader + * program needs to be re-compiled. If preprocessingData is different + * from the last time this function was called the shader program will be + * recompiled before returned. + */ + ProgramObject* programObject( + LayerShaderPreprocessingData preprocessingData); - /** - * Data needed for shader preprocessing before compiling a layered texture shader - * program. - * - * If a LayerShaderPreprocessingData is compared with another it can - * be determined wheter or not a LayerShaderManager needs to - * recompile its shader program. For each TextureGroup there is - * information about how many layers it has and whether or not to blend the texture - * levels. - */ - struct LayerShaderPreprocessingData { - std::array - layeredTextureInfo; - std::vector > keyValuePairs; - bool operator==(const LayerShaderPreprocessingData& other) const; - }; - - /** - * This class has ownership of an updated shader program for rendering tiles. - */ - class LayerShaderManager { - public: - LayerShaderManager( - const std::string& shaderName, - const std::string& vsPath, - const std::string& fsPath); - ~LayerShaderManager(); - - /** - * Returns a pointer to a ProgramObject for rendering tiles. - * \param preprocessingData determines wherer or not the shader - * program needs to be re-compiled. If preprocessingData is different - * from the last time this function was called the shader program will be - * recompiled before returned. - */ - ProgramObject* programObject( - LayerShaderPreprocessingData preprocessingData); - - bool updatedOnLastCall(); + bool updatedOnLastCall(); - private: +private: - void recompileShaderProgram(LayerShaderPreprocessingData preprocessingData); + void recompileShaderProgram(LayerShaderPreprocessingData preprocessingData); - std::unique_ptr _programObject; - LayerShaderPreprocessingData _preprocessingData; + std::unique_ptr _programObject; + LayerShaderPreprocessingData _preprocessingData; - const std::string _shaderName; - const std::string _vsPath; - const std::string _fsPath; + const std::string _shaderName; + const std::string _vsPath; + const std::string _fsPath; - bool _updatedOnLastCall; - }; + bool _updatedOnLastCall; +}; } // namespace globebrowsing } // namespace openspace -#endif // __LAYER_SHADER_MANAGER_H__ \ No newline at end of file +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___LAYER_SHADER_MANAGER___H__ diff --git a/modules/globebrowsing/tile/asynctilereader.h b/modules/globebrowsing/tile/asynctilereader.h index 1bcf4fb6d1..748c95c62d 100644 --- a/modules/globebrowsing/tile/asynctilereader.h +++ b/modules/globebrowsing/tile/asynctilereader.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_ASYNC_TILE_DATA_PROVIDER_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_ASYNC_TILE_DATA_PROVIDER_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___ASYNC_TILE_DATA_PROVIDER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___ASYNC_TILE_DATA_PROVIDER___H__ #include #include @@ -107,4 +107,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_ASYNC_TILE_DATA_PROVIDER_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___ASYNC_TILE_DATA_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/chunktile.h b/modules/globebrowsing/tile/chunktile.h index 7cc32952d2..05f765c449 100644 --- a/modules/globebrowsing/tile/chunktile.h +++ b/modules/globebrowsing/tile/chunktile.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_CHUNKTILE_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_CHUNKTILE_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKTILE___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKTILE___H__ #include #include @@ -46,4 +46,4 @@ struct ChunkTilePile { } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_CHUNKTILE_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKTILE___H__ diff --git a/modules/globebrowsing/tile/pixelregion.h b/modules/globebrowsing/tile/pixelregion.h index 771bbc0ed9..84fbca1d0d 100644 --- a/modules/globebrowsing/tile/pixelregion.h +++ b/modules/globebrowsing/tile/pixelregion.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_PIXELREGION_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_PIXELREGION_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___PIXELREGION___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___PIXELREGION___H__ #include @@ -103,4 +103,4 @@ struct PixelRegion { } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_PIXELREGION_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___PIXELREGION___H__ diff --git a/modules/globebrowsing/tile/tile.h b/modules/globebrowsing/tile/tile.h index 883dc8b60e..dc478a93d5 100644 --- a/modules/globebrowsing/tile/tile.h +++ b/modules/globebrowsing/tile/tile.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_TILE_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_TILE_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILE___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TILE___H__ #include @@ -140,4 +140,4 @@ struct Tile { } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_TILE_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE___H__ diff --git a/modules/globebrowsing/tile/tiledataset.h b/modules/globebrowsing/tile/tiledataset.h index f8f3b224e6..96b7c4dcc9 100644 --- a/modules/globebrowsing/tile/tiledataset.h +++ b/modules/globebrowsing/tile/tiledataset.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_TILE_DATASET_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_TILE_DATASET_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DATASET___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DATASET___H__ #include #include @@ -195,4 +195,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_TILE_DATASET_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DATASET___H__ diff --git a/modules/globebrowsing/tile/tiledatatype.h b/modules/globebrowsing/tile/tiledatatype.h index 3fce12a867..5c26df5a37 100644 --- a/modules/globebrowsing/tile/tiledatatype.h +++ b/modules/globebrowsing/tile/tiledatatype.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_TILE_DATA_TYPE_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_TILE_DATA_TYPE_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DATA_TYPE___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DATA_TYPE___H__ #include @@ -51,4 +51,4 @@ struct TileDataType { } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_TILE_DATA_TYPE_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DATA_TYPE___H__ diff --git a/modules/globebrowsing/tile/tiledepthtransform.h b/modules/globebrowsing/tile/tiledepthtransform.h index 2aac786f09..2d71672b17 100644 --- a/modules/globebrowsing/tile/tiledepthtransform.h +++ b/modules/globebrowsing/tile/tiledepthtransform.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __TILEDEPTHTRANSFORM_H__ -#define __TILEDEPTHTRANSFORM_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILEDEPTHTRANSFORM___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TILEDEPTHTRANSFORM___H__ namespace openspace { namespace globebrowsing { @@ -36,4 +36,4 @@ struct TileDepthTransform { } // namespace globebrowsing } // namespace openspace -#endif // __TILEDEPTHTRANSFORM_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILEDEPTHTRANSFORM___H__ diff --git a/modules/globebrowsing/tile/tilediskcache.h b/modules/globebrowsing/tile/tilediskcache.h index c216919fbe..71880d8036 100644 --- a/modules/globebrowsing/tile/tilediskcache.h +++ b/modules/globebrowsing/tile/tilediskcache.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_TILE_DISK_CACHE_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_TILE_DISK_CACHE_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DISK_CACHE___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DISK_CACHE___H__ #include #include @@ -60,4 +60,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_TILE_DISK_CACHE_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DISK_CACHE___H__ diff --git a/modules/globebrowsing/tile/tileindex.h b/modules/globebrowsing/tile/tileindex.h index 1d461d7484..d8d3314c2f 100644 --- a/modules/globebrowsing/tile/tileindex.h +++ b/modules/globebrowsing/tile/tileindex.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_TILE_INDEX_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_TILE_INDEX_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILE_INDEX___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TILE_INDEX___H__ #include #include @@ -123,4 +123,4 @@ std::ostream& operator<<(std::ostream& os, const TileIndex& ti); } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_TILE_INDEX_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_INDEX___H__ diff --git a/modules/globebrowsing/tile/tileprovider/cachingtileprovider.h b/modules/globebrowsing/tile/tileprovider/cachingtileprovider.h index 4d03e7e89b..5531c6e9d2 100644 --- a/modules/globebrowsing/tile/tileprovider/cachingtileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/cachingtileprovider.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_CACHING_TILE_PROVIDER_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_CACHING_TILE_PROVIDER_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CACHING_TILE_PROVIDER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___CACHING_TILE_PROVIDER___H__ #include @@ -95,4 +95,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_CACHING_TILE_PROVIDER_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___CACHING_TILE_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/tileprovider/singleimageprovider.h b/modules/globebrowsing/tile/tileprovider/singleimageprovider.h index bae41910c0..793337a0c4 100644 --- a/modules/globebrowsing/tile/tileprovider/singleimageprovider.h +++ b/modules/globebrowsing/tile/tileprovider/singleimageprovider.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_SINGLE_IMAGE_PROVIDER_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_SINGLE_IMAGE_PROVIDER_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___SINGLE_IMAGE_PROVIDER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___SINGLE_IMAGE_PROVIDER___H__ #include @@ -54,4 +54,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_SINGLE_IMAGE_PROVIDER_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___SINGLE_IMAGE_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h index c19dafcfa1..d4a453db18 100644 --- a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_TEMPORAL_TILE_PROVIDER_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_TEMPORAL_TILE_PROVIDER_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TEMPORAL_TILE_PROVIDER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TEMPORAL_TILE_PROVIDER___H__ #include @@ -279,12 +279,11 @@ private: std::string _datasetFile; std::string _gdalXmlTemplate; - std::unordered_map > _tileProviderMap; + std::unordered_map> _tileProviderMap; // Used for creation of time specific instances of CachingTileProvider ghoul::Dictionary _initDict; - Tile _defaultTile; std::shared_ptr _currentTileProvider; @@ -296,4 +295,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_TEMPORAL_TILE_PROVIDER_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TEMPORAL_TILE_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/tileprovider/texttileprovider.h b/modules/globebrowsing/tile/tileprovider/texttileprovider.h index 1db7b52db8..a158fb7416 100644 --- a/modules/globebrowsing/tile/tileprovider/texttileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/texttileprovider.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_TEXT_TILE_PROVIDER_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_TEXT_TILE_PROVIDER_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TEXT_TILE_PROVIDER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TEXT_TILE_PROVIDER___H__ #include @@ -134,4 +134,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_TEXT_TILE_PROVIDER_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TEXT_TILE_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/tileprovider/tileprovider.h b/modules/globebrowsing/tile/tileprovider/tileprovider.h index 1691fd21e1..7a43c24482 100644 --- a/modules/globebrowsing/tile/tileprovider/tileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/tileprovider.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_TILE_PROVIDER_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_TILE_PROVIDER_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILE_PROVIDER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TILE_PROVIDER___H__ #include #include @@ -146,4 +146,4 @@ using TileCache = LRUCache; } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_TILE_PROVIDER_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h b/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h index 094fb87f40..09e4922e71 100644 --- a/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h +++ b/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_TILE_PROVIDER_BY_INDEX_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_TILE_PROVIDER_BY_INDEX_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILE_PROVIDER_BY_INDEX___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TILE_PROVIDER_BY_INDEX___H__ #include @@ -54,4 +54,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_TILE_PROVIDER_BY_INDEX_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_PROVIDER_BY_INDEX___H__ diff --git a/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h b/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h index adb37cc2c0..3477c92e86 100644 --- a/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h +++ b/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_TILE_PROVIDER_BY_LEVEL_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_TILE_PROVIDER_BY_LEVEL_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILE_PROVIDER_BY_LEVEL___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TILE_PROVIDER_BY_LEVEL___H__ #include @@ -54,4 +54,4 @@ private: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_TILE_PROVIDER_BY_LEVEL_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_PROVIDER_BY_LEVEL___H__ diff --git a/modules/globebrowsing/tile/tileselector.h b/modules/globebrowsing/tile/tileselector.h index 54cc20da29..3a5b960b36 100644 --- a/modules/globebrowsing/tile/tileselector.h +++ b/modules/globebrowsing/tile/tileselector.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING_TILE_SELECTOR_H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING_TILE_SELECTOR_H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILE_SELECTOR___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___TILE_SELECTOR___H__ #include #include @@ -49,4 +49,4 @@ public: } // namespace globebrowsing } // namespace openspace -#endif // __OPENSPACE_MODULE_GLOBEBROWSING_TILE_SELECTOR_H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_SELECTOR___H__