From 26682669ff9f708337c8869b75225d652c2eb41c Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 16 Jul 2017 01:55:35 -0400 Subject: [PATCH] More work on making use of nested namespaces --- .../cache/memoryawaretilecache.cpp | 15 +-- .../globebrowsing/cache/texturecontainer.cpp | 10 +- modules/globebrowsing/chunk/chunk.cpp | 9 +- .../chunklevelevaluator/distanceevaluator.cpp | 10 +- .../projectedareaevaluator.cpp | 10 +- modules/globebrowsing/chunk/chunknode.cpp | 8 +- .../chunk/culling/frustumculler.cpp | 10 +- .../chunk/culling/horizonculler.cpp | 22 ++-- modules/globebrowsing/geometry/ellipsoid.cpp | 19 ++-- modules/globebrowsing/geometry/geodetic2.cpp | 8 +- .../globebrowsing/geometry/geodeticpatch.cpp | 8 +- .../globebrowsing/globebrowsingmodule_lua.inl | 14 +-- .../globebrowsing/globes/chunkedlodglobe.cpp | 12 +-- modules/globebrowsing/globes/pointglobe.cpp | 10 +- .../globebrowsing/globes/renderableglobe.cpp | 13 +-- modules/globebrowsing/meshes/grid.cpp | 8 +- modules/globebrowsing/meshes/skirtedgrid.cpp | 8 +- modules/globebrowsing/meshes/trianglesoup.cpp | 10 +- .../globebrowsing/other/distanceswitch.cpp | 8 +- modules/globebrowsing/other/pixelbuffer.cpp | 8 +- .../globebrowsing/other/statscollector.cpp | 8 +- modules/globebrowsing/other/threadpool.cpp | 12 +-- .../globebrowsing/rendering/chunkrenderer.cpp | 8 +- .../rendering/gpu/gpuchunktile.cpp | 8 +- .../rendering/gpu/gpuchunktilepile.cpp | 9 +- .../rendering/gpu/gpuheightlayer.cpp | 8 +- .../globebrowsing/rendering/gpu/gpulayer.cpp | 8 +- .../rendering/gpu/gpulayeradjustment.cpp | 13 ++- .../rendering/gpu/gpulayergroup.cpp | 8 +- .../rendering/gpu/gpulayermanager.cpp | 8 +- .../rendering/gpu/gpulayerrendersettings.cpp | 11 +- .../rendering/gpu/gputiledepthtransform.cpp | 8 +- .../rendering/gpu/gputileuvtransform.cpp | 8 +- .../globebrowsing/rendering/layer/layer.cpp | 10 +- .../rendering/layer/layeradjustment.cpp | 12 +-- .../rendering/layer/layergroup.cpp | 8 +- .../rendering/layer/layermanager.cpp | 26 +++-- .../rendering/layer/layerrendersettings.cpp | 12 +-- .../rendering/layershadermanager.cpp | 8 +- modules/globebrowsing/tile/pixelregion.cpp | 8 +- modules/globebrowsing/tile/rawtile.cpp | 8 +- .../gdalrawtiledatareader.cpp | 15 ++- .../tile/rawtiledatareader/gdalwrapper.cpp | 11 +- .../tile/rawtiledatareader/iodescription.cpp | 8 +- .../rawtiledatareader/rawtiledatareader.cpp | 8 +- .../simplerawtiledatareader.cpp | 12 +-- .../tile/rawtiledatareader/tiledatatype.cpp | 12 +-- modules/globebrowsing/tile/tile.cpp | 12 +-- modules/globebrowsing/tile/tileindex.cpp | 10 +- modules/globebrowsing/tile/tileloadjob.cpp | 8 +- modules/globebrowsing/tile/tilemetadata.cpp | 8 +- .../tile/tileprovider/defaulttileprovider.cpp | 10 +- .../tile/tileprovider/singleimageprovider.cpp | 12 +-- .../sizereferencetileprovider.cpp | 17 +-- .../tileprovider/temporaltileprovider.cpp | 16 ++- .../tile/tileprovider/texttileprovider.cpp | 10 +- .../tileprovider/tileindextileprovider.cpp | 19 ++-- .../tile/tileprovider/tileprovider.cpp | 10 +- .../tile/tileprovider/tileproviderbyindex.cpp | 14 +-- .../tile/tileprovider/tileproviderbylevel.cpp | 15 +-- modules/globebrowsing/tile/tileselector.cpp | 17 ++- .../tile/tiletextureinitdata.cpp | 8 +- modules/iswa/rendering/dataplane.cpp | 6 +- modules/iswa/rendering/datasphere.cpp | 6 +- modules/iswa/rendering/datasphere.h | 3 +- modules/iswa/rendering/iswabasegroup.cpp | 6 +- modules/iswa/rendering/iswabasegroup.h | 4 +- modules/iswa/rendering/iswacygnet.cpp | 6 +- modules/iswa/rendering/iswacygnet.h | 3 +- modules/iswa/rendering/iswadatagroup.cpp | 6 +- modules/iswa/rendering/iswakameleongroup.cpp | 4 +- modules/iswa/rendering/iswakameleongroup.h | 3 +- modules/iswa/rendering/kameleonplane.cpp | 4 +- modules/iswa/rendering/screenspacecygnet.cpp | 6 +- modules/iswa/rendering/screenspacecygnet.h | 4 +- modules/iswa/rendering/texturecygnet.cpp | 10 +- modules/iswa/rendering/textureplane.cpp | 6 +- modules/iswa/util/dataprocessor.cpp | 6 +- modules/iswa/util/dataprocessorjson.cpp | 6 +- modules/iswa/util/dataprocessorkameleon.cpp | 6 +- modules/iswa/util/dataprocessortext.cpp | 6 +- modules/iswa/util/iswamanager.cpp | 10 +- modules/iswa/util/iswamanager.h | 3 +- modules/kameleon/include/kameleonwrapper.h | 5 +- .../kameleonvolume/kameleonvolumemodule.cpp | 9 +- .../kameleonvolume/kameleonvolumereader.cpp | 4 +- modules/kameleonvolume/kameleonvolumereader.h | 6 +- .../rendering/kameleonvolumeraycaster.cpp | 5 +- .../rendering/kameleonvolumeraycaster.h | 13 +-- .../rendering/renderablekameleonvolume.cpp | 6 +- .../rendering/renderablekameleonvolume.h | 3 +- .../tasks/kameleondocumentationtask.cpp | 4 +- .../tasks/kameleonmetadatatojsontask.cpp | 4 +- .../multiresvolume/rendering/atlasmanager.cpp | 6 +- .../multiresvolume/rendering/atlasmanager.h | 9 +- .../multiresvolume/rendering/brickmanager.cpp | 6 +- .../multiresvolume/rendering/brickmanager.h | 8 +- .../rendering/errorhistogrammanager.cpp | 6 +- .../rendering/histogrammanager.cpp | 6 +- .../rendering/localerrorhistogrammanager.cpp | 6 +- .../rendering/localtfbrickselector.cpp | 100 ++++++++++++++---- .../rendering/localtfbrickselector.h | 3 +- .../rendering/multiresvolumeraycaster.cpp | 73 ++++++++----- .../rendering/multiresvolumeraycaster.h | 11 +- .../rendering/renderablemultiresvolume.cpp | 28 ++--- .../rendering/renderablemultiresvolume.h | 22 ++-- .../rendering/shenbrickselector.cpp | 6 +- .../rendering/shenbrickselector.h | 13 +-- .../rendering/simpletfbrickselector.cpp | 10 +- .../rendering/simpletfbrickselector.h | 7 +- .../rendering/tfbrickselector.cpp | 13 ++- .../rendering/tfbrickselector.h | 8 +- modules/multiresvolume/rendering/tsp.cpp | 9 +- modules/multiresvolume/rendering/tsp.h | 3 +- .../rendering/renderablecrawlingline.cpp | 3 +- modules/newhorizons/rendering/renderablefov.h | 14 +-- .../rendering/renderablemodelprojection.cpp | 4 +- .../rendering/renderablemodelprojection.h | 17 ++- .../rendering/renderableplaneprojection.h | 16 ++- .../rendering/renderableplanetprojection.cpp | 4 +- .../rendering/renderableplanetprojection.h | 7 +- .../rendering/renderableshadowcylinder.cpp | 5 +- .../rendering/renderableshadowcylinder.h | 6 +- modules/newhorizons/util/decoder.h | 6 +- modules/newhorizons/util/hongkangparser.cpp | 4 +- modules/newhorizons/util/imagesequencer.cpp | 6 +- .../newhorizons/util/instrumentdecoder.cpp | 15 ++- .../util/instrumenttimesparser.cpp | 6 +- modules/newhorizons/util/labelparser.cpp | 6 +- modules/newhorizons/util/labelparser.h | 6 +- .../newhorizons/util/projectioncomponent.cpp | 4 +- .../newhorizons/util/projectioncomponent.h | 13 +-- modules/newhorizons/util/scannerdecoder.cpp | 6 +- modules/newhorizons/util/scannerdecoder.h | 3 +- modules/newhorizons/util/sequenceparser.cpp | 6 +- modules/newhorizons/util/targetdecoder.cpp | 13 ++- modules/onscreengui/include/gui.h | 8 +- modules/onscreengui/include/guicomponent.h | 8 +- .../include/guifilepathcomponent.h | 8 +- .../onscreengui/include/guihelpcomponent.h | 8 +- .../onscreengui/include/guiiswacomponent.h | 8 +- .../onscreengui/include/guiorigincomponent.h | 8 +- .../include/guiparallelcomponent.h | 8 +- .../include/guiperformancecomponent.h | 12 +-- .../include/guipropertycomponent.h | 13 +-- .../onscreengui/include/guitimecomponent.h | 8 +- .../onscreengui/include/renderproperties.h | 10 +- modules/onscreengui/onscreenguimodule.cpp | 4 +- modules/onscreengui/src/gui.cpp | 10 +- modules/onscreengui/src/gui_lua.inl | 12 +-- modules/onscreengui/src/guicomponent.cpp | 8 +- .../onscreengui/src/guifilepathcomponent.cpp | 9 +- modules/onscreengui/src/guihelpcomponent.cpp | 10 +- modules/onscreengui/src/guiiswacomponent.cpp | 8 +- .../onscreengui/src/guiorigincomponent.cpp | 8 +- .../onscreengui/src/guiparallelcomponent.cpp | 12 +-- .../src/guiperformancecomponent.cpp | 12 +-- .../onscreengui/src/guipropertycomponent.cpp | 41 ++++--- modules/onscreengui/src/guitimecomponent.cpp | 12 +-- modules/onscreengui/src/renderproperties.cpp | 12 ++- 160 files changed, 726 insertions(+), 908 deletions(-) diff --git a/modules/globebrowsing/cache/memoryawaretilecache.cpp b/modules/globebrowsing/cache/memoryawaretilecache.cpp index aa1aa28946..eb49e136dd 100644 --- a/modules/globebrowsing/cache/memoryawaretilecache.cpp +++ b/modules/globebrowsing/cache/memoryawaretilecache.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -35,13 +35,11 @@ #include #include -namespace openspace { -namespace globebrowsing { -namespace cache { - namespace { const char* _loggerCat = "MemoryAwareTileCache"; -} +} // namespace + +namespace openspace::globebrowsing::cache { MemoryAwareTileCache::MemoryAwareTileCache() : PropertyOwner("TileCache") @@ -309,7 +307,4 @@ bool MemoryAwareTileCache::shouldUsePbo() const { return _usePbo; } -} // namespace cache -} // namespace globebrowsing -} // namespace openspace - +} // namespace openspace::globebrowsing::cache diff --git a/modules/globebrowsing/cache/texturecontainer.cpp b/modules/globebrowsing/cache/texturecontainer.cpp index 5e7b4ccfc2..aac4858c9d 100644 --- a/modules/globebrowsing/cache/texturecontainer.cpp +++ b/modules/globebrowsing/cache/texturecontainer.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -25,9 +25,7 @@ #include #include -namespace openspace { -namespace globebrowsing { -namespace cache { +namespace openspace::globebrowsing::cache { TextureContainer::TextureContainer(TileTextureInitData initData, size_t numTextures) : _initData(initData) @@ -86,6 +84,4 @@ size_t TextureContainer::size() const { return _textures.size(); }; -} -} -} +} // namespace openspace::globebrowsing::cache diff --git a/modules/globebrowsing/chunk/chunk.cpp b/modules/globebrowsing/chunk/chunk.cpp index de665c22f7..62e088b519 100644 --- a/modules/globebrowsing/chunk/chunk.cpp +++ b/modules/globebrowsing/chunk/chunk.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,9 +32,7 @@ #include #include - -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { const float Chunk::DEFAULT_HEIGHT = 0.0f; @@ -222,5 +220,4 @@ std::vector Chunk::getBoundingPolyhedronCorners() const { return corners; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/chunk/chunklevelevaluator/distanceevaluator.cpp b/modules/globebrowsing/chunk/chunklevelevaluator/distanceevaluator.cpp index 73624a9e26..1e70b1eedf 100644 --- a/modules/globebrowsing/chunk/chunklevelevaluator/distanceevaluator.cpp +++ b/modules/globebrowsing/chunk/chunklevelevaluator/distanceevaluator.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,9 +31,7 @@ #include #include -namespace openspace { -namespace globebrowsing { -namespace chunklevelevaluator { +namespace openspace::globebrowsing::chunklevelevaluator { int Distance::getDesiredLevel(const Chunk& chunk, const RenderData& data) const { // Calculations are done in the reference frame of the globe @@ -71,6 +69,4 @@ int Distance::getDesiredLevel(const Chunk& chunk, const RenderData& data) const return desiredLevel; } -} // namespace chunklevelevaluator -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::chunklevelevaluator diff --git a/modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.cpp b/modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.cpp index 31514dc6c5..dd7613316b 100644 --- a/modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.cpp +++ b/modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,9 +31,7 @@ #include #include -namespace openspace { -namespace globebrowsing { -namespace chunklevelevaluator { +namespace openspace::globebrowsing::chunklevelevaluator { int ProjectedArea::getDesiredLevel(const Chunk& chunk, const RenderData& data) const { // Calculations are done in the reference frame of the globe @@ -125,6 +123,4 @@ int ProjectedArea::getDesiredLevel(const Chunk& chunk, const RenderData& data) c return chunk.tileIndex().level + round(scaledArea - 1); } -} // namespace chunklevelevaluator -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::chunklevelevaluator diff --git a/modules/globebrowsing/chunk/chunknode.cpp b/modules/globebrowsing/chunk/chunknode.cpp index 9b229cc54f..2ebc726e00 100644 --- a/modules/globebrowsing/chunk/chunknode.cpp +++ b/modules/globebrowsing/chunk/chunknode.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,8 +29,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { ChunkNode::ChunkNode(const Chunk& chunk, ChunkNode* parent) : _parent(parent) @@ -186,5 +185,4 @@ const Chunk& ChunkNode::getChunk() const { return _chunk; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/chunk/culling/frustumculler.cpp b/modules/globebrowsing/chunk/culling/frustumculler.cpp index 8d3c5ee849..d3f610bb7b 100644 --- a/modules/globebrowsing/chunk/culling/frustumculler.cpp +++ b/modules/globebrowsing/chunk/culling/frustumculler.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -28,9 +28,7 @@ #include #include -namespace openspace { -namespace globebrowsing { -namespace culling { +namespace openspace::globebrowsing::culling { FrustumCuller::FrustumCuller(AABB3 viewFrustum) : _viewFrustum(std::move(viewFrustum)) @@ -59,6 +57,4 @@ bool FrustumCuller::isCullable(const Chunk& chunk, const RenderData& data) { return !(_viewFrustum.intersects(bounds)); } -} // namespace culling -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::culling diff --git a/modules/globebrowsing/chunk/culling/horizonculler.cpp b/modules/globebrowsing/chunk/culling/horizonculler.cpp index c7c62a89bd..d6190d1743 100644 --- a/modules/globebrowsing/chunk/culling/horizonculler.cpp +++ b/modules/globebrowsing/chunk/culling/horizonculler.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -28,9 +28,7 @@ #include #include -namespace openspace { -namespace globebrowsing { -namespace culling { +namespace openspace::globebrowsing::culling { bool HorizonCuller::isCullable(const Chunk& chunk, const RenderData& data) { // Calculations are done in the reference frame of the globe. Hence, the camera @@ -58,13 +56,17 @@ bool HorizonCuller::isCullable(const Chunk& chunk, const RenderData& data) { // real closest point, glm::dvec3 corners[4]; corners[0] = ellipsoid.cartesianSurfacePosition( - chunk.surfacePatch().getCorner(NORTH_WEST)); + chunk.surfacePatch().getCorner(NORTH_WEST) + ); corners[1] = ellipsoid.cartesianSurfacePosition( - chunk.surfacePatch().getCorner(NORTH_EAST)); + chunk.surfacePatch().getCorner(NORTH_EAST) + ); corners[2] = ellipsoid.cartesianSurfacePosition( - chunk.surfacePatch().getCorner(SOUTH_WEST)); + chunk.surfacePatch().getCorner(SOUTH_WEST) + ); corners[3] = ellipsoid.cartesianSurfacePosition( - chunk.surfacePatch().getCorner(SOUTH_EAST)); + chunk.surfacePatch().getCorner(SOUTH_EAST) + ); for (int i = 0; i < 4; ++i) { float distance = glm::length(cameraPosition - corners[i]); @@ -100,6 +102,4 @@ bool HorizonCuller::isCullable(const glm::dvec3& cameraPosition, return distanceToObjectSquared > minimumAllowedDistanceToObjectSquared; } -} // namespace culling -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::culling diff --git a/modules/globebrowsing/geometry/ellipsoid.cpp b/modules/globebrowsing/geometry/ellipsoid.cpp index 9d51d762d2..914b0dbf55 100644 --- a/modules/globebrowsing/geometry/ellipsoid.cpp +++ b/modules/globebrowsing/geometry/ellipsoid.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,8 +27,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { Ellipsoid::Ellipsoid(glm::dvec3 radii) : _radii(radii) { updateInternalCache(); @@ -132,7 +131,7 @@ double Ellipsoid::longitudalDistance(double lat, double lon1, double lon2) const return meanRadius * std::abs(lon2 - lon1); } -double Ellipsoid::greatCircleDistance(const Geodetic2& p1, const Geodetic2& p2) const{ +double Ellipsoid::greatCircleDistance(const Geodetic2& p1, const Geodetic2& p2) const { // https://en.wikipedia.org/wiki/Meridian_arc // https://en.wikipedia.org/wiki/Great-circle_distance#Vector_version @@ -146,22 +145,19 @@ double Ellipsoid::greatCircleDistance(const Geodetic2& p1, const Geodetic2& p2) return centralAngle * glm::length(centralNormal); } -Geodetic2 Ellipsoid::cartesianToGeodetic2(const glm::dvec3& p) const -{ +Geodetic2 Ellipsoid::cartesianToGeodetic2(const glm::dvec3& p) const { glm::dvec3 normal = geodeticSurfaceNormalForGeocentricallyProjectedPoint(p); return Geodetic2( asin(normal.z / length(normal)), // Latitude atan2(normal.y, normal.x)); // Longitude } -glm::dvec3 Ellipsoid::cartesianSurfacePosition(const Geodetic2& geodetic2) const -{ +glm::dvec3 Ellipsoid::cartesianSurfacePosition(const Geodetic2& geodetic2) const { // Position on surface : height = 0 return cartesianPosition(Geodetic3({ geodetic2, 0 })); } -glm::dvec3 Ellipsoid::cartesianPosition(const Geodetic3& geodetic3) const -{ +glm::dvec3 Ellipsoid::cartesianPosition(const Geodetic3& geodetic3) const { glm::dvec3 normal = geodeticSurfaceNormal(geodetic3.geodetic2); glm::dvec3 k = _cached._radiiSquared * normal; double gamma = sqrt(dot(k, normal)); @@ -169,5 +165,4 @@ glm::dvec3 Ellipsoid::cartesianPosition(const Geodetic3& geodetic3) const return rSurface + geodetic3.height * normal; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/geometry/geodetic2.cpp b/modules/globebrowsing/geometry/geodetic2.cpp index b97d0a2e5e..20b3954d18 100644 --- a/modules/globebrowsing/geometry/geodetic2.cpp +++ b/modules/globebrowsing/geometry/geodetic2.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -24,8 +24,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { Geodetic2::Geodetic2(double latitude, double longitude) : lat(latitude) @@ -60,5 +59,4 @@ Geodetic2 Geodetic2::operator/(double scalar) const { return Geodetic2(lat / scalar, lon / scalar); } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/geometry/geodeticpatch.cpp b/modules/globebrowsing/geometry/geodeticpatch.cpp index 72f515d91b..87c187f3f6 100644 --- a/modules/globebrowsing/geometry/geodeticpatch.cpp +++ b/modules/globebrowsing/geometry/geodeticpatch.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,8 +29,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { GeodeticPatch::GeodeticPatch(double centerLat, double centerLon, double halfSizeLat, double halfSizeLon) @@ -241,5 +240,4 @@ Geodetic2 GeodeticPatch::closestPoint(const Geodetic2& p) const { return Geodetic2(clampedLat, clampedLon); } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/globebrowsingmodule_lua.inl b/modules/globebrowsing/globebrowsingmodule_lua.inl index 0ac27b6baf..5f06914f8a 100644 --- a/modules/globebrowsing/globebrowsingmodule_lua.inl +++ b/modules/globebrowsing/globebrowsingmodule_lua.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -22,7 +22,6 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ - #include #include @@ -35,12 +34,10 @@ #include #include -namespace openspace { -namespace globebrowsing { -namespace luascriptfunctions { +namespace openspace::globebrowsing::luascriptfunctions { /** - Adds a layer to the specified globe. + *Adds a layer to the specified globe. */ int addLayer(lua_State* L) { using ghoul::lua::errorLocation; @@ -176,7 +173,4 @@ int goToGeo(lua_State* L) { return 0; } - -} // namespace luascriptfunctions -} // nameapace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::luascriptfunctions diff --git a/modules/globebrowsing/globes/chunkedlodglobe.cpp b/modules/globebrowsing/globes/chunkedlodglobe.cpp index 60de75ff00..52687802a7 100644 --- a/modules/globebrowsing/globes/chunkedlodglobe.cpp +++ b/modules/globebrowsing/globes/chunkedlodglobe.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -49,8 +49,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { const TileIndex ChunkedLodGlobe::LEFT_HEMISPHERE_INDEX = TileIndex(0, 0, 1); const TileIndex ChunkedLodGlobe::RIGHT_HEMISPHERE_INDEX = TileIndex(1, 0, 1); @@ -190,8 +189,8 @@ float ChunkedLodGlobe::getHeight(glm::dvec3 position) const { return 0; } - ghoul::opengl::Texture* tileTexture = tile.texture(); - if (!tileTexture) { + ghoul::opengl::Texture* tileTexture = tile.texture(); + if (!tileTexture) { return 0; } @@ -361,5 +360,4 @@ void ChunkedLodGlobe::update(const UpdateData& data) { _renderer->update(); } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/globes/pointglobe.cpp b/modules/globebrowsing/globes/pointglobe.cpp index 110571ae35..a177fdf06c 100644 --- a/modules/globebrowsing/globes/pointglobe.cpp +++ b/modules/globebrowsing/globes/pointglobe.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -33,8 +33,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { PointGlobe::PointGlobe(const RenderableGlobe& owner) : _owner(owner) @@ -69,7 +68,7 @@ bool PointGlobe::initialize() { glBindVertexArray(_vaoID); - std::array quadVertexData = {{ + std::array quadVertexData = {{ glm::vec2(-1.0f, -1.0f), glm::vec2(1.0f, -1.0f), glm::vec2(-1.0f, 1.0f), @@ -162,5 +161,4 @@ void PointGlobe::render(const RenderData& data) { _programObject->deactivate(); } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/globes/renderableglobe.cpp b/modules/globebrowsing/globes/renderableglobe.cpp index 6b61e0f7d0..25a82bea81 100644 --- a/modules/globebrowsing/globes/renderableglobe.cpp +++ b/modules/globebrowsing/globes/renderableglobe.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -34,14 +34,12 @@ namespace { const char* keyRadii = "Radii"; const char* keySegmentsPerPatch = "SegmentsPerPatch"; const char* keyLayers = "Layers"; -} +} // namespace -namespace openspace { +using namespace openspace::properties; -using namespace properties; +namespace openspace::globebrowsing { -namespace globebrowsing { - RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) : _debugProperties({ BoolProperty("saveOrThrowCamera", "save or throw camera", false), @@ -284,5 +282,4 @@ void RenderableGlobe::setSaveCamera(std::shared_ptr camera) { _savedCamera = camera; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/meshes/grid.cpp b/modules/globebrowsing/meshes/grid.cpp index 69a800ddd8..a187f32920 100644 --- a/modules/globebrowsing/meshes/grid.cpp +++ b/modules/globebrowsing/meshes/grid.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -24,8 +24,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { Grid::Grid(int xSegments, int ySegments) : _xSegments(xSegments) @@ -36,5 +35,4 @@ TriangleSoup& Grid::geometry() { return *_geometry; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/meshes/skirtedgrid.cpp b/modules/globebrowsing/meshes/skirtedgrid.cpp index d0211c3675..3ce0d29ecd 100644 --- a/modules/globebrowsing/meshes/skirtedgrid.cpp +++ b/modules/globebrowsing/meshes/skirtedgrid.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -26,8 +26,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { SkirtedGrid::SkirtedGrid(unsigned int xSegments, unsigned int ySegments, TriangleSoup::Positions usePositions, @@ -172,5 +171,4 @@ std::vector SkirtedGrid::createNormals(int xSegments, int ySegments) return normals; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/meshes/trianglesoup.cpp b/modules/globebrowsing/meshes/trianglesoup.cpp index 897dd3027d..c5f652e76b 100644 --- a/modules/globebrowsing/meshes/trianglesoup.cpp +++ b/modules/globebrowsing/meshes/trianglesoup.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,11 +27,10 @@ #include namespace { - const std::string _loggerCat = "TriangleSoup"; + const char* _loggerCat = "TriangleSoup"; } -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { TriangleSoup::TriangleSoup(std::vector elements, Positions usePositions, TextureCoordinates useTextures, Normals useNormals) @@ -170,5 +169,4 @@ void TriangleSoup::drawUsingActiveProgram() { glBindVertexArray(0); } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/other/distanceswitch.cpp b/modules/globebrowsing/other/distanceswitch.cpp index aeb95de079..448965785f 100644 --- a/modules/globebrowsing/other/distanceswitch.cpp +++ b/modules/globebrowsing/other/distanceswitch.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -26,8 +26,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { DistanceSwitch::~DistanceSwitch() {} @@ -73,5 +72,4 @@ void DistanceSwitch::addSwitchValue(std::shared_ptr renderable) { _renderables.push_back(renderable); } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/other/pixelbuffer.cpp b/modules/globebrowsing/other/pixelbuffer.cpp index 22b8264a48..9242b7e413 100644 --- a/modules/globebrowsing/other/pixelbuffer.cpp +++ b/modules/globebrowsing/other/pixelbuffer.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,9 +27,9 @@ namespace { const char* _loggerCat = "PixelBuffer"; -}; +} // namespace -using namespace openspace::globebrowsing; +namespace openspace::globebrowsing { PixelBuffer::PixelBuffer(size_t numBytes, Usage usage) : _numBytes(numBytes) @@ -82,3 +82,5 @@ bool PixelBuffer::isMapped() const { PixelBuffer::operator GLuint() const { return _id; } + +} // namespace openspace::globebrowsing \ No newline at end of file diff --git a/modules/globebrowsing/other/statscollector.cpp b/modules/globebrowsing/other/statscollector.cpp index 21bd3168a1..c729b31de9 100644 --- a/modules/globebrowsing/other/statscollector.cpp +++ b/modules/globebrowsing/other/statscollector.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -28,8 +28,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { StatsCollector::StatsCollector(const std::string& filename, int dumpEveryXRecord, Enabled enabled, const std::string & delimiter) @@ -118,5 +117,4 @@ void StatsCollector::writeData() { ofs.close(); } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/other/threadpool.cpp b/modules/globebrowsing/other/threadpool.cpp index a5a6fb718a..7f0e5b4299 100644 --- a/modules/globebrowsing/other/threadpool.cpp +++ b/modules/globebrowsing/other/threadpool.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -24,12 +24,9 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { -Worker::Worker(ThreadPool& pool) - : pool(pool) -{} +Worker::Worker(ThreadPool& pool) : pool(pool) {} void Worker::operator()() { std::function task; @@ -106,5 +103,4 @@ void ThreadPool::clearTasks() { } // release lock } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/rendering/chunkrenderer.cpp b/modules/globebrowsing/rendering/chunkrenderer.cpp index f5c931878b..05c0979289 100644 --- a/modules/globebrowsing/rendering/chunkrenderer.cpp +++ b/modules/globebrowsing/rendering/chunkrenderer.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -33,8 +33,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { ChunkRenderer::ChunkRenderer(std::shared_ptr grid, std::shared_ptr layerManager) @@ -336,5 +335,4 @@ void ChunkRenderer::renderChunkLocally(const Chunk& chunk, const RenderData& dat programObject->deactivate(); } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace:;globebrowsing diff --git a/modules/globebrowsing/rendering/gpu/gpuchunktile.cpp b/modules/globebrowsing/rendering/gpu/gpuchunktile.cpp index 9efcdd9f74..c70d29b08c 100644 --- a/modules/globebrowsing/rendering/gpu/gpuchunktile.cpp +++ b/modules/globebrowsing/rendering/gpu/gpuchunktile.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,8 +27,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { void GPUChunkTile::setValue(ghoul::opengl::ProgramObject* programObject, const ChunkTile& chunkTile) @@ -48,5 +47,4 @@ void GPUChunkTile::deactivate() { gpuTexture.deactivate(); } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/rendering/gpu/gpuchunktilepile.cpp b/modules/globebrowsing/rendering/gpu/gpuchunktilepile.cpp index a07cd46857..fc91d01d65 100644 --- a/modules/globebrowsing/rendering/gpu/gpuchunktilepile.cpp +++ b/modules/globebrowsing/rendering/gpu/gpuchunktilepile.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -24,9 +24,7 @@ #include - -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { void GPUChunkTilePile::setValue(ghoul::opengl::ProgramObject* programObject, const ChunkTilePile& chunkTilePile) @@ -56,5 +54,4 @@ void GPUChunkTilePile::deactivate() { } } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/rendering/gpu/gpuheightlayer.cpp b/modules/globebrowsing/rendering/gpu/gpuheightlayer.cpp index ce2fa871ef..aa9127225c 100644 --- a/modules/globebrowsing/rendering/gpu/gpuheightlayer.cpp +++ b/modules/globebrowsing/rendering/gpu/gpuheightlayer.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,8 +30,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { void GPUHeightLayer::setValue(ghoul::opengl::ProgramObject* programObject, const Layer& layer, const TileIndex& tileIndex, @@ -49,5 +48,4 @@ void GPUHeightLayer::bind(ghoul::opengl::ProgramObject* programObject, const Lay } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/rendering/gpu/gpulayer.cpp b/modules/globebrowsing/rendering/gpu/gpulayer.cpp index edfeb457ef..1aa8ab92cd 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayer.cpp +++ b/modules/globebrowsing/rendering/gpu/gpulayer.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -26,8 +26,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { void GPULayer::setValue(ghoul::opengl::ProgramObject* programObject, const Layer& layer, const TileIndex& tileIndex, int pileSize) @@ -84,5 +83,4 @@ void GPULayer::deactivate() { gpuChunkTilePile.deactivate(); } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/rendering/gpu/gpulayeradjustment.cpp b/modules/globebrowsing/rendering/gpu/gpulayeradjustment.cpp index 69ff1707bb..b87796832f 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayeradjustment.cpp +++ b/modules/globebrowsing/rendering/gpu/gpulayeradjustment.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -25,8 +25,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { void GPULayerAdjustment::setValue(ghoul::opengl::ProgramObject* programObject, const LayerAdjustment& layerAdjustment) @@ -44,8 +43,9 @@ void GPULayerAdjustment::setValue(ghoul::opengl::ProgramObject* programObject, } } -void GPULayerAdjustment::bind(const LayerAdjustment& layerAdjustment, ghoul::opengl::ProgramObject* programObject, - const std::string& nameBase) +void GPULayerAdjustment::bind(const LayerAdjustment& layerAdjustment, + ghoul::opengl::ProgramObject* programObject, + const std::string& nameBase) { switch (layerAdjustment.type()) { case layergroupid::AdjustmentTypeID::None: @@ -60,5 +60,4 @@ void GPULayerAdjustment::bind(const LayerAdjustment& layerAdjustment, ghoul::ope } } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/rendering/gpu/gpulayergroup.cpp b/modules/globebrowsing/rendering/gpu/gpulayergroup.cpp index 12715dff59..dfb68c51f6 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayergroup.cpp +++ b/modules/globebrowsing/rendering/gpu/gpulayergroup.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -28,8 +28,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { void GPULayerGroup::setValue(ghoul::opengl::ProgramObject* programObject, const LayerGroup& layerGroup, const TileIndex& tileIndex) @@ -77,5 +76,4 @@ void GPULayerGroup::deactivate() { } } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/rendering/gpu/gpulayermanager.cpp b/modules/globebrowsing/rendering/gpu/gpulayermanager.cpp index b73e96bcc7..055d83a41a 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayermanager.cpp +++ b/modules/globebrowsing/rendering/gpu/gpulayermanager.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -26,8 +26,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { void GPULayerManager::setValue(ghoul::opengl::ProgramObject* programObject, const LayerManager& layerManager, @@ -62,5 +61,4 @@ void GPULayerManager::deactivate() { } } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.cpp b/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.cpp index 71824f88a5..a5634fcaf3 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.cpp +++ b/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -26,8 +26,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { void GPULayerRenderSettings::setValue(ghoul::opengl::ProgramObject* programObject, const LayerRenderSettings& layerSettings) @@ -42,7 +41,8 @@ void GPULayerRenderSettings::setValue(ghoul::opengl::ProgramObject* programObjec } } -void GPULayerRenderSettings::bind(const LayerRenderSettings& layerSettings, ghoul::opengl::ProgramObject* programObject, +void GPULayerRenderSettings::bind(const LayerRenderSettings& layerSettings, + ghoul::opengl::ProgramObject* programObject, const std::string& nameBase) { gpuOpacity.bind(programObject, nameBase + "opacity"); @@ -55,5 +55,4 @@ void GPULayerRenderSettings::bind(const LayerRenderSettings& layerSettings, ghou } } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/rendering/gpu/gputiledepthtransform.cpp b/modules/globebrowsing/rendering/gpu/gputiledepthtransform.cpp index deb14fabc7..c5b6a37d4e 100644 --- a/modules/globebrowsing/rendering/gpu/gputiledepthtransform.cpp +++ b/modules/globebrowsing/rendering/gpu/gputiledepthtransform.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -26,8 +26,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { void GPUTileDepthTransform::setValue(ghoul::opengl::ProgramObject* programObject, const TileDepthTransform& depthTransform) @@ -43,5 +42,4 @@ void GPUTileDepthTransform::bind(ghoul::opengl::ProgramObject* programObject, _gpuDepthScale.bind(programObject, nameBase + "depthScale"); } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/rendering/gpu/gputileuvtransform.cpp b/modules/globebrowsing/rendering/gpu/gputileuvtransform.cpp index 477b02b75b..4430ad34f1 100644 --- a/modules/globebrowsing/rendering/gpu/gputileuvtransform.cpp +++ b/modules/globebrowsing/rendering/gpu/gputileuvtransform.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,8 +30,7 @@ //#include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { void GPUTileUvTransform::setValue(ghoul::opengl::ProgramObject* programObject, const TileUvTransform& tileUvTransform) @@ -47,5 +46,4 @@ void GPUTileUvTransform::bind(ghoul::opengl::ProgramObject* programObject, _gpuUvScale.bind(programObject, nameBase + "uvScale"); } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/rendering/layer/layer.cpp b/modules/globebrowsing/rendering/layer/layer.cpp index d4f482ba8c..7a3849655f 100644 --- a/modules/globebrowsing/rendering/layer/layer.cpp +++ b/modules/globebrowsing/rendering/layer/layer.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -26,8 +26,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { namespace { const char* _loggerCat = "Layer"; @@ -38,7 +37,7 @@ namespace { const char* keySettings = "Settings"; const char* keyAdjustment = "Adjustment"; const char* KeyBlendMode = "BlendMode"; -} +} // namespace Layer::Layer(layergroupid::GroupID id, const ghoul::Dictionary& layerDict) : properties::PropertyOwner(layerDict.value(keyName)) @@ -322,5 +321,4 @@ void Layer::removeVisibleProperties() { } } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/rendering/layer/layeradjustment.cpp b/modules/globebrowsing/rendering/layer/layeradjustment.cpp index fad6678097..e5a724b2a5 100644 --- a/modules/globebrowsing/rendering/layer/layeradjustment.cpp +++ b/modules/globebrowsing/rendering/layer/layeradjustment.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -24,14 +24,13 @@ #include -namespace openspace { -namespace globebrowsing { - namespace { const char* keyType = "Type"; const char* keyChromaKeyColor = "ChromaKeyColor"; const char* keyChromaKeyTolerance = "ChromaKeyTolerance"; -} +} // namespace + +namespace openspace::globebrowsing { LayerAdjustment::LayerAdjustment() : properties::PropertyOwner("adjustment") @@ -130,5 +129,4 @@ void LayerAdjustment::onChange(std::function callback) { _onChangeCallback = std::move(callback); } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/rendering/layer/layergroup.cpp b/modules/globebrowsing/rendering/layer/layergroup.cpp index 7b038c8f58..b6aeec9d24 100644 --- a/modules/globebrowsing/rendering/layer/layergroup.cpp +++ b/modules/globebrowsing/rendering/layer/layergroup.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,8 +30,7 @@ namespace { const char* _loggerCat = "LayerGroup"; } -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { LayerGroup::LayerGroup(layergroupid::GroupID id) : properties::PropertyOwner(std::move(layergroupid::LAYER_GROUP_NAMES[id])) @@ -125,5 +124,4 @@ void LayerGroup::onChange(std::function callback) { } } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/rendering/layer/layermanager.cpp b/modules/globebrowsing/rendering/layer/layermanager.cpp index b2a2a98e24..10b008f199 100644 --- a/modules/globebrowsing/rendering/layer/layermanager.cpp +++ b/modules/globebrowsing/rendering/layer/layermanager.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -28,23 +28,22 @@ #include #include -namespace openspace { -namespace globebrowsing { - namespace { - const char* _loggerCat = "LayerManager"; -} + const char* _loggerCat = "LayerManager"; +} // namespace + +namespace openspace::globebrowsing { LayerManager::LayerManager(const ghoul::Dictionary& layerGroupsDict) : properties::PropertyOwner("Layers") { - // First create empty layer groups in case not all are specified + // First create empty layer groups in case not all are specified _layerGroups.resize(layergroupid::NUM_LAYER_GROUPS); for (int i = 0; i < _layerGroups.size(); ++i) { - ghoul::Dictionary emptyDict; + ghoul::Dictionary emptyDict; _layerGroups[i] = std::make_shared( - static_cast(i), emptyDict - ); + static_cast(i), emptyDict + ); } std::vector layerGroupNamesInDict = layerGroupsDict.keys(); @@ -57,8 +56,8 @@ LayerManager::LayerManager(const ghoul::Dictionary& layerGroupsDict) if (groupId != layergroupid::GroupID::Unknown) { ghoul::Dictionary layerGroupDict = layerGroupsDict.value(groupName); - _layerGroups[static_cast(groupId)] = - std::make_shared(groupId, layerGroupDict); + _layerGroups[static_cast(groupId)] = + std::make_shared(groupId, layerGroupDict); } else { LWARNING("Unknown layer group: " + groupName); @@ -170,5 +169,4 @@ void LayerManager::onChange(std::function callback) { } } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/rendering/layer/layerrendersettings.cpp b/modules/globebrowsing/rendering/layer/layerrendersettings.cpp index 8cbbd95a79..4c95df18ee 100644 --- a/modules/globebrowsing/rendering/layer/layerrendersettings.cpp +++ b/modules/globebrowsing/rendering/layer/layerrendersettings.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -24,16 +24,15 @@ #include -namespace openspace { -namespace globebrowsing { - namespace { const char* keyOpacity = "Opacity"; const char* keyGamma = "Gamma"; const char* keyMultiplier = "Multiplier"; const char* keyOffset = "Offset"; const char* keyValueBlending = "ValueBlending"; -} +} // namespace + +namespace openspace::globebrowsing { LayerRenderSettings::LayerRenderSettings() : properties::PropertyOwner("Settings") @@ -112,5 +111,4 @@ void LayerRenderSettings::setDefaultValues() { valueBlending = 1.f; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/rendering/layershadermanager.cpp b/modules/globebrowsing/rendering/layershadermanager.cpp index bf51dddfc2..d877e780ed 100644 --- a/modules/globebrowsing/rendering/layershadermanager.cpp +++ b/modules/globebrowsing/rendering/layershadermanager.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -35,8 +35,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { bool LayerShaderManager::LayerShaderPreprocessingData::LayerGroupPreprocessingData::operator==( const LayerGroupPreprocessingData& other) const { @@ -231,5 +230,4 @@ bool LayerShaderManager::updatedOnLastCall() { return _updatedOnLastCall; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/tile/pixelregion.cpp b/modules/globebrowsing/tile/pixelregion.cpp index 4375afd19a..da1179f306 100644 --- a/modules/globebrowsing/tile/pixelregion.cpp +++ b/modules/globebrowsing/tile/pixelregion.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -26,8 +26,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { PixelRegion::PixelRegion(const PixelCoordinate& pixelStart, const PixelRange& numberOfPixels) @@ -278,5 +277,4 @@ bool PixelRegion::equals(const PixelRegion& r) const { return start == r.start && numPixels == r.numPixels; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/tile/rawtile.cpp b/modules/globebrowsing/tile/rawtile.cpp index a8afc49b01..233aca184c 100644 --- a/modules/globebrowsing/tile/rawtile.cpp +++ b/modules/globebrowsing/tile/rawtile.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,8 +27,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { RawTile::RawTile() : imageData(nullptr) @@ -48,5 +47,4 @@ RawTile RawTile::createDefault(const TileTextureInitData& initData) { } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/tile/rawtiledatareader/gdalrawtiledatareader.cpp b/modules/globebrowsing/tile/rawtiledatareader/gdalrawtiledatareader.cpp index 45eaa90a8b..d5eb03d985 100644 --- a/modules/globebrowsing/tile/rawtiledatareader/gdalrawtiledatareader.cpp +++ b/modules/globebrowsing/tile/rawtiledatareader/gdalrawtiledatareader.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -21,6 +21,7 @@ * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ + #ifdef GLOBEBROWSING_USE_GDAL #include @@ -45,11 +46,10 @@ #include namespace { - const std::string _loggerCat = "GdalRawTileDataReader"; + const char* _loggerCat = "GdalRawTileDataReader"; } -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { std::ostream& operator<<(std::ostream& os, const PixelRegion& pr) { return os << pr.start.x << ", " << pr.start.y << " with size " << pr.numPixels.x << @@ -337,8 +337,8 @@ RawTile::ReadError GdalRawTileDataReader::rasterRead( dataDest += io.write.region.start.x * _initData.bytesPerPixel(); GDALRasterBand* gdalRasterBand = _dataset->GetRasterBand(rasterBand); - CPLErr readError = CE_Failure; - readError = gdalRasterBand->RasterIO( + CPLErr readError = CE_Failure; + readError = gdalRasterBand->RasterIO( GF_Read, io.read.region.start.x, // Begin read x io.read.region.start.y, // Begin read y @@ -397,7 +397,6 @@ int GdalRawTileDataReader::calculateTileLevelDifference(int minimumPixelSize) co return diff; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // GLOBEBROWSING_USE_GDAL \ No newline at end of file diff --git a/modules/globebrowsing/tile/rawtiledatareader/gdalwrapper.cpp b/modules/globebrowsing/tile/rawtiledatareader/gdalwrapper.cpp index 952dbb93f8..3438466688 100644 --- a/modules/globebrowsing/tile/rawtiledatareader/gdalwrapper.cpp +++ b/modules/globebrowsing/tile/rawtiledatareader/gdalwrapper.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -37,10 +37,9 @@ namespace { const char* _loggerCat = "GdalWrapper"; -} +} // namespace -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { void gdalErrorHandler(CPLErr eErrClass, int errNo, const char *msg) { if (GdalWrapper::ref().logGdalErrors()) { @@ -183,8 +182,6 @@ void GdalWrapper::setGdalProxyConfiguration() { } } - -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // GLOBEBROWSING_USE_GDAL diff --git a/modules/globebrowsing/tile/rawtiledatareader/iodescription.cpp b/modules/globebrowsing/tile/rawtiledatareader/iodescription.cpp index 77597f562c..ef43c8e8d7 100644 --- a/modules/globebrowsing/tile/rawtiledatareader/iodescription.cpp +++ b/modules/globebrowsing/tile/rawtiledatareader/iodescription.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -26,8 +26,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { IODescription IODescription::cut(PixelRegion::Side side, int pos) { PixelRegion readPreCut = read.region; @@ -62,5 +61,4 @@ IODescription IODescription::cut(PixelRegion::Side side, int pos) { return whatCameOff; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/tile/rawtiledatareader/rawtiledatareader.cpp b/modules/globebrowsing/tile/rawtiledatareader/rawtiledatareader.cpp index b88fb167ed..1f56e127c8 100644 --- a/modules/globebrowsing/tile/rawtiledatareader/rawtiledatareader.cpp +++ b/modules/globebrowsing/tile/rawtiledatareader/rawtiledatareader.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -53,8 +53,7 @@ #define _USE_MATH_DEFINES #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { const PixelRegion RawTileDataReader::padding = PixelRegion( TileTextureInitData::tilePixelStartOffset, @@ -410,5 +409,4 @@ RawTile::ReadError RawTileDataReader::postProcessErrorCheck( return RawTile::ReadError::None; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/tile/rawtiledatareader/simplerawtiledatareader.cpp b/modules/globebrowsing/tile/rawtiledatareader/simplerawtiledatareader.cpp index e0d4d72ac7..99c3154a3c 100644 --- a/modules/globebrowsing/tile/rawtiledatareader/simplerawtiledatareader.cpp +++ b/modules/globebrowsing/tile/rawtiledatareader/simplerawtiledatareader.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -38,11 +38,10 @@ #include namespace { - const std::string _loggerCat = "SimpleRawTileDataReader"; -} + const char* _loggerCat = "SimpleRawTileDataReader"; +} // namespace -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { SimpleRawTileDataReader::SimpleRawTileDataReader(const std::string& filePath, const TileTextureInitData& initData, @@ -160,5 +159,4 @@ RawTile::ReadError SimpleRawTileDataReader::rasterRead( } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/tile/rawtiledatareader/tiledatatype.cpp b/modules/globebrowsing/tile/rawtiledatareader/tiledatatype.cpp index 4278175d9b..4d46b6a021 100644 --- a/modules/globebrowsing/tile/rawtiledatareader/tiledatatype.cpp +++ b/modules/globebrowsing/tile/rawtiledatareader/tiledatatype.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -42,11 +42,9 @@ namespace { const char* _loggerCat = "TileDataType"; -} +} // namespace -namespace openspace { -namespace globebrowsing { -namespace tiledatatype { +namespace openspace::globebrowsing::tiledatatype { #ifdef GLOBEBROWSING_USE_GDAL @@ -618,6 +616,4 @@ GLenum glTextureFormat(GLenum glType, ghoul::opengl::Texture::Format format) { } } -} // namespace tiledatatype -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::tiledatatype diff --git a/modules/globebrowsing/tile/tile.cpp b/modules/globebrowsing/tile/tile.cpp index dc851ef376..591df20ec9 100644 --- a/modules/globebrowsing/tile/tile.cpp +++ b/modules/globebrowsing/tile/tile.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -28,11 +28,10 @@ #include namespace { - const std::string _loggerCat = "Tile"; -} + const char* _loggerCat = "Tile"; +} // namespace -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { const Tile Tile::TileUnavailable = Tile(nullptr, nullptr, Tile::Status::Unavailable); @@ -65,5 +64,4 @@ glm::vec2 Tile::TileUvToTextureSamplePosition(const TileUvTransform& uvTransform return uv; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/tile/tileindex.cpp b/modules/globebrowsing/tile/tileindex.cpp index c6fb3147d6..f4cdc380f7 100644 --- a/modules/globebrowsing/tile/tileindex.cpp +++ b/modules/globebrowsing/tile/tileindex.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -34,10 +34,9 @@ namespace { const char* KeyLevel = "Level"; const char* KeyX = "X"; const char* KeyY = "Y"; -} +} // namespace -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { TileIndex::TileIndex(int x, int y, int level) : x(x), y(y), level(level) @@ -154,5 +153,4 @@ std::ostream& operator<<(std::ostream& os, const TileIndex& ci) { return os; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/tile/tileloadjob.cpp b/modules/globebrowsing/tile/tileloadjob.cpp index 3fe11ae7e1..52f6ff79b7 100644 --- a/modules/globebrowsing/tile/tileloadjob.cpp +++ b/modules/globebrowsing/tile/tileloadjob.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -26,8 +26,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { TileLoadJob::TileLoadJob(std::shared_ptr rawTileDataReader, const TileIndex& tileIndex) @@ -75,5 +74,4 @@ bool TileLoadJob::hasOwnershipOfData() const { return _hasOwnershipOfData; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/tile/tilemetadata.cpp b/modules/globebrowsing/tile/tilemetadata.cpp index 2b7e20d9eb..7690628aec 100644 --- a/modules/globebrowsing/tile/tilemetadata.cpp +++ b/modules/globebrowsing/tile/tilemetadata.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -24,8 +24,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { void TileMetaData::serialize(std::ostream& os) { os << maxValues.size() << std::endl; @@ -54,5 +53,4 @@ TileMetaData TileMetaData::deserialize(std::istream& is) { return res; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/tile/tileprovider/defaulttileprovider.cpp b/modules/globebrowsing/tile/tileprovider/defaulttileprovider.cpp index e7343007f0..41dea738d0 100644 --- a/modules/globebrowsing/tile/tileprovider/defaulttileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/defaulttileprovider.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -51,9 +51,7 @@ namespace { const char* KeyPreCacheLevel = "PreCacheLevel"; } -namespace openspace { -namespace globebrowsing { -namespace tileprovider { +namespace openspace::globebrowsing::tileprovider { DefaultTileProvider::DefaultTileProvider(const ghoul::Dictionary& dictionary) : TileProvider(dictionary) @@ -249,6 +247,4 @@ TileDepthTransform DefaultTileProvider::depthTransform() { } } -} // namespace tileprovider -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::tileprovider diff --git a/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp b/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp index 38efce4ba6..417eccd0a3 100644 --- a/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/singleimageprovider.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,11 +30,9 @@ namespace { const char* KeyFilePath = "FilePath"; -} +} // namespace -namespace openspace { -namespace globebrowsing { -namespace tileprovider { +namespace openspace::globebrowsing::tileprovider { SingleImageProvider::SingleImageProvider(const ghoul::Dictionary& dictionary) : _tile(nullptr, nullptr, Tile::Status::Unavailable) @@ -98,6 +96,4 @@ int SingleImageProvider::maxLevel() { return 1337; // unlimited } -} // namespace tileprovider -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::tileprovider diff --git a/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.cpp b/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.cpp index 39f735b8da..570b884437 100644 --- a/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -36,21 +36,16 @@ #include #include -using namespace ghoul::fontrendering; - -namespace openspace { -namespace globebrowsing { -namespace tileprovider { - namespace { const char* KeyRadii = "Radii"; -} +} // namespace + +namespace openspace::globebrowsing::tileprovider { SizeReferenceTileProvider::SizeReferenceTileProvider(const ghoul::Dictionary& dictionary) : TextTileProvider(LayerManager::getTileTextureInitData(layergroupid::GroupID::ColorLayers)) , _backgroundTile(Tile::TileUnavailable) { - _fontSize = 50; _font = OsEng.fontManager().font("Mono", _fontSize); @@ -114,6 +109,4 @@ TileIndex::TileHashKey SizeReferenceTileProvider::toHash(const TileIndex& tileIn return key; } -} // namespace tileprovider -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::tileprovider diff --git a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp index 1c3666e0eb..90498473a7 100644 --- a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -36,17 +36,15 @@ #include namespace { - const std::string _loggerCat = "TemporalTileProvider"; + const char* _loggerCat = "TemporalTileProvider"; const char* KeyFilePath = "FilePath"; const char* KeyBasePath = "BasePath"; const char* KeyPreCacheStartTime = "PreCacheStartTime"; const char* KeyPreCacheEndTime = "PreCacheEndTime"; -} +} // namespace -namespace openspace { -namespace globebrowsing { -namespace tileprovider { +namespace openspace::globebrowsing::tileprovider { const char* TemporalTileProvider::URL_TIME_PLACEHOLDER("${OpenSpaceTimeId}"); @@ -284,7 +282,7 @@ std::shared_ptr TemporalTileProvider::getTileProvider(const Time& std::shared_ptr TemporalTileProvider::getTileProvider( const TimeKey& timekey) { - std::unordered_map>::iterator it = _tileProviderMap.find(timekey); + std::unordered_map>::iterator it = _tileProviderMap.find(timekey); if (it != _tileProviderMap.end()) { return it->second; } @@ -481,8 +479,6 @@ std::vector