From 6a198c5d93b8d75cc56e3e2047255945eb747d78 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 14 Jul 2017 14:21:01 -0400 Subject: [PATCH 01/44] Started some warning cleanup --- .../openspace/interaction/orbitalnavigator.h | 2 +- include/openspace/rendering/abufferrenderer.h | 2 +- modules/base/rendering/renderableplane.cpp | 2 +- modules/base/rendering/renderablesphere.cpp | 2 +- .../rendering/renderabledebugplane.cpp | 2 +- modules/galaxy/rendering/galaxyraycaster.h | 2 +- modules/galaxy/rendering/renderablegalaxy.cpp | 2 -- .../cache/memoryawaretilecache.cpp | 9 ++++--- modules/globebrowsing/chunk/chunk.cpp | 2 +- modules/globebrowsing/globebrowsingmodule.h | 11 ++++---- modules/globebrowsing/globes/pointglobe.cpp | 16 ++++++------ .../tile/rawtiledatareader/tiledatatype.cpp | 7 ++++- .../sizereferencetileprovider.cpp | 2 +- .../kameleonvolume/kameleonvolumereader.cpp | 6 ++--- .../rendering/kameleonvolumeraycaster.cpp | 2 +- .../rendering/renderablekameleonvolume.cpp | 7 ++--- .../multiresvolume/rendering/atlasmanager.cpp | 6 ++--- .../rendering/localtfbrickselector.cpp | 16 ++++++------ .../rendering/multiresvolumeraycaster.h | 2 +- .../rendering/renderablemultiresvolume.cpp | 6 ++--- .../rendering/simpletfbrickselector.cpp | 19 ++++++++------ .../rendering/tfbrickselector.cpp | 14 +++++----- modules/multiresvolume/rendering/tsp.cpp | 2 +- .../rendering/renderableplanetprojection.cpp | 2 +- modules/touch/src/TouchInteraction.cpp | 26 +++++++++++-------- modules/touch/src/TouchMarker.cpp | 12 ++++----- modules/touch/touchmodule.cpp | 2 +- .../rendering/renderabletoyvolume.cpp | 13 +++++----- src/interaction/luaconsole.cpp | 6 ++--- src/properties/vector/bvec2property.cpp | 10 ------- 30 files changed, 109 insertions(+), 103 deletions(-) diff --git a/include/openspace/interaction/orbitalnavigator.h b/include/openspace/interaction/orbitalnavigator.h index bdd97f39ba..6ef2a95e42 100644 --- a/include/openspace/interaction/orbitalnavigator.h +++ b/include/openspace/interaction/orbitalnavigator.h @@ -41,7 +41,7 @@ namespace openspace { class SceneGraphNode; class Camera; -class SurfacePositionHandle; +struct SurfacePositionHandle; namespace interaction { diff --git a/include/openspace/rendering/abufferrenderer.h b/include/openspace/rendering/abufferrenderer.h index 2a3fc3a8fd..4480600e31 100644 --- a/include/openspace/rendering/abufferrenderer.h +++ b/include/openspace/rendering/abufferrenderer.h @@ -77,13 +77,13 @@ public: void update(); void render(float blackoutFactor, bool doPerformanceMeasurements) override; - /** * Update render data * Responsible for calling renderEngine::setRenderData */ virtual void updateRendererData() override; virtual void raycastersChanged(VolumeRaycaster& raycaster, bool attached) override; + private: void clear(); diff --git a/modules/base/rendering/renderableplane.cpp b/modules/base/rendering/renderableplane.cpp index 1398d290b2..ad80ed2699 100644 --- a/modules/base/rendering/renderableplane.cpp +++ b/modules/base/rendering/renderableplane.cpp @@ -104,7 +104,7 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary) "RenderablePlane" ); - _size = dictionary.value(KeySize); + _size = static_cast(dictionary.value(KeySize)); if (dictionary.hasKey(KeyBillboard)) { _billboard = dictionary.value(KeyBillboard); diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp index 25ca8c0494..cbb1b53ecd 100644 --- a/modules/base/rendering/renderablesphere.cpp +++ b/modules/base/rendering/renderablesphere.cpp @@ -108,7 +108,7 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary) "RenderableSphere" ); - _size = dictionary.value(KeySize); + _size = static_cast(dictionary.value(KeySize)); _segments = static_cast(dictionary.value(KeySegments)); _texturePath = absPath(dictionary.value(KeyTexture)); diff --git a/modules/debugging/rendering/renderabledebugplane.cpp b/modules/debugging/rendering/renderabledebugplane.cpp index 53278c1c42..d0acd3216b 100644 --- a/modules/debugging/rendering/renderabledebugplane.cpp +++ b/modules/debugging/rendering/renderabledebugplane.cpp @@ -49,7 +49,7 @@ RenderableDebugPlane::RenderableDebugPlane(const ghoul::Dictionary& dictionary) : Renderable(dictionary) , _texture("texture", "Texture", -1, -1, 255) , _billboard("billboard", "Billboard", false) - , _size("size", "Size", 10, 0, std::pow(10, 25)) + , _size("size", "Size", 10.f, 0.f, std::pow(10.f, 25.f)) , _origin(Origin::Center) , _shader(nullptr) , _quad(0) diff --git a/modules/galaxy/rendering/galaxyraycaster.h b/modules/galaxy/rendering/galaxyraycaster.h index b65e08eff6..8ac51b9579 100644 --- a/modules/galaxy/rendering/galaxyraycaster.h +++ b/modules/galaxy/rendering/galaxyraycaster.h @@ -45,7 +45,7 @@ namespace ghoul { namespace openspace { struct RenderData; -class RaycastData; +struct RaycastData; class GalaxyRaycaster : public VolumeRaycaster { public: diff --git a/modules/galaxy/rendering/renderablegalaxy.cpp b/modules/galaxy/rendering/renderablegalaxy.cpp index 2d7cd49bd2..9146885392 100644 --- a/modules/galaxy/rendering/renderablegalaxy.cpp +++ b/modules/galaxy/rendering/renderablegalaxy.cpp @@ -186,8 +186,6 @@ bool RenderableGalaxy::initialize() { float maxdist = 0; - - float x, y, z, r, g, b, a; for (size_t i = 0; i < _nPoints; ++i) { float x = pointData[i * 7 + 0]; float y = pointData[i * 7 + 1]; diff --git a/modules/globebrowsing/cache/memoryawaretilecache.cpp b/modules/globebrowsing/cache/memoryawaretilecache.cpp index 98f439f700..aa1aa28946 100644 --- a/modules/globebrowsing/cache/memoryawaretilecache.cpp +++ b/modules/globebrowsing/cache/memoryawaretilecache.cpp @@ -80,11 +80,14 @@ MemoryAwareTileCache::MemoryAwareTileCache() setSizeEstimated(_tileCacheSize * 1024 * 1024); }); _cpuAllocatedTileData.setMaxValue( - CpuCap.installedMainMemory() * 0.25); + static_cast(CpuCap.installedMainMemory() * 0.25) + ); _gpuAllocatedTileData.setMaxValue( - CpuCap.installedMainMemory() * 0.25); + static_cast(CpuCap.installedMainMemory() * 0.25) + ); _tileCacheSize.setMaxValue( - CpuCap.installedMainMemory() * 0.25); + static_cast(CpuCap.installedMainMemory() * 0.25) + ); setSizeEstimated(_tileCacheSize * 1024 * 1024); diff --git a/modules/globebrowsing/chunk/chunk.cpp b/modules/globebrowsing/chunk/chunk.cpp index dca2d4697d..de665c22f7 100644 --- a/modules/globebrowsing/chunk/chunk.cpp +++ b/modules/globebrowsing/chunk/chunk.cpp @@ -64,7 +64,7 @@ bool Chunk::isVisible() const { Chunk::Status Chunk::update(const RenderData& data) { const auto& savedCamera = _owner.savedCamera(); const Camera& camRef = savedCamera != nullptr ? *savedCamera : data.camera; - RenderData myRenderData = { camRef, data.position, data.doPerformanceMeasurement, data.doPerformanceMeasurement, data.renderBinMask, data.modelTransform }; + RenderData myRenderData = { camRef, data.position, data.time, data.doPerformanceMeasurement, data.renderBinMask, data.modelTransform }; _isVisible = true; if (_owner.chunkedLodGlobe()->testIfCullable(*this, myRenderData)) { diff --git a/modules/globebrowsing/globebrowsingmodule.h b/modules/globebrowsing/globebrowsingmodule.h index 2faad330ef..37bf355a43 100644 --- a/modules/globebrowsing/globebrowsingmodule.h +++ b/modules/globebrowsing/globebrowsingmodule.h @@ -30,12 +30,13 @@ #include namespace openspace { - class Camera; +class Camera; + namespace globebrowsing { - class RenderableGlobe; - class TileIndex; - class Geodetic2; - class Geodetic3; +class RenderableGlobe; +class TileIndex; +struct Geodetic2; +struct Geodetic3; namespace cache { class MemoryAwareTileCache; diff --git a/modules/globebrowsing/globes/pointglobe.cpp b/modules/globebrowsing/globes/pointglobe.cpp index f1cc79a4c3..39addc5fe0 100644 --- a/modules/globebrowsing/globes/pointglobe.cpp +++ b/modules/globebrowsing/globes/pointglobe.cpp @@ -69,14 +69,14 @@ bool PointGlobe::initialize() { glBindVertexArray(_vaoID); - std::array quadVertexData = { - glm::vec2(-1.0f, -1.0f), - glm::vec2(1.0f, -1.0f), - glm::vec2(-1.0f, 1.0f), - glm::vec2(-1.0f, 1.0f), - glm::vec2(1.0f, -1.0f), - glm::vec2(1.0f, 1.0f) - }; + std::array quadVertexData = { + glm::vec2(-1.0f, -1.0f), + glm::vec2(1.0f, -1.0f), + glm::vec2(-1.0f, 1.0f), + glm::vec2(-1.0f, 1.0f), + glm::vec2(1.0f, -1.0f), + glm::vec2(1.0f, 1.0f) + }; // Vertex buffer glBindBuffer(GL_ARRAY_BUFFER, _vertexBufferID); diff --git a/modules/globebrowsing/tile/rawtiledatareader/tiledatatype.cpp b/modules/globebrowsing/tile/rawtiledatareader/tiledatatype.cpp index 03a08c4ed0..662c4c5c58 100644 --- a/modules/globebrowsing/tile/rawtiledatareader/tiledatatype.cpp +++ b/modules/globebrowsing/tile/rawtiledatareader/tiledatatype.cpp @@ -415,7 +415,9 @@ size_t numberOfRasters(ghoul::opengl::Texture::Format format) { case ghoul::opengl::Texture::Format::BGR: return 3; case ghoul::opengl::Texture::Format::RGBA:; // Intentional fallthrough case ghoul::opengl::Texture::Format::BGRA: return 4; - default: ghoul_assert(false, "Unknown format"); + default: + ghoul_assert(false, "Unknown format"); + return size_t(-1); } } @@ -432,6 +434,7 @@ size_t numberOfBytes(GLenum glType) { case GL_DOUBLE: return sizeof(GLdouble); default: ghoul_assert(false, "Unknown data type"); + return size_t(-1); } } @@ -449,6 +452,7 @@ size_t getMaximumValue(GLenum glType) { return 1 << 31; default: ghoul_assert(false, "Unknown data type"); + return size_t(-1); } } @@ -472,6 +476,7 @@ float interpretFloat(GLenum glType, const char* src) { return static_cast(*reinterpret_cast(src)); default: ghoul_assert(false, "Unknown data type"); + return 0.f; } } diff --git a/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.cpp b/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.cpp index fb12db848a..39f735b8da 100644 --- a/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.cpp @@ -50,7 +50,7 @@ SizeReferenceTileProvider::SizeReferenceTileProvider(const ghoul::Dictionary& di : TextTileProvider(LayerManager::getTileTextureInitData(layergroupid::GroupID::ColorLayers)) , _backgroundTile(Tile::TileUnavailable) { - + _fontSize = 50; _font = OsEng.fontManager().font("Mono", _fontSize); diff --git a/modules/kameleonvolume/kameleonvolumereader.cpp b/modules/kameleonvolume/kameleonvolumereader.cpp index 8b3a13bc82..a30af2e63a 100644 --- a/modules/kameleonvolume/kameleonvolumereader.cpp +++ b/modules/kameleonvolume/kameleonvolumereader.cpp @@ -113,9 +113,9 @@ std::vector KameleonVolumeReader::gridVariableNames() const { std::string y = tokens.at(1); std::string z = tokens.at(2); - std::transform(x.begin(), x.end(), x.begin(), ::tolower); - std::transform(y.begin(), y.end(), y.begin(), ::tolower); - std::transform(z.begin(), z.end(), z.begin(), ::tolower); + std::transform(x.begin(), x.end(), x.begin(), tolower); + std::transform(y.begin(), y.end(), y.begin(), tolower); + std::transform(z.begin(), z.end(), z.begin(), tolower); return std::vector{x, y, z}; } diff --git a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp index 10957bcb67..925ad77ba5 100644 --- a/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp +++ b/modules/kameleonvolume/rendering/kameleonvolumeraycaster.cpp @@ -121,7 +121,7 @@ void KameleonVolumeRaycaster::preRaycast(const RaycastData& data, ghoul::opengl: std::vector clipNormals = _clipPlanes->normals(); std::vector clipOffsets = _clipPlanes->offsets(); - int nClips = clipNormals.size(); + int nClips = static_cast(clipNormals.size()); program.setUniform("nClips_" + id, nClips); program.setUniform("clipNormals_" + id, clipNormals.data(), nClips); diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index 53db2037e8..8df390c4ba 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -72,8 +72,8 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict , _upperDomainBound("upperDomainBound", "Upper Domain Bound") , _domainScale("domainScale", "Domain scale") , _autoDomainBounds(false) - , _lowerValueBound("lowerValueBound", "Lower Value Bound", 0.0, 0.0, 1) - , _upperValueBound("upperValueBound", "Upper Value Bound", 1, 0.01, 1) + , _lowerValueBound("lowerValueBound", "Lower Value Bound", 0.f, 0.f, 1.f) + , _upperValueBound("upperValueBound", "Upper Value Bound", 1.f, 0.01f, 1.f) , _autoValueBounds(false) , _gridType("gridType", "Grid Type", properties::OptionProperty::DisplayType::Dropdown) , _autoGridType(false) @@ -83,7 +83,8 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict , _transferFunctionPath("transferFunctionPath", "Transfer Function Path") , _raycaster(nullptr) , _transferFunction(nullptr) - , _cache("cache", "Cache") { + , _cache("cache", "Cache") +{ glm::vec3 dimensions; if (dictionary.getValue(KeyDimensions, dimensions)) { diff --git a/modules/multiresvolume/rendering/atlasmanager.cpp b/modules/multiresvolume/rendering/atlasmanager.cpp index 761ab98184..8c65684332 100644 --- a/modules/multiresvolume/rendering/atlasmanager.cpp +++ b/modules/multiresvolume/rendering/atlasmanager.cpp @@ -91,10 +91,10 @@ unsigned int AtlasManager::atlasMapBuffer() { } void AtlasManager::updateAtlas(BUFFER_INDEX bufferIndex, std::vector& brickIndices) { - int nBrickIndices = brickIndices.size(); + size_t nBrickIndices = brickIndices.size(); _requiredBricks.clear(); - for (int i = 0; i < nBrickIndices; i++) { + for (size_t i = 0; i < nBrickIndices; i++) { _requiredBricks.insert(brickIndices[i]); } @@ -105,7 +105,7 @@ void AtlasManager::updateAtlas(BUFFER_INDEX bufferIndex, std::vector& brick } // Stats - _nUsedBricks = _requiredBricks.size(); + _nUsedBricks = static_cast(_requiredBricks.size()); _nStreamedBricks = 0; _nDiskReads = 0; diff --git a/modules/multiresvolume/rendering/localtfbrickselector.cpp b/modules/multiresvolume/rendering/localtfbrickselector.cpp index b20c1c7a48..656a9f88bd 100644 --- a/modules/multiresvolume/rendering/localtfbrickselector.cpp +++ b/modules/multiresvolume/rendering/localtfbrickselector.cpp @@ -98,7 +98,7 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) // On average on the whole time period, splitting this spatial brick in two time steps // would generate twice as much streaming. Current number of streams of this spatial brick // is 2^nTemporalSplits over the whole time period. - int newStreams = std::pow(2, bs.nTemporalSplits); + int newStreams = static_cast(std::pow(2, bs.nTemporalSplits)); if (nStreamedBricks + newStreams > totalStreamingBudget) { // Reached dead end (streaming budget would be exceeded) deadEnds.push_back(bs); @@ -129,7 +129,7 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) // On average on the whole time period, splitting this spatial brick into eight spatial bricks // would generate eight times as much streaming. Current number of streams of this spatial brick // is 2^nTemporalStreams over the whole time period. - int newStreams = 7*std::pow(2, bs.nTemporalSplits); + int newStreams = 7 * static_cast(std::pow(2, bs.nTemporalSplits)); if (nStreamedBricks + newStreams > totalStreamingBudget) { // Reached dead end (streaming budget would be exceeded) // However, temporal split might be possible @@ -186,7 +186,7 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) temporalSplitQueue.pop_back(); unsigned int brickIndex = bs.brickIndex; - int newStreams = std::pow(2, bs.nTemporalSplits); + int newStreams = static_cast(std::pow(2, bs.nTemporalSplits)); if (nStreamedBricks + newStreams > totalStreamingBudget) { // The current best choice would make us exceed the streaming budget, try next instead. deadEnds.push_back(bs); @@ -242,14 +242,14 @@ float LocalTfBrickSelector::temporalSplitPoints(unsigned int brickIndex) { if (_tsp->isBstLeaf(brickIndex)) { return -1; } - return _brickErrors[brickIndex].temporal * 0.5; + return _brickErrors[brickIndex].temporal * 0.5f; } float LocalTfBrickSelector::spatialSplitPoints(unsigned int brickIndex) { if (_tsp->isOctreeLeaf(brickIndex)) { return -1; } - return _brickErrors[brickIndex].spatial * 0.125; + return _brickErrors[brickIndex].spatial * 0.125f; } float LocalTfBrickSelector::splitPoints(unsigned int brickIndex, BrickSelection::SplitType& splitType) { @@ -285,7 +285,7 @@ bool LocalTfBrickSelector::calculateBrickErrors() { glm::vec4 nextRgba = tf->sample(offset + 1); float colorDifference = glm::distance(prevRgba, nextRgba); - float alpha = (prevRgba.w + nextRgba.w) * 0.5; + float alpha = (prevRgba.w + nextRgba.w) * 0.5f; gradients[offset] = colorDifference*alpha; } @@ -300,7 +300,7 @@ bool LocalTfBrickSelector::calculateBrickErrors() { const Histogram* histogram = _histogramManager->getSpatialHistogram(brickIndex); float error = 0; for (int i = 0; i < gradients.size(); i++) { - float x = (i + 0.5) / tfWidth; + float x = (i + 0.5f) / tfWidth; float sample = histogram->interpolate(x); assert(sample >= 0); assert(gradients[i] >= 0); @@ -315,7 +315,7 @@ bool LocalTfBrickSelector::calculateBrickErrors() { const Histogram* histogram = _histogramManager->getTemporalHistogram(brickIndex); float error = 0; for (int i = 0; i < gradients.size(); i++) { - float x = (i + 0.5) / tfWidth; + float x = (i + 0.5f) / tfWidth; float sample = histogram->interpolate(x); assert(sample >= 0); assert(gradients[i] >= 0); diff --git a/modules/multiresvolume/rendering/multiresvolumeraycaster.h b/modules/multiresvolume/rendering/multiresvolumeraycaster.h index 3c598ffd84..b0aee5f45b 100644 --- a/modules/multiresvolume/rendering/multiresvolumeraycaster.h +++ b/modules/multiresvolume/rendering/multiresvolumeraycaster.h @@ -49,7 +49,7 @@ namespace ghoul { namespace openspace { struct RenderData; -class RaycastData; +struct RaycastData; class MultiresVolumeRaycaster : public VolumeRaycaster { public: diff --git a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp index b2bb8f51d1..d6092b28d2 100644 --- a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp +++ b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp @@ -106,9 +106,9 @@ RenderableMultiresVolume::RenderableMultiresVolume (const ghoul::Dictionary& dic , _statsToFile("printStats", "Print Stats", false) , _statsToFileName("printStatsFileName", "Stats Filename") , _scalingExponent("scalingExponent", "Scaling Exponent", 1, -10, 20) - , _scaling("scaling", "Scaling", glm::vec3(1.0, 1.0, 1.0), glm::vec3(0.0), glm::vec3(10.0)) - , _translation("translation", "Translation", glm::vec3(0.0, 0.0, 0.0), glm::vec3(0.0), glm::vec3(10.0)) - , _rotation("rotation", "Euler rotation", glm::vec3(0.0, 0.0, 0.0), glm::vec3(0), glm::vec3(6.28)) + , _scaling("scaling", "Scaling", glm::vec3(1.f), glm::vec3(0.f), glm::vec3(10.f)) + , _translation("translation", "Translation", glm::vec3(0.f), glm::vec3(0.f), glm::vec3(10.f)) + , _rotation("rotation", "Euler rotation", glm::vec3(0.f, 0.f, 0.f), glm::vec3(0.f), glm::vec3(6.28f)) { std::string name; //bool success = dictionary.getValue(constants::scenegraphnode::keyName, name); diff --git a/modules/multiresvolume/rendering/simpletfbrickselector.cpp b/modules/multiresvolume/rendering/simpletfbrickselector.cpp index 63cf1b98e5..6067685fad 100644 --- a/modules/multiresvolume/rendering/simpletfbrickselector.cpp +++ b/modules/multiresvolume/rendering/simpletfbrickselector.cpp @@ -99,7 +99,7 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector& bricks) // On average on the whole time period, splitting this spatial brick in two time steps // would generate twice as much streaming. Current number of streams of this spatial brick // is 2^nTemporalSplits over the whole time period. - int newStreams = std::pow(2, bs.nTemporalSplits); + int newStreams = static_cast(std::pow(2, bs.nTemporalSplits)); // Refining this one more step would require the double amount of streams if (nStreamedBricks + newStreams > totalStreamingBudget) { @@ -132,7 +132,7 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector& bricks) // On average on the whole time period, splitting this spatial brick into eight spatial bricks // would generate eight times as much streaming. Current number of streams of this spatial brick // is 2^nTemporalStreams over the whole time period. - int newStreams = 7*std::pow(2, bs.nTemporalSplits); + int newStreams = 7 * static_cast(std::pow(2, bs.nTemporalSplits)); if (nStreamedBricks + newStreams > totalStreamingBudget) { // Reached dead end (streaming budget would be exceeded) // However, temporal split might be possible @@ -189,7 +189,7 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector& bricks) temporalSplitQueue.pop_back(); unsigned int brickIndex = bs.brickIndex; - int newStreams = std::pow(2, bs.nTemporalSplits); + int newStreams = static_cast(std::pow(2, bs.nTemporalSplits)); if (nStreamedBricks + newStreams > totalStreamingBudget) { // The current best choice would make us exceed the streaming budget, try next instead. deadEnds.push_back(bs); @@ -244,14 +244,14 @@ float SimpleTfBrickSelector::temporalSplitPoints(unsigned int brickIndex) { if (_tsp->isBstLeaf(brickIndex)) { return -1; } - return _brickImportances[brickIndex] * 0.5; + return _brickImportances[brickIndex] * 0.5f; } float SimpleTfBrickSelector::spatialSplitPoints(unsigned int brickIndex) { if (_tsp->isOctreeLeaf(brickIndex)) { return -1; } - return _brickImportances[brickIndex] * 0.125; + return _brickImportances[brickIndex] * 0.125f; } float SimpleTfBrickSelector::splitPoints(unsigned int brickIndex, BrickSelection::SplitType& splitType) { @@ -278,8 +278,11 @@ bool SimpleTfBrickSelector::calculateBrickImportances() { TransferFunction *tf = _transferFunction; if (!tf) return false; - float tfWidth = tf->width(); - if (tfWidth <= 0) return false; + size_t tfWidth = tf->width(); + + // By changing tfWidth to the correct type size_t, this check is no longer valid since + // size_t is unsigned ---abock + //if (tfWidth <= 0) return false; /* std::vector gradients(tfWidth - 1); for (size_t offset = 0; offset < tfWidth - 1; offset++) { @@ -303,7 +306,7 @@ bool SimpleTfBrickSelector::calculateBrickImportances() { float dotProduct = 0; for (int i = 0; i < tf->width(); i++) { - float x = float(i) / tfWidth; + float x = static_cast(i) / static_cast(tfWidth); float sample = histogram->interpolate(x); assert(sample >= 0); diff --git a/modules/multiresvolume/rendering/tfbrickselector.cpp b/modules/multiresvolume/rendering/tfbrickselector.cpp index 3057459047..707eff09c2 100644 --- a/modules/multiresvolume/rendering/tfbrickselector.cpp +++ b/modules/multiresvolume/rendering/tfbrickselector.cpp @@ -105,7 +105,7 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { // would generate twice as much streaming. Current number of streams of this spatial brick // is 2^nTemporalSplits over the whole time period. - int newStreams = std::pow(2, bs.nTemporalSplits); + int newStreams = static_cast(std::pow(2, bs.nTemporalSplits)); //std::cout << "preparing for " << newStreams << " new streams" << std::endl; // Refining this one more step would require the double amount of streams @@ -139,7 +139,7 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { // On average on the whole time period, splitting this spatial brick into eight spatial bricks // would generate eight times as much streaming. Current number of streams of this spatial brick // is 2^nTemporalStreams over the whole time period. - int newStreams = 7*std::pow(2, bs.nTemporalSplits); + int newStreams = 7 * static_cast(std::pow(2, bs.nTemporalSplits)); if (nStreamedBricks + newStreams > totalStreamingBudget) { // Reached dead end (streaming budget would be exceeded) @@ -207,7 +207,7 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { temporalSplitQueue.pop_back(); unsigned int brickIndex = bs.brickIndex; - int newStreams = std::pow(2, bs.nTemporalSplits); + int newStreams = static_cast(std::pow(2, bs.nTemporalSplits)); if (nStreamedBricks + newStreams > totalStreamingBudget) { // The current best choice would make us exceed the streaming budget, try next instead. deadEnds.push_back(bs); @@ -282,7 +282,7 @@ float TfBrickSelector::temporalSplitPoints(unsigned int brickIndex) { //std::cout << "local temporal split minimum for brick " << brickIndex << std::endl; diff = -diff; } - return diff * 0.5; + return diff * 0.5f; } float TfBrickSelector::spatialSplitPoints(unsigned int brickIndex) { @@ -310,7 +310,7 @@ float TfBrickSelector::spatialSplitPoints(unsigned int brickIndex) { diff = -diff; } - return diff * 0.125; + return diff * 0.125f; } float TfBrickSelector::splitPoints(unsigned int brickIndex, BrickSelection::SplitType& splitType) { @@ -345,7 +345,7 @@ bool TfBrickSelector::calculateBrickErrors() { glm::vec4 nextRgba = tf->sample(offset + 1); float colorDifference = glm::distance(prevRgba, nextRgba); - float alpha = (prevRgba.w + nextRgba.w) * 0.5; + float alpha = (prevRgba.w + nextRgba.w) * 0.5f; gradients[offset] = colorDifference*alpha; } @@ -362,7 +362,7 @@ bool TfBrickSelector::calculateBrickErrors() { const Histogram* histogram = _histogramManager->getHistogram(brickIndex); float error = 0; for (int i = 0; i < gradients.size(); i++) { - float x = (i + 0.5) / tfWidth; + float x = (i + 0.5f) / tfWidth; float sample = histogram->interpolate(x); assert(sample >= 0); assert(gradients[i] >= 0); diff --git a/modules/multiresvolume/rendering/tsp.cpp b/modules/multiresvolume/rendering/tsp.cpp index 003c2af590..fa43e30a49 100644 --- a/modules/multiresvolume/rendering/tsp.cpp +++ b/modules/multiresvolume/rendering/tsp.cpp @@ -307,7 +307,7 @@ bool TSP::calculateSpatialError() { average += *it; } - averages[brick] = average / static_cast(numBrickVals); + averages[brick] = static_cast(average / static_cast(numBrickVals)); } // Spatial SNR stats diff --git a/modules/newhorizons/rendering/renderableplanetprojection.cpp b/modules/newhorizons/rendering/renderableplanetprojection.cpp index ae891c31d7..db8e1710a5 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.cpp +++ b/modules/newhorizons/rendering/renderableplanetprojection.cpp @@ -174,7 +174,7 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary& _shiftMeridianBy180 = dictionary.value(keyMeridianShift); } - float radius = std::pow(10.0, 9.0); + float radius = std::pow(10.f, 9.f); dictionary.getValue(keyRadius, radius); setBoundingSphere(radius); diff --git a/modules/touch/src/TouchInteraction.cpp b/modules/touch/src/TouchInteraction.cpp index 6819db108a..af5ebabbc7 100644 --- a/modules/touch/src/TouchInteraction.cpp +++ b/modules/touch/src/TouchInteraction.cpp @@ -65,24 +65,28 @@ TouchInteraction::TouchInteraction() , _maxTapTime("Max Tap Time", "Max tap delay (in ms) for double tap", 300, 10, 1000) , _deceleratesPerSecond("Decelerates per second", "Number of times velocity is decelerated per second", 240, 60, 300) , _touchScreenSize("TouchScreenSize", "Touch Screen size in inches", 55.0f, 5.5f, 150.0f) - , _tapZoomFactor("Tap zoom factor","Scaling distance travelled on tap", 0.2, 0.0, 0.5) + , _tapZoomFactor("Tap zoom factor","Scaling distance travelled on tap", 0.2f, 0.f, 0.5f) , _nodeRadiusThreshold("Activate direct-manipulation", "Radius a planet has to have to activate direct-manipulation", 0.2f, 0.0f, 1.0f) , _rollAngleThreshold("Interpret roll", "Threshold for min angle for roll interpret", 0.025f, 0.0f, 0.05f) , _orbitSpeedThreshold("Activate orbit spinning", "Threshold to activate orbit spinning in direct-manipulation", 0.005f, 0.0f, 0.01f) - , _spinSensitivity("Sensitivity of spinning", "Sensitivity of spinning in direct-manipulation", 1.0f, 0, 2) - , _inputStillThreshold("Input still", "Threshold for interpreting input as still", 0.0005f, 0, 0.001) - , _centroidStillThreshold("Centroid stationary", "Threshold for stationary centroid", 0.0018f, 0, 0.01) // used to void wrongly interpreted roll interactions - , _interpretPan("Pan delta distance", "Delta distance between fingers allowed for interpreting pan interaction", 0.015f, 0, 0.1) - , _slerpTime("Time to slerp", "Time to slerp in seconds to new orientation with new node picking", 3, 0, 5) + , _spinSensitivity("Sensitivity of spinning", "Sensitivity of spinning in direct-manipulation", 1.f, 0.f, 2.f) + , _inputStillThreshold("Input still", "Threshold for interpreting input as still", 0.0005f, 0.f, 0.001f) + , _centroidStillThreshold("Centroid stationary", "Threshold for stationary centroid", 0.0018f, 0.f, 0.01f) // used to void wrongly interpreted roll interactions + , _interpretPan("Pan delta distance", "Delta distance between fingers allowed for interpreting pan interaction", 0.015f, 0.f, 0.1f) + , _slerpTime("Time to slerp", "Time to slerp in seconds to new orientation with new node picking", 3.f, 0.f, 5.f) , _guiButton("GUI Button", "GUI button size in pixels.", glm::ivec2(32, 64), glm::ivec2(8, 16), glm::ivec2(128, 256)) - , _friction("Friction", "Friction for different interactions (orbit, zoom, roll, pan)", glm::vec4(0.01, 0.025, 0.02, 0.02), glm::vec4(0.0), glm::vec4(0.2)) + , _friction("Friction", "Friction for different interactions (orbit, zoom, roll, pan)", glm::vec4(0.01f, 0.025f, 0.02f, 0.02f), glm::vec4(0.f), glm::vec4(0.2f)) , _vel{ glm::dvec2(0.0), 0.0, 0.0, glm::dvec2(0.0) } , _sensitivity{glm::dvec2(0.08, 0.045), 4.0, 2.75, glm::dvec2(0.08, 0.045) } , _centroid{ glm::dvec3(0.0) } , _projectionScaleFactor{ 1.000004 } // calculated with two vectors with known diff in length, then projDiffLength/diffLength. , _currentRadius{ 1.0 }, _slerpdT{ 1000 }, _numOfTests{ 0 }, _timeSlack{ 0.0 } - , _directTouchMode{ false }, _tap{ false }, _doubleTap{ false }, _lmSuccess{ true }, _guiON{ false } + , _directTouchMode{ false } + , _tap{ false } + , _doubleTap{ false } + , _lmSuccess{ true } + , _guiON{ false } { addProperty(_touchActive); addProperty(_unitTest); @@ -240,7 +244,7 @@ void TouchInteraction::directControl(const std::vector& list) { // Gradient of distToMinimize w.r.t par (using forward difference) auto gradient = [](double* g, double* par, int x, void* fdata, LMstat* lmstat) { FunctionData* ptr = reinterpret_cast(fdata); - double h, hZoom, lastG, f1, f0 = ptr->distToMinimize(par, x, fdata, lmstat); + double h, lastG, f1, f0 = ptr->distToMinimize(par, x, fdata, lmstat); double scale = log10(ptr->node->boundingSphere()); // scale value to find minimum step size h, dependant on planet size std::vector dPar(ptr->nDOF, 0.0); dPar.assign(par, par + ptr->nDOF); @@ -447,8 +451,8 @@ int TouchInteraction::interpretInteraction(const std::vector& list, double rollOn = std::accumulate(list.begin(), list.end(), 0.0, [&](double diff, const TuioCursor& c) { TuioPoint point = std::find_if(lastProcessed.begin(), lastProcessed.end(), [&c](const Point& p) { return p.first == c.getSessionID(); })->second; double res = 0.0; - double lastAngle = point.getAngle(_centroid.x, _centroid.y); - double currentAngle = c.getAngle(_centroid.x, _centroid.y); + float lastAngle = point.getAngle(_centroid.x, _centroid.y); + float currentAngle = c.getAngle(_centroid.x, _centroid.y); if (lastAngle > currentAngle + 1.5 * M_PI) res = currentAngle + (2 * M_PI - lastAngle); else if (currentAngle > lastAngle + 1.5 * M_PI) diff --git a/modules/touch/src/TouchMarker.cpp b/modules/touch/src/TouchMarker.cpp index d257035ae8..1551d6a4be 100644 --- a/modules/touch/src/TouchMarker.cpp +++ b/modules/touch/src/TouchMarker.cpp @@ -40,9 +40,9 @@ namespace openspace { TouchMarker::TouchMarker() : properties::PropertyOwner("TouchMarker") , _visible("TouchMarkers visible", "Toggle visibility of markers", true) - , _radiusSize("Marker size", "Marker radius", 30, 0, 100) - , _transparency("Transparency of marker", "Marker transparency", 0.8, 0, 1.0) - , _thickness("Thickness of marker", "Marker thickness", 2.0, 0, 4.0) + , _radiusSize("Marker size", "Marker radius", 30.f, 0.f, 100.f) + , _transparency("Transparency of marker", "Marker transparency", 0.8f, 0.f, 1.f) + , _thickness("Thickness of marker", "Marker thickness", 2.f, 0.f, 4.f) , _color( "MarkerColor", "Marker color", @@ -116,12 +116,12 @@ void TouchMarker::render(const std::vector& list) { } void TouchMarker::createVertexList(const std::vector& list) { - _numFingers = list.size(); + _numFingers = static_cast(list.size()); GLfloat vertexData[MAX_FINGERS]; int i = 0; for (const TUIO::TuioCursor& c : list) { - vertexData[i] = 2 * (c.getX() - 0.5); - vertexData[i + 1] = -2 * (c.getY() - 0.5); + vertexData[i] = 2 * (c.getX() - 0.5f); + vertexData[i + 1] = -2 * (c.getY() - 0.5f); i += 2; } diff --git a/modules/touch/touchmodule.cpp b/modules/touch/touchmodule.cpp index 663a4c2634..fb9a6b49f5 100644 --- a/modules/touch/touchmodule.cpp +++ b/modules/touch/touchmodule.cpp @@ -32,7 +32,7 @@ #include #include -#include +//#include #include #include diff --git a/modules/toyvolume/rendering/renderabletoyvolume.cpp b/modules/toyvolume/rendering/renderabletoyvolume.cpp index 8086a47ac5..774acea8aa 100644 --- a/modules/toyvolume/rendering/renderabletoyvolume.cpp +++ b/modules/toyvolume/rendering/renderabletoyvolume.cpp @@ -38,13 +38,14 @@ namespace openspace { RenderableToyVolume::RenderableToyVolume(const ghoul::Dictionary& dictionary) : Renderable(dictionary) , _scalingExponent("scalingExponent", "Scaling Exponent", 1, -10, 20) - , _stepSize("stepSize", "Step Size", 0.02, 0.01, 1) - , _scaling("scaling", "Scaling", glm::vec3(1.0, 1.0, 1.0), glm::vec3(0.0), glm::vec3(10.0)) - , _translation("translation", "Translation", glm::vec3(0.0, 0.0, 0.0), glm::vec3(0.0), glm::vec3(10.0)) + , _stepSize("stepSize", "Step Size", 0.02f, 0.01f, 1.f) + , _scaling("scaling", "Scaling", glm::vec3(1.f, 1.f, 1.f), glm::vec3(0.f), glm::vec3(10.f)) + , _translation("translation", "Translation", glm::vec3(0.f, 0.f, 0.f), glm::vec3(0.f), glm::vec3(10.f)) , _rotation("rotation", "Euler rotation", glm::vec3(0.f, 0.f, 0.f), glm::vec3(0), glm::vec3(6.28f)) - , _color("color", "Color", glm::vec4(1.f, 0.f, 0.f, 0.1f), glm::vec4(0.f), glm::vec4(1.f)) { - - float scalingExponent, stepSize; + , _color("color", "Color", glm::vec4(1.f, 0.f, 0.f, 0.1f), glm::vec4(0.f), glm::vec4(1.f)) +{ + float stepSize; + int scalingExponent; glm::vec3 scaling, translation, rotation; glm::vec4 color; if (dictionary.getValue("ScalingExponent", scalingExponent)) { diff --git a/src/interaction/luaconsole.cpp b/src/interaction/luaconsole.cpp index a7958903e1..5ef4929b15 100644 --- a/src/interaction/luaconsole.cpp +++ b/src/interaction/luaconsole.cpp @@ -600,7 +600,7 @@ void LuaConsole::update() { const glm::ivec2 res = OsEng.windowWrapper().currentWindowResolution(); const glm::vec2 dpiScaling = OsEng.windowWrapper().dpiScaling(); _currentHeight += (_targetHeight - _currentHeight) * - std::pow(0.98, 1.0 / (ConsoleOpenSpeed / dpiScaling.y * frametime)); + std::pow(0.98f, 1.f / (ConsoleOpenSpeed / dpiScaling.y * frametime)); _currentHeight = std::max(0.0f, _currentHeight); _currentHeight = std::min(static_cast(res.y), _currentHeight); @@ -690,10 +690,10 @@ void LuaConsole::render() { } // Since the overflow is positive, at least one character needs to be removed. - const size_t nCharsOverflow = std::min( + const size_t nCharsOverflow = static_cast(std::min( std::max(1.f, overflow / _font->glyph('m')->width()), static_cast(currentCommand.size()) - ); + )); // Do not hide the cursor and `NVisibleCharsAfterCursor` more characters in the end. const size_t maxAdditionalCharsToChopEnd = std::max( diff --git a/src/properties/vector/bvec2property.cpp b/src/properties/vector/bvec2property.cpp index 4e2f319375..cab0dfeb32 100644 --- a/src/properties/vector/bvec2property.cpp +++ b/src/properties/vector/bvec2property.cpp @@ -105,12 +105,6 @@ namespace properties { } -// Forcing value from int to bool is acceptable here (line 48) -#ifdef WIN32 -#pragma warning(disable : 4800) -#endif - - REGISTER_TEMPLATEPROPERTY_SOURCE(BVec2Property, glm::bvec2, glm::bvec2(false), DEFAULT_FROM_LUA_LAMBDA(glm::bvec2, lua_toboolean, lua_isboolean), @@ -119,9 +113,5 @@ REGISTER_TEMPLATEPROPERTY_SOURCE(BVec2Property, glm::bvec2, glm::bvec2(false), DEFAULT_TO_STRING_LAMBDA(glm::bvec2), LUA_TTABLE); -#ifdef WIN32 -#pragma warning(default : 4800) -#endif - } // namespace properties } // namespace openspace From 0a93fa64c45742d5c3d0bc307bd71b5ebbc247dc Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 14 Jul 2017 16:02:19 -0400 Subject: [PATCH 02/44] Remove non-existing resetCameraDirection --- data/scene/default.scene | 2 -- 1 file changed, 2 deletions(-) diff --git a/data/scene/default.scene b/data/scene/default.scene index 3714385858..03d7252799 100644 --- a/data/scene/default.scene +++ b/data/scene/default.scene @@ -29,8 +29,6 @@ function postInitialization() openspace.addVirtualProperty("BoolProperty", "Show Trails", "*Trail.renderable.enabled", true, nil, nil) - openspace.resetCameraDirection() - openspace.printInfo("Done setting default values") end From 88b8789336ab55e497bc55121d57c0e667282a70 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 14 Jul 2017 16:49:03 -0400 Subject: [PATCH 03/44] Add recursion for TableVerifiers to check whether a documentation contains an illegal " character Fix Configurationmanager documentation to remove " character --- src/documentation/documentationengine.cpp | 22 +++++++++++++++++----- src/engine/configurationmanager_doc.inl | 5 ++--- 2 files changed, 19 insertions(+), 8 deletions(-) diff --git a/src/documentation/documentationengine.cpp b/src/documentation/documentationengine.cpp index 4f862869fc..66ef92f7f0 100644 --- a/src/documentation/documentationengine.cpp +++ b/src/documentation/documentationengine.cpp @@ -297,12 +297,24 @@ std::string DocumentationEngine::generateJson() const { } void DocumentationEngine::addDocumentation(Documentation doc) { + std::function testDocumentation = + [&testDocumentation](const DocumentationEntry& e) { + (void)e; // Unused variable in Release mode + ghoul_assert( + e.documentation.find('"') == std::string::npos, + fmt::format("Documentation cannot contain \" character. {} does", e.key) + ); + + TableVerifier* v = dynamic_cast(e.verifier.get()); + if (v) { + for (const DocumentationEntry& e : v->documentations) { + testDocumentation(e); + } + } + }; + for (const DocumentationEntry& e : doc.entries) { - (void)e; // Unused variable in Release mode - ghoul_assert( - e.documentation.find('"') == std::string::npos, - "Documentation cannot contain \" character" - ); + testDocumentation(e); } if (doc.id.empty()) { diff --git a/src/engine/configurationmanager_doc.inl b/src/engine/configurationmanager_doc.inl index 9446e54a16..2d181ae301 100644 --- a/src/engine/configurationmanager_doc.inl +++ b/src/engine/configurationmanager_doc.inl @@ -89,15 +89,14 @@ documentation::Documentation ConfigurationManager::Documentation() { { ConfigurationManager::PartLogDir, new StringVerifier, - "The directory for logs." - "Default value is \"${BASE_PATH}\"", + "The directory for logs. Default value is '${BASE_PATH}'", Optional::Yes }, { ConfigurationManager::PartLogPerformancePrefix, new StringVerifier, "A string to prefix PerformanceMeasurement logfiles." - "Default value is \"PM-\"", + "Default value is 'PM-'", Optional::Yes }, { From 6f524f4a678597b8f5f87cb83303bed596b0cbf2 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 14 Jul 2017 16:58:18 -0400 Subject: [PATCH 04/44] Add centralized escaping of JSON strings Enable correct escaping of " character thus removing the need to outlaw "s in comments --- .../documentation/documentationgenerator.h | 9 +++++ src/documentation/documentationengine.cpp | 35 +++++-------------- src/documentation/documentationgenerator.cpp | 24 +++++++++++++ src/engine/configurationmanager_doc.inl | 4 +-- src/interaction/keybindingmanager.cpp | 2 +- src/scripting/scriptengine.cpp | 8 ++--- 6 files changed, 48 insertions(+), 34 deletions(-) diff --git a/include/openspace/documentation/documentationgenerator.h b/include/openspace/documentation/documentationgenerator.h index ca91bc9eff..10c6d7ad91 100644 --- a/include/openspace/documentation/documentationgenerator.h +++ b/include/openspace/documentation/documentationgenerator.h @@ -100,6 +100,15 @@ private: const std::string _javascriptFile; }; + +/** + * This function takes a \p text and escapes all necessary characters () that JSON + * does not want in its strings. + * \param text The text that is to be escaped + * \return The same text will all required characteres escaped + */ +std::string escapedJson(const std::string& text); + } // namespace openspace #endif // __OPENSPACE_CORE___DOCUMENTATIONGENERATOR___H__ diff --git a/src/documentation/documentationengine.cpp b/src/documentation/documentationengine.cpp index 66ef92f7f0..5d41d4d3d8 100644 --- a/src/documentation/documentationengine.cpp +++ b/src/documentation/documentationengine.cpp @@ -156,7 +156,7 @@ std::string generateJsonDocumentation(const Documentation& d) { result << "\"key\": \"" << p.key << "\","; result << "\"optional\": " << (p.optional ? "true" : "false") << ","; result << "\"type\": \"" << p.verifier->type() << "\","; - result << "\"documentation\": \"" << p.documentation << "\","; + result << "\"documentation\": \"" << escapedJson(p.documentation) << "\","; TableVerifier* tv = dynamic_cast(p.verifier.get()); ReferencingVerifier* rv = dynamic_cast(p.verifier.get()); @@ -210,7 +210,7 @@ std::string generateHtmlDocumentation(const Documentation& d) { << "\t\t\n" << "\t\t" << p.key << "\n" << "\t\t" << (p.optional ? "Optional" : "Required") << "\n" - << "\t\t" << p.documentation << "\n" + << "\t\t" << escapedJson(p.documentation) << "\n" << "\t\t" << p.verifier->type() << "\n"; TableVerifier* tv = dynamic_cast(p.verifier.get()); @@ -285,11 +285,12 @@ std::string DocumentationEngine::generateJson() const { std::string jsonString = ""; for (const char& c : json.str()) { - if (c == '\'') { - jsonString += "\\'"; - } - else { - jsonString += c; + switch (c) { + case '\'': + jsonString += "\\'"; + break; + default: + jsonString += c; } } @@ -297,26 +298,6 @@ std::string DocumentationEngine::generateJson() const { } void DocumentationEngine::addDocumentation(Documentation doc) { - std::function testDocumentation = - [&testDocumentation](const DocumentationEntry& e) { - (void)e; // Unused variable in Release mode - ghoul_assert( - e.documentation.find('"') == std::string::npos, - fmt::format("Documentation cannot contain \" character. {} does", e.key) - ); - - TableVerifier* v = dynamic_cast(e.verifier.get()); - if (v) { - for (const DocumentationEntry& e : v->documentations) { - testDocumentation(e); - } - } - }; - - for (const DocumentationEntry& e : doc.entries) { - testDocumentation(e); - } - if (doc.id.empty()) { _documentations.push_back(std::move(doc)); } diff --git a/src/documentation/documentationgenerator.cpp b/src/documentation/documentationgenerator.cpp index 3f11f02563..96eb80d1f0 100644 --- a/src/documentation/documentationgenerator.cpp +++ b/src/documentation/documentationgenerator.cpp @@ -150,4 +150,28 @@ void DocumentationGenerator::writeDocumentation(const std::string& filename) { << "" << '\n'; } +std::string escapedJson(const std::string& text) { + std::string jsonString = ""; + for (const char& c : text) { + switch (c) { + case '\t': + jsonString += "\\t"; + break; + case '"': + // The " character has to be double escaped as JSON.parse will remove a single + // escape character, thus leaving only " behind that breaks the string + jsonString += "\\\\\""; + break; + case '\\': + jsonString += "\\\\"; + break; + default: + jsonString += c; + } + } + + return jsonString; +} + + } // namespace openspace diff --git a/src/engine/configurationmanager_doc.inl b/src/engine/configurationmanager_doc.inl index 2d181ae301..96da8110e5 100644 --- a/src/engine/configurationmanager_doc.inl +++ b/src/engine/configurationmanager_doc.inl @@ -89,14 +89,14 @@ documentation::Documentation ConfigurationManager::Documentation() { { ConfigurationManager::PartLogDir, new StringVerifier, - "The directory for logs. Default value is '${BASE_PATH}'", + "The directory for logs. Default value is \"${BASE_PATH}\"", Optional::Yes }, { ConfigurationManager::PartLogPerformancePrefix, new StringVerifier, "A string to prefix PerformanceMeasurement logfiles." - "Default value is 'PM-'", + "Default value is \"PM-\"", Optional::Yes }, { diff --git a/src/interaction/keybindingmanager.cpp b/src/interaction/keybindingmanager.cpp index 2f3db8e2bc..9756791af6 100644 --- a/src/interaction/keybindingmanager.cpp +++ b/src/interaction/keybindingmanager.cpp @@ -124,7 +124,7 @@ std::string KeyBindingManager::generateJson() const { json << "\"key\": \"" << std::to_string(p.first) << "\","; json << "\"script\": \"" << p.second.command << "\","; json << "\"remoteScripting\": " << (p.second.synchronization ? "true," : "false,"); - json << "\"documentation\": \"" << p.second.documentation << "\""; + json << "\"documentation\": \"" << escapedJson(p.second.documentation) << "\""; json << "}"; } json << "]"; diff --git a/src/scripting/scriptengine.cpp b/src/scripting/scriptengine.cpp index f81e9d7f2c..b2520f8707 100644 --- a/src/scripting/scriptengine.cpp +++ b/src/scripting/scriptengine.cpp @@ -603,8 +603,8 @@ std::string ScriptEngine::generateJson() const { for (const LuaLibrary::Function& f : l.functions) { json << "{"; json << "\"name\": \"" << f.name << "\", "; - json << "\"arguments\": \"" << f.argumentText << "\", "; - json << "\"help\": \"" << f.helpText << "\""; + json << "\"arguments\": \"" << escapedJson(f.argumentText) << "\", "; + json << "\"help\": \"" << escapedJson(f.helpText) << "\""; json << "}"; if (&f != &l.functions.back() || !l.documentations.empty()) { json << ","; @@ -614,8 +614,8 @@ std::string ScriptEngine::generateJson() const { for (const LuaLibrary::Documentation& doc : l.documentations) { json << "{"; json << "\"name\": \"" << doc.name << "\", "; - json << "\"arguments\": \"" << doc.parameter<< "\", "; - json << "\"help\": \"" << doc.description<< "\""; + json << "\"arguments\": \"" << escapedJson(doc.parameter) << "\", "; + json << "\"help\": \"" << escapedJson(doc.description) << "\""; json << "}"; if (&doc != &l.documentations.back()) { json << ","; From 99b5d09fc2d25f152d20a1760c5318411c57c24b Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 14 Jul 2017 17:47:08 -0400 Subject: [PATCH 05/44] Update Ghoul repository --- ext/ghoul | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ghoul b/ext/ghoul index 67827b142e..5309bfcb56 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 67827b142e95122b66d58e7c402fe1a28a65631e +Subproject commit 5309bfcb56e184510d766462aadeab61862fb158 From 35636890daf29d3b9edbcf5e2343d294057f1bee Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Fri, 14 Jul 2017 18:43:22 -0400 Subject: [PATCH 06/44] Various fixes for the New Horizons scene - Fix transparency issue making the New Horizons module invisible - Fix the offsets of the instruments on board New Horizons - Fix the missing projections occurred by switching the radius specifications from PSC to regular coordinates - Update the accurate kernel usage --- .../newhorizons/jupiter/callisto/callisto.mod | 5 +- .../newhorizons/jupiter/europa/europa.mod | 5 +- .../newhorizons/jupiter/ganymede/ganymede.mod | 5 +- .../missions/newhorizons/jupiter/io/io.mod | 7 +- .../newhorizons/jupiter/jupiter/jupiter.mod | 5 +- .../newhorizons/newhorizons/newhorizons.mod | 66 +-- .../newhorizonsfov/newhorizonsfov.mod | 551 +++++++++--------- .../newhorizons/pluto/charon/charon.mod | 12 +- .../newhorizons/pluto/hydra/hydra.mod | 7 +- .../newhorizons/pluto/kerberos/kerberos.mod | 7 +- .../missions/newhorizons/pluto/nix/nix.mod | 7 +- .../newhorizons/pluto/pluto/pluto.mod | 15 +- .../missions/newhorizons/pluto/styx/styx.mod | 7 +- modules/base/shaders/model_fs.glsl | 6 +- .../rendering/renderableplanetprojection.cpp | 2 +- .../shaders/renderableModel_fs.glsl | 3 +- .../renderablePlanetProjection_fs.glsl | 8 +- 17 files changed, 381 insertions(+), 337 deletions(-) diff --git a/data/scene/missions/newhorizons/jupiter/callisto/callisto.mod b/data/scene/missions/newhorizons/jupiter/callisto/callisto.mod index c99c354d59..3a51e4c5bb 100644 --- a/data/scene/missions/newhorizons/jupiter/callisto/callisto.mod +++ b/data/scene/missions/newhorizons/jupiter/callisto/callisto.mod @@ -1,3 +1,5 @@ +local callisto_radius = 1.8213E6 + return { -- Callisto module { @@ -7,9 +9,10 @@ return { Type = "RenderablePlanetProjection", Frame = "IAU_CALLISTO", Body = "CALLISTO", + Radius = callisto_radius, Geometry = { Type = "SimpleSphere", - Radius = 1.8213E6, + Radius = callisto_radius, Segments = 100 }, Textures = { diff --git a/data/scene/missions/newhorizons/jupiter/europa/europa.mod b/data/scene/missions/newhorizons/jupiter/europa/europa.mod index 21e07a2703..37a137fdb0 100644 --- a/data/scene/missions/newhorizons/jupiter/europa/europa.mod +++ b/data/scene/missions/newhorizons/jupiter/europa/europa.mod @@ -1,3 +1,5 @@ +local europa_radius = 1.8213E6 + return { -- Europa module { @@ -7,9 +9,10 @@ return { Type = "RenderablePlanetProjection", Frame = "IAU_EUROPA", Body = "EUROPA", + Radius = europa_radius, Geometry = { Type = "SimpleSphere", - Radius = 1.8213E6, + Radius = europa_radius, Segments = 100 }, Textures = { diff --git a/data/scene/missions/newhorizons/jupiter/ganymede/ganymede.mod b/data/scene/missions/newhorizons/jupiter/ganymede/ganymede.mod index 5fa473d332..9d16289f9b 100644 --- a/data/scene/missions/newhorizons/jupiter/ganymede/ganymede.mod +++ b/data/scene/missions/newhorizons/jupiter/ganymede/ganymede.mod @@ -1,3 +1,5 @@ +local ganymede_local = 1.8213E6 + return { -- Ganymede module { @@ -7,9 +9,10 @@ return { Type = "RenderablePlanetProjection", Frame = "IAU_GANYMEDE", Body = "GANYMEDE", + Radius = ganymede_local, Geometry = { Type = "SimpleSphere", - Radius = 1.8213E6, + Radius = ganymede_local, Segments = 100 }, Textures = { diff --git a/data/scene/missions/newhorizons/jupiter/io/io.mod b/data/scene/missions/newhorizons/jupiter/io/io.mod index d4e5260cbd..60ed022544 100644 --- a/data/scene/missions/newhorizons/jupiter/io/io.mod +++ b/data/scene/missions/newhorizons/jupiter/io/io.mod @@ -1,3 +1,5 @@ +local io_radius = 1.8213E6 + return { -- Io module { @@ -7,9 +9,10 @@ return { Type = "RenderablePlanetProjection", Frame = "IAU_IO", Body = "IO", + Radius = io_radius, Geometry = { Type = "SimpleSphere", - Radius = 1.8213E6, + Radius = io_radius, Segments = 100 }, Textures = { @@ -74,7 +77,7 @@ return { Parent = "Io", Renderable = { Type = "RenderablePlane", - Size = {1.0, 7.4}, + Size = 10^7.4, Origin = "Center", Billboard = true, Texture = "textures/Io-Text.png", diff --git a/data/scene/missions/newhorizons/jupiter/jupiter/jupiter.mod b/data/scene/missions/newhorizons/jupiter/jupiter/jupiter.mod index 17f3a6afea..f4fbe278f0 100644 --- a/data/scene/missions/newhorizons/jupiter/jupiter/jupiter.mod +++ b/data/scene/missions/newhorizons/jupiter/jupiter/jupiter.mod @@ -1,3 +1,5 @@ +local jupiter_local = 0.71492E8 + return { -- Jupiter barycenter module { @@ -20,9 +22,10 @@ return { Type = "RenderablePlanetProjection", Frame = "IAU_JUPITER", Body = "JUPITER", + Radius = jupiter_local, Geometry = { Type = "SimpleSphere", - Radius = 0.71492E8, + Radius = jupiter_local, Segments = 200, }, Textures = { diff --git a/data/scene/missions/newhorizons/newhorizons/newhorizons.mod b/data/scene/missions/newhorizons/newhorizons/newhorizons.mod index 40368d7efc..3e00eac771 100644 --- a/data/scene/missions/newhorizons/newhorizons/newhorizons.mod +++ b/data/scene/missions/newhorizons/newhorizons/newhorizons.mod @@ -1,46 +1,36 @@ if UseAccurateNewHorizonsKernels then NewHorizonsKernels = { - -- SCLK - "${SPICE}/nh_kernels/sclk/new-horizons_0976.tsc", - -- "${SPICE}/NewHorizonsKernels/new_horizons_413.tsc", + "${SPICE}/nh_20170126/spk/nh_pred_20141201_20190301_od122.bsp", + "${SPICE}/nh_20170126/spk/NavSE_plu047_od122.bsp", + "${SPICE}/nh_20170126/spk/NavPE_de433_od122.bsp", - -- SPK - "${SPICE}/nh_kernels/spk/nh_pred_20141201_20190301_od122.bsp", - -- "${SPICE}/nh_kernels/spk/nh_pred_20120501_20160913_od093.bsp", - "${SPICE}/nh_kernels/spk/plu_all_mvi.spk", "${SPICE}/jup260.bsp", - -- "${SPICE}/NewHorizonsKernels/de413.bsp", - -- CK - "${SPICE}/nh_kernels/ck/nh_scispi_2015_pred.bc", - "${SPICE}/nh_kernels/ck/nh_scispi_2015_recon.bc", - "${SPICE}/nh_kernels/ck/nh_lorri_wcs.bc", - "${SPICE}/nh_kernels/ck/plutonet_PS104.bc", + "${SPICE}/nh_20170126/ck/nh_scispi_2015_pred.bc", + "${SPICE}/nh_20170126/ck/nh_scispi_2015_recon.bc", + "${SPICE}/nh_20170126/ck/nh_lorri_wcs.bc", + + "${SPICE}/nh_20170126/smithed_pc_and_sp/PLU_LORRI_ALL_161216.bc", - -- FK - "${SPICE}/nh_kernels/fk/nh_soc_misc_v001.tf", - "${SPICE}/nh_kernels/fk/nh_v220.tf", + "${SPICE}/nh_20170126/sclk/new-horizons_1121.tsc", - -- IK - "${SPICE}/nh_kernels/ik/nh_alice_v120.ti", - "${SPICE}/nh_kernels/ik/nh_allinstruments_v002.ti", - "${SPICE}/nh_kernels/ik/nh_astr_v000.ti", - "${SPICE}/nh_kernels/ik/nh_fss_v000.ti", - "${SPICE}/nh_kernels/ik/nh_lorri_v100.ti", - "${SPICE}/nh_kernels/ik/nh_pepssi_v110.ti", - "${SPICE}/nh_kernels/ik/nh_ralph_v100.ti", - "${SPICE}/nh_kernels/ik/nh_rex_v100.ti", - "${SPICE}/nh_kernels/ik/nh_sdc_v101.ti", - "${SPICE}/nh_kernels/ik/nh_swap_v100.ti", + "${SPICE}/nh_20170126/pck/nh_targets_v001.tpc", + "${SPICE}/nh_20170126/pck/nh_pcnh_005.tpc", - -- LSK - "${SPICE}/nh_kernels/lsk/naif0011.tls", - - -- PCK - "${SPICE}/nh_kernels/pck/nh_targets_v001.tpc", - "${SPICE}/nh_kernels/pck/pck00010.tpc", - "${SPICE}/nh_kernels/pck/nh_pcnh_002.tpc" - }; + "${SPICE}/nh_20170126/fk/nh_v220.tf", + "${SPICE}/nh_20170126/ik/nh_allinstruments_v002.ti", + "${SPICE}/nh_20170126/ik/nh_alice_v200.ti", + "${SPICE}/nh_20170126/ik/nh_lorri_v201.ti", + "${SPICE}/nh_20170126/ik/nh_pepssi_v110.ti", + "${SPICE}/nh_20170126/ik/nh_ralph_v100.ti", + "${SPICE}/nh_20170126/ik/nh_rex_v100.ti", + "${SPICE}/nh_20170126/ik/nh_sdc_v101.ti", + "${SPICE}/nh_20170126/ik/nh_swap_v100.ti", + "${SPICE}/nh_20170126/ik/nh_astr_v000.ti", + "${SPICE}/nh_20170126/ik/nh_fss_v000.ti", + "${SPICE}/nh_20170126/fk/nh_soc_misc_v001.tf", + "${SPICE}/nh_20170126/spk/nh_stars.bsp", + } else NewHorizonsKernels = { --SCLK @@ -118,12 +108,6 @@ return { Ghosting = false, }, }, - Transform = { - Scale = { - Type = "StaticScale", - Scale = 100 - } - }, }, --NewHorizonsTrail module --[[{ diff --git a/data/scene/missions/newhorizons/newhorizonsfov/newhorizonsfov.mod b/data/scene/missions/newhorizons/newhorizonsfov/newhorizonsfov.mod index 7ece77d4e9..7c2c7fd4e5 100644 --- a/data/scene/missions/newhorizons/newhorizonsfov/newhorizonsfov.mod +++ b/data/scene/missions/newhorizons/newhorizonsfov/newhorizonsfov.mod @@ -1,22 +1,21 @@ +local LorriOffset = { -6.626, -4.1, -3.23 } +local RalphOffset = { -6.9, -4.6, 8.7 } +local AliceOffset = { -7.9, -1.7, 8.3 } +local RexOffset = { 0, 0, 0 } + return { -- NewHorizonsFov main module - { + { Name = "NH_LORRI", Parent = "NewHorizonsPosition", Renderable = { Type = "RenderableFov", Body = "NEW HORIZONS", Frame = "NH_SPACECRAFT", - RGB = { 0.8, 0.7, 0.7 }, - Textures = { - Type = "simple", - Color = "textures/glare_blue.png", - -- need to add different texture - }, - Instrument = { + Color = { 0.8, 0.7, 0.7 }, + Instrument = { Name = "NH_LORRI", - Method = "ELLIPSOID", - Aberration = "NONE", + Aberration = "NONE" }, PotentialTargets = { "Pluto", @@ -24,281 +23,311 @@ return { "Jupiter", "Io", "Europa", "Ganymede", "Callisto" } }, + Transform = { + Translation = { + Type = "StaticTranslation", + Position = LorriOffset + } + } }, + -- NewHorizonsFov module NH_RALPH_LEISA - { - Name = "NH_RALPH_LEISA", - Parent = "NewHorizonsPosition", - Renderable = { - Type = "RenderableFov", - Body = "NEW HORIZONS", - Frame = "NH_SPACECRAFT", - RGB = { 0.8, 0.7, 0.7 }, - Textures = { - Type = "simple", - Color = "textures/glare_blue.png", - -- need to add different texture - }, - Instrument = { - Name = "NH_RALPH_LEISA", - Method = "ELLIPSOID", - Aberration = "NONE", - }, - PotentialTargets = { - "Pluto", - "Charon", - "Jupiter", "Io", "Europa", "Ganymede", "Callisto" - } +{ + Name = "NH_RALPH_LEISA", + Parent = "NewHorizonsPosition", + Renderable = { + Type = "RenderableFov", + Body = "NEW HORIZONS", + Frame = "NH_SPACECRAFT", + RGB = { 0.8, 0.7, 0.7 }, + Instrument = { + Name = "NH_RALPH_LEISA", + Aberration = "NONE" }, + PotentialTargets = { + "Pluto", + "Charon", + "Jupiter", "Io", "Europa", "Ganymede", "Callisto" + } }, + Transform = { + Translation = { + Type = "StaticTranslation", + Position = RalphOffset + } + } +}, - -- NewHorizonsFov module NH_RALPH_MVIC_PAN1 - { - Name = "NH_RALPH_MVIC_PAN1", - Parent = "NewHorizonsPosition", - Renderable = { - Type = "RenderableFov", - Body = "NEW HORIZONS", - Frame = "NH_SPACECRAFT", - RGB = { 0.8, 0.7, 0.7 }, - Textures = { - Type = "simple", - Color = "textures/glare_blue.png", - -- need to add different texture - }, - Instrument = { - Name = "NH_RALPH_MVIC_PAN1", - Method = "ELLIPSOID", - Aberration = "NONE", - }, - PotentialTargets = { - "Pluto", - "Charon", - "Jupiter", "Io", "Europa", "Ganymede", "Callisto" - } +-- NewHorizonsFov module NH_RALPH_MVIC_PAN1 +{ + Name = "NH_RALPH_MVIC_PAN1", + Parent = "NewHorizonsPosition", + Renderable = { + Type = "RenderableFov", + Body = "NEW HORIZONS", + Frame = "NH_SPACECRAFT", + RGB = { 0.8, 0.7, 0.7 }, + Instrument = { + Name = "NH_RALPH_MVIC_PAN1", + Aberration = "NONE" }, + PotentialTargets = { + "Pluto", + "Charon", + "Jupiter", "Io", "Europa", "Ganymede", "Callisto" + } }, - -- NewHorizonsFov module NH_RALPH_MVIC_PAN2 - { - Name = "NH_RALPH_MVIC_PAN2", - Parent = "NewHorizonsPosition", - Renderable = { - Type = "RenderableFov", - Body = "NEW HORIZONS", - Frame = "NH_SPACECRAFT", - RGB = { 0.8, 0.7, 0.7 }, - Textures = { - Type = "simple", - Color = "textures/glare_blue.png", - -- need to add different texture - }, - Instrument = { - Name = "NH_RALPH_MVIC_PAN2", - Method = "ELLIPSOID", - Aberration = "NONE", - }, - PotentialTargets = { - "Pluto", - "Charon", - "Jupiter", "Io", "Europa", "Ganymede", "Callisto" - } + Transform = { + Translation = { + Type = "StaticTranslation", + Position = RalphOffset + } + } +}, +-- NewHorizonsFov module NH_RALPH_MVIC_PAN2 +{ + Name = "NH_RALPH_MVIC_PAN2", + Parent = "NewHorizonsPosition", + Renderable = { + Type = "RenderableFov", + Body = "NEW HORIZONS", + Frame = "NH_SPACECRAFT", + RGB = { 0.8, 0.7, 0.7 }, + Instrument = { + Name = "NH_RALPH_MVIC_PAN2", + Aberration = "NONE" }, + PotentialTargets = { + "Pluto", + "Charon", + "Jupiter", "Io", "Europa", "Ganymede", "Callisto" + } }, - -- NewHorizonsFov module NH_RALPH_MVIC_RED - { - Name = "NH_RALPH_MVIC_RED", - Parent = "NewHorizonsPosition", - Renderable = { - Type = "RenderableFov", - Body = "NEW HORIZONS", - Frame = "NH_SPACECRAFT", - RGB = { 0.8, 0.7, 0.7 }, - Textures = { - Type = "simple", - Color = "textures/glare_blue.png", - -- need to add different texture - }, - Instrument = { - Name = "NH_RALPH_MVIC_RED", - Method = "ELLIPSOID", - Aberration = "NONE", - }, - PotentialTargets = { - "Pluto", - "Charon", - "Jupiter", "Io", "Europa", "Ganymede", "Callisto" - } + Transform = { + Translation = { + Type = "StaticTranslation", + Position = RalphOffset + } + } +}, +-- NewHorizonsFov module NH_RALPH_MVIC_RED +{ + Name = "NH_RALPH_MVIC_RED", + Parent = "NewHorizonsPosition", + Renderable = { + Type = "RenderableFov", + Body = "NEW HORIZONS", + Frame = "NH_SPACECRAFT", + RGB = { 0.8, 0.7, 0.7 }, + Instrument = { + Name = "NH_RALPH_MVIC_RED", + Aberration = "NONE" }, + PotentialTargets = { + "Pluto", + "Charon", + "Jupiter", "Io", "Europa", "Ganymede", "Callisto" + } }, - -- NewHorizonsFov module NH_RALPH_MVIC_BLUE - { - Name = "NH_RALPH_MVIC_BLUE", - Parent = "NewHorizonsPosition", - Renderable = { - Type = "RenderableFov", - Body = "NEW HORIZONS", - Frame = "NH_SPACECRAFT", - RGB = { 0.8, 0.7, 0.7 }, - Textures = { - Type = "simple", - Color = "textures/glare_blue.png", - -- need to add different texture - }, - Instrument = { - Name = "NH_RALPH_MVIC_BLUE", - Method = "ELLIPSOID", - Aberration = "NONE", - }, - PotentialTargets = { - "Pluto", - "Charon", - "Jupiter", "Io", "Europa", "Ganymede", "Callisto" - } + Transform = { + Translation = { + Type = "StaticTranslation", + Position = RalphOffset + } + } +}, + + -- NewHorizonsFov module NH_RALPH_MVIC_BLUE + { + Name = "NH_RALPH_MVIC_BLUE", + Parent = "NewHorizonsPosition", + Renderable = { + Type = "RenderableFov", + Body = "NEW HORIZONS", + Frame = "NH_SPACECRAFT", + RGB = { 0.8, 0.7, 0.7 }, + Instrument = { + Name = "NH_RALPH_MVIC_BLUE", + Aberration = "NONE" }, + PotentialTargets = { + "Pluto", + "Charon", + "Jupiter", "Io", "Europa", "Ganymede", "Callisto" + } }, - -- NewHorizonsFov module NH_RALPH_MVIC_FT - { - Name = "NH_RALPH_MVIC_FT", - Parent = "NewHorizonsPosition", - Renderable = { - Type = "RenderableFov", - Body = "NEW HORIZONS", - Frame = "NH_SPACECRAFT", - RGB = { 0.8, 0.7, 0.7 }, - Textures = { - Type = "simple", - Color = "textures/glare_blue.png", - -- need to add different texture - }, - Instrument = { - Name = "NH_RALPH_MVIC_FT", - Method = "ELLIPSOID", - Aberration = "NONE", - }, - PotentialTargets = { - "Pluto", - "Charon", - "Jupiter", "Io", "Europa", "Ganymede", "Callisto" - } + Transform = { + Translation = { + Type = "StaticTranslation", + Position = RalphOffset + } + } +}, + +-- NewHorizonsFov module NH_RALPH_MVIC_FT +{ + Name = "NH_RALPH_MVIC_FT", + Parent = "NewHorizonsPosition", + Renderable = { + Type = "RenderableFov", + Body = "NEW HORIZONS", + Frame = "NH_SPACECRAFT", + RGB = { 0.8, 0.7, 0.7 }, + Instrument = { + Name = "NH_RALPH_MVIC_FT", + Aberration = "NONE" }, + PotentialTargets = { + "Pluto", + "Charon", + "Jupiter", "Io", "Europa", "Ganymede", "Callisto" + } }, - -- NewHorizonsFov module NH_RALPH_MVIC_METHANE - { - Name = "NH_RALPH_MVIC_METHANE", - Parent = "NewHorizonsPosition", - Renderable = { - Type = "RenderableFov", - Body = "NEW HORIZONS", - Frame = "NH_SPACECRAFT", - RGB = { 0.8, 0.7, 0.7 }, - Textures = { - Type = "simple", - Color = "textures/glare_blue.png", - -- need to add different texture - }, - Instrument = { - Name = "NH_RALPH_MVIC_METHANE", - Method = "ELLIPSOID", - Aberration = "NONE", - }, - PotentialTargets = { - "Pluto", - "Charon", - "Jupiter", "Io", "Europa", "Ganymede", "Callisto" - } + Transform = { + Translation = { + Type = "StaticTranslation", + Position = RalphOffset + } + } +}, + +-- NewHorizonsFov module NH_RALPH_MVIC_METHANE +{ + Name = "NH_RALPH_MVIC_METHANE", + Parent = "NewHorizonsPosition", + Renderable = { + Type = "RenderableFov", + Body = "NEW HORIZONS", + Frame = "NH_SPACECRAFT", + RGB = { 0.8, 0.7, 0.7 }, + Instrument = { + Name = "NH_RALPH_MVIC_METHANE", + Aberration = "NONE" }, + PotentialTargets = { + "Pluto", + "Charon", + "Jupiter", "Io", "Europa", "Ganymede", "Callisto" + } }, - -- NewHorizonsFov module NH_RALPH_MVIC_NIR - { - Name = "NH_RALPH_MVIC_NIR", - Parent = "NewHorizonsPosition", - Renderable = { - Type = "RenderableFov", - Body = "NEW HORIZONS", - Frame = "NH_SPACECRAFT", - RGB = { 0.8, 0.7, 0.7 }, - Textures = { - Type = "simple", - Color = "textures/glare_blue.png", - -- need to add different texture - }, - Instrument = { - Name = "NH_RALPH_MVIC_NIR", - Method = "ELLIPSOID", - Aberration = "NONE", - }, - PotentialTargets = { - "Pluto", - "Charon", - "Jupiter", "Io", "Europa", "Ganymede", "Callisto" - } + Transform = { + Translation = { + Type = "StaticTranslation", + Position = RalphOffset + } + } +}, + +-- NewHorizonsFov module NH_RALPH_MVIC_NIR +{ + Name = "NH_RALPH_MVIC_NIR", + Parent = "NewHorizonsPosition", + Renderable = { + Type = "RenderableFov", + Body = "NEW HORIZONS", + Frame = "NH_SPACECRAFT", + RGB = { 0.8, 0.7, 0.7 }, + Instrument = { + Name = "NH_RALPH_MVIC_NIR", + Aberration = "NONE" }, + PotentialTargets = { + "Pluto", + "Charon", + "Jupiter", "Io", "Europa", "Ganymede", "Callisto" + } }, - -- NewHorizonsFov module NH_ALICE_AIRGLOW - { - Name = "NH_ALICE_AIRGLOW", - Parent = "NewHorizonsPosition", - Renderable = { - Type = "RenderableFov", - Body = "NEW HORIZONS", - Frame = "NH_SPACECRAFT", - RGB = { 0.8, 0.7, 0.7 }, - Textures = { - Type = "simple", - Color = "textures/glare_blue.png", - -- need to add different texture - }, - Instrument = { - Name = "NH_ALICE_AIRGLOW", - Method = "ELLIPSOID", - Aberration = "NONE", - }, - PotentialTargets = { - "Pluto", - "Charon", - "Jupiter", "Io", "Europa", "Ganymede", "Callisto" - } + Transform = { + Translation = { + Type = "StaticTranslation", + Position = RalphOffset + } + } +}, + +-- NewHorizonsFov module NH_ALICE_AIRGLOW +{ + Name = "NH_ALICE_AIRGLOW", + Parent = "NewHorizonsPosition", + Renderable = { + Type = "RenderableFov", + Body = "NEW HORIZONS", + Frame = "NH_SPACECRAFT", + RGB = { 0.8, 0.7, 0.7 }, + Instrument = { + Name = "NH_ALICE_AIRGLOW", + Aberration = "NONE" }, + PotentialTargets = { + "Pluto", + "Charon", + "Jupiter", "Io", "Europa", "Ganymede", "Callisto" + } }, - -- NewHorizonsFov module NH_ALICE_SOC - { - Name = "NH_ALICE_SOC", - Parent = "NewHorizonsPosition", - Renderable = { - Type = "RenderableFov", - Body = "NEW HORIZONS", - Frame = "NH_SPACECRAFT", - RGB = { 0.8, 0.7, 0.7 }, - Textures = { - Type = "simple", - Color = "textures/glare_blue.png", - -- need to add different texture - }, - Instrument = { - Name = "NH_ALICE_SOC", - Method = "ELLIPSOID", - Aberration = "NONE", - }, - PotentialTargets = { - "Pluto", - "Charon", - "Jupiter", "Io", "Europa", "Ganymede", "Callisto" - } + Transform = { + Translation = { + Type = "StaticTranslation", + Position = AliceOffset + } + } +}, + +-- NewHorizonsFov module NH_ALICE_SOC +{ + Name = "NH_ALICE_SOC", + Parent = "NewHorizonsPosition", + Renderable = { + Type = "RenderableFov", + Body = "NEW HORIZONS", + Frame = "NH_SPACECRAFT", + RGB = { 0.8, 0.7, 0.7 }, + Instrument = { + Name = "NH_ALICE_SOC", + Aberration = "NONE" }, + PotentialTargets = { + "Pluto", + "Charon", + "Jupiter", "Io", "Europa", "Ganymede", "Callisto" + } }, - { - Name = "NH_REX", - Parent = "NewHorizonsPosition", - Renderable = { - Type = "RenderableCrawlingLine", - Source = "NH_REX", - Target = "EARTH", - -- Body = "NEW HORIZONS", - Frame = "GALACTIC", - Color = { 1.0, 0.7, 0.0 }, - Instrument = "NH_REX" + Transform = { + Translation = { + Type = "StaticTranslation", + Position = AliceOffset }, } -} \ No newline at end of file + }, + +-- Module NH_REX +{ + Name = "NH_REX", + Parent = "NewHorizonsPosition", + Renderable = { + Type = "RenderableCrawlingLine", + Source = "NH_REX", + Target = "EARTH", + Instrument = "NH_REX", + Color = { + Start = { 1.0, 0.7, 0.0, 1.0}, + End = {0.0, 0.0, 0.0, 0.0 } + } + }, + Transform = { + Rotation = { + Type = "StaticRotation", + Rotation = { + 0.0, 1.0, 0.0, + 0.0, 0.0, 1.0, + 1.0, 0.0, 0.0 + } + }, + Translation = { + Type = "StaticTranslation", + Position = RexOffset + } + } +} +} diff --git a/data/scene/missions/newhorizons/pluto/charon/charon.mod b/data/scene/missions/newhorizons/pluto/charon/charon.mod index 7cc7544f84..1813547e25 100644 --- a/data/scene/missions/newhorizons/pluto/charon/charon.mod +++ b/data/scene/missions/newhorizons/pluto/charon/charon.mod @@ -1,6 +1,9 @@ +local charon_radius = 6.035E5 + if UseAccurateNewHorizonsKernels then NewHorizonsKernels = { - "${SPICE}/nh_kernels/spk/NavSE_plu047_od122.bsp" + "${SPICE}/nh_20170126/spk/NavSE_plu047_od122.bsp", + "${SPICE}/nh_20170126/spk/NavPE_de433_od122.bsp", } else NewHorizonsKernels = { @@ -8,12 +11,12 @@ else } end -Files = { +local Files = { low = "textures/charon_highres.jpg", med = "textures/charon_highres.jpg", high = "textures/cpmap_cyl_HR_0e.jpg" } -ColorTexture = Files[TextureResolution] +local ColorTexture = Files[TextureResolution] return { -- CharonProjection module @@ -22,9 +25,10 @@ return { Parent = "PlutoBarycenter", Renderable = { Type = "RenderablePlanetProjection", + Radius = charon_radius, Geometry = { Type = "SimpleSphere", - Radius = 6.035E5, + Radius = charon_radius, Segments = 100 }, Textures = { diff --git a/data/scene/missions/newhorizons/pluto/hydra/hydra.mod b/data/scene/missions/newhorizons/pluto/hydra/hydra.mod index dbffd9a8a2..9418f4ceb4 100644 --- a/data/scene/missions/newhorizons/pluto/hydra/hydra.mod +++ b/data/scene/missions/newhorizons/pluto/hydra/hydra.mod @@ -1,6 +1,8 @@ +local charon_radius = 0.53E5 + if UseAccurateNewHorizonsKernels then NewHorizonsKernels = { - "${SPICE}/nh_kernels/spk/NavSE_plu047_od122.bsp" + "${SPICE}/nh_20170126/spk/NavSE_plu047_od122.bsp" } else NewHorizonsKernels = { @@ -17,9 +19,10 @@ return { Type = "RenderablePlanet", Frame = "IAU_PLUTO", Body = "HYDRA", + Radius = charon_radius, Geometry = { Type = "SimpleSphere", - Radius = { 0.53 , 5 }, + Radius = charon_radius, Segments = 100 }, Textures = { diff --git a/data/scene/missions/newhorizons/pluto/kerberos/kerberos.mod b/data/scene/missions/newhorizons/pluto/kerberos/kerberos.mod index 5710783747..9dab2c556f 100644 --- a/data/scene/missions/newhorizons/pluto/kerberos/kerberos.mod +++ b/data/scene/missions/newhorizons/pluto/kerberos/kerberos.mod @@ -1,6 +1,8 @@ +local kerberos_radius = 0.1E5 + if UseAccurateNewHorizonsKernels then NewHorizonsKernels = { - "${SPICE}/nh_kernels/spk/NavSE_plu047_od122.bsp" + "${SPICE}/nh_20170126/spk/NavSE_plu047_od122.bsp" } else NewHorizonsKernels = { @@ -17,9 +19,10 @@ return { Type = "RenderablePlanet", Frame = "IAU_PLUTO", Body = "KERBEROS", + Radius = kerberos_radius, Geometry = { Type = "SimpleSphere", - Radius = { 0.1 , 5 }, + Radius = kerberos_radius, Segments = 100 }, Textures = { diff --git a/data/scene/missions/newhorizons/pluto/nix/nix.mod b/data/scene/missions/newhorizons/pluto/nix/nix.mod index 8a4373431c..5ea9374cf0 100644 --- a/data/scene/missions/newhorizons/pluto/nix/nix.mod +++ b/data/scene/missions/newhorizons/pluto/nix/nix.mod @@ -1,6 +1,8 @@ +local nix_radius = 0.45E5 + if UseAccurateNewHorizonsKernels then NewHorizonsKernels = { - "${SPICE}/nh_kernels/spk/NavSE_plu047_od122.bsp" + "${SPICE}/nh_20170126/spk/NavSE_plu047_od122.bsp" } else NewHorizonsKernels = { @@ -17,9 +19,10 @@ return { Type = "RenderablePlanet", Frame = "IAU_PLUTO", Body = "NIX", + Radius = nix_radius, Geometry = { Type = "SimpleSphere", - Radius = 0.45E5, + Radius = nix_radius, Segments = 100 }, Textures = { diff --git a/data/scene/missions/newhorizons/pluto/pluto/pluto.mod b/data/scene/missions/newhorizons/pluto/pluto/pluto.mod index 6709f03fdb..4e54ff8b2a 100644 --- a/data/scene/missions/newhorizons/pluto/pluto/pluto.mod +++ b/data/scene/missions/newhorizons/pluto/pluto/pluto.mod @@ -1,7 +1,9 @@ +local pluto_radius = 1.173E6 + if UseAccurateNewHorizonsKernels then NewHorizonsKernels = { - "${SPICE}/nh_kernels/spk/NavPE_de433_od122.bsp", - "${SPICE}/nh_kernels/spk/NavSE_plu047_od122.bsp" + "${SPICE}/nh_20170126/spk/NavPE_de433_od122.bsp", + "${SPICE}/nh_20170126/spk/NavSE_plu047_od122.bsp" } else NewHorizonsKernels = { @@ -9,12 +11,12 @@ else } end -Files = { +local Files = { low = "textures/pluto_large.jpg", med = "textures/Shenk_180.jpg", high = "textures/pmap_cyl_HR_LOR_lowres.jpg" } -ColorTexture = Files[TextureResolution] +local ColorTexture = Files[TextureResolution] return { -- Pluto barycenter module @@ -36,9 +38,10 @@ return { Parent = "PlutoBarycenter", Renderable = { Type = "RenderablePlanetProjection", + Radius = pluto_radius, Geometry = { Type = "SimpleSphere", - Radius = 1.173E6, + Radius = pluto_radius, Segments = 100 }, Textures = { @@ -205,7 +208,7 @@ return { Parent = "Pluto", Renderable = { Type = "RenderablePlane", - Size = {1.0, 6.4}, + Size = 10.0^6.4, Origin = "Center", Billboard = true, ProjectionListener = false, diff --git a/data/scene/missions/newhorizons/pluto/styx/styx.mod b/data/scene/missions/newhorizons/pluto/styx/styx.mod index 8637601452..da6e1bce05 100644 --- a/data/scene/missions/newhorizons/pluto/styx/styx.mod +++ b/data/scene/missions/newhorizons/pluto/styx/styx.mod @@ -1,6 +1,8 @@ +local styx_radius = 0.75E4 + if UseAccurateNewHorizonsKernels then NewHorizonsKernels = { - "${SPICE}/nh_kernels/spk/NavSE_plu047_od122.bsp" + "${SPICE}/nh_20170126/spk/NavSE_plu047_od122.bsp" } else NewHorizonsKernels = { @@ -17,9 +19,10 @@ return { Type = "RenderablePlanet", Frame = "IAU_PLUTO", Body = "STYX", + Radius = styx_radius, Geometry = { Type = "SimpleSphere", - Radius = 0.75E4, + Radius = styx_radius, Segments = 100 }, Textures = { diff --git a/modules/base/shaders/model_fs.glsl b/modules/base/shaders/model_fs.glsl index 3a14dc24dd..d53c5c30ae 100644 --- a/modules/base/shaders/model_fs.glsl +++ b/modules/base/shaders/model_fs.glsl @@ -22,8 +22,6 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -// Uniforms -uniform float transparency; uniform float fading; uniform bool performShading = true; @@ -76,10 +74,8 @@ Fragment getFragment() { color = diffuseAlbedo; } - float alpha = fading * transparency; - Fragment frag; - frag.color = vec4(color, alpha); + frag.color = vec4(color, fading); frag.depth = vs_positionScreenSpace.w; return frag; diff --git a/modules/newhorizons/rendering/renderableplanetprojection.cpp b/modules/newhorizons/rendering/renderableplanetprojection.cpp index db8e1710a5..ed13725709 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.cpp +++ b/modules/newhorizons/rendering/renderableplanetprojection.cpp @@ -280,7 +280,7 @@ void RenderablePlanetProjection::imageProjectGPU( if (_geometry->hasProperty("radius")){ ghoul::any r = _geometry->property("radius")->get(); - if (glm::vec4* radius = ghoul::any_cast(&r)){ + if (glm::vec3* radius = ghoul::any_cast(&r)){ _fboProgramObject->setUniform("_radius", radius); } }else{ diff --git a/modules/newhorizons/shaders/renderableModel_fs.glsl b/modules/newhorizons/shaders/renderableModel_fs.glsl index 2b9f770cc0..92cc06e689 100644 --- a/modules/newhorizons/shaders/renderableModel_fs.glsl +++ b/modules/newhorizons/shaders/renderableModel_fs.glsl @@ -90,6 +90,7 @@ Fragment getFragment() { Fragment frag; frag.color = vec4(color, 1.0); - frag.depth = vs_positionScreenSpace.w; + // frag.depth = vs_positionScreenSpace.w; + frag.depth = 0.0; return frag; } diff --git a/modules/newhorizons/shaders/renderablePlanetProjection_fs.glsl b/modules/newhorizons/shaders/renderablePlanetProjection_fs.glsl index 34020b7eef..db707936a1 100644 --- a/modules/newhorizons/shaders/renderablePlanetProjection_fs.glsl +++ b/modules/newhorizons/shaders/renderablePlanetProjection_fs.glsl @@ -37,14 +37,14 @@ uniform mat4 ProjectorMatrix; uniform mat4 ModelTransform; uniform vec2 _scaling; -uniform vec4 _radius; +uniform vec3 _radius; uniform int _segments; uniform vec3 boresight; #define M_PI 3.14159265358979323846 -vec4 uvToModel(vec2 uv, vec4 radius, float segments){ +vec4 uvToModel(vec2 uv, vec3 radius, float segments){ float fj = uv.x * segments; float fi = (1.0 - uv.y) * segments; @@ -55,7 +55,7 @@ vec4 uvToModel(vec2 uv, vec4 radius, float segments){ float y = radius[1] * cos(theta); // up float z = radius[2] * cos(phi) * sin(theta); // - return vec4(x, y, z, radius[3]); + return vec4(x, y, z, 0); } bool inRange(float x, float a, float b){ @@ -79,7 +79,7 @@ void main() { vec3 v_b = normalize(boresight); - if((inRange(projected.x, 0, 1) && + if((inRange(projected.x, 0, 1) && inRange(projected.y, 0, 1)) && dot(v_b, normal) < 0 ) { From ec6641038d7c90d46e64b2ab221d81d21f92ae67 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 15 Jul 2017 14:37:00 -0400 Subject: [PATCH 07/44] Make use of C++17 features in LuaConsole and filesystem walking --- ext/ghoul | 2 +- src/interaction/luaconsole.cpp | 6 ++---- src/scripting/scriptengine_lua.inl | 31 +++++++++++++++--------------- 3 files changed, 18 insertions(+), 21 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 5309bfcb56..9f27e93d41 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 5309bfcb56e184510d766462aadeab61862fb158 +Subproject commit 9f27e93d41a68eeab2f7bd1424c07ae2854fe21b diff --git a/src/interaction/luaconsole.cpp b/src/interaction/luaconsole.cpp index 5ef4929b15..d8d1546a40 100644 --- a/src/interaction/luaconsole.cpp +++ b/src/interaction/luaconsole.cpp @@ -52,9 +52,7 @@ namespace { // A high number is chosen since we didn't have a version number before // any small number might also be equal to the console history length - // @CPP17 - //const uint64_t CurrentVersion = 0xFEEE'FEEE'0000'0001; - const uint64_t CurrentVersion = 0xFEEEFEEE00000001; + const uint64_t CurrentVersion = 0xFEEE'FEEE'0000'0001; const openspace::Key CommandInputButton = openspace::Key::GraveAccent; @@ -750,7 +748,7 @@ void LuaConsole::render() { res.y - HistoryFontSize * 1.5f + _fullHeight - _currentHeight ); - // @CPP17: Replace with array_view + // @CPP: Replace with array_view std::vector commandSubset; if (_commandsHistory.size() < static_cast(_historyLength)) { commandSubset = _commandsHistory; diff --git a/src/scripting/scriptengine_lua.inl b/src/scripting/scriptengine_lua.inl index 0eda39fd16..807c79f629 100644 --- a/src/scripting/scriptengine_lua.inl +++ b/src/scripting/scriptengine_lua.inl @@ -30,16 +30,9 @@ namespace luascriptfunctions { namespace { -using walkFunc = std::vector(ghoul::filesystem::Directory::*)( - ghoul::filesystem::Directory::Recursive, ghoul::filesystem::Directory::Sort) const; - -// Defining a common walk function that works off a pointer-to-member function (defined -// above) allows us to easily reuse this code -int walkCommon(lua_State* L, walkFunc func) { - // @CPP17 Replace with std::invoke -#define CALL_MEMBER_FN(object,ptrToMember) ((object).*(ptrToMember)) - - using namespace ghoul::filesystem; +// Defining a common walk function that works off a pointer-to-member function +template +int walkCommon(lua_State* L, Func func) { const int nArguments = lua_gettop(L); if (nArguments < 1 || nArguments > 3) { return luaL_error(L, "Expected %i-%i arguments, got %i", 1, 3, nArguments); @@ -49,29 +42,35 @@ int walkCommon(lua_State* L, walkFunc func) { if (nArguments == 1) { // Only the path was passed const std::string path = luaL_checkstring(L, -1); - result = CALL_MEMBER_FN(Directory(path), func)( + result = std::invoke( + func, + ghoul::filesystem::Directory(path), ghoul::filesystem::Directory::Recursive::No, ghoul::filesystem::Directory::Sort::No - ); + ); } else if (nArguments == 2) { // The path and the recursive value were passed const std::string path = luaL_checkstring(L, -2); const bool recursive = lua_toboolean(L, -1) != 0; - result = CALL_MEMBER_FN(Directory(path), func)( + result = std::invoke( + func, + ghoul::filesystem::Directory(path), ghoul::filesystem::Directory::Recursive(recursive), ghoul::filesystem::Directory::Sort::No - ); + ); } else if (nArguments == 3) { // All three arguments were passed const std::string path = luaL_checkstring(L, -3); const bool recursive = lua_toboolean(L, -2) != 0; const bool sorted = lua_toboolean(L, -1) != 0; - result = CALL_MEMBER_FN(Directory(path), func)( + result = std::invoke( + func, + ghoul::filesystem::Directory(path), ghoul::filesystem::Directory::Recursive(recursive), ghoul::filesystem::Directory::Sort(sorted) - ); + ); } // Copy values into the lua_State From 469140f4f0e302ce55d2e2fb025097ccc830e8a9 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 15 Jul 2017 15:37:42 -0400 Subject: [PATCH 08/44] C++17 nested namespace test --- ext/ghoul | 2 +- support/cmake/support_macros.cmake | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 9f27e93d41..6d2f497e4f 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 9f27e93d41a68eeab2f7bd1424c07ae2854fe21b +Subproject commit 6d2f497e4f26120be8fbf0e51b6849817ea858d6 diff --git a/support/cmake/support_macros.cmake b/support/cmake/support_macros.cmake index 28273f7724..968acbfe15 100644 --- a/support/cmake/support_macros.cmake +++ b/support/cmake/support_macros.cmake @@ -110,13 +110,16 @@ function (set_compile_settings project) "/w44946" # reinterpret_cast used between related classes: 'class1' and 'class2' "/w44986" # 'symbol': exception specification does not match previous declaration "/w44988" # 'symbol': variable declared outside class/function scope - # "/std:c++latest" # Boost as of 1.64 still uses unary_function + "/std:c++latest" "/permissive-" "/Zc:strictStrings-" # Windows header don't adhere to this ) if (OPENSPACE_WARNINGS_AS_ERRORS) target_compile_options(${project} PRIVATE "/WX") endif () + + # Boost as of 1.64 still uses unary_function unless we define this + target_compile_definitions(${project} PRIVATE "_HAS_AUTO_PTR_ETC") elseif (APPLE) target_compile_definitions(${project} PRIVATE "__APPLE__") From 9401579cc0a88ecc96544e71f77eadb2fc6ae220 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 15 Jul 2017 15:53:45 -0400 Subject: [PATCH 09/44] Jenkins compile fix by specifying compile settings for applications --- apps/Launcher/CMakeLists.txt | 5 ++++- apps/OpenSpace/CMakeLists.txt | 3 +++ apps/TaskRunner/CMakeLists.txt | 2 ++ 3 files changed, 9 insertions(+), 1 deletion(-) diff --git a/apps/Launcher/CMakeLists.txt b/apps/Launcher/CMakeLists.txt index 8d21984d12..0b2cfba232 100644 --- a/apps/Launcher/CMakeLists.txt +++ b/apps/Launcher/CMakeLists.txt @@ -29,7 +29,8 @@ if (WIN32) set(RESOURCE_FILE ${OPENSPACE_APPS_DIR}/Launcher/openspace.rc) endif () -include (${GHOUL_BASE_DIR}/support/cmake/handle_external_library.cmake) +include(${GHOUL_BASE_DIR}/support/cmake/handle_external_library.cmake) +include(${OPENSPACE_CMAKE_EXT_DIR}/support_macros.cmake) set(application_path ${OPENSPACE_APPS_DIR}/Launcher) @@ -65,6 +66,8 @@ add_executable(${APPLICATION_NAME} MACOSX_BUNDLE ${RESOURCE_FILES} ) +set_compile_settings(${APPLICATION_NAME}) + target_link_libraries(${APPLICATION_NAME} Qt5::Widgets Qt5::Network diff --git a/apps/OpenSpace/CMakeLists.txt b/apps/OpenSpace/CMakeLists.txt index 6f9d4bb247..a2c52bed76 100644 --- a/apps/OpenSpace/CMakeLists.txt +++ b/apps/OpenSpace/CMakeLists.txt @@ -23,6 +23,7 @@ ########################################################################################## include(${GHOUL_BASE_DIR}/support/cmake/CopySharedLibraries.cmake) +include(${OPENSPACE_CMAKE_EXT_DIR}/support_macros.cmake) set(APPLICATION_NAME OpenSpace) set(APPLICATION_LINK_TO_OPENSPACE ON) @@ -130,3 +131,5 @@ if (MSVC) "/NODEFAULTLIB:LIBCMTD.lib /NODEFAULTLIB:LIBCMT.lib" ) endif() + +set_compile_settings(${APPLICATION_NAME}) diff --git a/apps/TaskRunner/CMakeLists.txt b/apps/TaskRunner/CMakeLists.txt index 69f23771d3..f05c53d6a9 100644 --- a/apps/TaskRunner/CMakeLists.txt +++ b/apps/TaskRunner/CMakeLists.txt @@ -26,6 +26,7 @@ set(APPLICATION_NAME TaskRunner) set(APPLICATION_LINK_TO_OPENSPACE ON) include (${GHOUL_BASE_DIR}/support/cmake/handle_external_library.cmake) +include(${OPENSPACE_CMAKE_EXT_DIR}/support_macros.cmake) set(application_path ${OPENSPACE_APPS_DIR}/TaskRunner) @@ -37,3 +38,4 @@ add_executable(${APPLICATION_NAME} MACOSX_BUNDLE ${SOURCE_FILES} ) +set_compile_settings(${APPLICATION_NAME}) From 93cb8a98da65453acab48e21f6b19b865fb5a1ae Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 15 Jul 2017 16:12:49 -0400 Subject: [PATCH 10/44] Set correct compiler flags for OpenSpaceTest --- support/cmake/support_macros.cmake | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/support/cmake/support_macros.cmake b/support/cmake/support_macros.cmake index 968acbfe15..c598f3d6bc 100644 --- a/support/cmake/support_macros.cmake +++ b/support/cmake/support_macros.cmake @@ -394,9 +394,7 @@ function (handle_option_tests) "/NODEFAULTLIB:LIBCMTD.lib /NODEFAULTLIB:LIBCMT.lib" ) endif () - set_property(TARGET OpenSpaceTest PROPERTY FOLDER "Unit Tests") - set_property(TARGET OpenSpaceTest PROPERTY CXX_STANDARD 14) - set_property(TARGET OpenSpaceTest PROPERTY CXX_STANDARD_REQUIRED On) + set_compile_settings(OpenSpaceTest) endif (OPENSPACE_HAVE_TESTS) if (TARGET GhoulTest) if (NOT TARGET gtest) From 713b5bb97b283cd069c5f178877739f189da824c Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 15 Jul 2017 17:48:03 -0400 Subject: [PATCH 11/44] Fix compile error in iSWA module Update warning specification for modules Disable unreferenced local function warning Update Ghoul --- ext/ghoul | 2 +- include/openspace/rendering/volumeraycaster.h | 12 +-- include/openspace/util/syncdata.h | 10 +-- modules/iswa/rendering/iswakameleongroup.cpp | 8 +- modules/iswa/rendering/kameleonplane.cpp | 8 +- support/cmake/module_definition.cmake | 74 ++++++++++++++----- support/cmake/support_macros.cmake | 1 + 7 files changed, 80 insertions(+), 35 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 6d2f497e4f..5f8dd8ba1e 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 6d2f497e4f26120be8fbf0e51b6849817ea858d6 +Subproject commit 5f8dd8ba1eae10096d55028a748120b75963314b diff --git a/include/openspace/rendering/volumeraycaster.h b/include/openspace/rendering/volumeraycaster.h index e9cb1674b0..4ba8fabe36 100644 --- a/include/openspace/rendering/volumeraycaster.h +++ b/include/openspace/rendering/volumeraycaster.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -51,30 +51,30 @@ public: /** * Render the volume's entry points (front face of the bounding geometry) */ - virtual void renderEntryPoints(const RenderData& data, ghoul::opengl::ProgramObject& program) = 0; + virtual void renderEntryPoints(const RenderData& /*data*/, ghoul::opengl::ProgramObject& /*program*/) = 0; /** * Render the volume's exit points (back face of the bounding geometry) */ - virtual void renderExitPoints(const RenderData& data, ghoul::opengl::ProgramObject& program) = 0; + virtual void renderExitPoints(const RenderData& /*data*/, ghoul::opengl::ProgramObject& /*program*/) = 0; /** * Prepare the volume for the ABuffer's resolve step. * Make sure textures are up to date, bind them to texture units, set program uniforms etc. */ - virtual void preRaycast(const RaycastData& data, ghoul::opengl::ProgramObject& program) {}; + virtual void preRaycast(const RaycastData& /*data*/, ghoul::opengl::ProgramObject& /*program*/) {}; /** * Clean up for the volume after the ABuffer's resolve step. * Make sure texture units are deinitialized, etc. */ - virtual void postRaycast(const RaycastData& data, ghoul::opengl::ProgramObject& program) {}; + virtual void postRaycast(const RaycastData& /*data*/, ghoul::opengl::ProgramObject& /*program*/) {}; /** * Return true if the camera is inside the volume. * Also set localPosition to the camera position in the volume's local coordainte system. */ - virtual bool cameraIsInside(const RenderData& data, glm::vec3& localPosition) { return false; }; + virtual bool cameraIsInside(const RenderData& /*data*/, glm::vec3& /*localPosition*/) { return false; }; /** * Return a path the file to use as vertex shader * diff --git a/include/openspace/util/syncdata.h b/include/openspace/util/syncdata.h index daeeaeedc0..b31aacb90d 100644 --- a/include/openspace/util/syncdata.h +++ b/include/openspace/util/syncdata.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -46,10 +46,10 @@ protected: // Allowing SyncEngine synchronization methods and at the same time hiding them // from the used of implementations of the interface friend class SyncEngine; - virtual void presync(bool isMaster) {}; - virtual void encode(SyncBuffer* syncBuffer) = 0; - virtual void decode(SyncBuffer* syncBuffer) = 0; - virtual void postsync(bool isMaster) {}; + virtual void presync(bool /*isMaster*/) {}; + virtual void encode(SyncBuffer* /*syncBuffer*/) = 0; + virtual void decode(SyncBuffer* /*syncBuffer*/) = 0; + virtual void postsync(bool /*isMaster*/) {}; }; /** diff --git a/modules/iswa/rendering/iswakameleongroup.cpp b/modules/iswa/rendering/iswakameleongroup.cpp index 31cf174525..c89a9b5d27 100644 --- a/modules/iswa/rendering/iswakameleongroup.cpp +++ b/modules/iswa/rendering/iswakameleongroup.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -113,7 +113,11 @@ void IswaKameleonGroup::readFieldlinePaths(std::string indexFile){ for (json::iterator it = fieldlines.begin(); it != fieldlines.end(); ++it) { _fieldlines.addOption({i, it.key()}); - _fieldlineState[i] = std::make_tuple(name()+"/"+it.key(), it.value(), false); + _fieldlineState[i] = std::make_tuple( + name() + "/" + it.key(), + it.value(), + false + ); i++; } diff --git a/modules/iswa/rendering/kameleonplane.cpp b/modules/iswa/rendering/kameleonplane.cpp index d7c1c6ed19..ea2f2d5594 100644 --- a/modules/iswa/rendering/kameleonplane.cpp +++ b/modules/iswa/rendering/kameleonplane.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -269,7 +269,11 @@ void KameleonPlane::readFieldlinePaths(std::string indexFile){ std::string partName = fullName.substr(0,fullName.find_last_of("-")); for (json::iterator it = fieldlines.begin(); it != fieldlines.end(); ++it) { _fieldlines.addOption({i, it.key()}); - _fieldlineState[i] = std::make_tuple(partName+"/"+it.key(), it.value(), false); + _fieldlineState[i] = std::make_tuple( + partName + "/" + it.key(), + it.value(), + false + ); i++; } } catch(const std::exception& e) { diff --git a/support/cmake/module_definition.cmake b/support/cmake/module_definition.cmake index 24c44bf5c0..79223f7cbd 100644 --- a/support/cmake/module_definition.cmake +++ b/support/cmake/module_definition.cmake @@ -82,28 +82,64 @@ endmacro () # Set the compiler settings that are common to all modules function (set_common_compile_settings target_name) - set_property(TARGET ${library_name} PROPERTY CXX_STANDARD 14) - set_property(TARGET ${library_name} PROPERTY CXX_STANDARD_REQUIRED On) + set_property(TARGET ${target_name} PROPERTY CXX_STANDARD 17) + set_property(TARGET ${target_name} PROPERTY CXX_STANDARD_REQUIRED On) if (MSVC) - target_compile_options(${library_name} PUBLIC - "/ZI" # Enable edit and continue support - "/MP" # Enabling multi-threaded compilation - "/wd4100" # Unreferenced formal parameter [too frequent in external libs] - "/wd4127" # constant conditional expression [used for do/while semicolon swallowing] - "/wd4201" # nameless struct/union [standard is ubiquitous] - "/wd4505" # Unreferenced function was removed - "/W4" # Warning level + target_compile_options(${target_name} PRIVATE + "/ZI" # Edit and continue support + "/MP" # Multi-threading support + "/W4" # Highest warning level + "/w44062" # enumerator 'identifier' in a switch of enum 'enumeration' is not handled + "/wd4127" # conditional expression is constant + "/wd4201" # nonstandard extension used : nameless struct/union + "/w44255" # 'function': no function prototype given: converting '()' to '(void)' + "/w44263" # 'function': member function does not override any base class virtual member function + "/w44264" # 'virtual_function': no override available for virtual member function from base 'class'; function is hidden + "/w44265" # 'class': class has virtual functions, but destructor is not virtual + "/w44266" # 'function': no override available for virtual member function from base 'type'; function is hidden + "/w44289" # nonstandard extension used : 'var' : loop control variable declared in the for-loop is used outside the for-loop scope + "/w44296" # 'operator': expression is always false + "/w44311" # 'variable' : pointer truncation from 'type' to 'type' + "/w44339" # 'type' : use of undefined type detected in CLR meta-data - use of this type may lead to a runtime exception + "/w44342" # behavior change: 'function' called, but a member operator was called in previous versions + "/w44350" # behavior change: 'member1' called instead of 'member2' + "/w44431" # missing type specifier - int assumed. Note: C no longer supports default-int + "/w44471" # a forward declaration of an unscoped enumeration must have an underlying type (int assumed) + "/wd4505" # unreferenced local function has been removed + "/w44545" # expression before comma evaluates to a function which is missing an argument list + "/w44546" # function call before comma missing argument list + "/w44547" # 'operator': operator before comma has no effect; expected operator with side-effect + "/w44548" # expression before comma has no effect; expected expression with side-effect + "/w44549" # 'operator': operator before comma has no effect; did you intend 'operator'? + "/w44555" # expression has no effect; expected expression with side-effect + "/w44574" # 'identifier' is defined to be '0': did you mean to use '#if identifier'? + "/w44608" # 'symbol1' has already been initialized by another union member in the initializer list, 'symbol2' + "/w44619" # #pragma warning: there is no warning number 'number' + "/w44628" # digraphs not supported with -Ze. Character sequence 'digraph' not interpreted as alternate token for 'char' + "/w44640" # 'instance': construction of local static object is not thread-safe + "/w44905" # wide string literal cast to 'LPSTR' + "/w44906" # string literal cast to 'LPWSTR' + "/w44946" # reinterpret_cast used between related classes: 'class1' and 'class2' + "/w44986" # 'symbol': exception specification does not match previous declaration + "/w44988" # 'symbol': variable declared outside class/function scope + "/std:c++latest" + "/permissive-" + "/Zc:strictStrings-" # Windows header don't adhere to this ) - target_compile_definitions(${library_name} PUBLIC "NOMINMAX") + + target_compile_definitions(${target_name} PUBLIC "NOMINMAX") if (OPENSPACE_WARNINGS_AS_ERRORS) - target_compile_options(${library_name} PUBLIC "/Wx") + target_compile_options(${target_name} PUBLIC "/Wx") endif () + + # Boost as of 1.64 still uses unary_function unless we define this + target_compile_definitions(${target_name} PRIVATE "_HAS_AUTO_PTR_ETC") elseif (APPLE) - target_compile_definitions(${library_name} PUBLIC "__APPLE__") - target_compile_options(${library_name} PUBLIC "-stdlib=libc++") + target_compile_definitions(${target_name} PUBLIC "__APPLE__") + target_compile_options(${target_name} PUBLIC "-stdlib=libc++") if (OPENSPACE_WARNINGS_AS_ERRORS) - target_compile_options(${library_name} PUBLIC "-Werror") + target_compile_options(${target_name} PUBLIC "-Werror") endif () elseif (UNIX) include (CheckCXXCompilerFlag) @@ -111,16 +147,16 @@ function (set_common_compile_settings target_name) CHECK_CXX_COMPILER_FLAG("-std=c++0x" COMPILER_SUPPORTS_CXX0X) mark_as_advanced(COMPILER_SUPPORTS_CXX11, COMPILER_SUPPORTS_CXX0X) if (COMPILER_SUPPORTS_CXX11) - target_compile_options(${library_name} PUBLIC "-std=c++11") + target_compile_options(${target_name} PUBLIC "-std=c++11") elseif (COMPILER_SUPPORTS_CXX0X) - target_compile_options(${library_name} PUBLIC "-std=c++0x") + target_compile_options(${target_name} PUBLIC "-std=c++0x") else () message(FATAL_ERROR "Compiler does not have C++11 support") endif () - target_compile_options(${library_name} PUBLIC "-ggdb" "-Wall" "-Wno-long-long" "-pedantic" "-Wextra") + target_compile_options(${target_name} PUBLIC "-ggdb" "-Wall" "-Wno-long-long" "-pedantic" "-Wextra") if (OPENSPACE_WARNINGS_AS_ERRORS) - target_compile_options(${library_name} PUBLIC "-Werror") + target_compile_options(${target_name} PUBLIC "-Werror") endif () endif () endfunction () diff --git a/support/cmake/support_macros.cmake b/support/cmake/support_macros.cmake index c598f3d6bc..2ae89cd8ec 100644 --- a/support/cmake/support_macros.cmake +++ b/support/cmake/support_macros.cmake @@ -94,6 +94,7 @@ function (set_compile_settings project) "/w44350" # behavior change: 'member1' called instead of 'member2' "/w44431" # missing type specifier - int assumed. Note: C no longer supports default-int "/w44471" # a forward declaration of an unscoped enumeration must have an underlying type (int assumed) + "/wd4505" # unreferenced local function has been removed "/w44545" # expression before comma evaluates to a function which is missing an argument list "/w44546" # function call before comma missing argument list "/w44547" # 'operator': operator before comma has no effect; expected operator with side-effect From 3b1c2b37a0910b0d84e605687a44b162d10df5da Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 15 Jul 2017 18:13:52 -0400 Subject: [PATCH 12/44] Update ghoul repository Adapt to the change from ghoul::any to std::any --- ext/ghoul | 2 +- .../properties/numericalproperty.inl | 4 +- include/openspace/properties/property.h | 12 +++--- .../openspace/properties/templateproperty.h | 14 +++---- .../openspace/properties/templateproperty.inl | 42 ++++++++++++------- .../openspace/properties/triggerproperty.h | 4 +- modules/iswa/rendering/datacygnet.cpp | 30 ++++++------- .../rendering/renderableplanetprojection.cpp | 10 ++--- src/documentation/documentation.cpp | 3 +- src/documentation/documentationengine.cpp | 3 +- src/documentation/verifier.cpp | 4 +- src/engine/virtualpropertymanager.cpp | 11 ++--- src/mission/mission.cpp | 6 ++- src/properties/property.cpp | 12 +++--- src/properties/triggerproperty.cpp | 4 +- 15 files changed, 91 insertions(+), 70 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 5f8dd8ba1e..0eabe3dd20 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 5f8dd8ba1eae10096d55028a748120b75963314b +Subproject commit 0eabe3dd20b2ed015c0634c5c013ff1461a004d9 diff --git a/include/openspace/properties/numericalproperty.inl b/include/openspace/properties/numericalproperty.inl index e7d46cf07e..07e9e08979 100644 --- a/include/openspace/properties/numericalproperty.inl +++ b/include/openspace/properties/numericalproperty.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -328,7 +328,7 @@ bool NumericalProperty::setStringValue(std::string value) { value, success ); if (success) - TemplateProperty::set(ghoul::any(std::move(thisValue))); + TemplateProperty::set(std::any(std::move(thisValue))); return success; } diff --git a/include/openspace/properties/property.h b/include/openspace/properties/property.h index 80b446b5a3..fc9dd0dc33 100644 --- a/include/openspace/properties/property.h +++ b/include/openspace/properties/property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -28,6 +28,8 @@ #include #include + +#include #include #include @@ -113,11 +115,11 @@ public: /** * This method returns the encapsulated value of the Property to the caller. The type * that is returned is determined by the type function and is up to the developer of - * the derived class. The default implementation returns an empty ghoul::any object. - * \return The value that is encapsulated by this Property, or an empty ghoul::any + * the derived class. The default implementation returns an empty std::any object. + * \return The value that is encapsulated by this Property, or an empty std::any * object if the method was not overritten. */ - virtual ghoul::any get() const; + virtual std::any get() const; /** * Sets the value encapsulated by this Property to the value passed to @@ -127,7 +129,7 @@ public: * implementation of this method ignores the input. * \param value The new value that should be stored in this Property */ - virtual void set(ghoul::any value); + virtual void set(std::any value); /** * This method returns the type that is requested by this Property for the set method. diff --git a/include/openspace/properties/templateproperty.h b/include/openspace/properties/templateproperty.h index feddc84167..9b23293408 100644 --- a/include/openspace/properties/templateproperty.h +++ b/include/openspace/properties/templateproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -85,21 +85,21 @@ public: virtual std::string className() const override; /** - * Returns the stored value packed into a ghoul::any object. - * \return The stored value packed into a ghoul::any object + * Returns the stored value packed into a std::any object. + * \return The stored value packed into a std::any object */ - virtual ghoul::any get() const override; + virtual std::any get() const override; /** - * Sets the value fro the provided ghoul::any object. If the types between + * Sets the value from the provided std::any object. If the types between * T and value disagree, an error is logged and the stored * value remains unchanged. */ - virtual void set(ghoul::any value) override; + virtual void set(std::any value) override; /** * Returns the std::type_info describing the template parameter - * T. It can be used to test against a ghoul::any value before trying to + * T. It can be used to test against a std::any value before trying to * assign it. * \return The type info object describing the template parameter T */ diff --git a/include/openspace/properties/templateproperty.inl b/include/openspace/properties/templateproperty.inl index 7e4c2b790e..a377edfaa2 100644 --- a/include/openspace/properties/templateproperty.inl +++ b/include/openspace/properties/templateproperty.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -214,20 +214,20 @@ std::ostream& operator<<(std::ostream& os, const TemplateProperty& obj) { } template -ghoul::any TemplateProperty::get() const { - return ghoul::any(_value); +std::any TemplateProperty::get() const { + return std::any(_value); } template -void TemplateProperty::set(ghoul::any value) { +void TemplateProperty::set(std::any value) { try { - T v = ghoul::any_cast(std::move(value)); + T v = std::any_cast(std::move(value)); if (v != _value) { _value = std::move(v); notifyListener(); } } - catch (ghoul::bad_any_cast&) { + catch (std::bad_any_cast&) { LERRORC("TemplateProperty", "Illegal cast from '" << value.type().name() << "' to '" << typeid(T).name() << "'"); } @@ -240,16 +240,23 @@ const std::type_info& TemplateProperty::type() const { template bool TemplateProperty::getLuaValue(lua_State* state) const { - bool success = PropertyDelegate>::template toLuaValue(state, _value); + bool success = PropertyDelegate>::template toLuaValue( + state, + _value + ); return success; } template bool TemplateProperty::setLuaValue(lua_State* state) { bool success = false; - T thisValue = PropertyDelegate>::template fromLuaValue(state, success); - if (success) - set(ghoul::any(thisValue)); + T thisValue = PropertyDelegate>::template fromLuaValue( + state, + success + ); + if (success) { + set(std::any(thisValue)); + } return success; } @@ -260,16 +267,23 @@ int TemplateProperty::typeLua() const { template bool TemplateProperty::getStringValue(std::string& value) const { - bool success = PropertyDelegate>::template toString(value, _value); + bool success = PropertyDelegate>::template toString( + value, + _value + ); return success; } template bool TemplateProperty::setStringValue(std::string value) { bool success = false; - T thisValue = PropertyDelegate>::template fromString(value, success); - if (success) - set(ghoul::any(thisValue)); + T thisValue = PropertyDelegate>::template fromString( + value, + success + ); + if (success) { + set(std::any(thisValue)); + } return success; } diff --git a/include/openspace/properties/triggerproperty.h b/include/openspace/properties/triggerproperty.h index 47afb82b25..0772f6c1b4 100644 --- a/include/openspace/properties/triggerproperty.h +++ b/include/openspace/properties/triggerproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -64,7 +64,7 @@ public: * listeners regardless of the value * \param value The ignored value */ - void set(ghoul::any value); + void set(std::any value); }; } // namespace properties diff --git a/modules/iswa/rendering/datacygnet.cpp b/modules/iswa/rendering/datacygnet.cpp index b706741c1b..6db26364ee 100644 --- a/modules/iswa/rendering/datacygnet.cpp +++ b/modules/iswa/rendering/datacygnet.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -33,24 +33,24 @@ #include namespace { - const std::string _loggerCat = "DataCygnet"; -} + const char* _loggerCat = "DataCygnet"; +} // namespace -namespace openspace{ +namespace openspace { DataCygnet::DataCygnet(const ghoul::Dictionary& dictionary) - :IswaCygnet(dictionary) - ,_dataProcessor(nullptr) - ,_dataOptions("dataOptions", "Data Options") - ,_useLog("useLog","Use Logarithm", false) - ,_useHistogram("useHistogram", "Auto Contrast", false) - ,_autoFilter("autoFilter", "Auto Filter", true) - ,_normValues("normValues", "Normalize Values", glm::vec2(1.0,1.0), glm::vec2(0), glm::vec2(5.0)) - ,_backgroundValues("backgroundValues", "Background Values", glm::vec2(0.0), glm::vec2(0), glm::vec2(1.0)) - ,_transferFunctionsFile("transferfunctions", "Transfer Functions", "${SCENE}/iswa/tfs/default.tf") + : IswaCygnet(dictionary) + , _dataProcessor(nullptr) + , _dataOptions("dataOptions", "Data Options") + , _useLog("useLog","Use Logarithm", false) + , _useHistogram("useHistogram", "Auto Contrast", false) + , _autoFilter("autoFilter", "Auto Filter", true) + , _normValues("normValues", "Normalize Values", glm::vec2(1.0,1.0), glm::vec2(0), glm::vec2(5.0)) + , _backgroundValues("backgroundValues", "Background Values", glm::vec2(0.0), glm::vec2(0), glm::vec2(1.0)) + , _transferFunctionsFile("transferfunctions", "Transfer Functions", "${SCENE}/iswa/tfs/default.tf") //FOR TESTING - ,_numOfBenchmarks(0) - ,_avgBenchmarkTime(0.0f) + , _numOfBenchmarks(0) + , _avgBenchmarkTime(0.0f) { addProperty(_dataOptions); addProperty(_useLog); diff --git a/modules/newhorizons/rendering/renderableplanetprojection.cpp b/modules/newhorizons/rendering/renderableplanetprojection.cpp index ed13725709..9b7f7427f4 100644 --- a/modules/newhorizons/rendering/renderableplanetprojection.cpp +++ b/modules/newhorizons/rendering/renderableplanetprojection.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -279,16 +279,16 @@ void RenderablePlanetProjection::imageProjectGPU( _fboProgramObject->setUniform("boresight" , _boresight); if (_geometry->hasProperty("radius")){ - ghoul::any r = _geometry->property("radius")->get(); - if (glm::vec3* radius = ghoul::any_cast(&r)){ + std::any r = _geometry->property("radius")->get(); + if (glm::vec3* radius = std::any_cast(&r)){ _fboProgramObject->setUniform("_radius", radius); } }else{ LERROR("Geometry object needs to provide radius"); } if (_geometry->hasProperty("segments")){ - ghoul::any s = _geometry->property("segments")->get(); - if (int* segments = ghoul::any_cast(&s)){ + std::any s = _geometry->property("segments")->get(); + if (int* segments = std::any_cast(&s)){ _fboProgramObject->setUniform("_segments", segments[0]); } }else{ diff --git a/src/documentation/documentation.cpp b/src/documentation/documentation.cpp index 3fe89f43ce..a83e3f7f60 100644 --- a/src/documentation/documentation.cpp +++ b/src/documentation/documentation.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,6 +27,7 @@ #include +#include #include namespace { diff --git a/src/documentation/documentationengine.cpp b/src/documentation/documentationengine.cpp index 5d41d4d3d8..fb135b1bf9 100644 --- a/src/documentation/documentationengine.cpp +++ b/src/documentation/documentationengine.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,6 +31,7 @@ #include #include +#include #include #include #include diff --git a/src/documentation/verifier.cpp b/src/documentation/verifier.cpp index bac9f9fefb..75dcfbede7 100644 --- a/src/documentation/verifier.cpp +++ b/src/documentation/verifier.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -26,6 +26,8 @@ #include +#include + namespace openspace { namespace documentation { diff --git a/src/engine/virtualpropertymanager.cpp b/src/engine/virtualpropertymanager.cpp index 2543ee284a..52dcb33173 100644 --- a/src/engine/virtualpropertymanager.cpp +++ b/src/engine/virtualpropertymanager.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -24,13 +24,11 @@ #include +#include + namespace openspace { -VirtualPropertyManager::VirtualPropertyManager() - : properties::PropertyOwner("") -{ - -} +VirtualPropertyManager::VirtualPropertyManager() : properties::PropertyOwner("") {} void VirtualPropertyManager::addProperty(std::unique_ptr prop) { // PropertyOwner does not take the ownership of the pointer @@ -54,5 +52,4 @@ void VirtualPropertyManager::removeProperty(properties::Property* prop) { ); } - } // namespace openspace diff --git a/src/mission/mission.cpp b/src/mission/mission.cpp index 107d486aae..10d2dde2f2 100644 --- a/src/mission/mission.cpp +++ b/src/mission/mission.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,14 @@ #include #include +#include + namespace { const char* KeyName = "Name"; const char* KeyDescription = "Description"; const char* KeyPhases = "Phases"; const char* KeyTimeRange = "TimeRange"; -} +} // namespace namespace openspace { diff --git a/src/properties/property.cpp b/src/properties/property.cpp index 237fed2092..eab6559539 100644 --- a/src/properties/property.cpp +++ b/src/properties/property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -28,6 +28,8 @@ #include +#include + namespace openspace { namespace properties { @@ -38,7 +40,7 @@ namespace { const char* MetaDataKeyReadOnly = "isReadOnly"; const char* _metaDataKeyViewPrefix = "view."; -} +} // namespace Property::OnChangeHandle Property::OnChangeHandleAll = std::numeric_limits::max(); @@ -80,15 +82,15 @@ std::string Property::fullyQualifiedIdentifier() const { return identifier; } -ghoul::any Property::get() const { - return ghoul::any(); +std::any Property::get() const { + return std::any(); } bool Property::getLuaValue(lua_State*) const { return false; } -void Property::set(ghoul::any) {} +void Property::set(std::any) {} bool Property::setLuaValue(lua_State*) { return false; diff --git a/src/properties/triggerproperty.cpp b/src/properties/triggerproperty.cpp index b5e25c032c..4ef68e869b 100644 --- a/src/properties/triggerproperty.cpp +++ b/src/properties/triggerproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -41,7 +41,7 @@ bool TriggerProperty::setLuaValue(lua_State*) { return true; } -void TriggerProperty::set(ghoul::any) { +void TriggerProperty::set(std::any) { notifyListener(); } From 9d4215695dcc21b9d210683214568b99e726f9c4 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 15 Jul 2017 18:36:01 -0400 Subject: [PATCH 13/44] Update Ghoul --- ext/ghoul | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ext/ghoul b/ext/ghoul index 0eabe3dd20..385ad74d75 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 0eabe3dd20b2ed015c0634c5c013ff1461a004d9 +Subproject commit 385ad74d75e113adbb9ba51a450d90cb7d62dd62 From 4dba552fd160b79ce71d7e2117dec52e0f193a6b Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 15 Jul 2017 20:01:55 -0400 Subject: [PATCH 14/44] Started switching OpenSpace projects to nested namespaces Various cleanups --- .../openspace/documentation/documentation.h | 9 ++-- .../documentation/documentationengine.h | 8 ++-- include/openspace/documentation/verifier.h | 8 ++-- include/openspace/documentation/verifier.inl | 10 ++--- .../openspace/engine/configurationmanager.h | 1 + include/openspace/engine/logfactory.h | 10 ++--- include/openspace/engine/moduleengine.h | 10 +---- include/openspace/engine/openspaceengine.h | 13 ++---- include/openspace/interaction/controller.h | 8 ++-- .../openspace/interaction/delayedvariable.h | 8 ++-- .../openspace/interaction/delayedvariable.inl | 8 ++-- include/openspace/interaction/inputstate.h | 8 ++-- include/openspace/interaction/interpolator.h | 10 ++--- .../openspace/interaction/interpolator.inl | 8 ++-- .../openspace/interaction/keybindingmanager.h | 16 ++++--- .../openspace/interaction/keyframenavigator.h | 14 +++---- include/openspace/interaction/luaconsole.h | 8 +--- include/openspace/interaction/mousestate.h | 19 ++++----- .../openspace/interaction/navigationhandler.h | 14 +++---- .../openspace/interaction/orbitalnavigator.h | 15 ++++--- include/openspace/mission/mission.h | 3 +- include/openspace/network/messagestructures.h | 11 ++--- .../openspace/network/parallelconnection.h | 8 +--- .../openspace/performance/performancelayout.h | 8 ++-- .../performance/performancemanager.h | 15 +++---- .../performance/performancemeasurement.h | 8 ++-- .../properties/matrix/dmat2property.h | 8 ++-- .../properties/matrix/dmat2x3property.h | 8 ++-- .../properties/matrix/dmat2x4property.h | 8 ++-- .../properties/matrix/dmat3property.h | 8 ++-- .../properties/matrix/dmat3x2property.h | 8 ++-- .../properties/matrix/dmat3x4property.h | 8 ++-- .../properties/matrix/dmat4property.h | 8 ++-- .../properties/matrix/dmat4x2property.h | 8 ++-- .../properties/matrix/dmat4x3property.h | 8 ++-- .../properties/matrix/mat2property.h | 8 ++-- .../properties/matrix/mat2x3property.h | 8 ++-- .../properties/matrix/mat2x4property.h | 8 ++-- .../properties/matrix/mat3property.h | 8 ++-- .../properties/matrix/mat3x2property.h | 8 ++-- .../properties/matrix/mat3x4property.h | 8 ++-- .../properties/matrix/mat4property.h | 8 ++-- .../properties/matrix/mat4x2property.h | 8 ++-- .../properties/matrix/mat4x3property.h | 8 ++-- .../openspace/properties/numericalproperty.h | 8 ++-- .../properties/numericalproperty.inl | 6 +-- include/openspace/properties/optionproperty.h | 8 ++-- include/openspace/properties/property.h | 6 +-- .../openspace/properties/propertydelegate.h | 8 ++-- .../openspace/properties/propertydelegate.inl | 8 ++-- include/openspace/properties/propertyowner.h | 8 ++-- .../properties/scalar/boolproperty.h | 8 ++-- .../properties/scalar/charproperty.h | 8 ++-- .../properties/scalar/doubleproperty.h | 8 ++-- .../properties/scalar/floatproperty.h | 8 ++-- .../openspace/properties/scalar/intproperty.h | 8 ++-- .../properties/scalar/longdoubleproperty.h | 8 ++-- .../properties/scalar/longlongproperty.h | 8 ++-- .../properties/scalar/longproperty.h | 8 ++-- .../properties/scalar/shortproperty.h | 8 ++-- .../properties/scalar/signedcharproperty.h | 8 ++-- .../properties/scalar/ucharproperty.h | 8 ++-- .../properties/scalar/uintproperty.h | 8 ++-- .../properties/scalar/ulonglongproperty.h | 8 ++-- .../properties/scalar/ulongproperty.h | 8 ++-- .../properties/scalar/ushortproperty.h | 8 ++-- .../properties/scalar/wcharproperty.h | 8 ++-- .../openspace/properties/selectionproperty.h | 8 ++-- include/openspace/properties/stringproperty.h | 8 ++-- .../openspace/properties/templateproperty.h | 6 +-- .../openspace/properties/templateproperty.inl | 6 +-- .../openspace/properties/triggerproperty.h | 6 +-- .../properties/vector/bvec2property.h | 8 ++-- .../properties/vector/bvec3property.h | 8 ++-- .../properties/vector/bvec4property.h | 8 ++-- .../properties/vector/dvec2property.h | 8 ++-- .../properties/vector/dvec3property.h | 8 ++-- .../properties/vector/dvec4property.h | 8 ++-- .../properties/vector/ivec2property.h | 8 ++-- .../properties/vector/ivec3property.h | 8 ++-- .../properties/vector/ivec4property.h | 8 ++-- .../properties/vector/uvec2property.h | 8 ++-- .../properties/vector/uvec3property.h | 8 ++-- .../properties/vector/uvec4property.h | 8 ++-- .../properties/vector/vec2property.h | 8 ++-- .../properties/vector/vec3property.h | 8 ++-- .../properties/vector/vec4property.h | 8 ++-- include/openspace/query/query.h | 6 +-- .../openspace/rendering/framebufferrenderer.h | 18 ++++---- .../openspace/rendering/raycasterlistener.h | 6 +-- include/openspace/rendering/renderable.h | 14 +++---- include/openspace/rendering/renderengine.h | 16 +++---- include/openspace/rendering/renderer.h | 17 +++----- include/openspace/rendering/volume.h | 11 ++--- include/openspace/rendering/volumeraycaster.h | 8 ++-- include/openspace/scene/scenemanager.h | 4 +- include/openspace/scripting/lualibrary.h | 8 ++-- include/openspace/scripting/scriptengine.h | 11 ++--- include/openspace/scripting/scriptscheduler.h | 15 +++---- .../scripting/systemcapabilitiesbinding.h | 8 ++-- .../openspace/util/powerscaledcoordinate.h | 8 +--- include/openspace/util/powerscaledscalar.h | 3 +- include/openspace/util/powerscaledsphere.h | 3 +- include/openspace/util/syncdata.h | 1 - include/openspace/util/time.h | 3 +- include/openspace/util/timerange.h | 3 +- include/openspace/util/updatestructures.h | 7 +--- modules/base/basemodule.cpp | 4 +- modules/base/rendering/modelgeometry.cpp | 8 ++-- modules/base/rendering/modelgeometry.h | 20 ++++----- modules/base/rendering/multimodelgeometry.cpp | 8 ++-- modules/base/rendering/multimodelgeometry.h | 13 +++--- modules/base/rendering/renderablemodel.cpp | 3 +- modules/base/rendering/renderablemodel.h | 13 ++---- modules/base/rendering/renderableplane.h | 10 ++--- modules/base/rendering/renderablesphere.h | 8 ++-- .../rendering/renderablesphericalgrid.cpp | 7 ++-- .../base/rendering/renderablesphericalgrid.h | 4 +- modules/base/rendering/renderabletrail.cpp | 4 +- modules/base/rendering/renderabletrail.h | 8 ++-- .../base/rendering/renderabletrailorbit.cpp | 4 +- .../rendering/renderabletrailtrajectory.cpp | 4 +- modules/base/rotation/staticrotation.cpp | 4 +- modules/base/scale/staticscale.cpp | 4 +- .../base/translation/statictranslation.cpp | 4 +- modules/debugging/debuggingmodule.cpp | 6 +-- modules/debugging/rendering/debugrenderer.cpp | 7 ++-- .../rendering/renderabledebugplane.cpp | 6 +-- .../rendering/renderabledebugplane.h | 28 ++++++------- modules/fieldlines/fieldlinesmodule.cpp | 6 +-- .../rendering/renderablefieldlines.cpp | 6 +-- .../rendering/renderablefieldlines.h | 11 ++--- modules/galaxy/rendering/galaxyraycaster.h | 14 +++---- modules/galaxy/tasks/milkywayconversiontask.h | 7 ++-- .../tasks/milkywaypointsconversiontask.h | 5 +-- modules/globebrowsing/cache/lrucache.h | 10 ++--- modules/globebrowsing/cache/lrucache.inl | 10 ++--- .../cache/memoryawaretilecache.h | 11 ++--- .../globebrowsing/cache/texturecontainer.h | 13 ++---- modules/globebrowsing/chunk/chunk.h | 11 ++--- .../availabletiledataevaluator.cpp | 10 ++--- .../availabletiledataevaluator.h | 10 ++--- .../chunklevelevaluator/chunklevelevaluator.h | 16 +++---- .../chunklevelevaluator/distanceevaluator.h | 10 ++--- .../projectedareaevaluator.h | 11 ++--- modules/globebrowsing/chunk/chunknode.h | 8 ++-- .../globebrowsing/chunk/culling/chunkculler.h | 17 +++----- .../chunk/culling/frustumculler.h | 10 ++--- .../chunk/culling/horizonculler.h | 10 ++--- modules/globebrowsing/geometry/aabb.cpp | 8 ++-- modules/globebrowsing/geometry/aabb.h | 8 ++-- modules/globebrowsing/geometry/angle.h | 8 ++-- modules/globebrowsing/geometry/angle.inl | 8 ++-- modules/globebrowsing/geometry/ellipsoid.h | 8 ++-- modules/globebrowsing/geometry/geodetic2.h | 8 ++-- modules/globebrowsing/geometry/geodetic3.h | 8 ++-- .../globebrowsing/geometry/geodeticpatch.h | 8 ++-- .../globebrowsing/globes/chunkedlodglobe.h | 16 +++---- modules/globebrowsing/globes/pointglobe.h | 12 ++---- .../globebrowsing/globes/renderableglobe.h | 8 ++-- modules/globebrowsing/meshes/basicgrid.h | 8 ++-- modules/globebrowsing/meshes/grid.h | 8 ++-- modules/globebrowsing/meshes/skirtedgrid.h | 8 ++-- modules/globebrowsing/meshes/trianglesoup.h | 8 ++-- .../other/concurrentjobmanager.h | 8 ++-- .../other/concurrentjobmanager.inl | 8 ++-- modules/globebrowsing/other/concurrentqueue.h | 8 ++-- .../globebrowsing/other/concurrentqueue.inl | 8 ++-- modules/globebrowsing/other/distanceswitch.h | 15 ++++--- modules/globebrowsing/other/lruthreadpool.h | 11 ++--- modules/globebrowsing/other/lruthreadpool.inl | 8 ++-- modules/globebrowsing/other/pixelbuffer.h | 11 ++--- .../other/pixelbuffercontainer.h | 11 ++--- .../other/pixelbuffercontainer.inl | 8 ++-- .../other/prioritizingconcurrentjobmanager.h | 8 ++-- .../prioritizingconcurrentjobmanager.inl | 24 +++++------ modules/globebrowsing/other/statscollector.h | 8 ++-- .../globebrowsing/other/statscollector.inl | 8 ++-- modules/globebrowsing/other/threadpool.h | 9 ++-- .../globebrowsing/rendering/chunkrenderer.h | 15 +++---- .../rendering/gpu/gpuchunktile.h | 12 ++---- .../rendering/gpu/gpuchunktilepile.h | 12 ++---- .../rendering/gpu/gpuheightlayer.h | 12 ++---- .../globebrowsing/rendering/gpu/gpulayer.h | 12 ++---- .../rendering/gpu/gpulayeradjustment.h | 12 ++---- .../rendering/gpu/gpulayergroup.h | 12 ++---- .../rendering/gpu/gpulayermanager.h | 12 ++---- .../rendering/gpu/gpulayerrendersettings.h | 12 ++---- .../rendering/gpu/gputiledepthtransform.h | 12 ++---- .../rendering/gpu/gputileuvtransform.h | 12 ++---- modules/globebrowsing/rendering/layer/layer.h | 12 ++---- .../rendering/layer/layeradjustment.h | 15 +++---- .../rendering/layer/layergroup.h | 13 ++---- .../rendering/layer/layergroupid.h | 10 ++--- .../rendering/layer/layermanager.h | 8 ++-- .../rendering/layer/layerrendersettings.h | 8 ++-- .../rendering/layershadermanager.h | 15 +++---- .../tile/asynctiledataprovider.cpp | 8 ++-- .../tile/asynctiledataprovider.h | 9 ++-- modules/globebrowsing/tile/chunktile.h | 8 ++-- modules/globebrowsing/tile/pixelregion.h | 8 ++-- modules/globebrowsing/tile/rawtile.h | 10 ++--- .../rawtiledatareader/gdalrawtiledatareader.h | 8 ++-- .../tile/rawtiledatareader/gdalwrapper.h | 8 ++-- .../tile/rawtiledatareader/iodescription.h | 8 ++-- .../rawtiledatareader/rawtiledatareader.h | 8 ++-- .../simplerawtiledatareader.h | 8 ++-- .../tile/rawtiledatareader/tiledatatype.h | 10 ++--- modules/globebrowsing/tile/textureformat.h | 9 ++-- modules/globebrowsing/tile/tile.h | 12 ++---- .../globebrowsing/tile/tiledepthtransform.h | 8 ++-- modules/globebrowsing/tile/tileindex.h | 12 ++---- modules/globebrowsing/tile/tileloadjob.h | 20 ++++----- modules/globebrowsing/tile/tilemetadata.h | 9 ++-- .../tile/tileprovider/defaulttileprovider.h | 20 ++++----- .../tile/tileprovider/singleimageprovider.h | 10 ++--- .../tileprovider/sizereferencetileprovider.h | 10 ++--- .../tile/tileprovider/temporaltileprovider.h | 10 ++--- .../tile/tileprovider/texttileprovider.h | 20 ++++----- .../tile/tileprovider/tileindextileprovider.h | 10 ++--- .../tile/tileprovider/tileprovider.h | 10 ++--- .../tile/tileprovider/tileproviderbyindex.h | 10 ++--- .../tile/tileprovider/tileproviderbylevel.h | 10 ++--- modules/globebrowsing/tile/tileselector.h | 21 ++++------ .../globebrowsing/tile/tiletextureinitdata.h | 11 ++--- modules/globebrowsing/tile/tileuvtransform.h | 8 ++-- src/CMakeLists.txt | 1 - src/documentation/documentationengine.cpp | 6 +-- src/documentation/verifier.cpp | 6 +-- src/engine/configurationmanager.cpp | 2 +- src/engine/downloadmanager.cpp | 4 +- src/engine/logfactory.cpp | 4 +- src/engine/moduleengine.cpp | 4 +- src/engine/moduleengine_lua.inl | 8 ++-- src/engine/openspaceengine.cpp | 6 +-- src/interaction/controller.cpp | 11 ++--- src/interaction/inputstate.cpp | 8 ++-- src/interaction/keybindingmanager.cpp | 8 ++-- src/interaction/keybindingmanager_lua.inl | 21 ++++------ src/interaction/keyframenavigator.cpp | 8 ++-- src/interaction/luaconsole.cpp | 3 +- src/interaction/mousestate.cpp | 8 ++-- src/interaction/navigationhandler.cpp | 8 ++-- src/interaction/navigationhandler_lua.inl | 10 ++--- src/interaction/orbitalnavigator.cpp | 10 ++--- src/mission/missionmanager_lua.inl | 11 ++--- src/network/parallelconnection_lua.inl | 10 ++--- src/performance/performancelayout.cpp | 8 ++-- src/performance/performancemanager.cpp | 10 ++--- src/performance/performancemeasurement.cpp | 9 ++-- src/properties/matrix/dmat2property.cpp | 8 ++-- src/properties/matrix/dmat2x3property.cpp | 8 ++-- src/properties/matrix/dmat2x4property.cpp | 8 ++-- src/properties/matrix/dmat3property.cpp | 8 ++-- src/properties/matrix/dmat3x2property.cpp | 8 ++-- src/properties/matrix/dmat3x4property.cpp | 8 ++-- src/properties/matrix/dmat4property.cpp | 8 ++-- src/properties/matrix/dmat4x2property.cpp | 8 ++-- src/properties/matrix/dmat4x3property.cpp | 8 ++-- src/properties/matrix/mat2property.cpp | 8 ++-- src/properties/matrix/mat2x3property.cpp | 8 ++-- src/properties/matrix/mat2x4property.cpp | 8 ++-- src/properties/matrix/mat3property.cpp | 8 ++-- src/properties/matrix/mat3x2property.cpp | 8 ++-- src/properties/matrix/mat3x4property.cpp | 8 ++-- src/properties/matrix/mat4property.cpp | 8 ++-- src/properties/matrix/mat4x2property.cpp | 8 ++-- src/properties/matrix/mat4x3property.cpp | 8 ++-- src/properties/optionproperty.cpp | 10 ++--- src/properties/property.cpp | 8 ++-- src/properties/propertyowner.cpp | 13 +++--- src/properties/scalar/boolproperty.cpp | 9 ++-- src/properties/scalar/charproperty.cpp | 8 ++-- src/properties/scalar/doubleproperty.cpp | 8 ++-- src/properties/scalar/floatproperty.cpp | 8 ++-- src/properties/scalar/intproperty.cpp | 8 ++-- src/properties/scalar/longdoubleproperty.cpp | 8 ++-- src/properties/scalar/longlongproperty.cpp | 8 ++-- src/properties/scalar/longproperty.cpp | 8 ++-- src/properties/scalar/shortproperty.cpp | 8 ++-- src/properties/scalar/signedcharproperty.cpp | 8 ++-- src/properties/scalar/ucharproperty.cpp | 8 ++-- src/properties/scalar/uintproperty.cpp | 8 ++-- src/properties/scalar/ulonglongproperty.cpp | 8 ++-- src/properties/scalar/ulongproperty.cpp | 8 ++-- src/properties/scalar/ushortproperty.cpp | 8 ++-- src/properties/scalar/wcharproperty.cpp | 8 ++-- src/properties/selectionproperty.cpp | 14 +++---- src/properties/stringproperty.cpp | 8 ++-- src/properties/triggerproperty.cpp | 6 +-- src/properties/vector/bvec2property.cpp | 8 ++-- src/properties/vector/bvec3property.cpp | 8 ++-- src/properties/vector/bvec4property.cpp | 8 ++-- src/properties/vector/dvec2property.cpp | 8 ++-- src/properties/vector/dvec3property.cpp | 8 ++-- src/properties/vector/dvec4property.cpp | 8 ++-- src/properties/vector/ivec2property.cpp | 8 ++-- src/properties/vector/ivec3property.cpp | 8 ++-- src/properties/vector/ivec4property.cpp | 8 ++-- src/properties/vector/uvec2property.cpp | 8 ++-- src/properties/vector/uvec3property.cpp | 8 ++-- src/properties/vector/uvec4property.cpp | 8 ++-- src/properties/vector/vec2property.cpp | 8 ++-- src/properties/vector/vec3property.cpp | 8 ++-- src/properties/vector/vec4property.cpp | 8 ++-- src/query/query.cpp | 8 ++-- src/rendering/renderengine_lua.inl | 10 ++--- src/rendering/transferfunction.cpp | 8 ++-- src/scene/scene_lua.inl | 12 +++--- src/scene/scenegraphnode.cpp | 24 +++++------ src/scene/sceneloader.cpp | 42 +++++++++---------- src/scene/scenemanager.cpp | 5 ++- src/scripting/lualibrary.cpp | 8 ++-- src/scripting/scriptengine.cpp | 10 ++--- src/scripting/scriptengine_lua.inl | 10 ++--- src/scripting/scriptscheduler.cpp | 12 ++---- src/scripting/scriptscheduler_lua.inl | 6 +-- src/scripting/systemcapabilitiesbinding.cpp | 18 ++++---- src/util/boxgeometry.cpp | 6 +-- src/util/histogram.cpp | 7 ++-- src/util/keys.cpp | 6 +-- src/util/openspacemodule.cpp | 4 +- src/util/powerscaledcoordinate.cpp | 11 +++-- src/util/powerscaledscalar.cpp | 17 +++----- src/util/powerscaledsphere.cpp | 7 ++-- src/util/spicemanager.cpp | 3 +- src/util/spicemanager_lua.inl | 8 ++-- src/util/syncdata.cpp | 39 ----------------- src/util/time_lua.inl | 9 ++-- src/util/timerange.cpp | 8 ++-- src/util/transformationmanager.cpp | 6 +-- 331 files changed, 1126 insertions(+), 1917 deletions(-) delete mode 100644 src/util/syncdata.cpp diff --git a/include/openspace/documentation/documentation.h b/include/openspace/documentation/documentation.h index 5e64e3b4bc..a6557f44a0 100644 --- a/include/openspace/documentation/documentation.h +++ b/include/openspace/documentation/documentation.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -34,8 +34,7 @@ namespace ghoul { class Dictionary; } -namespace openspace { -namespace documentation { +namespace openspace::documentation { using Optional = ghoul::Boolean; using Exhaustive = ghoul::Boolean; @@ -303,9 +302,7 @@ TestResult testSpecification(const Documentation& documentation, void testSpecificationAndThrow(const Documentation& documentation, const ghoul::Dictionary& dictionary, std::string component); -} // namespace documentation - -} // namespace openspace +} // namespace openspace::documentation // Make the overload for std::to_string available for the Offense::Reason for easier // error logging diff --git a/include/openspace/documentation/documentationengine.h b/include/openspace/documentation/documentationengine.h index 5ab18d9f03..1b53a0cb8d 100644 --- a/include/openspace/documentation/documentationengine.h +++ b/include/openspace/documentation/documentationengine.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ #include -namespace openspace { -namespace documentation { +namespace openspace::documentation { /** * The DocumentationEngine has the ability to collect all Documentation%s that are @@ -92,8 +91,7 @@ private: static DocumentationEngine* _instance; }; -} // namespace documentation -} // namespace openspace +} // namespace openspace::documentation #define DocEng (openspace::documentation::DocumentationEngine::ref()) diff --git a/include/openspace/documentation/verifier.h b/include/openspace/documentation/verifier.h index ddf39e6c9a..eac3032474 100644 --- a/include/openspace/documentation/verifier.h +++ b/include/openspace/documentation/verifier.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ #include #include -namespace openspace { -namespace documentation { +namespace openspace::documentation { /** * The base class of all Verifier%s. Each object must have an Verifier::operator() @@ -1153,8 +1152,7 @@ extern template struct DeprecatedVerifier; extern template struct DeprecatedVerifier; extern template struct DeprecatedVerifier; -} // namespace documentation -} // namespace openspace +} // namespace openspace::documentation #include "verifier.inl" diff --git a/include/openspace/documentation/verifier.inl b/include/openspace/documentation/verifier.inl index 70751ac380..9f341a9c9b 100644 --- a/include/openspace/documentation/verifier.inl +++ b/include/openspace/documentation/verifier.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,10 +29,9 @@ namespace std { std::string to_string(std::string value); -} +} // namespace std -namespace openspace { -namespace documentation { +namespace openspace::documentation { template TestResult TemplateVerifier::operator()(const ghoul::Dictionary& dict, @@ -355,5 +354,4 @@ std::string DeprecatedVerifier::documentation() const { return T::documentation() + " (deprecated)"; } -} // namespace documentation -} // namespace openspace +} // namespace openspace::documentation diff --git a/include/openspace/engine/configurationmanager.h b/include/openspace/engine/configurationmanager.h index cb8d87a35e..c7a96aacff 100644 --- a/include/openspace/engine/configurationmanager.h +++ b/include/openspace/engine/configurationmanager.h @@ -28,6 +28,7 @@ #include namespace openspace { + namespace documentation { struct Documentation; } /** diff --git a/include/openspace/engine/logfactory.h b/include/openspace/engine/logfactory.h index 026208f33d..00773e355b 100644 --- a/include/openspace/engine/logfactory.h +++ b/include/openspace/engine/logfactory.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,12 +27,8 @@ #include -namespace ghoul { - -class Dictionary; -namespace logging { class Log; } - -} // namespace ghoul +namespace ghoul { class Dictionary; } +namespace ghoul::logging { class Log; } namespace openspace { diff --git a/include/openspace/engine/moduleengine.h b/include/openspace/engine/moduleengine.h index 08a9c663c3..3a75b503af 100644 --- a/include/openspace/engine/moduleengine.h +++ b/include/openspace/engine/moduleengine.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -33,13 +33,7 @@ #include #include -namespace ghoul { -namespace systemcapabilities { - -struct Version; - -} // namespace systemcapabilities -} // namespace ghoul +namespace ghoul::systemcapabilities { struct Version; } namespace openspace { diff --git a/include/openspace/engine/openspaceengine.h b/include/openspace/engine/openspaceengine.h index df4c372ee5..a971d46a6e 100644 --- a/include/openspace/engine/openspaceengine.h +++ b/include/openspace/engine/openspaceengine.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -35,14 +35,9 @@ #include #include -namespace ghoul { - -class Dictionary; - -namespace cmdparser { class CommandlineParser; } -namespace fontrendering { class FontManager; } - -} // namespace ghoul +namespace ghoul { class Dictionary; } +namespace ghoul::cmdparser { class CommandlineParser; } +namespace ghoul::fontrendering { class FontManager; } namespace openspace { diff --git a/include/openspace/interaction/controller.h b/include/openspace/interaction/controller.h index baa63c12a3..ec04567b3e 100644 --- a/include/openspace/interaction/controller.h +++ b/include/openspace/interaction/controller.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,8 +30,7 @@ #include #include -namespace openspace { -namespace interaction { +namespace openspace::interaction { class NavigationHandler; @@ -47,7 +46,6 @@ protected: NavigationHandler* _handler; }; -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction #endif // __OPENSPACE_CORE___CONTROLLER___H__ diff --git a/include/openspace/interaction/delayedvariable.h b/include/openspace/interaction/delayedvariable.h index ad8b7e039e..26a5350887 100644 --- a/include/openspace/interaction/delayedvariable.h +++ b/include/openspace/interaction/delayedvariable.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -25,8 +25,7 @@ #ifndef __OPENSPACE_CORE___DELAYEDVARIABLE___H__ #define __OPENSPACE_CORE___DELAYEDVARIABLE___H__ -namespace openspace { -namespace interaction { +namespace openspace::interaction { /** * Class that acts as a smoothing filter to a variable. The filter has a step @@ -51,8 +50,7 @@ private: T _currentValue; }; -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction #include "delayedvariable.inl" diff --git a/include/openspace/interaction/delayedvariable.inl b/include/openspace/interaction/delayedvariable.inl index 03e8137f13..da298c6e60 100644 --- a/include/openspace/interaction/delayedvariable.inl +++ b/include/openspace/interaction/delayedvariable.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -25,8 +25,7 @@ #include #include -namespace openspace { -namespace interaction { +namespace openspace::interaction { template DelayedVariable::DelayedVariable(ScaleType scaleFactor, ScaleType friction) @@ -72,5 +71,4 @@ T DelayedVariable::get() const { return _currentValue; } -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction diff --git a/include/openspace/interaction/inputstate.h b/include/openspace/interaction/inputstate.h index 250a51743a..08932e862b 100644 --- a/include/openspace/interaction/inputstate.h +++ b/include/openspace/interaction/inputstate.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ #include -namespace openspace { -namespace interaction { +namespace openspace::interaction { class InputState { public: @@ -64,7 +63,6 @@ private: double _mouseScrollDelta; }; -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction #endif // __OPENSPACE_CORE___INPUTSTATE___H__ diff --git a/include/openspace/interaction/interpolator.h b/include/openspace/interaction/interpolator.h index cf4bafb25d..ace96e129e 100644 --- a/include/openspace/interaction/interpolator.h +++ b/include/openspace/interaction/interpolator.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,8 +27,7 @@ #include -namespace openspace { -namespace interaction { +namespace openspace::interaction { /* * Interpolates a typename T using a transfer function. @@ -44,7 +43,7 @@ public: void setDeltaTime(float deltaTime); void setTransferFunction(std::function transferFunction); void setInterpolationTime(float interpolationTime); - void step(); + void step(); float deltaTimeScaled() const; T value() const; @@ -57,8 +56,7 @@ private: float _scaledDeltaTime; }; -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction #include "interpolator.inl" diff --git a/include/openspace/interaction/interpolator.inl b/include/openspace/interaction/interpolator.inl index c9ad0ed612..45351970bc 100644 --- a/include/openspace/interaction/interpolator.inl +++ b/include/openspace/interaction/interpolator.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -26,8 +26,7 @@ #include -namespace openspace { -namespace interaction { +namespace openspace::interaction { template Interpolator::Interpolator() @@ -81,5 +80,4 @@ bool Interpolator::isInterpolating() const { return _t < 1.0 && _t >= 0.0; } -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction diff --git a/include/openspace/interaction/keybindingmanager.h b/include/openspace/interaction/keybindingmanager.h index 2d4432f06f..de040829b4 100644 --- a/include/openspace/interaction/keybindingmanager.h +++ b/include/openspace/interaction/keybindingmanager.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,14 +32,13 @@ #include namespace openspace { + class Camera; + class SceneGraphNode; +} // namespace -class Camera; -class SceneGraphNode; +namespace openspace::interaction { -namespace interaction { - -class KeyBindingManager : public DocumentationGenerator -{ +class KeyBindingManager : public DocumentationGenerator { public: KeyBindingManager(); ~KeyBindingManager() = default; @@ -81,7 +80,6 @@ private: std::multimap _keyLua; }; -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction #endif // __OPENSPACE_CORE___KEYBINDINGMANAGER___H__ diff --git a/include/openspace/interaction/keyframenavigator.h b/include/openspace/interaction/keyframenavigator.h index 511e2ae3df..d3cec6ac4f 100644 --- a/include/openspace/interaction/keyframenavigator.h +++ b/include/openspace/interaction/keyframenavigator.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,14 +31,11 @@ #include #include -namespace openspace { +namespace openspace { class Camera; } -class Camera; +namespace openspace::interaction { -namespace interaction { - -class KeyframeNavigator -{ +class KeyframeNavigator { public: struct CameraPose { glm::dvec3 position; @@ -63,7 +60,6 @@ private: Timeline _cameraPoseTimeline; }; -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction #endif // __OPENSPACE_CORE___KEYFRAMENAVIGATOR___H__ diff --git a/include/openspace/interaction/luaconsole.h b/include/openspace/interaction/luaconsole.h index de5da697ef..4640df72b7 100644 --- a/include/openspace/interaction/luaconsole.h +++ b/include/openspace/interaction/luaconsole.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -35,11 +35,7 @@ #include #include -namespace ghoul { -namespace opengl { - class ProgramObject; -} // namespace opengl -} // namespace ghoul +namespace ghoul::opengl { class ProgramObject; } namespace openspace { diff --git a/include/openspace/interaction/mousestate.h b/include/openspace/interaction/mousestate.h index c6db1380a7..7523d7cc8b 100644 --- a/include/openspace/interaction/mousestate.h +++ b/include/openspace/interaction/mousestate.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,8 +30,7 @@ #include -namespace openspace { -namespace interaction { +namespace openspace::interaction { struct MouseState { MouseState(double scaleFactor); @@ -42,14 +41,13 @@ struct MouseState { DelayedVariable velocity; }; -class MouseStates -{ +class MouseStates { public: /** - \param sensitivity - \param velocityScaleFactor can be set to 60 to remove the inertia of the - interaction. Lower value will make it harder to move the camera. - */ + * \param sensitivity + * \param velocityScaleFactor can be set to 60 to remove the inertia of the + * interaction. Lower value will make it harder to move the camera. + */ MouseStates(double sensitivity, double velocityScaleFactor); void updateMouseStatesFromInput(const InputState& inputState, double deltaTime); void setRotationalFriction(double friction); @@ -74,7 +72,6 @@ private: MouseState _globalRollMouseState; }; -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction #endif // __OPENSPACE_CORE___MOUSESTATE___H__ diff --git a/include/openspace/interaction/navigationhandler.h b/include/openspace/interaction/navigationhandler.h index 2d0c930d4a..fbbddbed77 100644 --- a/include/openspace/interaction/navigationhandler.h +++ b/include/openspace/interaction/navigationhandler.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -38,11 +38,11 @@ #include namespace openspace { + class Camera; + class SceneGraphNode; +} // namespace openspace -class Camera; -class SceneGraphNode; - -namespace interaction { +namespace openspace::interaction { class NavigationHandler : public properties::PropertyOwner { public: @@ -85,6 +85,7 @@ public: * interaction */ static scripting::LuaLibrary luaLibrary(); + private: bool _cameraUpdatedFromScript = false; @@ -99,7 +100,6 @@ private: properties::BoolProperty _useKeyFrameInteraction; }; -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction #endif // __OPENSPACE_CORE___NAVIGATIONHANDLER___H__ diff --git a/include/openspace/interaction/orbitalnavigator.h b/include/openspace/interaction/orbitalnavigator.h index 6ef2a95e42..ae49b851a5 100644 --- a/include/openspace/interaction/orbitalnavigator.h +++ b/include/openspace/interaction/orbitalnavigator.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -38,12 +38,12 @@ #include namespace openspace { + class SceneGraphNode; + class Camera; + struct SurfacePositionHandle; +} // namespace -class SceneGraphNode; -class Camera; -struct SurfacePositionHandle; - -namespace interaction { +namespace openspace::interaction { class OrbitalNavigator : public properties::PropertyOwner { public: @@ -191,7 +191,6 @@ private: const glm::dvec3 cameraPositionWorldSpace); }; -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction #endif // __OPENSPACE_CORE___ORBITALNAVIGATOR___H__ diff --git a/include/openspace/mission/mission.h b/include/openspace/mission/mission.h index b5dfe70f50..9c4ab7e04b 100644 --- a/include/openspace/mission/mission.h +++ b/include/openspace/mission/mission.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -34,6 +34,7 @@ namespace ghoul { class Dictionary; } namespace openspace { + namespace documentation { struct Documentation; } /** diff --git a/include/openspace/network/messagestructures.h b/include/openspace/network/messagestructures.h index b3943d7fed..9fa815094f 100644 --- a/include/openspace/network/messagestructures.h +++ b/include/openspace/network/messagestructures.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -25,18 +25,14 @@ #ifndef __OPENSPACE_CORE___MESSAGESTRUCTURES___H__ #define __OPENSPACE_CORE___MESSAGESTRUCTURES___H__ -//std includes #include #include -//glm includes #include -//openspace includes #include -namespace openspace{ -namespace datamessagestructures { +namespace openspace::datamessagestructures { enum class Type : uint32_t { CameraData = 0, TimeData, @@ -187,7 +183,6 @@ struct ScriptMessage { }; }; -} //namespace messagestructures -} // namespace openspace +} // namespace openspace::messagestructures #endif // __OPENSPACE_CORE___MESSAGESTRUCTURES___H__ diff --git a/include/openspace/network/parallelconnection.h b/include/openspace/network/parallelconnection.h index f14c871599..5a72305462 100644 --- a/include/openspace/network/parallelconnection.h +++ b/include/openspace/network/parallelconnection.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -25,20 +25,16 @@ #ifndef __OPENSPACE_CORE___PARALLELCONNECTION___H__ #define __OPENSPACE_CORE___PARALLELCONNECTION___H__ -//openspace includes #include #include #include #include #include -//glm includes #include -//ghoul includes #include -//std includes #include #include #include @@ -48,8 +44,6 @@ #include #include - - #if defined(WIN32) || defined(__MING32__) || defined(__MING64__) typedef size_t _SOCKET; #else diff --git a/include/openspace/performance/performancelayout.h b/include/openspace/performance/performancelayout.h index de9f5a450f..addba95ca1 100644 --- a/include/openspace/performance/performancelayout.h +++ b/include/openspace/performance/performancelayout.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,8 +27,7 @@ #include -namespace openspace { -namespace performance { +namespace openspace::performance { struct PerformanceLayout { static const int8_t Version = 0; @@ -57,7 +56,6 @@ struct PerformanceLayout { int16_t nFunctionEntries; }; -} // namespace performance -} // namespace openspace +} // namespace openspace::performance #endif // __OPENSPACE_CORE___PERFORMANCELAYOUT___H__ diff --git a/include/openspace/performance/performancemanager.h b/include/openspace/performance/performancemanager.h index 21e7c64b27..54101e158f 100644 --- a/include/openspace/performance/performancemanager.h +++ b/include/openspace/performance/performancemanager.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -33,15 +33,11 @@ #include #include -namespace ghoul { - class SharedMemory; -} +namespace ghoul { class SharedMemory; } -namespace openspace { +namespace openspace { class SceneGraphNode; } -class SceneGraphNode; - -namespace performance { +namespace openspace::performance { class PerformanceManager { public: @@ -95,7 +91,6 @@ private: bool createLogDir(); }; -} // namespace performance -} // namespace openspace +} // namespace openspace::performance #endif // __OPENSPACE_CORE___PERFORMANCEMANAGER___H__ diff --git a/include/openspace/performance/performancemeasurement.h b/include/openspace/performance/performancemeasurement.h index c820f81230..9479466f04 100644 --- a/include/openspace/performance/performancemeasurement.h +++ b/include/openspace/performance/performancemeasurement.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ #include #include -namespace openspace { -namespace performance { +namespace openspace::performance { class PerformanceManager; @@ -59,7 +58,6 @@ private: OsEng.renderEngine().performanceManager() \ ) -} // namespace performance -} // namespace openspace +} // namespace openspace::performance #endif // __OPENSPACE_CORE___PERFORMANCEMEASUREMENT___H__ diff --git a/include/openspace/properties/matrix/dmat2property.h b/include/openspace/properties/matrix/dmat2property.h index 978090b4a3..cee0f07574 100644 --- a/include/openspace/properties/matrix/dmat2property.h +++ b/include/openspace/properties/matrix/dmat2property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(DMat2Property, glm::dmat2x2); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___DMAT2PROPERTY___H__ diff --git a/include/openspace/properties/matrix/dmat2x3property.h b/include/openspace/properties/matrix/dmat2x3property.h index 69603e57c4..433adbb05c 100644 --- a/include/openspace/properties/matrix/dmat2x3property.h +++ b/include/openspace/properties/matrix/dmat2x3property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(DMat2x3Property, glm::dmat2x3); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___DMAT2X3PROPERTY___H__ diff --git a/include/openspace/properties/matrix/dmat2x4property.h b/include/openspace/properties/matrix/dmat2x4property.h index 3300ec67d7..d0cd44fa24 100644 --- a/include/openspace/properties/matrix/dmat2x4property.h +++ b/include/openspace/properties/matrix/dmat2x4property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(DMat2x4Property, glm::dmat2x4); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___DMAT2X4PROPERTY___H__ diff --git a/include/openspace/properties/matrix/dmat3property.h b/include/openspace/properties/matrix/dmat3property.h index 4052005316..8463219a37 100644 --- a/include/openspace/properties/matrix/dmat3property.h +++ b/include/openspace/properties/matrix/dmat3property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(DMat3Property, glm::dmat3x3); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___DMAT3PROPERTY___H__ diff --git a/include/openspace/properties/matrix/dmat3x2property.h b/include/openspace/properties/matrix/dmat3x2property.h index 15a01d557a..aecfe31832 100644 --- a/include/openspace/properties/matrix/dmat3x2property.h +++ b/include/openspace/properties/matrix/dmat3x2property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(DMat3x2Property, glm::dmat3x2); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___DMAT3X2PROPERTY___H__ diff --git a/include/openspace/properties/matrix/dmat3x4property.h b/include/openspace/properties/matrix/dmat3x4property.h index ba460f5714..430c30d238 100644 --- a/include/openspace/properties/matrix/dmat3x4property.h +++ b/include/openspace/properties/matrix/dmat3x4property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(DMat3x4Property, glm::dmat3x4); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___DMAT3X4PROPERTY___H__ diff --git a/include/openspace/properties/matrix/dmat4property.h b/include/openspace/properties/matrix/dmat4property.h index 3124aa57d8..ebf065fe24 100644 --- a/include/openspace/properties/matrix/dmat4property.h +++ b/include/openspace/properties/matrix/dmat4property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(DMat4Property, glm::dmat4x4); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___DMAT4PROPERTY___H__ diff --git a/include/openspace/properties/matrix/dmat4x2property.h b/include/openspace/properties/matrix/dmat4x2property.h index 1d0e1bfc94..fa6994f8cb 100644 --- a/include/openspace/properties/matrix/dmat4x2property.h +++ b/include/openspace/properties/matrix/dmat4x2property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(DMat4x2Property, glm::dmat4x2); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___DMAT4X2PROPERTY___H__ diff --git a/include/openspace/properties/matrix/dmat4x3property.h b/include/openspace/properties/matrix/dmat4x3property.h index 0843a3c944..75adce855d 100644 --- a/include/openspace/properties/matrix/dmat4x3property.h +++ b/include/openspace/properties/matrix/dmat4x3property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(DMat4x3Property, glm::dmat4x3); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___DMAT4X3PROPERTY___H__ diff --git a/include/openspace/properties/matrix/mat2property.h b/include/openspace/properties/matrix/mat2property.h index 8b48a60c3a..24a01b25d1 100644 --- a/include/openspace/properties/matrix/mat2property.h +++ b/include/openspace/properties/matrix/mat2property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(Mat2Property, glm::mat2x2); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___MAT2PROPERTY___H__ diff --git a/include/openspace/properties/matrix/mat2x3property.h b/include/openspace/properties/matrix/mat2x3property.h index 406834f057..c04c265873 100644 --- a/include/openspace/properties/matrix/mat2x3property.h +++ b/include/openspace/properties/matrix/mat2x3property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(Mat2x3Property, glm::mat2x3); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___MAT2X3PROPERTY___H__ diff --git a/include/openspace/properties/matrix/mat2x4property.h b/include/openspace/properties/matrix/mat2x4property.h index a678da4051..a2f322f128 100644 --- a/include/openspace/properties/matrix/mat2x4property.h +++ b/include/openspace/properties/matrix/mat2x4property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(Mat2x4Property, glm::mat2x4); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___MAT2X4PROPERTY___H__ diff --git a/include/openspace/properties/matrix/mat3property.h b/include/openspace/properties/matrix/mat3property.h index 8c428fce4f..5f8128b80e 100644 --- a/include/openspace/properties/matrix/mat3property.h +++ b/include/openspace/properties/matrix/mat3property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(Mat3Property, glm::mat3x3); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___MAT3PROPERTY___H__ diff --git a/include/openspace/properties/matrix/mat3x2property.h b/include/openspace/properties/matrix/mat3x2property.h index bfc5e2ef58..e8ce8b4e34 100644 --- a/include/openspace/properties/matrix/mat3x2property.h +++ b/include/openspace/properties/matrix/mat3x2property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(Mat3x2Property, glm::mat3x2); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___MAT3X2PROPERTY___H__ diff --git a/include/openspace/properties/matrix/mat3x4property.h b/include/openspace/properties/matrix/mat3x4property.h index 8f87c3ca52..9a1835ff67 100644 --- a/include/openspace/properties/matrix/mat3x4property.h +++ b/include/openspace/properties/matrix/mat3x4property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(Mat3x4Property, glm::mat3x4); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___MAT3X4PROPERTY___H__ diff --git a/include/openspace/properties/matrix/mat4property.h b/include/openspace/properties/matrix/mat4property.h index da2175ec20..b2cb74bf53 100644 --- a/include/openspace/properties/matrix/mat4property.h +++ b/include/openspace/properties/matrix/mat4property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(Mat4Property, glm::mat4x4); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___MAT4PROPERTY___H__ diff --git a/include/openspace/properties/matrix/mat4x2property.h b/include/openspace/properties/matrix/mat4x2property.h index e57ecdaaee..903252ad73 100644 --- a/include/openspace/properties/matrix/mat4x2property.h +++ b/include/openspace/properties/matrix/mat4x2property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(Mat4x2Property, glm::mat4x2); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___MAT4X2PROPERTY___H__ diff --git a/include/openspace/properties/matrix/mat4x3property.h b/include/openspace/properties/matrix/mat4x3property.h index cd8931479b..3c26fcf3f8 100644 --- a/include/openspace/properties/matrix/mat4x3property.h +++ b/include/openspace/properties/matrix/mat4x3property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(Mat4x3Property, glm::mat4x3); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___MAT4X3PROPERTY___H__ diff --git a/include/openspace/properties/numericalproperty.h b/include/openspace/properties/numericalproperty.h index 77ee822063..89912bda33 100644 --- a/include/openspace/properties/numericalproperty.h +++ b/include/openspace/properties/numericalproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,8 +27,7 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { template class NumericalProperty : public TemplateProperty { @@ -73,8 +72,7 @@ protected: T _stepping; }; -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #include "openspace/properties/numericalproperty.inl" diff --git a/include/openspace/properties/numericalproperty.inl b/include/openspace/properties/numericalproperty.inl index 07e9e08979..be9e5cecc6 100644 --- a/include/openspace/properties/numericalproperty.inl +++ b/include/openspace/properties/numericalproperty.inl @@ -24,8 +24,7 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { #define REGISTER_NUMERICALPROPERTY_HEADER(CLASS_NAME, TYPE) \ typedef NumericalProperty CLASS_NAME; \ @@ -361,5 +360,4 @@ std::string NumericalProperty::generateAdditionalDescription() const { return result; } -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/include/openspace/properties/optionproperty.h b/include/openspace/properties/optionproperty.h index 60d2fdc12f..983cdbf807 100644 --- a/include/openspace/properties/optionproperty.h +++ b/include/openspace/properties/optionproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,8 +29,7 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { /** * The OptionProperty is a property that provides a number of predefined (using the @@ -131,7 +130,6 @@ private: DisplayType _displayType; }; -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___OPTIONPROPERTY___H__ diff --git a/include/openspace/properties/property.h b/include/openspace/properties/property.h index fc9dd0dc33..eaf4a0c81e 100644 --- a/include/openspace/properties/property.h +++ b/include/openspace/properties/property.h @@ -35,8 +35,7 @@ struct lua_State; -namespace openspace { -namespace properties { +namespace openspace::properties { class PropertyOwner; @@ -419,7 +418,6 @@ private: OnChangeHandle _currentHandleValue; }; -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___PROPERTY___H__ diff --git a/include/openspace/properties/propertydelegate.h b/include/openspace/properties/propertydelegate.h index 9611d8f1f4..ebdc2bd1e0 100644 --- a/include/openspace/properties/propertydelegate.h +++ b/include/openspace/properties/propertydelegate.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,8 +29,7 @@ struct lua_State; -namespace openspace { -namespace properties { +namespace openspace::properties { /** * The PropertyDelegate class is used by (among others) the TemplateProperty and the @@ -158,8 +157,7 @@ public: static bool toString(std::string& outValue, U inValue); }; -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #include diff --git a/include/openspace/properties/propertydelegate.inl b/include/openspace/properties/propertydelegate.inl index 36ac0ed6ea..55bb783b9d 100644 --- a/include/openspace/properties/propertydelegate.inl +++ b/include/openspace/properties/propertydelegate.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -24,8 +24,7 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { template std::string PropertyDelegate::className() { @@ -95,5 +94,4 @@ U PropertyDelegate::fromString(std::string value, bool& success) { "Unimplemented PropertyDelegate::fromString specialization"); } -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/include/openspace/properties/propertyowner.h b/include/openspace/properties/propertyowner.h index 4fdec7bb12..9182e41c09 100644 --- a/include/openspace/properties/propertyowner.h +++ b/include/openspace/properties/propertyowner.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,8 +29,7 @@ #include #include -namespace openspace { -namespace properties { +namespace openspace::properties { class Property; @@ -236,7 +235,6 @@ private: std::vector _tags; }; -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___PROPERTYOWNER___H__ diff --git a/include/openspace/properties/scalar/boolproperty.h b/include/openspace/properties/scalar/boolproperty.h index 35ead669c1..209f4b154e 100644 --- a/include/openspace/properties/scalar/boolproperty.h +++ b/include/openspace/properties/scalar/boolproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -42,12 +42,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_TEMPLATEPROPERTY_HEADER(BoolProperty, bool); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___BOOLPROPERTY___H__ diff --git a/include/openspace/properties/scalar/charproperty.h b/include/openspace/properties/scalar/charproperty.h index c8a2c9910e..8e9d69af93 100644 --- a/include/openspace/properties/scalar/charproperty.h +++ b/include/openspace/properties/scalar/charproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -42,12 +42,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(CharProperty, char); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___CHARPROPERTY___H__ diff --git a/include/openspace/properties/scalar/doubleproperty.h b/include/openspace/properties/scalar/doubleproperty.h index 27401c7422..1aaef05190 100644 --- a/include/openspace/properties/scalar/doubleproperty.h +++ b/include/openspace/properties/scalar/doubleproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -42,12 +42,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(DoubleProperty, double); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___DOUBLEPROPERTY___H__ diff --git a/include/openspace/properties/scalar/floatproperty.h b/include/openspace/properties/scalar/floatproperty.h index fc780787a4..0af448dac7 100644 --- a/include/openspace/properties/scalar/floatproperty.h +++ b/include/openspace/properties/scalar/floatproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -42,12 +42,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(FloatProperty, float); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___FLOATPROPERTY___H__ diff --git a/include/openspace/properties/scalar/intproperty.h b/include/openspace/properties/scalar/intproperty.h index 4c55848994..8ed6a71f9c 100644 --- a/include/openspace/properties/scalar/intproperty.h +++ b/include/openspace/properties/scalar/intproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -42,12 +42,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(IntProperty, int); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___INTPROPERTY___H__ diff --git a/include/openspace/properties/scalar/longdoubleproperty.h b/include/openspace/properties/scalar/longdoubleproperty.h index 47db702438..0b45e01e42 100644 --- a/include/openspace/properties/scalar/longdoubleproperty.h +++ b/include/openspace/properties/scalar/longdoubleproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -42,12 +42,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(LongDoubleProperty, long double); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___LONGDOUBLEPROPERTY___H__ diff --git a/include/openspace/properties/scalar/longlongproperty.h b/include/openspace/properties/scalar/longlongproperty.h index b95de8c278..62570f42b4 100644 --- a/include/openspace/properties/scalar/longlongproperty.h +++ b/include/openspace/properties/scalar/longlongproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -42,12 +42,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(LongLongProperty, long long); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___LONGLONGPROPERTY___H__ diff --git a/include/openspace/properties/scalar/longproperty.h b/include/openspace/properties/scalar/longproperty.h index 5b09507df9..0944ad7248 100644 --- a/include/openspace/properties/scalar/longproperty.h +++ b/include/openspace/properties/scalar/longproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -42,12 +42,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(LongProperty, long); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___LONGPROPERTY___H__ diff --git a/include/openspace/properties/scalar/shortproperty.h b/include/openspace/properties/scalar/shortproperty.h index 7a2dd2c6a5..d5a1ff065e 100644 --- a/include/openspace/properties/scalar/shortproperty.h +++ b/include/openspace/properties/scalar/shortproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -42,12 +42,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(ShortProperty, short); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___SHORTPROPERTY___H__ diff --git a/include/openspace/properties/scalar/signedcharproperty.h b/include/openspace/properties/scalar/signedcharproperty.h index d808e1bb4d..fe2e25e2e0 100644 --- a/include/openspace/properties/scalar/signedcharproperty.h +++ b/include/openspace/properties/scalar/signedcharproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -42,12 +42,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(SignedCharProperty, signed char); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___SIGNEDCHARPROPERTY___H__ diff --git a/include/openspace/properties/scalar/ucharproperty.h b/include/openspace/properties/scalar/ucharproperty.h index 8460a72710..07f368864d 100644 --- a/include/openspace/properties/scalar/ucharproperty.h +++ b/include/openspace/properties/scalar/ucharproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -42,12 +42,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(UCharProperty, unsigned char); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___UCHARPROPERTY___H__ diff --git a/include/openspace/properties/scalar/uintproperty.h b/include/openspace/properties/scalar/uintproperty.h index 53c11668a0..f9bc3b7e12 100644 --- a/include/openspace/properties/scalar/uintproperty.h +++ b/include/openspace/properties/scalar/uintproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -42,12 +42,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(UIntProperty, unsigned int); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___UINTPROPERTY___H__ diff --git a/include/openspace/properties/scalar/ulonglongproperty.h b/include/openspace/properties/scalar/ulonglongproperty.h index 7e57f0c28a..d7a2fb70f8 100644 --- a/include/openspace/properties/scalar/ulonglongproperty.h +++ b/include/openspace/properties/scalar/ulonglongproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -42,12 +42,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(ULongLongProperty, unsigned long long); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___ULONGLONGPROPERTY___H__ diff --git a/include/openspace/properties/scalar/ulongproperty.h b/include/openspace/properties/scalar/ulongproperty.h index 8be77cc026..2a9a608c28 100644 --- a/include/openspace/properties/scalar/ulongproperty.h +++ b/include/openspace/properties/scalar/ulongproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -42,12 +42,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(ULongProperty, unsigned long); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___ULONGPROPERTY___H__ diff --git a/include/openspace/properties/scalar/ushortproperty.h b/include/openspace/properties/scalar/ushortproperty.h index 890ca2b881..738931b8e2 100644 --- a/include/openspace/properties/scalar/ushortproperty.h +++ b/include/openspace/properties/scalar/ushortproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -42,12 +42,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(UShortProperty, unsigned short); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___USHORTPROPERTY___H__ diff --git a/include/openspace/properties/scalar/wcharproperty.h b/include/openspace/properties/scalar/wcharproperty.h index 07f10d03cb..4aa41831c4 100644 --- a/include/openspace/properties/scalar/wcharproperty.h +++ b/include/openspace/properties/scalar/wcharproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -42,12 +42,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { //REGISTER_NUMERICALPROPERTY_HEADER(WCharProperty, wchar_t); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___WCHARPROPERTY___H__ diff --git a/include/openspace/properties/selectionproperty.h b/include/openspace/properties/selectionproperty.h index 672659ebdb..44882f8237 100644 --- a/include/openspace/properties/selectionproperty.h +++ b/include/openspace/properties/selectionproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,8 +29,7 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { class SelectionProperty : public TemplateProperty> { public: @@ -77,7 +76,6 @@ template <> template <> bool PropertyDelegate>>::toString(std::string& outValue, std::vector inValue); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___SELECTIONPROPERTY___H__ diff --git a/include/openspace/properties/stringproperty.h b/include/openspace/properties/stringproperty.h index 43b7761722..cf080f102e 100644 --- a/include/openspace/properties/stringproperty.h +++ b/include/openspace/properties/stringproperty.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,12 +27,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_TEMPLATEPROPERTY_HEADER(StringProperty, std::string); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___STRINGPROPERTY___H__ diff --git a/include/openspace/properties/templateproperty.h b/include/openspace/properties/templateproperty.h index 9b23293408..100d508449 100644 --- a/include/openspace/properties/templateproperty.h +++ b/include/openspace/properties/templateproperty.h @@ -27,8 +27,7 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { /** * This concrete subclass of Property handles a single parameter value that is of type @@ -186,8 +185,7 @@ protected: T _value; }; -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #include "openspace/properties/templateproperty.inl" diff --git a/include/openspace/properties/templateproperty.inl b/include/openspace/properties/templateproperty.inl index a377edfaa2..ffc8d3dbbd 100644 --- a/include/openspace/properties/templateproperty.inl +++ b/include/openspace/properties/templateproperty.inl @@ -24,8 +24,7 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { // The following macros can be used to quickly generate the necessary PropertyDelegate // specializations required by the TemplateProperty class. Use the @@ -287,5 +286,4 @@ bool TemplateProperty::setStringValue(std::string value) { return success; } -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/include/openspace/properties/triggerproperty.h b/include/openspace/properties/triggerproperty.h index 0772f6c1b4..2b963dd89e 100644 --- a/include/openspace/properties/triggerproperty.h +++ b/include/openspace/properties/triggerproperty.h @@ -27,8 +27,7 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { /** * TriggerProperty that can be used to fire events into your code using the callback @@ -67,7 +66,6 @@ public: void set(std::any value); }; -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___TRIGGERPROPERTY___H__ diff --git a/include/openspace/properties/vector/bvec2property.h b/include/openspace/properties/vector/bvec2property.h index 5f5164ea2f..f59ac15b90 100644 --- a/include/openspace/properties/vector/bvec2property.h +++ b/include/openspace/properties/vector/bvec2property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_TEMPLATEPROPERTY_HEADER(BVec2Property, glm::bvec2); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___BVEC2PROPERTY___H__ diff --git a/include/openspace/properties/vector/bvec3property.h b/include/openspace/properties/vector/bvec3property.h index f50fccbfb0..58b51f5669 100644 --- a/include/openspace/properties/vector/bvec3property.h +++ b/include/openspace/properties/vector/bvec3property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_TEMPLATEPROPERTY_HEADER(BVec3Property, glm::bvec3); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___BVEC3PROPERTY___H__ diff --git a/include/openspace/properties/vector/bvec4property.h b/include/openspace/properties/vector/bvec4property.h index 0bd80ad32f..51a59db91b 100644 --- a/include/openspace/properties/vector/bvec4property.h +++ b/include/openspace/properties/vector/bvec4property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_TEMPLATEPROPERTY_HEADER(BVec4Property, glm::bvec4); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___BVEC4PROPERTY___H__ diff --git a/include/openspace/properties/vector/dvec2property.h b/include/openspace/properties/vector/dvec2property.h index 84cd253505..03dc06dde0 100644 --- a/include/openspace/properties/vector/dvec2property.h +++ b/include/openspace/properties/vector/dvec2property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(DVec2Property, glm::dvec2); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___DVEC2PROPERTY___H__ diff --git a/include/openspace/properties/vector/dvec3property.h b/include/openspace/properties/vector/dvec3property.h index 63a057d8fb..9d8bbf0da1 100644 --- a/include/openspace/properties/vector/dvec3property.h +++ b/include/openspace/properties/vector/dvec3property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(DVec3Property, glm::dvec3); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___DVEC3PROPERTY___H__ diff --git a/include/openspace/properties/vector/dvec4property.h b/include/openspace/properties/vector/dvec4property.h index 6fbd0b337d..085ab24972 100644 --- a/include/openspace/properties/vector/dvec4property.h +++ b/include/openspace/properties/vector/dvec4property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(DVec4Property, glm::dvec4); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___DVEC4PROPERTY___H__ diff --git a/include/openspace/properties/vector/ivec2property.h b/include/openspace/properties/vector/ivec2property.h index e9c986dfc7..cec40036aa 100644 --- a/include/openspace/properties/vector/ivec2property.h +++ b/include/openspace/properties/vector/ivec2property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(IVec2Property, glm::ivec2); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___IVEC2PROPERTY___H__ diff --git a/include/openspace/properties/vector/ivec3property.h b/include/openspace/properties/vector/ivec3property.h index d6242dd434..49942e3316 100644 --- a/include/openspace/properties/vector/ivec3property.h +++ b/include/openspace/properties/vector/ivec3property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(IVec3Property, glm::ivec3); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___IVEC3PROPERTY___H__ diff --git a/include/openspace/properties/vector/ivec4property.h b/include/openspace/properties/vector/ivec4property.h index 8d234e7f5c..7545f8f8af 100644 --- a/include/openspace/properties/vector/ivec4property.h +++ b/include/openspace/properties/vector/ivec4property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(IVec4Property, glm::ivec4); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___IVEC4PROPERTY___H__ diff --git a/include/openspace/properties/vector/uvec2property.h b/include/openspace/properties/vector/uvec2property.h index fd0cad517b..d9edf7fc36 100644 --- a/include/openspace/properties/vector/uvec2property.h +++ b/include/openspace/properties/vector/uvec2property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(UVec2Property, glm::uvec2); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___UVEC2PROPERTY___H__ diff --git a/include/openspace/properties/vector/uvec3property.h b/include/openspace/properties/vector/uvec3property.h index b46ed1e6d9..b3d1dc6353 100644 --- a/include/openspace/properties/vector/uvec3property.h +++ b/include/openspace/properties/vector/uvec3property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(UVec3Property, glm::uvec3); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___UVEC3PROPERTY___H__ diff --git a/include/openspace/properties/vector/uvec4property.h b/include/openspace/properties/vector/uvec4property.h index 367ffea1a5..c171a9eec3 100644 --- a/include/openspace/properties/vector/uvec4property.h +++ b/include/openspace/properties/vector/uvec4property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(UVec4Property, glm::uvec4); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___UVEC4PROPERTY___H__ diff --git a/include/openspace/properties/vector/vec2property.h b/include/openspace/properties/vector/vec2property.h index 3476c013c7..c81360ade5 100644 --- a/include/openspace/properties/vector/vec2property.h +++ b/include/openspace/properties/vector/vec2property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(Vec2Property, glm::vec2); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___VEC2PROPERTY___H__ diff --git a/include/openspace/properties/vector/vec3property.h b/include/openspace/properties/vector/vec3property.h index 5c43e59606..0e658006b9 100644 --- a/include/openspace/properties/vector/vec3property.h +++ b/include/openspace/properties/vector/vec3property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(Vec3Property, glm::vec3); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___VEC3PROPERTY___H__ diff --git a/include/openspace/properties/vector/vec4property.h b/include/openspace/properties/vector/vec4property.h index 85bf3a3e87..0c29fde570 100644 --- a/include/openspace/properties/vector/vec4property.h +++ b/include/openspace/properties/vector/vec4property.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,10 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_NUMERICALPROPERTY_HEADER(Vec4Property, glm::vec4); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties #endif // __OPENSPACE_CORE___VEC4PROPERTY___H__ diff --git a/include/openspace/query/query.h b/include/openspace/query/query.h index 52fafb8d85..b5bf67adcd 100644 --- a/include/openspace/query/query.h +++ b/include/openspace/query/query.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,9 +30,7 @@ namespace openspace { -namespace properties { - class Property; -} +namespace properties { class Property; } class Renderable; class Scene; diff --git a/include/openspace/rendering/framebufferrenderer.h b/include/openspace/rendering/framebufferrenderer.h index 2bc0ec760e..666c572d56 100644 --- a/include/openspace/rendering/framebufferrenderer.h +++ b/include/openspace/rendering/framebufferrenderer.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -36,16 +36,12 @@ #include #include -namespace ghoul { - class Dictionary; - - namespace filesystem { - class File; - } - namespace opengl { - class ProgramObject; - class Texture; - } +namespace ghoul { class Dictionary; } +namespace ghoul::filesystem { class File; } + +namespace ghoul::opengl { + class ProgramObject; + class Texture; } namespace openspace { diff --git a/include/openspace/rendering/raycasterlistener.h b/include/openspace/rendering/raycasterlistener.h index 3efa452113..22c8c87f71 100644 --- a/include/openspace/rendering/raycasterlistener.h +++ b/include/openspace/rendering/raycasterlistener.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,8 @@ class VolumeRaycaster; class RaycasterListener { public: virtual void raycastersChanged(VolumeRaycaster& raycaster, bool attached) = 0; -}; // RaycasterListener +}; -} // openspace +} // namespace openspace #endif // __OPENSPACE_CORE___RAYCASTERLISTENER___H__ diff --git a/include/openspace/rendering/renderable.h b/include/openspace/rendering/renderable.h index a5bafcc8d5..718c4b10d0 100644 --- a/include/openspace/rendering/renderable.h +++ b/include/openspace/rendering/renderable.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,13 +29,11 @@ #include -namespace ghoul { - namespace opengl { - class ProgramObject; - class Texture; - } - class Dictionary; -} // namespace ghoul +namespace ghoul { class Dictionary; } +namespace ghoul::opengl { + class ProgramObject; + class Texture; +} namespace openspace { diff --git a/include/openspace/rendering/renderengine.h b/include/openspace/rendering/renderengine.h index c39d6d753b..e6ee382dd4 100644 --- a/include/openspace/rendering/renderengine.h +++ b/include/openspace/rendering/renderengine.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,22 +32,18 @@ #include #include - namespace ghoul { -namespace fontrendering { - class Font; + class Dictionary; + class SharedMemory; } -namespace opengl { - class ProgramObject; -} -class Dictionary; -class SharedMemory; -} // namespace ghoul +namespace ghoul::fontrendering { class Font; } +namespace ghoul::opengl { class ProgramObject; } namespace openspace { namespace performance { class PerformanceManager; } namespace scripting { struct LuaLibrary; } + class Camera; class RaycasterManager; class Renderer; diff --git a/include/openspace/rendering/renderer.h b/include/openspace/rendering/renderer.h index 825a2ce5ad..cf8d40c6dc 100644 --- a/include/openspace/rendering/renderer.h +++ b/include/openspace/rendering/renderer.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,16 +32,11 @@ #include #include -namespace ghoul { - class Dictionary; - - namespace filesystem { - class File; - } - namespace opengl { - class ProgramObject; - class Texture; - } +namespace ghoul { class Dictionary; } +namespace ghoul::filesystem { class File; } +namespace ghoul::opengl { + class ProgramObject; + class Texture; } namespace openspace { diff --git a/include/openspace/rendering/volume.h b/include/openspace/rendering/volume.h index f175a029e0..308a439ab7 100644 --- a/include/openspace/rendering/volume.h +++ b/include/openspace/rendering/volume.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -28,18 +28,15 @@ #include #include -namespace ghoul { - namespace opengl { - class Texture; - class ProgramObject; - } +namespace ghoul::opengl { + class Texture; + class ProgramObject; } namespace openspace { class Volume { public: - /** * Constructor */ diff --git a/include/openspace/rendering/volumeraycaster.h b/include/openspace/rendering/volumeraycaster.h index 4ba8fabe36..a6ac767b9a 100644 --- a/include/openspace/rendering/volumeraycaster.h +++ b/include/openspace/rendering/volumeraycaster.h @@ -29,11 +29,9 @@ #include #include -namespace ghoul { - namespace opengl { - class Texture; - class ProgramObject; - } +namespace ghoul::opengl { + class Texture; + class ProgramObject; } namespace openspace { diff --git a/include/openspace/scene/scenemanager.h b/include/openspace/scene/scenemanager.h index 26e73d9857..500e922e7e 100644 --- a/include/openspace/scene/scenemanager.h +++ b/include/openspace/scene/scenemanager.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -43,6 +43,6 @@ private: std::vector> _scenes; }; -} // namespace +} // namespace openspace #endif // __OPENSPACE_CORE___SCENEMANAGER___H__ diff --git a/include/openspace/scripting/lualibrary.h b/include/openspace/scripting/lualibrary.h index e49adc1026..ba12695bbe 100644 --- a/include/openspace/scripting/lualibrary.h +++ b/include/openspace/scripting/lualibrary.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,8 +30,7 @@ #include #include -namespace openspace { -namespace scripting { +namespace openspace::scripting { /** * This structure represents a Lua library, itself consisting of a unique #name and @@ -78,7 +77,6 @@ struct LuaLibrary { bool operator<(const LuaLibrary& rhs) const; }; -} // namespace scripting -} // namespace openspace +} // namespace openspace::scripting #endif // __OPENSPACE_CORE___LUALIBRARY___H__ diff --git a/include/openspace/scripting/scriptengine.h b/include/openspace/scripting/scriptengine.h index 5c6e42a6da..7a9072081b 100644 --- a/include/openspace/scripting/scriptengine.h +++ b/include/openspace/scripting/scriptengine.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -38,11 +38,9 @@ #include #include -namespace openspace { +namespace openspace { class SyncBuffer; } -class SyncBuffer; - -namespace scripting { +namespace openspace::scripting { /** * The ScriptEngine is responsible for handling the execution of custom Lua functions and @@ -132,7 +130,6 @@ private: std::string _logFilename; }; -} // namespace scripting -} // namespace openspace +} // namespace openspace::scripting #endif // __OPENSPACE_CORE___SCRIPTENGINE___H__ diff --git a/include/openspace/scripting/scriptscheduler.h b/include/openspace/scripting/scriptscheduler.h index fce3028caf..cb7815dc88 100644 --- a/include/openspace/scripting/scriptscheduler.h +++ b/include/openspace/scripting/scriptscheduler.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,13 +30,11 @@ #include #include -namespace ghoul { -class Dictionary; -} // namespace ghoul +namespace ghoul { class Dictionary; } -namespace openspace { -namespace documentation { struct Documentation; } -namespace scripting { +namespace openspace::documentation { struct Documentation; } + +namespace openspace::scripting { /** * Maintains an ordered list of ScheduledScripts and provides a simple @@ -123,7 +121,6 @@ private: }; -} // namespace scripting -} // namespace openspace +} // namespace openspace::scripting #endif // __OPENSPACE_CORE___SCRIPTSCHEDULER___H__ diff --git a/include/openspace/scripting/systemcapabilitiesbinding.h b/include/openspace/scripting/systemcapabilitiesbinding.h index 107b97b5c3..0d1937dd93 100644 --- a/include/openspace/scripting/systemcapabilitiesbinding.h +++ b/include/openspace/scripting/systemcapabilitiesbinding.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,13 +27,11 @@ #include -namespace openspace { -namespace scripting { +namespace openspace::scripting { LuaLibrary generalSystemCapabilities(); LuaLibrary openglSystemCapabilities(); -} // namespace scripting -} // namespace openspace +} // namespace openspace::scripting #endif // __OPENSPACE_CORE___SYSTEMCAPABILITIESBINDING___H__ diff --git a/include/openspace/util/powerscaledcoordinate.h b/include/openspace/util/powerscaledcoordinate.h index 24b9925abc..83acd3f9c8 100644 --- a/include/openspace/util/powerscaledcoordinate.h +++ b/include/openspace/util/powerscaledcoordinate.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -25,17 +25,13 @@ #ifndef __OPENSPACE_CORE___POWERSCALEDCOORDINATE___H__ #define __OPENSPACE_CORE___POWERSCALEDCOORDINATE___H__ -// open space includes -// glm includes #include #include #include #include -namespace openspace -{ +namespace openspace { -// forward declare the power scaled scalars class PowerScaledScalar; class PowerScaledCoordinate { diff --git a/include/openspace/util/powerscaledscalar.h b/include/openspace/util/powerscaledscalar.h index 3e1e06e1a2..6ba304dc61 100644 --- a/include/openspace/util/powerscaledscalar.h +++ b/include/openspace/util/powerscaledscalar.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -25,7 +25,6 @@ #ifndef __OPENSPACE_CORE___POWERSCALEDSCALAR___H__ #define __OPENSPACE_CORE___POWERSCALEDSCALAR___H__ -// glm includes #include #include #include diff --git a/include/openspace/util/powerscaledsphere.h b/include/openspace/util/powerscaledsphere.h index 7c18782b8c..e699f3a61d 100644 --- a/include/openspace/util/powerscaledsphere.h +++ b/include/openspace/util/powerscaledsphere.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -25,7 +25,6 @@ #ifndef __OPENSPACE_CORE___POWERSCALEDSPHERE___H__ #define __OPENSPACE_CORE___POWERSCALEDSPHERE___H__ -// open space includes #include #include #include diff --git a/include/openspace/util/syncdata.h b/include/openspace/util/syncdata.h index b31aacb90d..734045fa48 100644 --- a/include/openspace/util/syncdata.h +++ b/include/openspace/util/syncdata.h @@ -121,7 +121,6 @@ protected: T data; T doubleBufferedData; std::mutex _mutex; - }; } // namespace openspace diff --git a/include/openspace/util/time.h b/include/openspace/util/time.h index 947f7a0948..3d5758cb67 100644 --- a/include/openspace/util/time.h +++ b/include/openspace/util/time.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -54,7 +54,6 @@ namespace openspace { * * The synchronization of the simulation time requires */ - class Time { public: /** diff --git a/include/openspace/util/timerange.h b/include/openspace/util/timerange.h index b7739f1322..e22bcaa6ed 100644 --- a/include/openspace/util/timerange.h +++ b/include/openspace/util/timerange.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,7 +32,6 @@ namespace openspace { namespace documentation { struct Documentation; } struct TimeRange { - /** * Default constructor initializes an empty time range. */ diff --git a/include/openspace/util/updatestructures.h b/include/openspace/util/updatestructures.h index 47609c7994..918131bc3d 100644 --- a/include/openspace/util/updatestructures.h +++ b/include/openspace/util/updatestructures.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -33,9 +33,7 @@ namespace openspace { class VolumeRaycaster; -struct InitializeData { - -}; +struct InitializeData {}; struct TransformData { glm::dvec3 translation; @@ -49,7 +47,6 @@ struct UpdateData { const bool doPerformanceMeasurement; }; - struct RenderData { const Camera& camera; // psc position to be removed in favor of the double precision position defined in diff --git a/modules/base/basemodule.cpp b/modules/base/basemodule.cpp index 85382d5add..22db18df17 100644 --- a/modules/base/basemodule.cpp +++ b/modules/base/basemodule.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -52,7 +52,7 @@ namespace openspace { -BaseModule::BaseModule() : OpenSpaceModule(BaseModule::Name) {} +BaseModule::BaseModule() : OpenSpaceModule(BaseModule::Name) {} void BaseModule::internalInitialize() { FactoryManager::ref().addFactory( diff --git a/modules/base/rendering/modelgeometry.cpp b/modules/base/rendering/modelgeometry.cpp index 5b1cc4b287..572e477f6a 100644 --- a/modules/base/rendering/modelgeometry.cpp +++ b/modules/base/rendering/modelgeometry.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -44,8 +44,7 @@ namespace { const int8_t CurrentCacheVersion = 3; } // namespace -namespace openspace { -namespace modelgeometry { +namespace openspace::modelgeometry { documentation:: Documentation ModelGeometry::Documentation() { using namespace documentation; @@ -295,5 +294,4 @@ bool ModelGeometry::loadCachedFile(const std::string& filename) { void ModelGeometry::setUniforms(ghoul::opengl::ProgramObject&) {} -} // namespace modelgeometry -} // namespace openspace +} // namespace openspace::modelgeometry diff --git a/modules/base/rendering/modelgeometry.h b/modules/base/rendering/modelgeometry.h index f76685404c..a62ea6ab7f 100644 --- a/modules/base/rendering/modelgeometry.h +++ b/modules/base/rendering/modelgeometry.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,18 +31,13 @@ #include -namespace ghoul { - class Dictionary; +namespace ghoul { class Dictionary; } +namespace ghoul::opengl { class ProgramObject; } - namespace opengl { class ProgramObject; } -} // namespace ghoul +namespace openspace { class Renderable; } +namespace openspace::documentation { struct Documentation; } -namespace openspace { - -class Renderable; - -namespace documentation { struct Documentation; } -namespace modelgeometry { +namespace openspace::modelgeometry { class ModelGeometry : public properties::PropertyOwner { public: @@ -89,7 +84,6 @@ protected: std::string _file; }; -} // namespace modelgeometry -} // namespace openspace +} // namespace openspace::modelgeometry #endif // __OPENSPACE_MODULE_BASE___MODELGEOMETRY___H__ diff --git a/modules/base/rendering/multimodelgeometry.cpp b/modules/base/rendering/multimodelgeometry.cpp index ee8ea50aa2..112f7e00cd 100644 --- a/modules/base/rendering/multimodelgeometry.cpp +++ b/modules/base/rendering/multimodelgeometry.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -28,8 +28,7 @@ #include -namespace openspace { -namespace modelgeometry { +namespace openspace::modelgeometry { MultiModelGeometry::MultiModelGeometry(const ghoul::Dictionary& dictionary) : ModelGeometry(dictionary) @@ -59,5 +58,4 @@ bool MultiModelGeometry::loadModel(const std::string& filename) { return true; } -} // namespace modelgeometry -} // namespace openspace +} // namespace openspace::modelgeometry diff --git a/modules/base/rendering/multimodelgeometry.h b/modules/base/rendering/multimodelgeometry.h index 57f255f646..151557c59b 100644 --- a/modules/base/rendering/multimodelgeometry.h +++ b/modules/base/rendering/multimodelgeometry.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -28,11 +28,11 @@ #include namespace openspace { + class RenderableModel; + class RenderableModelProjection; +} // namespace openspace -class RenderableModel; -class RenderableModelProjection; - -namespace modelgeometry { +namespace openspace::modelgeometry { class MultiModelGeometry : public ModelGeometry { public: @@ -42,7 +42,6 @@ private: bool loadModel(const std::string& filename); }; -} // namespace modelgeometry -} // namespace openspace +} // namespace openspace::modelgeometry #endif // __OPENSPACE_MODULE_BASE___MULTIMODELGEOMETRY___H__ diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index 97175e9d9c..1842a52ec6 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -51,7 +51,6 @@ namespace { const char* keyBody = "Body"; const char* keyStart = "StartTime"; const char* keyEnd = "EndTime"; - } // namespace namespace openspace { diff --git a/modules/base/rendering/renderablemodel.h b/modules/base/rendering/renderablemodel.h index f169710df7..a644a8f2fe 100644 --- a/modules/base/rendering/renderablemodel.h +++ b/modules/base/rendering/renderablemodel.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -34,12 +34,10 @@ #include -namespace ghoul { -namespace opengl { +namespace ghoul::opengl { class ProgramObject; class Texture; -} // namespace opengl -} // namespace ghoul +} // namespace ghoul::opengl namespace openspace { @@ -47,10 +45,7 @@ struct RenderData; struct UpdateData; namespace documentation { struct Documentation; } - -namespace modelgeometry { -class ModelGeometry; -} +namespace modelgeometry { class ModelGeometry; } class RenderableModel : public Renderable { public: diff --git a/modules/base/rendering/renderableplane.h b/modules/base/rendering/renderableplane.h index aad6a2b2e9..92cb56ea42 100644 --- a/modules/base/rendering/renderableplane.h +++ b/modules/base/rendering/renderableplane.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -33,14 +33,12 @@ #include -namespace ghoul { -namespace filesystem { class File; } +namespace ghoul::filesystem { class File; } -namespace opengl { +namespace ghoul::opengl { class ProgramObject; class Texture; -} -} // namespace ghoul +} // namespace ghoul::opengl namespace openspace { diff --git a/modules/base/rendering/renderablesphere.h b/modules/base/rendering/renderablesphere.h index 8f74d6fe96..8951c8ab04 100644 --- a/modules/base/rendering/renderablesphere.h +++ b/modules/base/rendering/renderablesphere.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,12 +32,10 @@ #include #include -namespace ghoul { -namespace opengl { +namespace ghoul::opengl { class ProgramObject; class Texture; -} -} // namespace ghoul +} // namespace ghoul::opengl namespace openspace { diff --git a/modules/base/rendering/renderablesphericalgrid.cpp b/modules/base/rendering/renderablesphericalgrid.cpp index 00a1f8b862..42bfe5d2ae 100644 --- a/modules/base/rendering/renderablesphericalgrid.cpp +++ b/modules/base/rendering/renderablesphericalgrid.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -34,7 +34,7 @@ #include namespace { - static const std::string _loggerCat = "RenderableSphericalGrid"; + static const char* _loggerCat = "RenderableSphericalGrid"; const char* KeyGridType = "GridType"; const char* KeyGridColor = "GridColor"; const char* KeyGridMatrix = "GridMatrix"; @@ -42,7 +42,8 @@ namespace { const char* KeyGridRadius = "GridRadius"; const char* KeyGridParentsRotation = "ParentsRotation"; const glm::vec2 GridRadius = { 1.f, 20.f }; -} +} // namespace + namespace openspace { RenderableSphericalGrid::RenderableSphericalGrid(const ghoul::Dictionary& dictionary) diff --git a/modules/base/rendering/renderablesphericalgrid.h b/modules/base/rendering/renderablesphericalgrid.h index b4dabab32a..f1beb5dfb2 100644 --- a/modules/base/rendering/renderablesphericalgrid.h +++ b/modules/base/rendering/renderablesphericalgrid.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -33,7 +33,7 @@ namespace openspace { -class RenderableSphericalGrid : public Renderable{ +class RenderableSphericalGrid : public Renderable { public: RenderableSphericalGrid(const ghoul::Dictionary& dictionary); ~RenderableSphericalGrid(); diff --git a/modules/base/rendering/renderabletrail.cpp b/modules/base/rendering/renderabletrail.cpp index 159dc60c61..d20cde174a 100644 --- a/modules/base/rendering/renderabletrail.cpp +++ b/modules/base/rendering/renderabletrail.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -56,7 +56,7 @@ namespace { { "Lines+Points", RenderingModeLinesPoints }, { "Points+Lines", RenderingModeLinesPoints } }; -} +} // namespace namespace openspace { diff --git a/modules/base/rendering/renderabletrail.h b/modules/base/rendering/renderabletrail.h index f96f5d7bed..30bcdfc9d1 100644 --- a/modules/base/rendering/renderabletrail.h +++ b/modules/base/rendering/renderabletrail.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -36,12 +36,10 @@ #include -namespace ghoul { -namespace opengl { +namespace ghoul::opengl { class ProgramObject; class Texture; -} // namespace opengl -} // namespace ghoul +} // namespace ghoul::opengl namespace openspace { diff --git a/modules/base/rendering/renderabletrailorbit.cpp b/modules/base/rendering/renderabletrailorbit.cpp index fe11720f80..7f8f3c700a 100644 --- a/modules/base/rendering/renderabletrailorbit.cpp +++ b/modules/base/rendering/renderabletrailorbit.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -83,7 +83,7 @@ namespace { const char* KeyPeriod = "Period"; const char* KeyResolution = "Resolution"; -} +} // namespace namespace openspace { diff --git a/modules/base/rendering/renderabletrailtrajectory.cpp b/modules/base/rendering/renderabletrailtrajectory.cpp index 8094ba3abd..694954d495 100644 --- a/modules/base/rendering/renderabletrailtrajectory.cpp +++ b/modules/base/rendering/renderabletrailtrajectory.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -49,7 +49,7 @@ namespace { const char* KeySampleInterval = "SampleInterval"; const char* KeyTimeStampSubsample = "TimeStampSubsampleFactor"; const char* KeyShowFullTrail = "ShowFullTrail"; -} +} // namespace namespace openspace { diff --git a/modules/base/rotation/staticrotation.cpp b/modules/base/rotation/staticrotation.cpp index e8aa408dd8..dc2c817363 100644 --- a/modules/base/rotation/staticrotation.cpp +++ b/modules/base/rotation/staticrotation.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,7 +29,7 @@ namespace { const char* KeyRotation = "Rotation"; -} +} // namespace namespace openspace { diff --git a/modules/base/scale/staticscale.cpp b/modules/base/scale/staticscale.cpp index 6eb819e419..c239ed179e 100644 --- a/modules/base/scale/staticscale.cpp +++ b/modules/base/scale/staticscale.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,7 +29,7 @@ namespace { const char* KeyValue = "Scale"; -} +} // namespace namespace openspace { diff --git a/modules/base/translation/statictranslation.cpp b/modules/base/translation/statictranslation.cpp index 069c64e10e..430380f1f8 100644 --- a/modules/base/translation/statictranslation.cpp +++ b/modules/base/translation/statictranslation.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,7 +29,7 @@ namespace { const char* KeyPosition = "Position"; -} +} // namespace namespace openspace { diff --git a/modules/debugging/debuggingmodule.cpp b/modules/debugging/debuggingmodule.cpp index bbebf4a0db..29615b991c 100644 --- a/modules/debugging/debuggingmodule.cpp +++ b/modules/debugging/debuggingmodule.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -33,9 +33,7 @@ namespace openspace { -DebuggingModule::DebuggingModule() - : OpenSpaceModule(Name) -{} +DebuggingModule::DebuggingModule() : OpenSpaceModule(Name) {} void DebuggingModule::internalInitialize() { auto fRenderable = FactoryManager::ref().factory(); diff --git a/modules/debugging/rendering/debugrenderer.cpp b/modules/debugging/rendering/debugrenderer.cpp index a84a0ff170..0b077a195e 100644 --- a/modules/debugging/rendering/debugrenderer.cpp +++ b/modules/debugging/rendering/debugrenderer.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -35,9 +35,8 @@ #include namespace { - const std::string _loggerCat = "DebugRenderer"; -} - + const char* _loggerCat = "DebugRenderer"; +} // namespace namespace openspace { diff --git a/modules/debugging/rendering/renderabledebugplane.cpp b/modules/debugging/rendering/renderabledebugplane.cpp index d0acd3216b..ffd8ce505e 100644 --- a/modules/debugging/rendering/renderabledebugplane.cpp +++ b/modules/debugging/rendering/renderabledebugplane.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -40,8 +40,8 @@ #include namespace { - const std::string _loggerCat = "RenderablePlaneTexture"; -} + const char* _loggerCat = "RenderablePlaneTexture"; +} // namespace namespace openspace { diff --git a/modules/debugging/rendering/renderabledebugplane.h b/modules/debugging/rendering/renderabledebugplane.h index 6a5aaafb6d..e7b83eb885 100644 --- a/modules/debugging/rendering/renderabledebugplane.h +++ b/modules/debugging/rendering/renderabledebugplane.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,25 +31,17 @@ #include #include -namespace ghoul { - namespace filesystem { - class File; - } - namespace opengl { - class ProgramObject; - class Texture; - } -} +namespace ghoul::filesystem { class File; } +namespace ghoul::opengl { + class ProgramObject; + class Texture; +} // namespace ghoul::opengl namespace openspace { - struct LinePoint; -class RenderableDebugPlane: public Renderable { - - enum class Origin { - LowerLeft, LowerRight, UpperLeft, UpperRight, Center - }; +struct LinePoint; +class RenderableDebugPlane : public Renderable { public: RenderableDebugPlane(const ghoul::Dictionary& dictionary); ~RenderableDebugPlane(); @@ -63,6 +55,10 @@ public: void update(const UpdateData& data) override; private: + enum class Origin { + LowerLeft, LowerRight, UpperLeft, UpperRight, Center + }; + void createPlane(); properties::IntProperty _texture; diff --git a/modules/fieldlines/fieldlinesmodule.cpp b/modules/fieldlines/fieldlinesmodule.cpp index f677bd8d95..ba1c531307 100644 --- a/modules/fieldlines/fieldlinesmodule.cpp +++ b/modules/fieldlines/fieldlinesmodule.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -33,9 +33,7 @@ namespace openspace { -FieldlinesModule::FieldlinesModule() - : OpenSpaceModule(Name) -{} +FieldlinesModule::FieldlinesModule() : OpenSpaceModule(Name) {} void FieldlinesModule::internalInitialize() { auto fRenderable = FactoryManager::ref().factory(); diff --git a/modules/fieldlines/rendering/renderablefieldlines.cpp b/modules/fieldlines/rendering/renderablefieldlines.cpp index a6dc9e6f52..2b4404d571 100644 --- a/modules/fieldlines/rendering/renderablefieldlines.cpp +++ b/modules/fieldlines/rendering/renderablefieldlines.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -38,7 +38,7 @@ #include namespace { - std::string _loggerCat = "RenderableFieldlines"; + const char* _loggerCat = "RenderableFieldlines"; const float defaultFieldlineStepSize = 0.5f;; const glm::vec4 defaultFieldlineColor = glm::vec4(1.f, 0.f, 0.f, 1.f); @@ -70,7 +70,7 @@ namespace { const int SeedPointSourceFile = 0; const int SeedPointSourceTable = 1; -} +} // namespace namespace openspace { diff --git a/modules/fieldlines/rendering/renderablefieldlines.h b/modules/fieldlines/rendering/renderablefieldlines.h index a6b28821b2..2a34eff63a 100644 --- a/modules/fieldlines/rendering/renderablefieldlines.h +++ b/modules/fieldlines/rendering/renderablefieldlines.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -35,14 +35,11 @@ #include #include -namespace ghoul { -namespace opengl { - class ProgramObject; -} -} +namespace ghoul::opengl { class ProgramObject; } namespace openspace { - struct LinePoint; + +struct LinePoint; class RenderableFieldlines : public Renderable { public: diff --git a/modules/galaxy/rendering/galaxyraycaster.h b/modules/galaxy/rendering/galaxyraycaster.h index 8ac51b9579..e4eda52182 100644 --- a/modules/galaxy/rendering/galaxyraycaster.h +++ b/modules/galaxy/rendering/galaxyraycaster.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -34,13 +34,11 @@ #include #include -namespace ghoul { - namespace opengl { - class Texture; - class TextureUnit; - class ProgramObject; - } -} +namespace ghoul::opengl { + class Texture; + class TextureUnit; + class ProgramObject; +} // namespace ghoul::opengl namespace openspace { diff --git a/modules/galaxy/tasks/milkywayconversiontask.h b/modules/galaxy/tasks/milkywayconversiontask.h index 4e00b9c975..aeeb59a5b0 100644 --- a/modules/galaxy/tasks/milkywayconversiontask.h +++ b/modules/galaxy/tasks/milkywayconversiontask.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,10 +32,9 @@ #include #include - namespace openspace { -namespace documentation { struct Documentation; } +namespace documentation { struct Documentation; } /** * Converts a set of exr image slices to a raw volume @@ -58,6 +57,6 @@ private: glm::ivec3 _outDimensions; }; -} +} // namespace openspace #endif // __OPENSPACE_MODULE_GALAXY___MILKYWAYCONVERSIONTASK___H__ diff --git a/modules/galaxy/tasks/milkywaypointsconversiontask.h b/modules/galaxy/tasks/milkywaypointsconversiontask.h index d20eb4bcef..b4b6fd8d44 100644 --- a/modules/galaxy/tasks/milkywaypointsconversiontask.h +++ b/modules/galaxy/tasks/milkywaypointsconversiontask.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,7 +32,6 @@ #include #include - namespace openspace { namespace documentation { struct Documentation; } @@ -56,6 +55,6 @@ private: std::string _outFilename; }; -} +} // namespace openspace #endif // __OPENSPACE_MODULE_GALAXY___MILKYWAYPOINTSCONVERSIONTASK_H__ diff --git a/modules/globebrowsing/cache/lrucache.h b/modules/globebrowsing/cache/lrucache.h index 8ebf224a9c..75e76aa280 100644 --- a/modules/globebrowsing/cache/lrucache.h +++ b/modules/globebrowsing/cache/lrucache.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,9 +29,7 @@ #include #include -namespace openspace { -namespace globebrowsing { -namespace cache { +namespace openspace::globebrowsing::cache { /** * Templated class implementing a Least-Recently-Used Cache. @@ -83,9 +81,7 @@ private: size_t _maximumCacheSize; }; -} // namespace cache -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::cache #include diff --git a/modules/globebrowsing/cache/lrucache.inl b/modules/globebrowsing/cache/lrucache.inl index 47c0eb4126..52827ad978 100644 --- a/modules/globebrowsing/cache/lrucache.inl +++ b/modules/globebrowsing/cache/lrucache.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -24,9 +24,7 @@ #include -namespace openspace { -namespace globebrowsing { -namespace cache { +namespace openspace::globebrowsing::cache { template LRUCache::LRUCache(size_t size) @@ -163,6 +161,4 @@ LRUCache::cleanAndFetchPopped() return toReturn; } -} // namespace cache -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::cache diff --git a/modules/globebrowsing/cache/memoryawaretilecache.h b/modules/globebrowsing/cache/memoryawaretilecache.h index 21f2d26dcc..df02e0a150 100644 --- a/modules/globebrowsing/cache/memoryawaretilecache.h +++ b/modules/globebrowsing/cache/memoryawaretilecache.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -41,9 +41,7 @@ #include #include -namespace openspace { -namespace globebrowsing { -namespace cache { +namespace openspace::globebrowsing::cache { struct ProviderTileKey { TileIndex tileIndex; @@ -87,7 +85,6 @@ struct ProviderTileHasher { class MemoryAwareTileCache : public properties::PropertyOwner { public: - MemoryAwareTileCache(); ~MemoryAwareTileCache(); @@ -131,8 +128,6 @@ private: properties::BoolProperty _usePbo; }; -} // namespace cache -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::cache #endif // __OPENSPACE_MODULE_GLOBEBROWSING___MEMORY_AWARE_TILE_CACHE___H__ diff --git a/modules/globebrowsing/cache/texturecontainer.h b/modules/globebrowsing/cache/texturecontainer.h index bcab70e17c..03eb30eeca 100644 --- a/modules/globebrowsing/cache/texturecontainer.h +++ b/modules/globebrowsing/cache/texturecontainer.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,16 +30,13 @@ #include #include -namespace openspace { -namespace globebrowsing { -namespace cache { +namespace openspace::globebrowsing::cache { /** * Owner of texture data used for tiles. Instead of dynamically allocating textures one * by one, they are created once and reused. */ -class TextureContainer -{ +class TextureContainer { public: /** * \param initData is the description of the texture type. @@ -74,8 +71,6 @@ private: size_t _numTextures; }; -} // namespace cache -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::cache #endif // __OPENSPACE_MODULE_GLOBEBROWSING___TEXTURE_CONTAINER___H__ diff --git a/modules/globebrowsing/chunk/chunk.h b/modules/globebrowsing/chunk/chunk.h index c235fa4525..d4a04a9894 100644 --- a/modules/globebrowsing/chunk/chunk.h +++ b/modules/globebrowsing/chunk/chunk.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,11 +32,9 @@ #include -namespace openspace { +namespace openspace { struct RenderData; } -struct RenderData; - -namespace globebrowsing { +namespace openspace::globebrowsing { class RenderableGlobe; struct TileIndex; @@ -101,7 +99,6 @@ private: const GeodeticPatch _surfacePatch; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNK___H__ diff --git a/modules/globebrowsing/chunk/chunklevelevaluator/availabletiledataevaluator.cpp b/modules/globebrowsing/chunk/chunklevelevaluator/availabletiledataevaluator.cpp index 8191439767..66bb810b10 100644 --- a/modules/globebrowsing/chunk/chunklevelevaluator/availabletiledataevaluator.cpp +++ b/modules/globebrowsing/chunk/chunklevelevaluator/availabletiledataevaluator.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,9 +31,7 @@ #include #include -namespace openspace { -namespace globebrowsing { -namespace chunklevelevaluator { +namespace openspace::globebrowsing::chunklevelevaluator { int AvailableTileData::getDesiredLevel(const Chunk& chunk, const RenderData& data) const { auto layerManager = chunk.owner().chunkedLodGlobe()->layerManager(); @@ -52,6 +50,4 @@ int AvailableTileData::getDesiredLevel(const Chunk& chunk, const RenderData& dat return currLevel - 1; } -} // namespace chunklevelevaluator -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::chunklevelevaluator diff --git a/modules/globebrowsing/chunk/chunklevelevaluator/availabletiledataevaluator.h b/modules/globebrowsing/chunk/chunklevelevaluator/availabletiledataevaluator.h index f0ac953813..a45ad5f855 100644 --- a/modules/globebrowsing/chunk/chunklevelevaluator/availabletiledataevaluator.h +++ b/modules/globebrowsing/chunk/chunklevelevaluator/availabletiledataevaluator.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,9 +27,7 @@ #include -namespace openspace { -namespace globebrowsing { -namespace chunklevelevaluator { +namespace openspace::globebrowsing::chunklevelevaluator { /** * If this chunk has available tile data for any LayerGroup on any of its active @@ -42,8 +40,6 @@ public: int getDesiredLevel(const Chunk& chunk, const RenderData& data) const override; }; -} // namespace chunklevelevaluator -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::chunklevelevaluator #endif // __OPENSPACE_MODULE_GLOBEBROWSING___AVAILABLETILEDATAEVALUATOR___H__ diff --git a/modules/globebrowsing/chunk/chunklevelevaluator/chunklevelevaluator.h b/modules/globebrowsing/chunk/chunklevelevaluator/chunklevelevaluator.h index 2634174bd7..28a13a945e 100644 --- a/modules/globebrowsing/chunk/chunklevelevaluator/chunklevelevaluator.h +++ b/modules/globebrowsing/chunk/chunklevelevaluator/chunklevelevaluator.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -25,15 +25,11 @@ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKLEVELEVALUATOR___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKLEVELEVALUATOR___H__ -namespace openspace { +namespace openspace { struct RenderData; } -struct RenderData; - -namespace globebrowsing { - -class Chunk; +namespace openspace::globebrowsing { class Chunk; } -namespace chunklevelevaluator { +namespace openspace::globebrowsing::chunklevelevaluator { /** * Abstract class defining an interface for accessing a desired level of a Chunk. @@ -48,8 +44,6 @@ public: virtual int getDesiredLevel(const Chunk& chunk, const RenderData& data) const = 0; }; -} // namespace chunklevelevaluator -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::chunklevelevaluator #endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKLEVELEVALUATOR___H__ diff --git a/modules/globebrowsing/chunk/chunklevelevaluator/distanceevaluator.h b/modules/globebrowsing/chunk/chunklevelevaluator/distanceevaluator.h index ead3ba050d..6cc6cdbb17 100644 --- a/modules/globebrowsing/chunk/chunklevelevaluator/distanceevaluator.h +++ b/modules/globebrowsing/chunk/chunklevelevaluator/distanceevaluator.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,9 +27,7 @@ #include -namespace openspace { -namespace globebrowsing { -namespace chunklevelevaluator { +namespace openspace::globebrowsing::chunklevelevaluator { /** * Evaluate the Chunk level depending on the distance from the Camera to the Chunk. @@ -41,8 +39,6 @@ public: int getDesiredLevel(const Chunk& chunk, const RenderData& data) const override; }; -} // namespace chunklevelevaluator -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::chunklevelevaluator #endif // __OPENSPACE_MODULE_GLOBEBROWSING___DISTANCEEVALUATOR___H__ diff --git a/modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.h b/modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.h index 0bd0bee3f1..95965d4af2 100644 --- a/modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.h +++ b/modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,9 +27,7 @@ #include -namespace openspace { -namespace globebrowsing { -namespace chunklevelevaluator { +namespace openspace::globebrowsing::chunklevelevaluator { /** * Evaluate the chunk level using the area of the non-heightmapped Chunk projected @@ -43,9 +41,6 @@ public: virtual int getDesiredLevel(const Chunk& chunk, const RenderData& data) const; }; - -} // namespace chunklevelevaluator -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::chunklevelevaluator #endif // __OPENSPACE_MODULE_GLOBEBROWSING___PROJECTEDAREAEVALUATOR___H__ diff --git a/modules/globebrowsing/chunk/chunknode.h b/modules/globebrowsing/chunk/chunknode.h index 09ff70d302..b9daa5e966 100644 --- a/modules/globebrowsing/chunk/chunknode.h +++ b/modules/globebrowsing/chunk/chunknode.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { class ChunkedLodGlobe; @@ -80,7 +79,6 @@ private: Chunk _chunk; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKNODE___H__ diff --git a/modules/globebrowsing/chunk/culling/chunkculler.h b/modules/globebrowsing/chunk/culling/chunkculler.h index 9c09e55c8e..546e86cfc9 100644 --- a/modules/globebrowsing/chunk/culling/chunkculler.h +++ b/modules/globebrowsing/chunk/culling/chunkculler.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -25,15 +25,10 @@ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKCULLER___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKCULLER___H__ -namespace openspace { +namespace openspace { struct RenderData; } +namespace openspace::globebrowsing { class Chunk; } -struct RenderData; - -namespace globebrowsing { - -class Chunk; - -namespace culling { +namespace openspace::globebrowsing::culling { class ChunkCuller { public: @@ -46,8 +41,6 @@ public: virtual bool isCullable(const Chunk& chunk, const RenderData& renderData) = 0; }; -} // namespace culling -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::culling #endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKCULLER___H__ diff --git a/modules/globebrowsing/chunk/culling/frustumculler.h b/modules/globebrowsing/chunk/culling/frustumculler.h index 28cb74287f..0acafb4e8a 100644 --- a/modules/globebrowsing/chunk/culling/frustumculler.h +++ b/modules/globebrowsing/chunk/culling/frustumculler.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,9 +29,7 @@ #include -namespace openspace { -namespace globebrowsing { -namespace culling { +namespace openspace::globebrowsing::culling { /** * Culls all chunks that are completely outside the view frustum. @@ -56,8 +54,6 @@ private: const AABB3 _viewFrustum; }; -} // namespace culling -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::culling #endif // __OPENSPACE_MODULE_GLOBEBROWSING___FRUSTUMCULLER___H__ diff --git a/modules/globebrowsing/chunk/culling/horizonculler.h b/modules/globebrowsing/chunk/culling/horizonculler.h index 8823796c9e..e4f74b7780 100644 --- a/modules/globebrowsing/chunk/culling/horizonculler.h +++ b/modules/globebrowsing/chunk/culling/horizonculler.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,9 +29,7 @@ #include -namespace openspace { -namespace globebrowsing { -namespace culling { +namespace openspace::globebrowsing::culling { /** * In this implementation of the horizon culling, the closer the ellipsoid is to a @@ -50,8 +48,6 @@ private: double minimumGlobeRadius); }; -} // namespace culling -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::culling #endif // __OPENSPACE_MODULE_GLOBEBROWSING___HORIZONCULLER___H__ diff --git a/modules/globebrowsing/geometry/aabb.cpp b/modules/globebrowsing/geometry/aabb.cpp index d9e47cc691..2bb893ad4f 100644 --- a/modules/globebrowsing/geometry/aabb.cpp +++ b/modules/globebrowsing/geometry/aabb.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -26,8 +26,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { AABB1::AABB1() : AABB1(std::numeric_limits::max(), -std::numeric_limits::max()) @@ -185,5 +184,4 @@ AABB3::AABBSpatialRelation AABB3::relationTo(const AABB3& o) const { return AABB3::AABBSpatialRelation::None; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/geometry/aabb.h b/modules/globebrowsing/geometry/aabb.h index 5277230fcb..cbbcbd6b2d 100644 --- a/modules/globebrowsing/geometry/aabb.h +++ b/modules/globebrowsing/geometry/aabb.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,8 +27,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct AABB1 { enum class AABBSpatialRelation { @@ -99,7 +98,6 @@ struct AABB3 { glm::vec3 max; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___AABB___H__ diff --git a/modules/globebrowsing/geometry/angle.h b/modules/globebrowsing/geometry/angle.h index 1963f0d0a2..98b3b673e2 100644 --- a/modules/globebrowsing/geometry/angle.h +++ b/modules/globebrowsing/geometry/angle.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,8 +29,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { template class Angle { @@ -129,8 +128,7 @@ private: using dAngle = Angle; using fAngle = Angle; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #include diff --git a/modules/globebrowsing/geometry/angle.inl b/modules/globebrowsing/geometry/angle.inl index f84431f91f..a078c93b15 100644 --- a/modules/globebrowsing/geometry/angle.inl +++ b/modules/globebrowsing/geometry/angle.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -24,8 +24,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { template const T Angle::PI = 3.14159265358979323846264338327950; @@ -240,5 +239,4 @@ Angle Angle::getAbs() const { return Angle(*this).abs(); } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/geometry/ellipsoid.h b/modules/globebrowsing/geometry/ellipsoid.h index 9dac318f5b..e8fa50047a 100644 --- a/modules/globebrowsing/geometry/ellipsoid.h +++ b/modules/globebrowsing/geometry/ellipsoid.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,8 +30,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { /** * This class is based largely on the Ellipsoid class defined in the book @@ -99,7 +98,6 @@ private: glm::dvec3 _radii; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___ELLIPSOID___H__ diff --git a/modules/globebrowsing/geometry/geodetic2.h b/modules/globebrowsing/geometry/geodetic2.h index 9c4e029fb5..5255758f06 100644 --- a/modules/globebrowsing/geometry/geodetic2.h +++ b/modules/globebrowsing/geometry/geodetic2.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,8 +27,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct Geodetic2 { Geodetic2(double latitude = 0.0, double longitude = 0.0); @@ -51,7 +50,6 @@ struct Geodetic2 { double lon; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___GEODETIC2___H__ diff --git a/modules/globebrowsing/geometry/geodetic3.h b/modules/globebrowsing/geometry/geodetic3.h index e0d6bb337d..c61b763fe9 100644 --- a/modules/globebrowsing/geometry/geodetic3.h +++ b/modules/globebrowsing/geometry/geodetic3.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,15 +27,13 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct Geodetic3 { Geodetic2 geodetic2; double height; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___GEODETIC3___H__ diff --git a/modules/globebrowsing/geometry/geodeticpatch.h b/modules/globebrowsing/geometry/geodeticpatch.h index eff1392431..ba74887da0 100644 --- a/modules/globebrowsing/geometry/geodeticpatch.h +++ b/modules/globebrowsing/geometry/geodeticpatch.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,8 +29,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { class GeodeticPatch { public: @@ -110,7 +109,6 @@ private: Geodetic2 _halfSize; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___GEODETICPATCH___H__ diff --git a/modules/globebrowsing/globes/chunkedlodglobe.h b/modules/globebrowsing/globes/chunkedlodglobe.h index 52f5e61d3c..605edbe568 100644 --- a/modules/globebrowsing/globes/chunkedlodglobe.h +++ b/modules/globebrowsing/globes/chunkedlodglobe.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -33,16 +33,11 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { -namespace chunklevelevaluator { - class Evaluator; -} // namespace chunklevelevaluator +namespace chunklevelevaluator { class Evaluator; } -namespace culling { - class ChunkCuller; -} // namespace culling +namespace culling { class ChunkCuller; } class Chunk; class ChunkNode; @@ -145,7 +140,6 @@ private: bool _shadersNeedRecompilation; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKED_LOD_GLOBE___H__ diff --git a/modules/globebrowsing/globes/pointglobe.h b/modules/globebrowsing/globes/pointglobe.h index 34c28ab6fb..78199d1e30 100644 --- a/modules/globebrowsing/globes/pointglobe.h +++ b/modules/globebrowsing/globes/pointglobe.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,12 +30,9 @@ #include -namespace ghoul { namespace opengl { -class ProgramObject; -} } +namespace ghoul::opengl { class ProgramObject; } -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { class RenderableGlobe; @@ -61,7 +58,6 @@ private: properties::FloatProperty _lightIntensity; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___POINTGLOBE___H__ diff --git a/modules/globebrowsing/globes/renderableglobe.h b/modules/globebrowsing/globes/renderableglobe.h index 73e080b2cc..7f80b38388 100644 --- a/modules/globebrowsing/globes/renderableglobe.h +++ b/modules/globebrowsing/globes/renderableglobe.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -34,8 +34,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { class ChunkedLodGlobe; class PointGlobe; @@ -135,7 +134,6 @@ private: properties::PropertyOwner _debugPropertyOwner; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___RENDERABLEGLOBE___H__ diff --git a/modules/globebrowsing/meshes/basicgrid.h b/modules/globebrowsing/meshes/basicgrid.h index ab71f540c6..0dffc2359b 100644 --- a/modules/globebrowsing/meshes/basicgrid.h +++ b/modules/globebrowsing/meshes/basicgrid.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { class BasicGrid : public Grid { public: @@ -67,7 +66,6 @@ private: inline size_t numVertices(int xSegments, int ySegments); }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___BASICGRIDGEOMETRY___H__ diff --git a/modules/globebrowsing/meshes/grid.h b/modules/globebrowsing/meshes/grid.h index cf6c8b990c..b61e46410a 100644 --- a/modules/globebrowsing/meshes/grid.h +++ b/modules/globebrowsing/meshes/grid.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { /** * Abstract class defining an interface used for geometries with grid structures. @@ -97,7 +96,6 @@ protected: const int _ySegments; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___GRIDGEOMETRY___H__ diff --git a/modules/globebrowsing/meshes/skirtedgrid.h b/modules/globebrowsing/meshes/skirtedgrid.h index 66c675887f..d14267ad6e 100644 --- a/modules/globebrowsing/meshes/skirtedgrid.h +++ b/modules/globebrowsing/meshes/skirtedgrid.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,8 +30,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { /** * This grid is the same as BasicGrid except it has skirts around its edges. @@ -72,7 +71,6 @@ private: size_t numVertices(int xSegments, int ySegments); }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___SKIRTEDGRID___H__ diff --git a/modules/globebrowsing/meshes/trianglesoup.h b/modules/globebrowsing/meshes/trianglesoup.h index 5085003cec..e51e440be2 100644 --- a/modules/globebrowsing/meshes/trianglesoup.h +++ b/modules/globebrowsing/meshes/trianglesoup.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { /** * Class to hold vertex data and handling OpenGL interfacing and rendering. @@ -101,7 +100,6 @@ private: bool _gpuDataNeedUpdate; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___TRIANGLESOUP___H__ diff --git a/modules/globebrowsing/other/concurrentjobmanager.h b/modules/globebrowsing/other/concurrentjobmanager.h index fad0a62704..33ec128abe 100644 --- a/modules/globebrowsing/other/concurrentjobmanager.h +++ b/modules/globebrowsing/other/concurrentjobmanager.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,8 +30,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { // Templated abstract base class representing a job to be done. // Client code derive from this class and implement the virtual execute() method @@ -67,8 +66,7 @@ private: ThreadPool threadPool; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #include "concurrentjobmanager.inl" diff --git a/modules/globebrowsing/other/concurrentjobmanager.inl b/modules/globebrowsing/other/concurrentjobmanager.inl index 763f46b848..0e3f50182b 100644 --- a/modules/globebrowsing/other/concurrentjobmanager.inl +++ b/modules/globebrowsing/other/concurrentjobmanager.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -24,8 +24,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { template Job

::Job() {} @@ -64,5 +63,4 @@ size_t ConcurrentJobManager

::numFinishedJobs() const { return _finishedJobs.size(); } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/other/concurrentqueue.h b/modules/globebrowsing/other/concurrentqueue.h index e66f64e734..c23be18df3 100644 --- a/modules/globebrowsing/other/concurrentqueue.h +++ b/modules/globebrowsing/other/concurrentqueue.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,8 +29,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { /** * Templated thread-safe queue based on std::thread and std::queue @@ -54,8 +53,7 @@ private: mutable std::condition_variable _cond; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #include "concurrentqueue.inl" diff --git a/modules/globebrowsing/other/concurrentqueue.inl b/modules/globebrowsing/other/concurrentqueue.inl index f493cacc7f..b35b67c7aa 100644 --- a/modules/globebrowsing/other/concurrentqueue.inl +++ b/modules/globebrowsing/other/concurrentqueue.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -22,8 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { template T ConcurrentQueue::pop() { @@ -71,5 +70,4 @@ size_t ConcurrentQueue::size() const { return s; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/other/distanceswitch.h b/modules/globebrowsing/other/distanceswitch.h index 2ba77a9d90..ec6f73ff57 100644 --- a/modules/globebrowsing/other/distanceswitch.h +++ b/modules/globebrowsing/other/distanceswitch.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,12 @@ #include namespace openspace { + class Renderable; + struct RenderData; + struct UpdateData; +} // namespace openspace -class Renderable; -struct RenderData; -struct UpdateData; - -namespace globebrowsing { +namespace openspace::globebrowsing { /** * Selects a specific Renderable to be used for rendering, based on distance to the @@ -63,7 +63,6 @@ private: std::vector> _renderables; }; -} // namespace globebrowsing -} // openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___DISTANCESWITCH___H__ diff --git a/modules/globebrowsing/other/lruthreadpool.h b/modules/globebrowsing/other/lruthreadpool.h index 1b89e04ce1..82e53b8dcb 100644 --- a/modules/globebrowsing/other/lruthreadpool.h +++ b/modules/globebrowsing/other/lruthreadpool.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -37,11 +37,9 @@ // Implementatin based on http://progsch.net/wordpress/?p=81 -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { -template -class LRUThreadPool; +template class LRUThreadPool; template class LRUThreadPoolWorker { @@ -93,8 +91,7 @@ private: bool _stop; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #include "lruthreadpool.inl" diff --git a/modules/globebrowsing/other/lruthreadpool.inl b/modules/globebrowsing/other/lruthreadpool.inl index bcc57029b5..b75e4b0258 100644 --- a/modules/globebrowsing/other/lruthreadpool.inl +++ b/modules/globebrowsing/other/lruthreadpool.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -22,8 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { template LRUThreadPoolWorker::LRUThreadPoolWorker(LRUThreadPool& pool) @@ -144,5 +143,4 @@ void LRUThreadPool::clearEnqueuedTasks() { } // release lock } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/other/pixelbuffer.h b/modules/globebrowsing/other/pixelbuffer.h index 1f9ee4918e..bc7134e027 100644 --- a/modules/globebrowsing/other/pixelbuffer.h +++ b/modules/globebrowsing/other/pixelbuffer.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,8 +27,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { /** * Handles an OpenGL pixel buffer which contains data allocated on the GPU. A simple @@ -37,8 +36,7 @@ namespace globebrowsing { * address pointer, the user needs to ensure the data is unmapped before the data can * be used on the GPU / CPU depending on Usage. */ -class PixelBuffer -{ +class PixelBuffer { public: /** * All kinds of usage for pixel buffer objects as defined by the OpenGL standard. @@ -134,7 +132,6 @@ private: bool _isMapped; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___PIXEL_BUFFER___H__ diff --git a/modules/globebrowsing/other/pixelbuffercontainer.h b/modules/globebrowsing/other/pixelbuffercontainer.h index f1fdcfb9aa..02b8472826 100644 --- a/modules/globebrowsing/other/pixelbuffercontainer.h +++ b/modules/globebrowsing/other/pixelbuffercontainer.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,8 +29,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { /** * Templated class which owns one or many PixelBuffers. The @@ -38,8 +37,7 @@ namespace globebrowsing { * mapped. */ template -class PixelBufferContainer -{ +class PixelBufferContainer { public: /** * Creates numPixelBuffers pixel buffer objects, each with numBytesPerBuffer bytes @@ -107,8 +105,7 @@ private: std::map _indexMap; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #include "pixelbuffercontainer.inl" diff --git a/modules/globebrowsing/other/pixelbuffercontainer.inl b/modules/globebrowsing/other/pixelbuffercontainer.inl index c1a4e4aaa2..028d7b2934 100644 --- a/modules/globebrowsing/other/pixelbuffercontainer.inl +++ b/modules/globebrowsing/other/pixelbuffercontainer.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -22,8 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { template PixelBufferContainer::PixelBufferContainer(size_t numBytesPerBuffer, @@ -126,5 +125,4 @@ GLuint PixelBufferContainer::idOfMappedBuffer(KeyType key) { return 0; } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/other/prioritizingconcurrentjobmanager.h b/modules/globebrowsing/other/prioritizingconcurrentjobmanager.h index 6b166dd1a2..3d622bf97c 100644 --- a/modules/globebrowsing/other/prioritizingconcurrentjobmanager.h +++ b/modules/globebrowsing/other/prioritizingconcurrentjobmanager.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { /** * Concurrent job manager which prioritizes which jobs to work on depending on which @@ -91,8 +90,7 @@ private: }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #include "prioritizingconcurrentjobmanager.inl" diff --git a/modules/globebrowsing/other/prioritizingconcurrentjobmanager.inl b/modules/globebrowsing/other/prioritizingconcurrentjobmanager.inl index dbfbcbefdf..3ea12cee7b 100644 --- a/modules/globebrowsing/other/prioritizingconcurrentjobmanager.inl +++ b/modules/globebrowsing/other/prioritizingconcurrentjobmanager.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -24,16 +24,15 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { -template +template PrioritizingConcurrentJobManager::PrioritizingConcurrentJobManager( LRUThreadPool pool) : _threadPool(pool) { } -template +template void PrioritizingConcurrentJobManager::enqueueJob(std::shared_ptr> job, KeyType key) { @@ -44,29 +43,29 @@ void PrioritizingConcurrentJobManager::enqueueJob(std::shared_ptr +template std::vector PrioritizingConcurrentJobManager::getKeysToUnfinishedJobs() { return _threadPool.getUnqueuedTasksKeys(); } -template +template std::vector PrioritizingConcurrentJobManager::getKeysToEnqueuedJobs() { return _threadPool.getQueuedTasksKeys(); } -template +template bool PrioritizingConcurrentJobManager::touch(KeyType key) { return _threadPool.touch(key); } -template +template void PrioritizingConcurrentJobManager::clearEnqueuedJobs() { _threadPool.clearEnqueuedTasks(); } -template +template std::shared_ptr> PrioritizingConcurrentJobManager::popFinishedJob() { ghoul_assert(_finishedJobs.size() > 0, "There is no finished job to pop!"); std::lock_guard lock(_finishedJobsMutex); @@ -74,10 +73,9 @@ std::shared_ptr> PrioritizingConcurrentJobManager::popFinishe return result; } -template +template size_t PrioritizingConcurrentJobManager::numFinishedJobs() const { return _finishedJobs.size(); } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/other/statscollector.h b/modules/globebrowsing/other/statscollector.h index 1d78e81eb9..1758fee8f3 100644 --- a/modules/globebrowsing/other/statscollector.h +++ b/modules/globebrowsing/other/statscollector.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { template class TemplatedStatsCollector { @@ -116,8 +115,7 @@ private: bool _hasWrittenHeader; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #include "statscollector.inl" diff --git a/modules/globebrowsing/other/statscollector.inl b/modules/globebrowsing/other/statscollector.inl index 3ee7b93f8c..0a74fae403 100644 --- a/modules/globebrowsing/other/statscollector.inl +++ b/modules/globebrowsing/other/statscollector.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -22,8 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { template TemplatedStatsCollector::TemplatedStatsCollector(bool& enabled, @@ -108,5 +107,4 @@ void TemplatedStatsCollector::writeNextRecord(std::ostream& os) { } } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/other/threadpool.h b/modules/globebrowsing/other/threadpool.h index 475714086f..1494557e04 100644 --- a/modules/globebrowsing/other/threadpool.h +++ b/modules/globebrowsing/other/threadpool.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -35,8 +35,8 @@ // Implementatin based on http://progsch.net/wordpress/?p=81 -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { +namespace { class ThreadPool; @@ -70,7 +70,6 @@ private: bool stop; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___THREAD_POOL___H__ diff --git a/modules/globebrowsing/rendering/chunkrenderer.h b/modules/globebrowsing/rendering/chunkrenderer.h index 9caf680685..6e0b12c311 100644 --- a/modules/globebrowsing/rendering/chunkrenderer.h +++ b/modules/globebrowsing/rendering/chunkrenderer.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,15 +27,11 @@ #include -namespace ghoul { namespace opengl { - class ProgramObject; -} } +namespace ghoul::opengl { class ProgramObject; } -namespace openspace { +namespace openspace { struct RenderData; } -struct RenderData; - -namespace globebrowsing { +namespace openspace::globebrowsing { class Chunk; class Grid; @@ -103,7 +99,6 @@ private: std::shared_ptr _localGpuLayerManager; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNK_RENDERER___H__ diff --git a/modules/globebrowsing/rendering/gpu/gpuchunktile.h b/modules/globebrowsing/rendering/gpu/gpuchunktile.h index 490c7a81bd..7a5ca1b062 100644 --- a/modules/globebrowsing/rendering/gpu/gpuchunktile.h +++ b/modules/globebrowsing/rendering/gpu/gpuchunktile.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,12 +31,9 @@ #include -namespace ghoul { namespace opengl { -class ProgramObject; -}} +namespace ghoul::opengl { class ProgramObject; } -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct ChunkTile; @@ -72,7 +69,6 @@ private: GPUTileUvTransform gpuTileUvTransform; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPUCHUNKTILE___H__ diff --git a/modules/globebrowsing/rendering/gpu/gpuchunktilepile.h b/modules/globebrowsing/rendering/gpu/gpuchunktilepile.h index e09b516370..30231526b6 100644 --- a/modules/globebrowsing/rendering/gpu/gpuchunktilepile.h +++ b/modules/globebrowsing/rendering/gpu/gpuchunktilepile.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -33,12 +33,9 @@ #include -namespace ghoul { namespace opengl { -class ProgramObject; -}} +namespace ghoul::opengl { class ProgramObject; } -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { /** * Manages a GPU representation of a ChunkTilePile @@ -71,7 +68,6 @@ private: std::vector _gpuChunkTiles; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPUCHUNKTILEPILE___H__ diff --git a/modules/globebrowsing/rendering/gpu/gpuheightlayer.h b/modules/globebrowsing/rendering/gpu/gpuheightlayer.h index 14e9ac7cfc..2c8ccf6922 100644 --- a/modules/globebrowsing/rendering/gpu/gpuheightlayer.h +++ b/modules/globebrowsing/rendering/gpu/gpuheightlayer.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,12 +31,9 @@ #include #include -namespace ghoul { namespace opengl { -class ProgramObject; -}} +namespace ghoul::opengl { class ProgramObject; } -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { class Layer; struct TileIndex; @@ -70,7 +67,6 @@ private: GPUTileDepthTransform _gpuDepthTransform; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPUHEIGHTLAYER___H__ diff --git a/modules/globebrowsing/rendering/gpu/gpulayer.h b/modules/globebrowsing/rendering/gpu/gpulayer.h index 746c581b25..e220dccf67 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayer.h +++ b/modules/globebrowsing/rendering/gpu/gpulayer.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,12 +31,9 @@ #include #include -namespace ghoul { namespace opengl { -class ProgramObject; -}} +namespace ghoul::opengl { class ProgramObject; } -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { class Layer; struct TileIndex; @@ -80,7 +77,6 @@ private: GPUData gpuColor; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYER___H__ diff --git a/modules/globebrowsing/rendering/gpu/gpulayeradjustment.h b/modules/globebrowsing/rendering/gpu/gpulayeradjustment.h index 3a53b8808f..eed958dcb0 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayeradjustment.h +++ b/modules/globebrowsing/rendering/gpu/gpulayeradjustment.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,12 +27,9 @@ #include -namespace ghoul { namespace opengl { -class ProgramObject; -}} +namespace ghoul::opengl { class ProgramObject; } -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct LayerAdjustment; @@ -50,7 +47,6 @@ private: GPUData gpuChromaKeyTolerance; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYER_ADJUSMENT___H__ diff --git a/modules/globebrowsing/rendering/gpu/gpulayergroup.h b/modules/globebrowsing/rendering/gpu/gpulayergroup.h index 0ca34a1dad..c674e162da 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayergroup.h +++ b/modules/globebrowsing/rendering/gpu/gpulayergroup.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,12 +32,9 @@ #include -namespace ghoul { namespace opengl { -class ProgramObject; -}} +namespace ghoul::opengl { class ProgramObject; } -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct ChunkTile; class Layer; @@ -82,7 +79,6 @@ private: std::vector> _gpuActiveLayers; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYERGROUP___H__ diff --git a/modules/globebrowsing/rendering/gpu/gpulayermanager.h b/modules/globebrowsing/rendering/gpu/gpulayermanager.h index def785685d..61df5db142 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayermanager.h +++ b/modules/globebrowsing/rendering/gpu/gpulayermanager.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,12 +30,9 @@ #include -namespace ghoul { namespace opengl { -class ProgramObject; -}} +namespace ghoul::opengl { class ProgramObject; } -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { class LayerManager; @@ -72,7 +69,6 @@ private: std::vector> _gpuLayerGroups; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYERMANAGER___H__ diff --git a/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.h b/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.h index 5720616e4e..ff1ffb8589 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.h +++ b/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,9 @@ #include -namespace ghoul { namespace opengl { -class ProgramObject; -}} +namespace ghoul::opengl { class ProgramObject; } -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct LayerRenderSettings; @@ -68,7 +65,6 @@ private: GPUData gpuValueBlending; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPULAYERRENDERSETTINGS___H__ diff --git a/modules/globebrowsing/rendering/gpu/gputiledepthtransform.h b/modules/globebrowsing/rendering/gpu/gputiledepthtransform.h index 4e16940280..48f2efd8c3 100644 --- a/modules/globebrowsing/rendering/gpu/gputiledepthtransform.h +++ b/modules/globebrowsing/rendering/gpu/gputiledepthtransform.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,9 @@ #include -namespace ghoul { namespace opengl { -class ProgramObject; -}} +namespace ghoul::opengl { class ProgramObject; } -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct TileDepthTransform; @@ -64,7 +61,6 @@ private: GPUData _gpuDepthScale; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPUTILEDEPTHTRANSFORM___H__ diff --git a/modules/globebrowsing/rendering/gpu/gputileuvtransform.h b/modules/globebrowsing/rendering/gpu/gputileuvtransform.h index 066eebfc47..2b77d8510b 100644 --- a/modules/globebrowsing/rendering/gpu/gputileuvtransform.h +++ b/modules/globebrowsing/rendering/gpu/gputileuvtransform.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,12 +29,9 @@ #include -namespace ghoul { namespace opengl { -class ProgramObject; -}} +namespace ghoul::opengl { class ProgramObject; } -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct TileUvTransform; @@ -64,7 +61,6 @@ private: GPUData _gpuUvScale; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___GPUTILEUVTRANSFORM___H__ diff --git a/modules/globebrowsing/rendering/layer/layer.h b/modules/globebrowsing/rendering/layer/layer.h index c8380e5b4f..3b9f515da8 100644 --- a/modules/globebrowsing/rendering/layer/layer.h +++ b/modules/globebrowsing/rendering/layer/layer.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -37,12 +37,9 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { -namespace tileprovider { - class TileProvider; -} +namespace tileprovider { class TileProvider; } class Layer : public properties::PropertyOwner { public: @@ -94,7 +91,6 @@ private: std::function _onChangeCallback; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___LAYER___H__ diff --git a/modules/globebrowsing/rendering/layer/layeradjustment.h b/modules/globebrowsing/rendering/layer/layeradjustment.h index 20b9f11a78..7e3583ddd8 100644 --- a/modules/globebrowsing/rendering/layer/layeradjustment.h +++ b/modules/globebrowsing/rendering/layer/layeradjustment.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -33,15 +33,11 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { -namespace tileprovider { - class TileProvider; -} +namespace tileprovider { class TileProvider; } -class LayerAdjustment : public properties::PropertyOwner -{ +class LayerAdjustment : public properties::PropertyOwner { public: LayerAdjustment(); ~LayerAdjustment() = default; @@ -66,7 +62,6 @@ private: std::function _onChangeCallback; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___LAYER_ADJUSTMENT___H__ diff --git a/modules/globebrowsing/rendering/layer/layergroup.h b/modules/globebrowsing/rendering/layer/layergroup.h index 8cf6d22d9b..8159ef4c03 100644 --- a/modules/globebrowsing/rendering/layer/layergroup.h +++ b/modules/globebrowsing/rendering/layer/layergroup.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -35,13 +35,9 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { - -namespace tileprovider { - class TileProvider; -} +namespace tileprovider { class TileProvider; } /** * Convenience class for dealing with multiple Layers. @@ -78,7 +74,6 @@ private: std::function _onChangeCallback; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___LAYERGROUP___H__ diff --git a/modules/globebrowsing/rendering/layer/layergroupid.h b/modules/globebrowsing/rendering/layer/layergroupid.h index 8445c4b962..b630f60256 100644 --- a/modules/globebrowsing/rendering/layer/layergroupid.h +++ b/modules/globebrowsing/rendering/layer/layergroupid.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,9 +27,7 @@ #include -namespace openspace { -namespace globebrowsing { -namespace layergroupid { +namespace openspace::globebrowsing::layergroupid { static const int NUM_LAYER_GROUPS = 5; static const std::string LAYER_GROUP_NAMES[NUM_LAYER_GROUPS] = { @@ -152,8 +150,6 @@ static layergroupid::BlendModeID getBlendModeIDFromName( return BlendModeID::Normal; } -} // namespace layergroupid -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::layergroupid #endif // __OPENSPACE_MODULE_GLOBEBROWSING___LAYERGROUPID___H__ diff --git a/modules/globebrowsing/rendering/layer/layermanager.h b/modules/globebrowsing/rendering/layer/layermanager.h index 454a02d9f8..3afba32a72 100644 --- a/modules/globebrowsing/rendering/layer/layermanager.h +++ b/modules/globebrowsing/rendering/layer/layermanager.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -34,8 +34,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct LayerGroup; @@ -69,7 +68,6 @@ private: std::vector> _layerGroups; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___LAYERMANAGER___H__ diff --git a/modules/globebrowsing/rendering/layer/layerrendersettings.h b/modules/globebrowsing/rendering/layer/layerrendersettings.h index 95538ee28d..56ec67f811 100644 --- a/modules/globebrowsing/rendering/layer/layerrendersettings.h +++ b/modules/globebrowsing/rendering/layer/layerrendersettings.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,8 +30,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct LayerRenderSettings : public properties::PropertyOwner { LayerRenderSettings(); @@ -60,7 +59,6 @@ private: void setDefaultValues(); }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___LAYERRENDERSETTINGS___H__ diff --git a/modules/globebrowsing/rendering/layershadermanager.h b/modules/globebrowsing/rendering/layershadermanager.h index 026e98ecd0..022d3eac5f 100644 --- a/modules/globebrowsing/rendering/layershadermanager.h +++ b/modules/globebrowsing/rendering/layershadermanager.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,14 +31,9 @@ #include #include -namespace ghoul { -namespace opengl { -class ProgramObject; -} -} +namespace ghoul::opengl { class ProgramObject; } -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { class RenderableGlobe; @@ -105,7 +100,7 @@ private: bool _updatedOnLastCall; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___LAYER_SHADER_MANAGER___H__ diff --git a/modules/globebrowsing/tile/asynctiledataprovider.cpp b/modules/globebrowsing/tile/asynctiledataprovider.cpp index 46723e5fbc..4d4f4f4ef9 100644 --- a/modules/globebrowsing/tile/asynctiledataprovider.cpp +++ b/modules/globebrowsing/tile/asynctiledataprovider.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -37,8 +37,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { namespace { const char* _loggerCat = "AsyncTileDataProvider"; @@ -266,5 +265,4 @@ float AsyncTileDataProvider::noDataValueAsFloat() const { return _rawTileDataReader->noDataValueAsFloat(); } -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/tile/asynctiledataprovider.h b/modules/globebrowsing/tile/asynctiledataprovider.h index d318eb3851..01d2fdba4d 100644 --- a/modules/globebrowsing/tile/asynctiledataprovider.h +++ b/modules/globebrowsing/tile/asynctiledataprovider.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -25,7 +25,6 @@ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___ASYNC_TILE_DATAPROVIDER___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___ASYNC_TILE_DATAPROVIDER___H__ - #include #include @@ -39,8 +38,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { //class GlobeBrowsingModule; struct RawTile; @@ -128,7 +126,6 @@ private: bool _shouldBeDeleted; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___ASYNC_TILE_DATAPROVIDER___H__ diff --git a/modules/globebrowsing/tile/chunktile.h b/modules/globebrowsing/tile/chunktile.h index 3fa3bcde07..b31902f8b6 100644 --- a/modules/globebrowsing/tile/chunktile.h +++ b/modules/globebrowsing/tile/chunktile.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,8 +30,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct ChunkTile { ChunkTile() : tile(Tile::TileUnavailable) {}; @@ -47,7 +46,6 @@ struct ChunkTile { using ChunkTilePile = std::vector; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___CHUNKTILE___H__ diff --git a/modules/globebrowsing/tile/pixelregion.h b/modules/globebrowsing/tile/pixelregion.h index e85f2a84b1..6f755cae18 100644 --- a/modules/globebrowsing/tile/pixelregion.h +++ b/modules/globebrowsing/tile/pixelregion.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,8 +27,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct PixelRegion { using PixelCoordinate = glm::ivec2; @@ -100,7 +99,6 @@ struct PixelRegion { PixelRange numPixels; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___PIXELREGION___H__ diff --git a/modules/globebrowsing/tile/rawtile.h b/modules/globebrowsing/tile/rawtile.h index 5b609b16f4..1f73157e8b 100644 --- a/modules/globebrowsing/tile/rawtile.h +++ b/modules/globebrowsing/tile/rawtile.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -33,14 +33,12 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct TileMetaData; class TileTextureInitData; struct RawTile { - enum class ReadError { None = 0, Debug = 1, @@ -61,8 +59,6 @@ struct RawTile { static RawTile createDefault(const TileTextureInitData& initData); }; -} // namespace globebrowsing -} // namespace openspace - +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___RAWTILE___H__ diff --git a/modules/globebrowsing/tile/rawtiledatareader/gdalrawtiledatareader.h b/modules/globebrowsing/tile/rawtiledatareader/gdalrawtiledatareader.h index 8280b61ec3..dd469af7ea 100644 --- a/modules/globebrowsing/tile/rawtiledatareader/gdalrawtiledatareader.h +++ b/modules/globebrowsing/tile/rawtiledatareader/gdalrawtiledatareader.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -47,8 +47,7 @@ class GDALDataset; class GDALRasterBand; -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { class GeodeticPatch; @@ -133,8 +132,7 @@ private: mutable std::mutex _datasetLock; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // GLOBEBROWSING_USE_GDAL diff --git a/modules/globebrowsing/tile/rawtiledatareader/gdalwrapper.h b/modules/globebrowsing/tile/rawtiledatareader/gdalwrapper.h index 643aaf55ff..054c46cd95 100644 --- a/modules/globebrowsing/tile/rawtiledatareader/gdalwrapper.h +++ b/modules/globebrowsing/tile/rawtiledatareader/gdalwrapper.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -36,8 +36,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { /** * Function for passing GDAL error messages to the GHOUL logging system. @@ -88,8 +87,7 @@ private: static std::mutex _mutexLock; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // GLOBEBROWSING_USE_GDAL diff --git a/modules/globebrowsing/tile/rawtiledatareader/iodescription.h b/modules/globebrowsing/tile/rawtiledatareader/iodescription.h index a469492c30..a88cec8697 100644 --- a/modules/globebrowsing/tile/rawtiledatareader/iodescription.h +++ b/modules/globebrowsing/tile/rawtiledatareader/iodescription.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -33,8 +33,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct IODescription { struct ReadData { @@ -52,7 +51,6 @@ struct IODescription { IODescription cut(PixelRegion::Side side, int pos); }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___IO_DESCRIPTION___H__ diff --git a/modules/globebrowsing/tile/rawtiledatareader/rawtiledatareader.h b/modules/globebrowsing/tile/rawtiledatareader/rawtiledatareader.h index 4d0b5197e9..7bf77e0e4e 100644 --- a/modules/globebrowsing/tile/rawtiledatareader/rawtiledatareader.h +++ b/modules/globebrowsing/tile/rawtiledatareader/rawtiledatareader.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -40,8 +40,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { class GeodeticPatch; @@ -172,7 +171,6 @@ private: bool _hasBeenInitialized; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___RAW_TILE_DATA_READER___H__ diff --git a/modules/globebrowsing/tile/rawtiledatareader/simplerawtiledatareader.h b/modules/globebrowsing/tile/rawtiledatareader/simplerawtiledatareader.h index 0716dca804..e86009d4ce 100644 --- a/modules/globebrowsing/tile/rawtiledatareader/simplerawtiledatareader.h +++ b/modules/globebrowsing/tile/rawtiledatareader/simplerawtiledatareader.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -39,8 +39,7 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { class GeodeticPatch; @@ -78,7 +77,6 @@ private: std::unique_ptr _dataTexture; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___SIMPLE_RAW_TILE_DATA_READER___H__ diff --git a/modules/globebrowsing/tile/rawtiledatareader/tiledatatype.h b/modules/globebrowsing/tile/rawtiledatareader/tiledatatype.h index a0961bd6d0..cde7a7e554 100644 --- a/modules/globebrowsing/tile/rawtiledatareader/tiledatatype.h +++ b/modules/globebrowsing/tile/rawtiledatareader/tiledatatype.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -34,9 +34,7 @@ #include #endif // GLOBEBROWSING_USE_GDAL -namespace openspace { -namespace globebrowsing { -namespace tiledatatype { +namespace openspace::globebrowsing::tiledatatype { #ifdef GLOBEBROWSING_USE_GDAL GLenum getOpenGLDataType(GDALDataType gdalType); @@ -54,8 +52,6 @@ size_t numberOfBytes(GLenum glType); size_t getMaximumValue(GLenum glType); float interpretFloat(GLenum glType, const char* src); -} // namespace tiledatatype -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::tiledatatype #endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_DATA_TYPE___H__ diff --git a/modules/globebrowsing/tile/textureformat.h b/modules/globebrowsing/tile/textureformat.h index 607a804faf..8b94156fea 100644 --- a/modules/globebrowsing/tile/textureformat.h +++ b/modules/globebrowsing/tile/textureformat.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -28,16 +28,13 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct TextureFormat { ghoul::opengl::Texture::Format ghoulFormat; GLenum glFormat; }; - -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___TEXTUREFORMAT___H__ diff --git a/modules/globebrowsing/tile/tile.h b/modules/globebrowsing/tile/tile.h index 97056193af..a307e1ba06 100644 --- a/modules/globebrowsing/tile/tile.h +++ b/modules/globebrowsing/tile/tile.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,12 +30,9 @@ #include -namespace ghoul { namespace opengl { - class Texture; -}} +namespace ghoul::opengl { class Texture; } -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct TileMetaData; struct TileUvTransform; @@ -104,8 +101,7 @@ private: Status _status; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE___H__ diff --git a/modules/globebrowsing/tile/tiledepthtransform.h b/modules/globebrowsing/tile/tiledepthtransform.h index 9212863b72..e50c8f3ac4 100644 --- a/modules/globebrowsing/tile/tiledepthtransform.h +++ b/modules/globebrowsing/tile/tiledepthtransform.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -25,15 +25,13 @@ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TILEDEPTHTRANSFORM___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___TILEDEPTHTRANSFORM___H__ -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct TileDepthTransform { float depthScale; float depthOffset; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILEDEPTHTRANSFORM___H__ diff --git a/modules/globebrowsing/tile/tileindex.h b/modules/globebrowsing/tile/tileindex.h index 41d0fb0b77..ff5826755e 100644 --- a/modules/globebrowsing/tile/tileindex.h +++ b/modules/globebrowsing/tile/tileindex.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,12 +30,9 @@ #include #include -namespace ghoul { - class Dictionary; -} +namespace ghoul { class Dictionary; } -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct Geodetic2; @@ -117,7 +114,6 @@ struct TileIndex { std::ostream& operator<<(std::ostream& os, const TileIndex& ti); -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_INDEX___H__ diff --git a/modules/globebrowsing/tile/tileloadjob.h b/modules/globebrowsing/tile/tileloadjob.h index 06daeb0f5d..a05cc0f483 100644 --- a/modules/globebrowsing/tile/tileloadjob.h +++ b/modules/globebrowsing/tile/tileloadjob.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -28,8 +28,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { class RawTileDataReader; struct RawTile; @@ -65,11 +64,11 @@ struct TileLoadJob : public Job { */ void execute() override; - /** - * Marks the job as finised and releases ownership of the data. - * Unless the job is marked as finished, the pixel data will be deallocated - * when the job is deleted. - */ + /** + * Marks the job as finised and releases ownership of the data. + * Unless the job is marked as finished, the pixel data will be deallocated + * when the job is deleted. + */ std::shared_ptr product() override; /** @@ -85,10 +84,9 @@ protected: std::shared_ptr _rawTile; TileIndex _chunkIndex; char* _pboMappedDataDestination; - bool _hasOwnershipOfData; + bool _hasOwnershipOfData; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILELOADJOB___H__ diff --git a/modules/globebrowsing/tile/tilemetadata.h b/modules/globebrowsing/tile/tilemetadata.h index 64c82db2e3..105f45682b 100644 --- a/modules/globebrowsing/tile/tilemetadata.h +++ b/modules/globebrowsing/tile/tilemetadata.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -28,8 +28,7 @@ #include #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct TileMetaData { std::vector maxValues; @@ -40,8 +39,6 @@ struct TileMetaData { static TileMetaData deserialize(std::istream& s); }; -} // namespace globebrowsing -} // namespace openspace - +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILEMETADATA___H__ diff --git a/modules/globebrowsing/tile/tileprovider/defaulttileprovider.h b/modules/globebrowsing/tile/tileprovider/defaulttileprovider.h index bf2928dd37..98daf4f235 100644 --- a/modules/globebrowsing/tile/tileprovider/defaulttileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/defaulttileprovider.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,16 +31,14 @@ #include #include -namespace openspace { +namespace openspace { class PixelBuffer; } -class PixelBuffer; - -namespace globebrowsing { - -class AsyncTileDataProvider; -struct RawTile; +namespace openspace::globebrowsing { + class AsyncTileDataProvider; + struct RawTile; +} // namespace openspace::globebrowsing -namespace tileprovider { +namespace openspace::globebrowsing::tileprovider { /** * Provides tiles loaded by AsyncTileDataProvider and @@ -90,8 +88,6 @@ private: bool _performPreProcessing; }; -} // namespace tileprovider -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::tileprovider #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 d15aaa77f7..1168717cde 100644 --- a/modules/globebrowsing/tile/tileprovider/singleimageprovider.h +++ b/modules/globebrowsing/tile/tileprovider/singleimageprovider.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,9 +29,7 @@ #include -namespace openspace { -namespace globebrowsing { -namespace tileprovider { +namespace openspace::globebrowsing::tileprovider { class SingleImageProvider : public TileProvider { public: @@ -53,8 +51,6 @@ private: properties::StringProperty _filePath; }; -} // namespace tileprovider -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::tileprovider #endif // __OPENSPACE_MODULE_GLOBEBROWSING___SINGLE_IMAGE_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.h b/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.h index dc325feea7..4d6d686012 100644 --- a/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/sizereferencetileprovider.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,9 +29,7 @@ #include -namespace openspace { -namespace globebrowsing { -namespace tileprovider { +namespace openspace::globebrowsing::tileprovider { /** * Constructed with an ellipsoid and uses that to render the longitudal length of each @@ -53,8 +51,6 @@ private: Tile _backgroundTile; }; -} // namespace tileprovider -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::tileprovider #endif // __OPENSPACE_MODULE_GLOBEBROWSING___SIZEREFERENCE_TILE_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h index f46221dc45..a6e04e2478 100644 --- a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -44,9 +44,7 @@ struct CPLXMLNode; -namespace openspace { -namespace globebrowsing { -namespace tileprovider { +namespace openspace::globebrowsing::tileprovider { /** * Interface for stringifying OpenSpace Time instances. @@ -334,9 +332,7 @@ private: bool _successfulInitialization; }; -} // namespace tileprovider -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::tileprovider #endif // GLOBEBROWSING_USE_GDAL diff --git a/modules/globebrowsing/tile/tileprovider/texttileprovider.h b/modules/globebrowsing/tile/tileprovider/texttileprovider.h index 701f7587c4..577c49c6f5 100644 --- a/modules/globebrowsing/tile/tileprovider/texttileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/texttileprovider.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,14 +32,12 @@ #include -namespace ghoul { namespace fontrendering { -class Font; -class FontRenderer; -}} +namespace ghoul::fontrendering { + class Font; + class FontRenderer; +} // namespace ghoul::fontrendering -namespace openspace { -namespace globebrowsing { -namespace tileprovider { +namespace openspace::globebrowsing::tileprovider { /** * Enables a simple way of providing tiles with any type of rendered text. @@ -91,14 +89,12 @@ private: Tile createChunkIndexTile(const TileIndex& tileIndex); std::unique_ptr _fontRenderer; - + GLuint _fbo; cache::MemoryAwareTileCache* _tileCache; }; -} // namespace tileprovider -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::tileprovider #endif // __OPENSPACE_MODULE_GLOBEBROWSING___TEXT_TILE_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/tileprovider/tileindextileprovider.h b/modules/globebrowsing/tile/tileprovider/tileindextileprovider.h index ef1f8337eb..5bba94f073 100644 --- a/modules/globebrowsing/tile/tileprovider/tileindextileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/tileindextileprovider.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,9 +27,7 @@ #include -namespace openspace { -namespace globebrowsing { -namespace tileprovider { +namespace openspace::globebrowsing::tileprovider { /** * Provides Tiles with the chunk index rendered as text onto its tiles. @@ -42,8 +40,6 @@ public: const TileIndex& tileIndex) const; }; -} // namespace tileprovider -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::tileprovider #endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILEINDEX_TILE_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/tileprovider/tileprovider.h b/modules/globebrowsing/tile/tileprovider/tileprovider.h index 64ca44a00c..8f30a8cd94 100644 --- a/modules/globebrowsing/tile/tileprovider/tileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/tileprovider.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -36,9 +36,7 @@ #include -namespace openspace { -namespace globebrowsing { -namespace tileprovider { +namespace openspace::globebrowsing::tileprovider { /** * Interface for providing Tiles given a @@ -164,8 +162,6 @@ private: Tile _defaultTile; }; -} // namespace tileprovider -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::tileprovider #endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_PROVIDER___H__ diff --git a/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h b/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h index 2d543d81f0..d721b97432 100644 --- a/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h +++ b/modules/globebrowsing/tile/tileprovider/tileproviderbyindex.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,9 +27,7 @@ #include -namespace openspace { -namespace globebrowsing { -namespace tileprovider { +namespace openspace::globebrowsing::tileprovider { class TileProviderByIndex : public TileProvider { public: @@ -51,8 +49,6 @@ private: std::shared_ptr _defaultTileProvider; }; -} // namespace tileprovider -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::tileprovider #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 022fda011c..4f560c5ec6 100644 --- a/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h +++ b/modules/globebrowsing/tile/tileprovider/tileproviderbylevel.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,9 +29,7 @@ #include -namespace openspace { -namespace globebrowsing { -namespace tileprovider { +namespace openspace::globebrowsing::tileprovider { class TileProviderByLevel : public TileProvider { public: @@ -53,8 +51,6 @@ private: std::vector> _levelTileProviders; }; -} // namespace tileprovider -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::tileprovider #endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_PROVIDER_BY_LEVEL___H__ diff --git a/modules/globebrowsing/tile/tileselector.h b/modules/globebrowsing/tile/tileselector.h index a3cfc65c47..6379bbdf38 100644 --- a/modules/globebrowsing/tile/tileselector.h +++ b/modules/globebrowsing/tile/tileselector.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,14 +29,13 @@ #include -namespace openspace { -namespace globebrowsing { - -struct LayerGroup; -struct TileIndex; -struct LayerRenderSettings; +namespace openspace::globebrowsing { + struct LayerGroup; + struct TileIndex; + struct LayerRenderSettings; +} // namespace openspace::globebrowsing -namespace tileselector { +namespace openspace::globebrowsing::tileselector { ChunkTile getHighestResolutionTile(const LayerGroup& layerGroup, const TileIndex& tileIndex); @@ -47,12 +46,10 @@ std::vector > const TileIndex& tileIndex); std::vector > getTilesAndSettingsUnsorted(const LayerGroup& layerGroup, - const TileIndex& tileIndex); + const TileIndex& tileIndex); void ascendToParent(TileIndex& tileIndex, TileUvTransform& uv); -} // namespace tileselector -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing::tileselector #endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_SELECTOR___H__ diff --git a/modules/globebrowsing/tile/tiletextureinitdata.h b/modules/globebrowsing/tile/tiletextureinitdata.h index 874e232933..e0acca4531 100644 --- a/modules/globebrowsing/tile/tiletextureinitdata.h +++ b/modules/globebrowsing/tile/tiletextureinitdata.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,14 +31,12 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { /** * All information needed to create a texture used for a Tile. */ -class TileTextureInitData -{ +class TileTextureInitData { public: using HashKey = unsigned long long; using ShouldAllocateDataOnCPU = ghoul::Boolean; @@ -85,7 +83,6 @@ private: bool _shouldAllocateDataOnCPU; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILE_TEXTURE_INIT_DATA___H__ diff --git a/modules/globebrowsing/tile/tileuvtransform.h b/modules/globebrowsing/tile/tileuvtransform.h index 533bcfa88a..aeaabcff87 100644 --- a/modules/globebrowsing/tile/tileuvtransform.h +++ b/modules/globebrowsing/tile/tileuvtransform.h @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,15 +27,13 @@ #include -namespace openspace { -namespace globebrowsing { +namespace openspace::globebrowsing { struct TileUvTransform { glm::vec2 uvOffset; glm::vec2 uvScale; }; -} // namespace globebrowsing -} // namespace openspace +} // namespace openspace::globebrowsing #endif // __OPENSPACE_MODULE_GLOBEBROWSING___TILEUVTRANSFORM___H__ diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 478565e837..929ddd1216 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -155,7 +155,6 @@ set(OPENSPACE_SOURCE ${OPENSPACE_BASE_DIR}/src/util/spicemanager.cpp ${OPENSPACE_BASE_DIR}/src/util/spicemanager_lua.inl ${OPENSPACE_BASE_DIR}/src/util/syncbuffer.cpp - ${OPENSPACE_BASE_DIR}/src/util/syncdata.cpp ${OPENSPACE_BASE_DIR}/src/util/histogram.cpp ${OPENSPACE_BASE_DIR}/src/util/task.cpp ${OPENSPACE_BASE_DIR}/src/util/taskloader.cpp diff --git a/src/documentation/documentationengine.cpp b/src/documentation/documentationengine.cpp index fb135b1bf9..f6220f10ef 100644 --- a/src/documentation/documentationengine.cpp +++ b/src/documentation/documentationengine.cpp @@ -45,8 +45,7 @@ namespace { const char* JsFilename = "${OPENSPACE_DATA}/web/documentation/script.js"; } // namespace -namespace openspace { -namespace documentation { +namespace openspace::documentation { DocumentationEngine* DocumentationEngine::_instance = nullptr; @@ -322,5 +321,4 @@ std::vector DocumentationEngine::documentations() const { return _documentations; } -} // namespace documentation -} // namespace openspace +} // namespace openspace::documentation diff --git a/src/documentation/verifier.cpp b/src/documentation/verifier.cpp index 75dcfbede7..8e4610eb4d 100644 --- a/src/documentation/verifier.cpp +++ b/src/documentation/verifier.cpp @@ -28,8 +28,7 @@ #include -namespace openspace { -namespace documentation { +namespace openspace::documentation { // The explicit template instantiations for many of the commonly used template values // This cuts down on the compilation time by only compiling these once @@ -348,5 +347,4 @@ std::string OrVerifier::documentation() const { } -} // namespace documentation -} // namespace openspace +} // namespace openspace::documentation diff --git a/src/engine/configurationmanager.cpp b/src/engine/configurationmanager.cpp index ab167f6b56..4c153fdd3e 100644 --- a/src/engine/configurationmanager.cpp +++ b/src/engine/configurationmanager.cpp @@ -40,7 +40,7 @@ namespace { const char* _configurationFile = "openspace.cfg"; const char* _keyBasePath = "BASE_PATH"; const char* _initialConfigHelper = "${BASE_PATH}/scripts/configuration_helper.lua"; -} +} // namespace namespace openspace { diff --git a/src/engine/downloadmanager.cpp b/src/engine/downloadmanager.cpp index 1d755a084a..c4f571a0cb 100644 --- a/src/engine/downloadmanager.cpp +++ b/src/engine/downloadmanager.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -120,7 +120,7 @@ namespace { return 0; } -} +} // namespace namespace openspace { diff --git a/src/engine/logfactory.cpp b/src/engine/logfactory.cpp index 6097277953..187ef76ec8 100644 --- a/src/engine/logfactory.cpp +++ b/src/engine/logfactory.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -50,7 +50,7 @@ namespace { const char* BootstrapPath = "${OPENSPACE_DATA}/web/common/bootstrap.min.css"; const char* CssPath = "${OPENSPACE_DATA}/web/log/style.css"; const char* JsPath = "${OPENSPACE_DATA}/web/log/script.js"; -} +} // namespace namespace openspace { diff --git a/src/engine/moduleengine.cpp b/src/engine/moduleengine.cpp index 0fb80fda46..ad566ae9cd 100644 --- a/src/engine/moduleengine.cpp +++ b/src/engine/moduleengine.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -36,7 +36,7 @@ namespace { const char* _loggerCat = "ModuleEngine"; -} +} // namespace namespace openspace { diff --git a/src/engine/moduleengine_lua.inl b/src/engine/moduleengine_lua.inl index bd33e3875c..bea545657a 100644 --- a/src/engine/moduleengine_lua.inl +++ b/src/engine/moduleengine_lua.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -25,8 +25,7 @@ #include #include -namespace openspace { -namespace luascriptfunctions { +namespace openspace::luascriptfunctions { /** * \ingroup LuaScripts @@ -61,5 +60,4 @@ int isLoaded(lua_State* L) { return 1; } -} // namespace luascriptfunctions -} // namespace openspace +} // namespace openspace::luascriptfunctions diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 35a8f0ba56..83b7aea1de 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -112,13 +112,11 @@ namespace { std::string sceneName; std::string cacheFolder; } commandlineArgumentPlaceholders; -} +} // namespace namespace openspace { -namespace properties { - class Property; -} +namespace properties { class Property; } class Scene; diff --git a/src/interaction/controller.cpp b/src/interaction/controller.cpp index a7bc2549ea..1c15da9b09 100644 --- a/src/interaction/controller.cpp +++ b/src/interaction/controller.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -26,14 +26,11 @@ #include -namespace openspace { -namespace interaction { +namespace openspace::interaction { -void Controller::setHandler(NavigationHandler* handler) -{ +void Controller::setHandler(NavigationHandler* handler) { _handler = handler; } -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction diff --git a/src/interaction/inputstate.cpp b/src/interaction/inputstate.cpp index 93c29b204c..5b3fcefccb 100644 --- a/src/interaction/inputstate.cpp +++ b/src/interaction/inputstate.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -28,8 +28,7 @@ #include -namespace openspace { -namespace interaction { +namespace openspace::interaction { void InputState::keyboardCallback(Key key, KeyModifier modifier, KeyAction action) { if (action == KeyAction::Press) { @@ -93,5 +92,4 @@ bool InputState::isMouseButtonPressed(MouseButton mouseButton) const { mouseButton) != _mouseButtonsDown.end(); } -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction diff --git a/src/interaction/keybindingmanager.cpp b/src/interaction/keybindingmanager.cpp index 9756791af6..70560a7744 100644 --- a/src/interaction/keybindingmanager.cpp +++ b/src/interaction/keybindingmanager.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -46,8 +46,7 @@ namespace { #include "keybindingmanager_lua.inl" -namespace openspace { -namespace interaction { +namespace openspace::interaction { KeyBindingManager::KeyBindingManager() : DocumentationGenerator( @@ -174,5 +173,4 @@ scripting::LuaLibrary KeyBindingManager::luaLibrary() { }; } -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction diff --git a/src/interaction/keybindingmanager_lua.inl b/src/interaction/keybindingmanager_lua.inl index ba6b75e423..18d46a07a7 100644 --- a/src/interaction/keybindingmanager_lua.inl +++ b/src/interaction/keybindingmanager_lua.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -22,16 +22,15 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -namespace openspace { +namespace openspace::luascriptfunctions { -namespace luascriptfunctions { /** -* \ingroup LuaScripts -* bindKey(): -* Binds a key to Lua command to both execute locally -* and broadcast to all clients if this node is hosting -* a parallel connection. -*/ + * \ingroup LuaScripts + * bindKey(): + * Binds a key to Lua command to both execute locally + * and broadcast to all clients if this node is hosting + * a parallel connection. + */ int bindKey(lua_State* L) { using ghoul::lua::luaTypeToString; @@ -136,6 +135,4 @@ int clearKeys(lua_State* L) { return 0; } -} // namespace luascriptfunctions - -} // namespace openspace +} // namespace openspace::luascriptfunctions diff --git a/src/interaction/keyframenavigator.cpp b/src/interaction/keyframenavigator.cpp index 1ce1773e2f..ae538d2051 100644 --- a/src/interaction/keyframenavigator.cpp +++ b/src/interaction/keyframenavigator.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -34,8 +34,7 @@ #include -namespace openspace { -namespace interaction { +namespace openspace::interaction { void KeyframeNavigator::updateCamera(Camera& camera) { double now = OsEng.runTime(); @@ -123,5 +122,4 @@ size_t KeyframeNavigator::nKeyframes() const { return _cameraPoseTimeline.nKeyframes(); } -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction diff --git a/src/interaction/luaconsole.cpp b/src/interaction/luaconsole.cpp index d8d1546a40..2e2067da18 100644 --- a/src/interaction/luaconsole.cpp +++ b/src/interaction/luaconsole.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -69,7 +69,6 @@ namespace { // The number of characters to display after the cursor // when horizontal scrolling is required. const int NVisibleCharsAfterCursor = 5; - } // namespace namespace openspace { diff --git a/src/interaction/mousestate.cpp b/src/interaction/mousestate.cpp index f6e61e9371..d3afa7d3d9 100644 --- a/src/interaction/mousestate.cpp +++ b/src/interaction/mousestate.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -24,8 +24,7 @@ #include -namespace openspace { -namespace interaction { +namespace openspace::interaction { MouseState::MouseState(double scaleFactor) : velocity(scaleFactor, 1) @@ -173,5 +172,4 @@ glm::dvec2 MouseStates::globalRollMouseVelocity() const{ return _globalRollMouseState.velocity.get(); } -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction diff --git a/src/interaction/navigationhandler.cpp b/src/interaction/navigationhandler.cpp index 43218accc1..ca484e23c6 100644 --- a/src/interaction/navigationhandler.cpp +++ b/src/interaction/navigationhandler.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -50,8 +50,7 @@ namespace { #include "navigationhandler_lua.inl" -namespace openspace { -namespace interaction { +namespace openspace::interaction { NavigationHandler::NavigationHandler() : properties::PropertyOwner("NavigationHandler") @@ -295,5 +294,4 @@ scripting::LuaLibrary NavigationHandler::luaLibrary() { }; } -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction diff --git a/src/interaction/navigationhandler_lua.inl b/src/interaction/navigationhandler_lua.inl index 64d9bf1a21..14711dd6c7 100644 --- a/src/interaction/navigationhandler_lua.inl +++ b/src/interaction/navigationhandler_lua.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -22,9 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -namespace openspace { +namespace openspace::luascriptfunctions { -namespace luascriptfunctions { /** * \ingroup LuaScripts * setOrigin(): @@ -107,7 +106,4 @@ int resetCameraDirection(lua_State* L) { return 0; } - -} // namespace luascriptfunctions - -} // namespace openspace +} // namespace openspace::luascriptfunctions diff --git a/src/interaction/orbitalnavigator.cpp b/src/interaction/orbitalnavigator.cpp index 4bbebd12c6..772c3097ce 100644 --- a/src/interaction/orbitalnavigator.cpp +++ b/src/interaction/orbitalnavigator.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -35,10 +35,9 @@ namespace { const char* _loggerCat = "OrbitalNavigator"; -} +} // namespace -namespace openspace { -namespace interaction { +namespace openspace::interaction { OrbitalNavigator::OrbitalNavigator() : properties::PropertyOwner("OrbitalNavigator") @@ -528,5 +527,4 @@ SurfacePositionHandle OrbitalNavigator::calculateSurfacePositionHandle( return posHandle; } -} // namespace interaction -} // namespace openspace +} // namespace openspace::interaction diff --git a/src/mission/missionmanager_lua.inl b/src/mission/missionmanager_lua.inl index ad8e65c7c1..8fcc5b79ec 100644 --- a/src/mission/missionmanager_lua.inl +++ b/src/mission/missionmanager_lua.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -22,11 +22,9 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -namespace openspace { +namespace openspace::luascriptfunctions { -namespace luascriptfunctions { - - int loadMission(lua_State* L) { +int loadMission(lua_State* L) { using ghoul::lua::luaTypeToString; int nArguments = lua_gettop(L); if (nArguments != 1) @@ -54,5 +52,4 @@ int setCurrentMission(lua_State* L) { return 0; } -} // namespace luascriptfunction -} // namespace openspace +} // namespace openspace::luascriptfunction diff --git a/src/network/parallelconnection_lua.inl b/src/network/parallelconnection_lua.inl index 09547ea7c7..b05ab8ab27 100644 --- a/src/network/parallelconnection_lua.inl +++ b/src/network/parallelconnection_lua.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -22,9 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -namespace openspace { - -namespace luascriptfunctions { +namespace openspace::luascriptfunctions { int connect(lua_State* L) { int nArguments = lua_gettop(L); @@ -66,6 +64,4 @@ int resignHostship(lua_State* L) { return 0; } -} // namespace luascriptfunctions - -} // namespace openspace +} // namespace openspace::luascriptfunctions diff --git a/src/performance/performancelayout.cpp b/src/performance/performancelayout.cpp index f432f543f0..726a7b45fa 100644 --- a/src/performance/performancelayout.cpp +++ b/src/performance/performancelayout.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -26,8 +26,7 @@ #include -namespace openspace { -namespace performance { +namespace openspace::performance { PerformanceLayout::PerformanceLayout() : nScaleGraphEntries(0) @@ -46,5 +45,4 @@ PerformanceLayout::PerformanceLayout() ); } -} // namespace performance -} // namespace openspace +} // namespace openspace::performance diff --git a/src/performance/performancemanager.cpp b/src/performance/performancemanager.cpp index beaa9cba0d..14e9734006 100644 --- a/src/performance/performancemanager.cpp +++ b/src/performance/performancemanager.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -54,10 +54,9 @@ namespace { }; const char* LocalSharedMemoryNameBase = "PerformanceMeasurement_"; -} +} // namespace -namespace openspace { -namespace performance { +namespace openspace::performance { // The Performance Manager will use a level of indirection in order to support multiple // PerformanceManagers running in parallel: @@ -435,5 +434,4 @@ void PerformanceManager::storeScenePerformanceMeasurements( tick(); } -} // namespace performance -} // namespace openspace +} // namespace openspace::performance diff --git a/src/performance/performancemeasurement.cpp b/src/performance/performancemeasurement.cpp index ae6465cd4f..564a6db105 100644 --- a/src/performance/performancemeasurement.cpp +++ b/src/performance/performancemeasurement.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,8 +30,7 @@ #include -namespace openspace { -namespace performance { +namespace openspace::performance { PerformanceMeasurement::PerformanceMeasurement(std::string identifier, performance::PerformanceManager* manager) @@ -56,6 +55,4 @@ PerformanceMeasurement::~PerformanceMeasurement() { } } - -} // namespace performance -} // namespace openspace +} // namespace openspace::performance diff --git a/src/properties/matrix/dmat2property.cpp b/src/properties/matrix/dmat2property.cpp index 0696ab916d..b14076335f 100644 --- a/src/properties/matrix/dmat2property.cpp +++ b/src/properties/matrix/dmat2property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -136,5 +135,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat2Property, glm::dmat2x2, glm::dmat2x2(0), DEFAULT_TO_STRING_LAMBDA(glm::dmat2x2), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/matrix/dmat2x3property.cpp b/src/properties/matrix/dmat2x3property.cpp index 4451261c25..d0d26df3f9 100644 --- a/src/properties/matrix/dmat2x3property.cpp +++ b/src/properties/matrix/dmat2x3property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -140,5 +139,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat2x3Property, glm::dmat2x3, glm::dmat2x3(0) DEFAULT_TO_STRING_LAMBDA(glm::dmat2x3), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/matrix/dmat2x4property.cpp b/src/properties/matrix/dmat2x4property.cpp index b0b4eff710..aa20f8d40e 100644 --- a/src/properties/matrix/dmat2x4property.cpp +++ b/src/properties/matrix/dmat2x4property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -144,5 +143,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat2x4Property, glm::dmat2x4, glm::dmat2x4(0) DEFAULT_TO_STRING_LAMBDA(glm::dmat2x4), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/matrix/dmat3property.cpp b/src/properties/matrix/dmat3property.cpp index 77ee5324e2..8b1a924508 100644 --- a/src/properties/matrix/dmat3property.cpp +++ b/src/properties/matrix/dmat3property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -147,5 +146,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat3Property, glm::dmat3x3, glm::dmat3x3(0), DEFAULT_TO_STRING_LAMBDA(glm::dmat3x3), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/matrix/dmat3x2property.cpp b/src/properties/matrix/dmat3x2property.cpp index 70935e2d14..ae47ff51e7 100644 --- a/src/properties/matrix/dmat3x2property.cpp +++ b/src/properties/matrix/dmat3x2property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -140,5 +139,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat3x2Property, glm::dmat3x2, glm::dmat3x2(0) DEFAULT_TO_STRING_LAMBDA(glm::dmat3x2), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/matrix/dmat3x4property.cpp b/src/properties/matrix/dmat3x4property.cpp index a5ac727045..ef99c28234 100644 --- a/src/properties/matrix/dmat3x4property.cpp +++ b/src/properties/matrix/dmat3x4property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -153,5 +152,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat3x4Property, glm::dmat3x4, glm::dmat3x4(0) DEFAULT_TO_STRING_LAMBDA(glm::dmat3x4), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/matrix/dmat4property.cpp b/src/properties/matrix/dmat4property.cpp index 6951f9e81c..afdee102fc 100644 --- a/src/properties/matrix/dmat4property.cpp +++ b/src/properties/matrix/dmat4property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -162,5 +161,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat4Property, glm::dmat4x4, glm::dmat4x4(0), DEFAULT_TO_STRING_LAMBDA(glm::dmat4x4), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/matrix/dmat4x2property.cpp b/src/properties/matrix/dmat4x2property.cpp index 86412db0c1..e4241ca5d4 100644 --- a/src/properties/matrix/dmat4x2property.cpp +++ b/src/properties/matrix/dmat4x2property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -144,5 +143,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat4x2Property, glm::dmat4x2, glm::dmat4x2(0) DEFAULT_TO_STRING_LAMBDA(glm::dmat4x2), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/matrix/dmat4x3property.cpp b/src/properties/matrix/dmat4x3property.cpp index ea2d21d3d3..2b0995c521 100644 --- a/src/properties/matrix/dmat4x3property.cpp +++ b/src/properties/matrix/dmat4x3property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -153,5 +152,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat4x3Property, glm::dmat4x3, glm::dmat4x3(0) DEFAULT_TO_STRING_LAMBDA(glm::dmat4x3), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/matrix/mat2property.cpp b/src/properties/matrix/mat2property.cpp index afffaac69f..d34ee879a9 100644 --- a/src/properties/matrix/mat2property.cpp +++ b/src/properties/matrix/mat2property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -136,5 +135,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(Mat2Property, glm::mat2x2, glm::mat2x2(0), DEFAULT_TO_STRING_LAMBDA(glm::mat2x2), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/matrix/mat2x3property.cpp b/src/properties/matrix/mat2x3property.cpp index 85ef35813a..b47599725d 100644 --- a/src/properties/matrix/mat2x3property.cpp +++ b/src/properties/matrix/mat2x3property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -140,5 +139,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(Mat2x3Property, glm::mat2x3, glm::mat2x3(0), DEFAULT_TO_STRING_LAMBDA(glm::mat2x3), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/matrix/mat2x4property.cpp b/src/properties/matrix/mat2x4property.cpp index c38c138cbd..f0db5e1008 100644 --- a/src/properties/matrix/mat2x4property.cpp +++ b/src/properties/matrix/mat2x4property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -144,5 +143,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(Mat2x4Property, glm::mat2x4, glm::mat2x4(0), DEFAULT_TO_STRING_LAMBDA(glm::mat2x4), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/matrix/mat3property.cpp b/src/properties/matrix/mat3property.cpp index a38a07db76..46e6a55c4b 100644 --- a/src/properties/matrix/mat3property.cpp +++ b/src/properties/matrix/mat3property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -147,5 +146,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(Mat3Property, glm::mat3x3, glm::mat3x3(0), DEFAULT_TO_STRING_LAMBDA(glm::mat3x3), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/matrix/mat3x2property.cpp b/src/properties/matrix/mat3x2property.cpp index 2becdb6934..9fd28d1658 100644 --- a/src/properties/matrix/mat3x2property.cpp +++ b/src/properties/matrix/mat3x2property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -140,5 +139,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(Mat3x2Property, glm::mat3x2, glm::mat3x2(0), DEFAULT_TO_STRING_LAMBDA(glm::mat3x2), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/matrix/mat3x4property.cpp b/src/properties/matrix/mat3x4property.cpp index 6a0dbee999..706f7ec016 100644 --- a/src/properties/matrix/mat3x4property.cpp +++ b/src/properties/matrix/mat3x4property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -153,5 +152,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(Mat3x4Property, glm::mat3x4, glm::mat3x4(0), DEFAULT_TO_STRING_LAMBDA(glm::mat3x4), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/matrix/mat4property.cpp b/src/properties/matrix/mat4property.cpp index 3c40d1b979..5c52b7fc10 100644 --- a/src/properties/matrix/mat4property.cpp +++ b/src/properties/matrix/mat4property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -162,5 +161,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(Mat4Property, glm::mat4x4, glm::mat4x4(0), DEFAULT_TO_STRING_LAMBDA(glm::mat4x4), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/matrix/mat4x2property.cpp b/src/properties/matrix/mat4x2property.cpp index 3fccfdd740..ed0f2e2d39 100644 --- a/src/properties/matrix/mat4x2property.cpp +++ b/src/properties/matrix/mat4x2property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -144,5 +143,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(Mat4x2Property, glm::mat4x2, glm::mat4x2(0), DEFAULT_TO_STRING_LAMBDA(glm::mat4x2), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/matrix/mat4x3property.cpp b/src/properties/matrix/mat4x3property.cpp index c9f00f8cb9..23a98bcf47 100644 --- a/src/properties/matrix/mat4x3property.cpp +++ b/src/properties/matrix/mat4x3property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__) \ [](lua_State* state, bool& success) -> __TYPE__ { \ @@ -153,5 +152,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(Mat4x3Property, glm::mat4x3, glm::mat4x3(0), DEFAULT_TO_STRING_LAMBDA(glm::mat4x3), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/optionproperty.cpp b/src/properties/optionproperty.cpp index 86b377ca3c..b9280fb0de 100644 --- a/src/properties/optionproperty.cpp +++ b/src/properties/optionproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -26,10 +26,9 @@ namespace { const char* _loggerCat = "OptionProperty"; -} +} // namespace -namespace openspace { -namespace properties { +namespace openspace::properties { const std::string OptionProperty::OptionsKey = "Options"; @@ -115,5 +114,4 @@ std::string OptionProperty::generateAdditionalDescription() const { return result; } -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/property.cpp b/src/properties/property.cpp index eab6559539..a00992131c 100644 --- a/src/properties/property.cpp +++ b/src/properties/property.cpp @@ -30,9 +30,6 @@ #include -namespace openspace { -namespace properties { - namespace { const char* MetaDataKeyGuiName = "guiName"; const char* MetaDataKeyGroup = "Group"; @@ -42,6 +39,8 @@ namespace { const char* _metaDataKeyViewPrefix = "view."; } // namespace +namespace openspace::properties { + Property::OnChangeHandle Property::OnChangeHandleAll = std::numeric_limits::max(); @@ -242,5 +241,4 @@ std::string Property::generateAdditionalDescription() const { return ""; } -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/propertyowner.cpp b/src/properties/propertyowner.cpp index cf459cfbf0..e996a4664a 100644 --- a/src/properties/propertyowner.cpp +++ b/src/properties/propertyowner.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,22 +30,20 @@ #include -namespace openspace { -namespace properties { - namespace { const char* _loggerCat = "PropertyOwner"; bool propertyLess(Property* lhs, Property* rhs) { return lhs->identifier() < rhs->identifier(); } - + bool subOwnerLess(PropertyOwner* lhs, PropertyOwner* rhs) { return lhs->name() < rhs->name(); } - } // namespace +namespace openspace::properties { + PropertyOwner::PropertyOwner(std::string name) : _name(std::move(name)) , _owner(nullptr) @@ -282,5 +280,4 @@ void PropertyOwner::addTag(std::string tag) { _tags.push_back(std::move(tag)); } -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/scalar/boolproperty.cpp b/src/properties/scalar/boolproperty.cpp index ac5f7729cb..5568d2ec78 100644 --- a/src/properties/scalar/boolproperty.cpp +++ b/src/properties/scalar/boolproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -29,8 +29,7 @@ #include #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_TEMPLATEPROPERTY_SOURCE(BoolProperty, bool, false, [](lua_State* state, bool& success) -> bool { @@ -65,6 +64,4 @@ REGISTER_TEMPLATEPROPERTY_SOURCE(BoolProperty, bool, false, LUA_TBOOLEAN ); - -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/scalar/charproperty.cpp b/src/properties/scalar/charproperty.cpp index b35f91368d..7ac4996380 100644 --- a/src/properties/scalar/charproperty.cpp +++ b/src/properties/scalar/charproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(TYPE, DEFAULT_VALUE) \ [](lua_State* state, bool& success) -> TYPE { \ @@ -80,5 +79,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(CharProperty, char, char(0), DEFAULT_TO_STRING_LAMBDA(char), LUA_TNUMBER); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/scalar/doubleproperty.cpp b/src/properties/scalar/doubleproperty.cpp index 73c4406d67..a396b7733a 100644 --- a/src/properties/scalar/doubleproperty.cpp +++ b/src/properties/scalar/doubleproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(TYPE, DEFAULT_VALUE) \ [](lua_State* state, bool& success) -> TYPE { \ @@ -80,5 +79,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DoubleProperty, double, 0.0, DEFAULT_TO_STRING_LAMBDA(double), LUA_TNUMBER); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/scalar/floatproperty.cpp b/src/properties/scalar/floatproperty.cpp index c7489c0f96..11731544ce 100644 --- a/src/properties/scalar/floatproperty.cpp +++ b/src/properties/scalar/floatproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(TYPE, DEFAULT_VALUE) \ [](lua_State* state, bool& success) -> TYPE { \ @@ -80,5 +79,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(FloatProperty, float, 0.f, DEFAULT_TO_STRING_LAMBDA(float), LUA_TNUMBER); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/scalar/intproperty.cpp b/src/properties/scalar/intproperty.cpp index b0f2a040be..e555e77346 100644 --- a/src/properties/scalar/intproperty.cpp +++ b/src/properties/scalar/intproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(TYPE, DEFAULT_VALUE) \ [](lua_State* state, bool& success) -> TYPE { \ @@ -79,5 +78,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(IntProperty, int, int(0), numeric_limits: DEFAULT_TO_STRING_LAMBDA(int), LUA_TNUMBER); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/scalar/longdoubleproperty.cpp b/src/properties/scalar/longdoubleproperty.cpp index f8ad7a4b28..59720eadcf 100644 --- a/src/properties/scalar/longdoubleproperty.cpp +++ b/src/properties/scalar/longdoubleproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(TYPE, DEFAULT_VALUE) \ [](lua_State* state, bool& success) -> TYPE { \ @@ -80,5 +79,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(LongDoubleProperty, long double, 0l, DEFAULT_TO_STRING_LAMBDA(long double), LUA_TNUMBER); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/scalar/longlongproperty.cpp b/src/properties/scalar/longlongproperty.cpp index 2490e75db8..55a62f8e62 100644 --- a/src/properties/scalar/longlongproperty.cpp +++ b/src/properties/scalar/longlongproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(TYPE, DEFAULT_VALUE) \ [](lua_State* state, bool& success) -> TYPE { \ @@ -80,5 +79,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(LongLongProperty, long long, 0, DEFAULT_TO_STRING_LAMBDA(long long), LUA_TNUMBER); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/scalar/longproperty.cpp b/src/properties/scalar/longproperty.cpp index a1b15f221f..3e63243208 100644 --- a/src/properties/scalar/longproperty.cpp +++ b/src/properties/scalar/longproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(TYPE, DEFAULT_VALUE) \ [](lua_State* state, bool& success) -> TYPE { \ @@ -80,5 +79,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(LongProperty, long, long(0), DEFAULT_TO_STRING_LAMBDA(long), LUA_TNUMBER); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/scalar/shortproperty.cpp b/src/properties/scalar/shortproperty.cpp index 9dccb58213..1603f91b1a 100644 --- a/src/properties/scalar/shortproperty.cpp +++ b/src/properties/scalar/shortproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(TYPE, DEFAULT_VALUE) \ [](lua_State* state, bool& success) -> TYPE { \ @@ -80,5 +79,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(ShortProperty, short, short(0), DEFAULT_TO_STRING_LAMBDA(short), LUA_TNUMBER); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/scalar/signedcharproperty.cpp b/src/properties/scalar/signedcharproperty.cpp index 3078d1b238..5669b1cf78 100644 --- a/src/properties/scalar/signedcharproperty.cpp +++ b/src/properties/scalar/signedcharproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(TYPE, DEFAULT_VALUE) \ [](lua_State* state, bool& success) -> TYPE { \ @@ -80,5 +79,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(SignedCharProperty, signed char, 0, DEFAULT_TO_STRING_LAMBDA(signed char), LUA_TNUMBER); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/scalar/ucharproperty.cpp b/src/properties/scalar/ucharproperty.cpp index 24f3a0479a..3cb5f3f65c 100644 --- a/src/properties/scalar/ucharproperty.cpp +++ b/src/properties/scalar/ucharproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(TYPE, DEFAULT_VALUE) \ [](lua_State* state, bool& success) -> TYPE { \ @@ -80,5 +79,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(UCharProperty, unsigned char, 0, DEFAULT_TO_STRING_LAMBDA(unsigned char), LUA_TNUMBER); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/scalar/uintproperty.cpp b/src/properties/scalar/uintproperty.cpp index afc438d403..aa4946704d 100644 --- a/src/properties/scalar/uintproperty.cpp +++ b/src/properties/scalar/uintproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(TYPE, DEFAULT_VALUE) \ [](lua_State* state, bool& success) -> TYPE { \ @@ -80,5 +79,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(UCharProperty, unsigned int, 0, DEFAULT_TO_STRING_LAMBDA(unsigned int), LUA_TNUMBER); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/scalar/ulonglongproperty.cpp b/src/properties/scalar/ulonglongproperty.cpp index 680c718631..c7c1bb15f3 100644 --- a/src/properties/scalar/ulonglongproperty.cpp +++ b/src/properties/scalar/ulonglongproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(TYPE, DEFAULT_VALUE) \ [](lua_State* state, bool& success) -> TYPE { \ @@ -80,5 +79,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(ULongLongProperty, unsigned long long, 1ull, DEFAULT_TO_STRING_LAMBDA(unsigned long long), LUA_TNUMBER); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/scalar/ulongproperty.cpp b/src/properties/scalar/ulongproperty.cpp index c9e0398a80..e343f76aac 100644 --- a/src/properties/scalar/ulongproperty.cpp +++ b/src/properties/scalar/ulongproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(TYPE, DEFAULT_VALUE) \ [](lua_State* state, bool& success) -> TYPE { \ @@ -80,5 +79,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(ULongProperty, unsigned long, 0ul, DEFAULT_TO_STRING_LAMBDA(unsigned long), LUA_TNUMBER); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/scalar/ushortproperty.cpp b/src/properties/scalar/ushortproperty.cpp index 7fc56c7a12..897be0b1e6 100644 --- a/src/properties/scalar/ushortproperty.cpp +++ b/src/properties/scalar/ushortproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(TYPE, DEFAULT_VALUE) \ [](lua_State* state, bool& success) -> TYPE { \ @@ -80,5 +79,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(UShortProperty, unsigned short, 0, DEFAULT_TO_STRING_LAMBDA(unsigned short), LUA_TNUMBER); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/scalar/wcharproperty.cpp b/src/properties/scalar/wcharproperty.cpp index e48924f5b2..2da63051aa 100644 --- a/src/properties/scalar/wcharproperty.cpp +++ b/src/properties/scalar/wcharproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(TYPE, DEFAULT_VALUE) \ [](lua_State* state, bool& success) -> TYPE { \ @@ -71,5 +70,4 @@ namespace properties { // DEFAULT_TO_STRING_LAMBDA(wchar_t), // LUA_TNUMBER); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/selectionproperty.cpp b/src/properties/selectionproperty.cpp index fd70e2cafc..b0fc5c787b 100644 --- a/src/properties/selectionproperty.cpp +++ b/src/properties/selectionproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,13 +27,12 @@ #include namespace { - const std::string _loggerCat = "SelectionProperty"; + const char* _loggerCat = "SelectionProperty"; - const std::string Delimiter = ","; -} + const char Delimiter = ','; +} // namespace -namespace openspace { -namespace properties { +namespace openspace::properties { const std::string SelectionProperty::OptionsKey = "Options"; @@ -170,5 +169,4 @@ std::string SelectionProperty::generateAdditionalDescription() const { return result; } -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/stringproperty.cpp b/src/properties/stringproperty.cpp index 830abb962f..5409940db7 100644 --- a/src/properties/stringproperty.cpp +++ b/src/properties/stringproperty.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -26,8 +26,7 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { REGISTER_TEMPLATEPROPERTY_SOURCE(StringProperty, std::string, "", [](lua_State* state, bool& success) -> std::string { @@ -62,5 +61,4 @@ REGISTER_TEMPLATEPROPERTY_SOURCE(StringProperty, std::string, "", LUA_TSTRING ); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/triggerproperty.cpp b/src/properties/triggerproperty.cpp index 4ef68e869b..88c3df05fe 100644 --- a/src/properties/triggerproperty.cpp +++ b/src/properties/triggerproperty.cpp @@ -24,8 +24,7 @@ #include -namespace openspace { -namespace properties { +namespace openspace::properties { TriggerProperty::TriggerProperty(std::string identifier, std::string guiName, Property::Visibility visibility) @@ -45,5 +44,4 @@ void TriggerProperty::set(std::any) { notifyListener(); } -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/vector/bvec2property.cpp b/src/properties/vector/bvec2property.cpp index cab0dfeb32..f2d8303e52 100644 --- a/src/properties/vector/bvec2property.cpp +++ b/src/properties/vector/bvec2property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__, __CONVFUNC__, __TESTFUNC__) \ [](lua_State * state, bool& success) -> __TYPE__ { \ @@ -113,5 +112,4 @@ REGISTER_TEMPLATEPROPERTY_SOURCE(BVec2Property, glm::bvec2, glm::bvec2(false), DEFAULT_TO_STRING_LAMBDA(glm::bvec2), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/vector/bvec3property.cpp b/src/properties/vector/bvec3property.cpp index dc3c35692d..bd1366b6ec 100644 --- a/src/properties/vector/bvec3property.cpp +++ b/src/properties/vector/bvec3property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__, __CONVFUNC__, __TESTFUNC__) \ [](lua_State * state, bool& success) -> __TYPE__ { \ @@ -122,5 +121,4 @@ REGISTER_TEMPLATEPROPERTY_SOURCE(BVec3Property, glm::bvec3, glm::bvec3(false), #pragma warning(default : 4800) #endif -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/vector/bvec4property.cpp b/src/properties/vector/bvec4property.cpp index fc332a106f..06baffed7c 100644 --- a/src/properties/vector/bvec4property.cpp +++ b/src/properties/vector/bvec4property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__, __CONVFUNC__, __TESTFUNC__) \ [](lua_State * state, bool& success) -> __TYPE__ { \ @@ -122,5 +121,4 @@ REGISTER_TEMPLATEPROPERTY_SOURCE(BVec4Property, glm::bvec4, glm::bvec4(false), #pragma warning(default : 4800) #endif -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/vector/dvec2property.cpp b/src/properties/vector/dvec2property.cpp index 9b32310849..55bb78daed 100644 --- a/src/properties/vector/dvec2property.cpp +++ b/src/properties/vector/dvec2property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__, __CONVFUNC__, __TESTFUNC__) \ [](lua_State * state, bool& success) -> __TYPE__ { \ @@ -115,5 +114,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DVec2Property, glm::dvec2, glm::dvec2(0), DEFAULT_TO_STRING_LAMBDA(glm::dvec2), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/vector/dvec3property.cpp b/src/properties/vector/dvec3property.cpp index 178167297d..3aa7f28557 100644 --- a/src/properties/vector/dvec3property.cpp +++ b/src/properties/vector/dvec3property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__, __CONVFUNC__, __TESTFUNC__) \ [](lua_State * state, bool& success) -> __TYPE__ { \ @@ -115,5 +114,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DVec3Property, glm::dvec3, glm::dvec3(0), DEFAULT_TO_STRING_LAMBDA(glm::dvec3), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/vector/dvec4property.cpp b/src/properties/vector/dvec4property.cpp index 1108e4875a..c425779d36 100644 --- a/src/properties/vector/dvec4property.cpp +++ b/src/properties/vector/dvec4property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__, __CONVFUNC__, __TESTFUNC__) \ [](lua_State * state, bool& success) -> __TYPE__ { \ @@ -115,5 +114,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DVec4Property, glm::dvec4, glm::dvec4(0), DEFAULT_TO_STRING_LAMBDA(glm::dvec4), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/vector/ivec2property.cpp b/src/properties/vector/ivec2property.cpp index b5f124fad1..965e87561f 100644 --- a/src/properties/vector/ivec2property.cpp +++ b/src/properties/vector/ivec2property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__, __CONVFUNC__, __TESTFUNC__) \ [](lua_State * state, bool& success) -> __TYPE__ { \ @@ -114,5 +113,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(IVec2Property, glm::ivec2, glm::ivec2(0), DEFAULT_TO_STRING_LAMBDA(glm::ivec2), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/vector/ivec3property.cpp b/src/properties/vector/ivec3property.cpp index 0f7663cfe9..3d0206d0e3 100644 --- a/src/properties/vector/ivec3property.cpp +++ b/src/properties/vector/ivec3property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__, __CONVFUNC__, __TESTFUNC__) \ [](lua_State * state, bool& success) -> __TYPE__ { \ @@ -114,5 +113,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(IVec3Property, glm::ivec3, glm::ivec3(0), DEFAULT_TO_STRING_LAMBDA(glm::ivec3), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/vector/ivec4property.cpp b/src/properties/vector/ivec4property.cpp index b09881ce0e..b09164d538 100644 --- a/src/properties/vector/ivec4property.cpp +++ b/src/properties/vector/ivec4property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__, __CONVFUNC__, __TESTFUNC__) \ [](lua_State * state, bool& success) -> __TYPE__ { \ @@ -114,5 +113,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(IVec4Property, glm::ivec4, glm::ivec4(0), DEFAULT_TO_STRING_LAMBDA(glm::ivec4), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/vector/uvec2property.cpp b/src/properties/vector/uvec2property.cpp index 025fa9b886..79fce5edde 100644 --- a/src/properties/vector/uvec2property.cpp +++ b/src/properties/vector/uvec2property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__, __CONVFUNC__, __TESTFUNC__) \ [](lua_State * state, bool& success) -> __TYPE__ { \ @@ -115,5 +114,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(UVec2Property, glm::uvec2, glm::uvec2(0), DEFAULT_TO_STRING_LAMBDA(glm::uvec2), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/vector/uvec3property.cpp b/src/properties/vector/uvec3property.cpp index e51b366b42..b2408c90a7 100644 --- a/src/properties/vector/uvec3property.cpp +++ b/src/properties/vector/uvec3property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__, __CONVFUNC__, __TESTFUNC__) \ [](lua_State * state, bool& success) -> __TYPE__ { \ @@ -115,5 +114,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(UVec3Property, glm::uvec3, glm::uvec3(0), DEFAULT_TO_STRING_LAMBDA(glm::uvec3), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/vector/uvec4property.cpp b/src/properties/vector/uvec4property.cpp index c6c443ebfb..49bf7b6350 100644 --- a/src/properties/vector/uvec4property.cpp +++ b/src/properties/vector/uvec4property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__, __CONVFUNC__, __TESTFUNC__) \ [](lua_State * state, bool& success) -> __TYPE__ { \ @@ -115,5 +114,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(UVec4Property, glm::uvec4, glm::uvec4(0), DEFAULT_TO_STRING_LAMBDA(glm::uvec4), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/vector/vec2property.cpp b/src/properties/vector/vec2property.cpp index c6e57f06fc..8d16af7bac 100644 --- a/src/properties/vector/vec2property.cpp +++ b/src/properties/vector/vec2property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__, __CONVFUNC__, __TESTFUNC__) \ [](lua_State * state, bool& success) -> __TYPE__ { \ @@ -115,5 +114,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(Vec2Property, glm::vec2, glm::vec2(0), DEFAULT_TO_STRING_LAMBDA(glm::vec2), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/vector/vec3property.cpp b/src/properties/vector/vec3property.cpp index df30a38f0a..7620655868 100644 --- a/src/properties/vector/vec3property.cpp +++ b/src/properties/vector/vec3property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__, __CONVFUNC__, __TESTFUNC__) \ [](lua_State * state, bool& success) -> __TYPE__ { \ @@ -115,5 +114,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(Vec3Property, glm::vec3, glm::vec3(0), DEFAULT_TO_STRING_LAMBDA(glm::vec3), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/properties/vector/vec4property.cpp b/src/properties/vector/vec4property.cpp index 3f66e92396..cd469902d5 100644 --- a/src/properties/vector/vec4property.cpp +++ b/src/properties/vector/vec4property.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -32,8 +32,7 @@ using std::numeric_limits; -namespace openspace { -namespace properties { +namespace openspace::properties { #define DEFAULT_FROM_LUA_LAMBDA(__TYPE__, __CONVFUNC__, __TESTFUNC__) \ [](lua_State * state, bool& success) -> __TYPE__ { \ @@ -115,5 +114,4 @@ REGISTER_NUMERICALPROPERTY_SOURCE(Vec4Property, glm::vec4, glm::vec4(0), DEFAULT_TO_STRING_LAMBDA(glm::vec4), LUA_TTABLE); -} // namespace properties -} // namespace openspace +} // namespace openspace::properties diff --git a/src/query/query.cpp b/src/query/query.cpp index e2d205441a..e31cdefac8 100644 --- a/src/query/query.cpp +++ b/src/query/query.cpp @@ -1,4 +1,4 @@ - /***************************************************************************************** + /***************************************************************************************** * * * OpenSpace * * * @@ -37,11 +37,11 @@ #include #include -namespace openspace { - namespace { const char* _loggerCat = "Query"; -} +} // namespace + +namespace openspace { Scene* sceneGraph() { return OsEng.renderEngine().scene(); diff --git a/src/rendering/renderengine_lua.inl b/src/rendering/renderengine_lua.inl index 2806e8eb36..afad373816 100644 --- a/src/rendering/renderengine_lua.inl +++ b/src/rendering/renderengine_lua.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -22,9 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -namespace openspace { - -namespace luascriptfunctions { +namespace openspace::luascriptfunctions { /** * \ingroup LuaScripts @@ -143,6 +141,4 @@ int unregisterScreenSpaceRenderable(lua_State* L) { return 1; } -} // namespace luascriptfunctions - -}// namespace openspace +}// namespace openspace::luascriptfunctions diff --git a/src/rendering/transferfunction.cpp b/src/rendering/transferfunction.cpp index 96502a3302..39a92b1aaf 100644 --- a/src/rendering/transferfunction.cpp +++ b/src/rendering/transferfunction.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -38,7 +38,7 @@ #include namespace { - const std::string _loggerCat = "TransferFunction"; + const char* _loggerCat = "TransferFunction"; ghoul::opengl::Texture::FilterMode filtermode = ghoul::opengl::Texture::FilterMode::Linear; ghoul::opengl::Texture::WrappingMode wrappingmode = ghoul::opengl::Texture::WrappingMode::ClampToEdge; @@ -52,11 +52,11 @@ namespace { return false; } } - -} +} // namespace namespace openspace { + TransferFunction::TransferFunction(const std::string& filepath, TfChangedCallback tfChangedCallback) : _filepath(filepath) { setPath(filepath); setCallback(tfChangedCallback); diff --git a/src/scene/scene_lua.inl b/src/scene/scene_lua.inl index ee86083384..7aa9cb9232 100644 --- a/src/scene/scene_lua.inl +++ b/src/scene/scene_lua.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -125,10 +125,10 @@ std::string extractUriWithoutGroupName(std::string uri) { return uri.substr(pos); } -} +} // namespace +} // namespace openspace - -namespace luascriptfunctions { +namespace openspace::luascriptfunctions { int setPropertyCall_single(properties::Property* prop, std::string uri, lua_State* L, const int type) @@ -390,6 +390,4 @@ int removeSceneGraphNode(lua_State* L) { return 1; } -} // namespace luascriptfunctions - -} // namespace openspace +} // namespace openspace::luascriptfunctions diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index 9e0bc937ec..442e3c7b7c 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -54,13 +54,13 @@ #include "scenegraphnode_doc.inl" namespace { - const std::string _loggerCat = "SceneGraphNode"; - const std::string KeyRenderable = "Renderable"; + const char* _loggerCat = "SceneGraphNode"; + const char* KeyRenderable = "Renderable"; - const std::string keyTransformTranslation = "Transform.Translation"; - const std::string keyTransformRotation = "Transform.Rotation"; - const std::string keyTransformScale = "Transform.Scale"; -} + const char* keyTransformTranslation = "Transform.Translation"; + const char* keyTransformRotation = "Transform.Rotation"; + const char* keyTransformScale = "Transform.Scale"; +} // namespace namespace openspace { @@ -484,11 +484,11 @@ SurfacePositionHandle SceneGraphNode::calculateSurfacePositionHandle( return _renderable->calculateSurfacePositionHandle(targetModelSpace); } else { - return { - glm::dvec3(0.0, 0.0, 0.0), - glm::normalize(targetModelSpace), - 0.0 - }; + return { + glm::dvec3(0.0, 0.0, 0.0), + glm::normalize(targetModelSpace), + 0.0 + }; } } diff --git a/src/scene/sceneloader.cpp b/src/scene/sceneloader.cpp index d91ed6f95e..45fcd85dc3 100644 --- a/src/scene/sceneloader.cpp +++ b/src/scene/sceneloader.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -36,28 +36,28 @@ #include namespace { - const std::string _loggerCat = "SceneLoader"; - const std::string KeyPathScene = "ScenePath"; - const std::string KeyModules = "Modules"; - const std::string ModuleExtension = ".mod"; - const std::string KeyPathModule = "ModulePath"; + const char* _loggerCat = "SceneLoader"; + const char* KeyPathScene = "ScenePath"; + const char* KeyModules = "Modules"; + const char* ModuleExtension = ".mod"; + const char* KeyPathModule = "ModulePath"; - const std::string RootNodeName = "Root"; - const std::string KeyName = "Name"; - const std::string KeyParentName = "Parent"; - const std::string KeyDependencies = "Dependencies"; - const std::string KeyCamera = "Camera"; - const std::string KeyCameraFocus = "Focus"; - const std::string KeyCameraPosition = "Position"; - const std::string KeyCameraRotation = "Rotation"; -} + const char* RootNodeName = "Root"; + const char* KeyName = "Name"; + const char* KeyParentName = "Parent"; + const char* KeyDependencies = "Dependencies"; + const char* KeyCamera = "Camera"; + const char* KeyCameraFocus = "Focus"; + const char* KeyCameraPosition = "Position"; + const char* KeyCameraRotation = "Rotation"; -struct ModuleInformation { - ghoul::Dictionary dictionary; - std::string moduleFile; - std::string modulePath; - std::string moduleName; -}; + struct ModuleInformation { + ghoul::Dictionary dictionary; + std::string moduleFile; + std::string modulePath; + std::string moduleName; + }; +} // namespace namespace openspace { diff --git a/src/scene/scenemanager.cpp b/src/scene/scenemanager.cpp index 2c76a58974..fb22f8e720 100644 --- a/src/scene/scenemanager.cpp +++ b/src/scene/scenemanager.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -50,4 +50,5 @@ void SceneManager::unloadScene(Scene& scene) { void SceneManager::unloadAll() { _scenes.clear(); } -} + +} // namespace diff --git a/src/scripting/lualibrary.cpp b/src/scripting/lualibrary.cpp index 359ee27f4e..09130c5dad 100644 --- a/src/scripting/lualibrary.cpp +++ b/src/scripting/lualibrary.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -24,12 +24,10 @@ #include -namespace openspace { -namespace scripting { +namespace openspace::scripting { bool LuaLibrary::operator<(const LuaLibrary& rhs) const { return name < rhs.name; } -} // namespace scripting -} // namespace openspace +} // namespace openspace::scripting diff --git a/src/scripting/scriptengine.cpp b/src/scripting/scriptengine.cpp index b2520f8707..2fb7581816 100644 --- a/src/scripting/scriptengine.cpp +++ b/src/scripting/scriptengine.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -41,7 +41,7 @@ #include "scriptengine_lua.inl" namespace { - const std::string _loggerCat = "ScriptEngine"; + const char* _loggerCat = "ScriptEngine"; const char* LuaGlobalNamespace = "_G"; const char* PrintFunctionName = "print"; @@ -54,8 +54,7 @@ namespace { const char* JsFilename = "${OPENSPACE_DATA}/web/luascripting/script.js"; } // namespace -namespace openspace { -namespace scripting { +namespace openspace::scripting { std::string ScriptEngine::OpenSpaceLibraryName = "openspace"; @@ -753,5 +752,4 @@ void ScriptEngine::queueScript(const std::string &script, ScriptEngine::RemoteSc _mutex.unlock(); } -} // namespace scripting -} // namespace openspace +} // namespace openspace::scripting diff --git a/src/scripting/scriptengine_lua.inl b/src/scripting/scriptengine_lua.inl index 807c79f629..c7fbccd3f2 100644 --- a/src/scripting/scriptengine_lua.inl +++ b/src/scripting/scriptengine_lua.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -24,9 +24,7 @@ #include -namespace openspace { - -namespace luascriptfunctions { +namespace openspace::luascriptfunctions { namespace { @@ -291,6 +289,4 @@ int walkDirectoryFolder(lua_State* L) { } -} // namespace luascriptfunctions - -} // namespace openspace +} // namespace openspace::luascriptfunctions diff --git a/src/scripting/scriptscheduler.cpp b/src/scripting/scriptscheduler.cpp index dd01785e9e..4f5597160e 100644 --- a/src/scripting/scriptscheduler.cpp +++ b/src/scripting/scriptscheduler.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -39,13 +39,11 @@ namespace { const char* KeyForwardScript = "ForwardScript"; const char* KeyBackwardScript = "BackwardScript"; const char* KeyUniversalScript = "Script"; -} - -namespace openspace { +} // namespace #include "scriptscheduler_lua.inl" -namespace scripting { +namespace openspace::scripting { documentation::Documentation ScriptScheduler::Documentation() { using namespace openspace::documentation; @@ -294,6 +292,4 @@ LuaLibrary ScriptScheduler::luaLibrary() { }; } -} // namespace scripting - -} // namespace openspace +} // namespace openspace::scripting diff --git a/src/scripting/scriptscheduler_lua.inl b/src/scripting/scriptscheduler_lua.inl index cca380d9c0..26e6501510 100644 --- a/src/scripting/scriptscheduler_lua.inl +++ b/src/scripting/scriptscheduler_lua.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -namespace luascriptfunctions { +namespace openspace::luascriptfunctions { int loadFile(lua_State* L) { int nArguments = lua_gettop(L); @@ -98,4 +98,4 @@ int clear(lua_State* L) { return 0; } -} // namespace luascriptfunction +} // namespace openspace::luascriptfunction diff --git a/src/scripting/systemcapabilitiesbinding.cpp b/src/scripting/systemcapabilitiesbinding.cpp index 60fdd30982..a9c6a613e3 100644 --- a/src/scripting/systemcapabilitiesbinding.cpp +++ b/src/scripting/systemcapabilitiesbinding.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -37,8 +37,7 @@ using namespace ghoul::lua; using namespace ghoul::systemcapabilities; -namespace luascripting { -namespace general { +namespace luascripting::general { int operatingSystem(lua_State* L) { lua_pushstring(L, CpuCap.operatingSystemString().c_str()); @@ -81,9 +80,9 @@ int extensions(lua_State* L) { } -} // namespace general +} // namespace luascripting::general -namespace opengl { +namespace luascripting::opengl { int hasOpenGLVersion(lua_State* L) { int nArguments = lua_gettop(L); @@ -188,11 +187,9 @@ int maxUniformBufferBindings(lua_State* L) { } -} // namespace opengl -} // namespace luascripting +} // namespace luascripting::opengl -namespace openspace { -namespace scripting { +namespace openspace::scripting { LuaLibrary generalSystemCapabilities() { return { @@ -343,5 +340,4 @@ LuaLibrary openglSystemCapabilities() { }; } -} // namespace scripting -} // namespace openspace +} // namespace openspace::scripting diff --git a/src/util/boxgeometry.cpp b/src/util/boxgeometry.cpp index 0d37eff241..a19eae5208 100644 --- a/src/util/boxgeometry.cpp +++ b/src/util/boxgeometry.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,8 +27,8 @@ #include namespace { -const std::string _loggerCat = "BoxGeometry"; -} + const char* _loggerCat = "BoxGeometry"; +} // namespace namespace openspace { diff --git a/src/util/histogram.cpp b/src/util/histogram.cpp index d1c8907053..e19ba9bea0 100644 --- a/src/util/histogram.cpp +++ b/src/util/histogram.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -28,9 +28,10 @@ #include #include + namespace { - const std::string _loggerCat = "Histogram"; -} + const char* _loggerCat = "Histogram"; +} // namespace namespace openspace { diff --git a/src/util/keys.cpp b/src/util/keys.cpp index ab02ed8bc4..eaa83eef88 100644 --- a/src/util/keys.cpp +++ b/src/util/keys.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,8 +31,8 @@ #include namespace { - const std::string _loggerCat = "Keys"; -} + const char* _loggerCat = "Keys"; +} // namespace namespace openspace { diff --git a/src/util/openspacemodule.cpp b/src/util/openspacemodule.cpp index 35742213ea..5d91d543c7 100644 --- a/src/util/openspacemodule.cpp +++ b/src/util/openspacemodule.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -34,7 +34,7 @@ namespace { const char* _loggerCat = "OpenSpaceModule"; const char* ModuleBaseToken = "MODULE_"; -} +} // namespace namespace openspace { diff --git a/src/util/powerscaledcoordinate.cpp b/src/util/powerscaledcoordinate.cpp index aa0595b305..9bb28efb40 100644 --- a/src/util/powerscaledcoordinate.cpp +++ b/src/util/powerscaledcoordinate.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -22,20 +22,19 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -// open space includes #include #include -// std includes #include #include #include +namespace { + const double k = 10.0; +} // namespace + namespace openspace { -namespace { -const double k = 10.0; -} PowerScaledCoordinate::PowerScaledCoordinate() : _vec(0.f) diff --git a/src/util/powerscaledscalar.cpp b/src/util/powerscaledscalar.cpp index dcf78e00e0..f38170587e 100644 --- a/src/util/powerscaledscalar.cpp +++ b/src/util/powerscaledscalar.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -22,24 +22,19 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -// open space includes #include -// std includes #include #include #include +namespace { + const double k = 10.0; +} // namespace + namespace openspace { - namespace { - const double k = 10.0; - } - - -PowerScaledScalar::PowerScaledScalar() : _data(0.f) { - -} +PowerScaledScalar::PowerScaledScalar() : _data(0.f) {} PowerScaledScalar::PowerScaledScalar(const glm::vec2 &v) { _data = std::move(v); diff --git a/src/util/powerscaledsphere.cpp b/src/util/powerscaledsphere.cpp index 3f3c96904c..5796483ff2 100644 --- a/src/util/powerscaledsphere.cpp +++ b/src/util/powerscaledsphere.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -22,7 +22,6 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -// open space includes #include #include @@ -30,8 +29,8 @@ #include namespace { -const std::string _loggerCat = "PowerScaledSphere"; -} + const char* _loggerCat = "PowerScaledSphere"; +} // namespace namespace openspace { diff --git a/src/util/spicemanager.cpp b/src/util/spicemanager.cpp index d73edaec64..9ad524c989 100644 --- a/src/util/spicemanager.cpp +++ b/src/util/spicemanager.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -100,7 +100,6 @@ using std::string; namespace openspace { - SpiceManager::SpiceException::SpiceException(const string& msg) : ghoul::RuntimeError(msg, "Spice") { diff --git a/src/util/spicemanager_lua.inl b/src/util/spicemanager_lua.inl index 8f615fb7c2..12869db24b 100644 --- a/src/util/spicemanager_lua.inl +++ b/src/util/spicemanager_lua.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -24,8 +24,7 @@ #include -namespace openspace { -namespace luascriptfunctions { +namespace openspace::luascriptfunctions { /** * \ingroup LuaScripts @@ -88,5 +87,4 @@ int unloadKernel(lua_State* L) { return 0; } -} // luascriptfunctions -} // namespace openspace +} // namespace openspace::luascriptfunctions diff --git a/src/util/syncdata.cpp b/src/util/syncdata.cpp deleted file mode 100644 index 83e25d0c85..0000000000 --- a/src/util/syncdata.cpp +++ /dev/null @@ -1,39 +0,0 @@ -/***************************************************************************************** - * * - * OpenSpace * - * * - * Copyright (c) 2014-2017 * - * * - * 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 - - -namespace { - const std::string _loggerCat = "SyncData"; -} - -namespace openspace { - -} diff --git a/src/util/time_lua.inl b/src/util/time_lua.inl index cc1ee5ca6a..9933266268 100644 --- a/src/util/time_lua.inl +++ b/src/util/time_lua.inl @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -27,8 +27,7 @@ #include #include -namespace openspace { -namespace luascriptfunctions { +namespace openspace::luascriptfunctions { /** * \ingroup LuaScripts @@ -186,6 +185,4 @@ int time_currentWallTime(lua_State* L) { return 1; } -} // namespace luascriptfunctions - -} // namespace openspace +} // namespace openspace::luascriptfunctions diff --git a/src/util/timerange.cpp b/src/util/timerange.cpp index 5569cfab75..bd67c11b9c 100644 --- a/src/util/timerange.cpp +++ b/src/util/timerange.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -31,9 +31,9 @@ #include namespace { - const std::string KeyStart = "Start"; - const std::string KeyEnd = "End"; -} + const char* KeyStart = "Start"; + const char* KeyEnd = "End"; +} // namespace namespace openspace { diff --git a/src/util/transformationmanager.cpp b/src/util/transformationmanager.cpp index 53a975f09b..3306ae0eee 100644 --- a/src/util/transformationmanager.cpp +++ b/src/util/transformationmanager.cpp @@ -1,4 +1,4 @@ -/***************************************************************************************** +/***************************************************************************************** * * * OpenSpace * * * @@ -30,8 +30,8 @@ #include namespace { - const std::string _loggerCat = "TransformationManager"; - } + const char* _loggerCat = "TransformationManager"; + } // namespace namespace openspace{ TransformationManager::TransformationManager(){ From 26682669ff9f708337c8869b75225d652c2eb41c Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 16 Jul 2017 01:55:35 -0400 Subject: [PATCH 15/44] 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