diff --git a/apps/OpenSpace/ext/launcher/src/profile/actiondialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/actiondialog.cpp index fadafb16af..81dd9d81da 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/actiondialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/actiondialog.cpp @@ -546,7 +546,7 @@ void ActionDialog::actionSaved() { // If we got this far, we have a new identifier and it is a new one, so we need to // update other keybinds now ghoul_assert( - _keybindingWidgets.list->count() == _keybindingsData.size(), + _keybindingWidgets.list->count() == static_cast(_keybindingsData.size()), "The list and data got out of sync" ); for (int i = 0; i < _keybindingWidgets.list->count(); ++i) { diff --git a/apps/OpenSpace/ext/launcher/src/profile/propertiesdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/propertiesdialog.cpp index 969e2f37fa..4fc82565d9 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/propertiesdialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/propertiesdialog.cpp @@ -419,15 +419,15 @@ void PropertiesDialog::selectLineFromScriptLog() { // openspace.setPropertyValue('prop', value); if (text.startsWith("openspace.setPropertyValueSingle")) { - using namespace std::string_view_literals; _commandCombo->setCurrentIndex(0); - text = text.mid("openspace.setPropertyValueSingle"sv.size() + 1); // +1 for ( + std::string_view prefix = "openspace.setPropertyValueSingle"; + text = text.mid(static_cast(prefix.size()) + 1); // +1 for ( } else { // command == "openspace.setPropertyValue" - using namespace std::string_view_literals; _commandCombo->setCurrentIndex(1); - text = text.mid("openspace.setPropertyValue"sv.size() + 1); // +1 for ( + std::string_view prefix = "openspace.setPropertyValue"; + text = text.mid(static_cast(prefix.size()) + 1); // +1 for ( } // Remove everything past the closing brace diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index 20e67ebb4f..9289476ad3 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit 20e67ebb4f0f2544b1703f2c85e26be4b4cfb051 +Subproject commit 9289476ad3280f3a3e12ef3c26214b57ade2b436 diff --git a/ext/ghoul b/ext/ghoul index b4e0bbd108..35995e3e78 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit b4e0bbd108c1189173af8cad53c2fbc680a0a976 +Subproject commit 35995e3e78e3a96021a3d551c75a952b0d6d00c9 diff --git a/include/openspace/scripting/lualibrary.h b/include/openspace/scripting/lualibrary.h index d34120ee70..abdeb79c5f 100644 --- a/include/openspace/scripting/lualibrary.h +++ b/include/openspace/scripting/lualibrary.h @@ -59,7 +59,7 @@ struct LuaLibrary { /// A list of script files that are executed for each Lua state std::vector scripts = std::vector(); /// A list of all libraries that are children for this library - std::vector subLibraries; + std::vector subLibraries = std::vector(); /// This struct contains information about a function or constant that is defined in /// a Lua script diff --git a/modules/base/rendering/renderabledisc.cpp b/modules/base/rendering/renderabledisc.cpp index 36dd33cf09..f98bbd20f0 100644 --- a/modules/base/rendering/renderabledisc.cpp +++ b/modules/base/rendering/renderabledisc.cpp @@ -39,8 +39,6 @@ #include namespace { - constexpr const char _loggerCat[] = "RenderableDisc"; - constexpr const std::array UniformNames = { "modelViewProjectionTransform", "opacity", "width", "colorTexture" }; diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index 95ad7958e1..79752a2c04 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -586,10 +586,7 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) { glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * glm::dmat4(data.modelTransform.rotation) * glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale)) * - glm::scale( - glm::dmat4(_modelTransform.value()), - glm::dvec3(_modelScale) // Model scale unit - ); + glm::scale(_modelTransform.value(), glm::dvec3(_modelScale)); const glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform; diff --git a/modules/base/rendering/renderableplanetimevaryingimage.cpp b/modules/base/rendering/renderableplanetimevaryingimage.cpp index c3303b66ba..c3e3a50993 100644 --- a/modules/base/rendering/renderableplanetimevaryingimage.cpp +++ b/modules/base/rendering/renderableplanetimevaryingimage.cpp @@ -291,7 +291,7 @@ void RenderablePlaneTimeVaryingImage::computeSequenceEndTime() { const double lastTriggerTime = _startTimes[_sourceFiles.size() - 1]; const double sequenceDuration = lastTriggerTime - _startTimes[0]; const double averageStateDuration = sequenceDuration / - (static_cast(_sourceFiles.size() - 1.0)); + static_cast(_sourceFiles.size() - 1); _sequenceEndTime = lastTriggerTime + averageStateDuration; } } diff --git a/modules/base/rendering/renderableprism.cpp b/modules/base/rendering/renderableprism.cpp index 23c1e36c87..8e0002659c 100644 --- a/modules/base/rendering/renderableprism.cpp +++ b/modules/base/rendering/renderableprism.cpp @@ -36,8 +36,6 @@ #include namespace { - constexpr const char _loggerCat[] = "RenderablePrism"; - constexpr const std::array UniformNames = { "modelViewProjectionTransform", "vs_color" }; diff --git a/modules/base/rendering/renderabletimevaryingsphere.cpp b/modules/base/rendering/renderabletimevaryingsphere.cpp index c9f8e23fa7..1dfb41a490 100644 --- a/modules/base/rendering/renderabletimevaryingsphere.cpp +++ b/modules/base/rendering/renderabletimevaryingsphere.cpp @@ -44,7 +44,7 @@ namespace { constexpr const char* ProgramName = "Timevarying Sphere"; - constexpr const char* _loggerCat = "RenderableTimeVaryingSphere"; + constexpr const std::array UniformNames = { "opacity", "modelViewProjection", "modelViewRotation", "colorTexture", "mirrorTexture" diff --git a/modules/debugging/debuggingmodule_lua.inl b/modules/debugging/debuggingmodule_lua.inl index 51a1758a60..80425dde83 100644 --- a/modules/debugging/debuggingmodule_lua.inl +++ b/modules/debugging/debuggingmodule_lua.inl @@ -108,7 +108,7 @@ int renderCameraPath(lua_State* L) { return fmt::format("Point_{}", i); }; - auto addPoint = [pointIdentifier] (const std::string& id, glm::dvec3 p) { + auto addPoint = [](const std::string& id, glm::dvec3 p) { const std::string pointNode = "{" "Identifier = '" + id + "'," "Parent = '" + RenderedPathIdentifier + "'," @@ -126,10 +126,8 @@ int renderCameraPath(lua_State* L) { ); }; - auto addLineBetweenPoints = [pointIdentifier] (const std::string& id1, - const std::string& id2, - const glm::vec3& color, - float lineWidth) + auto addLineBetweenPoints = [](const std::string& id1, const std::string& id2, + const glm::vec3& color, float lineWidth) { const std::string lineNode = "{" "Identifier = '" + fmt::format("Line{}", id1) + "'," diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp index eb5e7c32d8..786e6ce8be 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp @@ -67,8 +67,6 @@ namespace { "hasColorMap", "enabledRectSizeControl", "hasDvarScaling" }; - constexpr double PARSEC = 0.308567756E17; - enum RenderOption { ViewDirection = 0, PositionNormal diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.cpp b/modules/digitaluniverse/rendering/renderabledumeshes.cpp index 83e1dd0f7d..bbd77b824e 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.cpp +++ b/modules/digitaluniverse/rendering/renderabledumeshes.cpp @@ -59,8 +59,6 @@ namespace { constexpr const int RenderOptionViewDirection = 0; constexpr const int RenderOptionPositionNormal = 1; - constexpr const double PARSEC = 0.308567756E17; - constexpr openspace::properties::Property::PropertyInfo TextColorInfo = { "TextColor", "Text Color", diff --git a/modules/digitaluniverse/rendering/renderablepoints.cpp b/modules/digitaluniverse/rendering/renderablepoints.cpp index cc5a7ec675..0ddc693ddf 100644 --- a/modules/digitaluniverse/rendering/renderablepoints.cpp +++ b/modules/digitaluniverse/rendering/renderablepoints.cpp @@ -55,8 +55,6 @@ namespace { "spriteTexture", "hasColorMap" }; - constexpr double PARSEC = 0.308567756E17; - constexpr openspace::properties::Property::PropertyInfo SpriteTextureInfo = { "Texture", "Point Sprite Texture", diff --git a/modules/globebrowsing/src/globelabelscomponent.cpp b/modules/globebrowsing/src/globelabelscomponent.cpp index 6a6e95f9e1..ab089b6059 100644 --- a/modules/globebrowsing/src/globelabelscomponent.cpp +++ b/modules/globebrowsing/src/globelabelscomponent.cpp @@ -365,7 +365,7 @@ bool GlobeLabelsComponent::readLabelsFile(const std::filesystem::path& file) { // atlas) // Once this limitation is fixed, we can remove the next piece of code // Removing non ASCII characters: - strncpy(lEntry.feature, token.c_str(), 256); + strncpy(lEntry.feature, token.c_str(), 255); int tokenChar = 0; while (tokenChar < 256) { if (lEntry.feature[tokenChar] < 0 && lEntry.feature[tokenChar] != '\0') { diff --git a/modules/globebrowsing/src/tileprovider/imagesequencetileprovider.cpp b/modules/globebrowsing/src/tileprovider/imagesequencetileprovider.cpp index f922c99681..597cacda81 100644 --- a/modules/globebrowsing/src/tileprovider/imagesequencetileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/imagesequencetileprovider.cpp @@ -112,7 +112,7 @@ TileDepthTransform ImageSequenceTileProvider::depthTransform() { void ImageSequenceTileProvider::update() { if (_isImageDirty && !_imagePaths.empty() && - _index >= 0 && _index < _imagePaths.size()) + _index >= 0 && _index < static_cast(_imagePaths.size())) { if (_currentTileProvider) { _currentTileProvider->deinitialize(); diff --git a/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.cpp b/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.cpp index a179af979f..6da9209036 100644 --- a/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.cpp @@ -104,7 +104,7 @@ Tile SizeReferenceTileProvider::tile(const TileIndex& tileIndex) { return TextTileProvider::renderTile(tileIndex, text, textPosition, glm::vec4(1.f)); } -Tile::Status SizeReferenceTileProvider::tileStatus(const TileIndex& index) { +Tile::Status SizeReferenceTileProvider::tileStatus(const TileIndex&) { return Tile::Status::OK; } diff --git a/modules/globebrowsing/src/tileprovider/temporaltileprovider.cpp b/modules/globebrowsing/src/tileprovider/temporaltileprovider.cpp index cb43d30361..dd1131cb68 100644 --- a/modules/globebrowsing/src/tileprovider/temporaltileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/temporaltileprovider.cpp @@ -44,17 +44,8 @@ #include namespace { - constexpr const char* KeyBasePath = "BasePath"; - constexpr const char* TimePlaceholder = "${OpenSpaceTimeId}"; - constexpr openspace::properties::Property::PropertyInfo FilePathInfo = { - "FilePath", - "File Path", - "This is the path to the XML configuration file that describes the temporal tile " - "information." - }; - constexpr openspace::properties::Property::PropertyInfo UseFixedTimeInfo = { "UseFixedTime", "Use Fixed Time", @@ -450,8 +441,8 @@ DefaultTileProvider* TemporalTileProvider::retrieveTileProvider(const Time& t) { _folder.files.cbegin(), _folder.files.cend(), time, - [](const std::pair& p, double time) { - return p.first < time; + [](const std::pair& p, double sec) { + return p.first < sec; } ); return std::string_view(it->second); @@ -721,9 +712,10 @@ Tile TemporalTileProvider::InterpolateTileProvider::tile(const TileIndex& tileIn Tile prev = t1->tile(tileIndex); Tile next = t2->tile(tileIndex); // the tile before and the tile after the interpolation interval are loaded so the - // interpolation goes smoother - Tile prevprev = before->tile(tileIndex); - Tile nextnext = future->tile(tileIndex); + // interpolation goes smoother. It is on purpose that we are not actually storing the + // return tile here, we just want to trigger the load already + before->tile(tileIndex); + future->tile(tileIndex); cache::ProviderTileKey key = { tileIndex, uniqueIdentifier }; if (!prev.texture || !next.texture) { diff --git a/modules/globebrowsing/src/tileprovider/tileprovider.cpp b/modules/globebrowsing/src/tileprovider/tileprovider.cpp index a0326513ef..324dda08f5 100644 --- a/modules/globebrowsing/src/tileprovider/tileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/tileprovider.cpp @@ -65,8 +65,6 @@ namespace { std::unique_ptr DefaultTileTexture; Tile DefaultTile = Tile { nullptr, std::nullopt, Tile::Status::Unavailable }; -constexpr const char* KeyFilePath = "FilePath"; - } // namespace unsigned int TileProvider::NumTileProviders = 0; diff --git a/modules/globebrowsing/src/tileprovider/tileproviderbyindex.cpp b/modules/globebrowsing/src/tileprovider/tileproviderbyindex.cpp index c9871e92f1..f2e416e39d 100644 --- a/modules/globebrowsing/src/tileprovider/tileproviderbyindex.cpp +++ b/modules/globebrowsing/src/tileprovider/tileproviderbyindex.cpp @@ -27,23 +27,32 @@ #include namespace { - constexpr const char* KeyDefaultProvider = "DefaultProvider"; - constexpr const char* KeyProviders = "IndexTileProviders"; - constexpr const char* KeyTileIndex = "TileIndex"; - constexpr const char* KeyTileProvider = "TileProvider"; - struct [[codegen::Dictionary(TileProviderByIndex)]] Parameters { ghoul::Dictionary defaultProvider; struct IndexProvider { struct Index { + // The x coordinate for this index. This specifies the horizontal + // direction (longitude) component int x [[codegen::greaterequal(0)]]; + + // The y coordinate for this index. This specifies the vertical direction + // (latitude) component int y [[codegen::greaterequal(0)]]; + + // The z-level which corresponds to the depth of the tile pyramid, which + // directly impacts the applied resolution of the tileprovider shown here int level [[codegen::inrange(0, 255)]]; }; + // The index for which the provided tile provider is used Index tileIndex; + + // The dictionary that described the tileprovider to be used by the provided + // index ghoul::Dictionary tileProvider; }; + + // The list of all tileprovides and the indices at which they are used std::vector indexTileProviders; }; #include "tileproviderbyindex_codegen.cpp" diff --git a/modules/globebrowsing/src/timequantizer.cpp b/modules/globebrowsing/src/timequantizer.cpp index 5d35b95396..74f322c2be 100644 --- a/modules/globebrowsing/src/timequantizer.cpp +++ b/modules/globebrowsing/src/timequantizer.cpp @@ -630,9 +630,8 @@ std::vector TimeQuantizer::quantized(Time& start, Time& end) { const double startSeconds = s.J2000(); const double endSeconds = e.J2000(); - const double delta = endSeconds - startSeconds; ghoul_assert( - static_cast(delta) % static_cast(_resolution) == 0, + static_cast(endSeconds - startSeconds) % static_cast(_resolution) == 0, "Quantization error" ); diff --git a/modules/iswa/util/iswamanager.cpp b/modules/iswa/util/iswamanager.cpp index 6710de7048..29cc009743 100644 --- a/modules/iswa/util/iswamanager.cpp +++ b/modules/iswa/util/iswamanager.cpp @@ -698,10 +698,10 @@ ghoul::Event<>& IswaManager::iswaEvent() { } void IswaManager::addCdfFiles(std::string cdfpath) { - std::filesystem::path cdf = absPath(cdfpath); - if (std::filesystem::is_regular_file(cdf)) { + std::filesystem::path cdfFile = absPath(cdfpath); + if (std::filesystem::is_regular_file(cdfFile)) { //std::string basePath = path.substr(0, path.find_last_of("/\\")); - std::ifstream jsonFile(cdf); + std::ifstream jsonFile(cdfFile); if (jsonFile.is_open()) { json cdfGroups = json::parse(jsonFile); @@ -740,7 +740,7 @@ void IswaManager::addCdfFiles(std::string cdfpath) { } } else { - LWARNING(fmt::format("{} is not a cdf file or can't be found", cdf)); + LWARNING(fmt::format("{} is not a cdf file or can't be found", cdfFile)); } } diff --git a/modules/space/rendering/renderablefluxnodes.cpp b/modules/space/rendering/renderablefluxnodes.cpp index 55054ff565..74055f818f 100644 --- a/modules/space/rendering/renderablefluxnodes.cpp +++ b/modules/space/rendering/renderablefluxnodes.cpp @@ -155,11 +155,6 @@ namespace { "Skipping Nodes By Radius", "Select nodes to skip depending on Radius." }; - constexpr openspace::properties::Property::PropertyInfo DistanceplanetInfo = { - "Distanceplanet", - "Distance Planet", - "Deciding what planet to check distance to." - }; constexpr openspace::properties::Property::PropertyInfo DistanceThresholdInfo = { "DistancePlanetThreshold", "Threshold for distance between planet", @@ -170,11 +165,6 @@ namespace { "Earths Proximity Nodes Size", "Changes size of nodes only close to earth." }; - constexpr openspace::properties::Property::PropertyInfo MisalignedIndexInfo = { - "MisalignedIndex", - "Index to shift sequence number", - "The misalignment number for sequence for fluxnodes vs Fieldlines" - }; constexpr openspace::properties::Property::PropertyInfo MaxNodeDistanceSizeInfo = { "MaxNodeDistanceSize", "Max Node Distance Size", @@ -248,42 +238,43 @@ documentation::Documentation RenderableFluxNodes::Documentation() { RenderableFluxNodes::RenderableFluxNodes(const ghoul::Dictionary& dictionary) : Renderable(dictionary) + , _earthdistGroup({ "Earthfocus" }) , _goesEnergyBins(GoesEnergyBinsInfo, properties::OptionProperty::DisplayType::Radio) , _styleGroup({ "Style" }) , _colorMode(ColorModeInfo, properties::OptionProperty::DisplayType::Radio) - , _scalingMethod(ScalingmethodInfo, properties::OptionProperty::DisplayType::Radio) - , _nodeskipMethod(NodeskipMethodInfo, properties::OptionProperty::DisplayType::Radio) , _streamColor( StreamColorInfo, glm::vec4(0.96f, 0.88f, 0.8f, 1.f), glm::vec4(0.f), - glm::vec4(1.f)) - , _streamGroup({ "Streams" }) - , _nodesAmountGroup({ "NodeGroup" }) - , _nodeSize(NodeSizeInfo, 2.f, 1.f, 10.f) + glm::vec4(1.f) + ) , _colorTablePath(ColorTablePathInfo) , _colorTableRange(colorTableRangeInfo, { -2.f, 4.f }, { -8.f, -8.f }, { 8.f, 8.f }) - , _domainZ(DomainZInfo, { -2.5f, 2.5f }, { -2.5f, -2.5f }, { 2.5f, 2.5f}) , _fluxColorAlpha(FluxColorAlphaInfo, 1.f, 0.f, 1.f) + , _streamGroup({ "Streams" }) + , _scalingMethod(ScalingmethodInfo, properties::OptionProperty::DisplayType::Radio) + , _nodesAmountGroup({ "NodeGroup" }) + , _nodeSize(NodeSizeInfo, 2.f, 1.f, 10.f) + , _distanceThreshold(DistanceThresholdInfo, 0.f, 0.f, 1.f) + , _proximityNodesSize(ProximityNodesSizeInfo, 1.f, 0.f, 100.f) + , _maxNodeDistanceSize(MaxNodeDistanceSizeInfo, 1.f, 1.f, 10.f) + , _minMaxNodeSize(MinMaxNodeSizeInfo, { 2.f, 30.f }, { 1.f, 1.f }, { 10.f, 200.f }) + , _domainZ(DomainZInfo, { -2.5f, 2.5f }, { -2.5f, -2.5f }, { 2.5f, 2.5f }) , _thresholdFlux(ThresholdFluxInfo, -1.5f, -50.f, 10.f) , _filteringLower(FilteringInfo, 0.f, 0.f, 5.f) , _filteringUpper(FilteringUpperInfo, 5.f, 0.f, 5.f) , _amountofNodes(AmountofNodesInfo, 1, 1, 100) + , _nodeskipMethod(NodeskipMethodInfo, properties::OptionProperty::DisplayType::Radio) , _defaultNodeSkip(DefaultNodeSkipInfo, 1, 1, 100) - , _earthNodeSkip(EarthNodeSkipInfo, 1, 1, 100) , _fluxNodeskipThreshold(FluxNodeskipThresholdInfo, 0, -20, 10) + , _earthNodeSkip(EarthNodeSkipInfo, 1, 1, 100) , _radiusNodeSkipThreshold(RadiusNodeSkipThresholdInfo, 0.f, 0.f, 5.f) - , _earthdistGroup({ "Earthfocus" }) - , _distanceThreshold(DistanceThresholdInfo, 0.f, 0.f, 1.f) - , _proximityNodesSize(ProximityNodesSizeInfo, 1.f, 0.f, 100.f) - , _maxNodeDistanceSize(MaxNodeDistanceSizeInfo, 1.f, 1.f, 10.f) + , _cameraPerspectiveGroup({ "CameraPerspective" }) , _cameraPerspectiveEnabled(CameraPerspectiveEnabledInfo, false) , _drawingCircles(DrawingCirclesInfo, true) - , _cameraPerspectiveGroup({ "CameraPerspective" }) , _drawingHollow(DrawingHollowInfo, false) , _gaussianAlphaFilter(GaussiandAlphaFilterInfo, false) , _perspectiveDistanceFactor(PerspectiveDistanceFactorInfo, 2.67f, 1.f, 20.f) - , _minMaxNodeSize(MinMaxNodeSizeInfo, {2.f, 30.f}, {1.f, 1.f}, {10.f, 200.f}) , _pulseEnabled(pulseEnabledInfo, false) , _gaussianPulseEnabled(gaussianPulseEnabledInfo, false) { @@ -528,10 +519,6 @@ bool RenderableFluxNodes::isReady() const { } void RenderableFluxNodes::populateStartTimes() { - // number of characters in UTC ISO8601 format (without additional Z) - // 'YYYY-MM-DDTHH-MM-SS-XXX' - constexpr const int timeFormatSize = 23; - std::string timeFile; std::string fileType; for (const std::string& filePath : _binarySourceFiles) { @@ -641,10 +628,7 @@ void RenderableFluxNodes::render(const RenderData& data, RendererTasks&) { const glm::dmat4 rotMat = glm::dmat4(data.modelTransform.rotation); const glm::dmat4 modelMat = glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * - rotMat * - glm::dmat4(glm::scale( - glm::dmat4(1.0), data.modelTransform.scale - )); + rotMat * glm::scale(glm::dmat4(1.0), data.modelTransform.scale); const glm::dmat4 modelViewMat = data.camera.combinedViewMatrix() * modelMat; _shaderProgram->setUniform("modelViewProjection", @@ -812,7 +796,7 @@ void RenderableFluxNodes::updatePositionBuffer() { glEnableVertexAttribArray(0); glEnable(GL_PROGRAM_POINT_SIZE); - glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, 0); + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, 0, nullptr); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); @@ -830,7 +814,7 @@ void RenderableFluxNodes::updateVertexColorBuffer() { ); glEnableVertexAttribArray(1); - glVertexAttribPointer(1, 1, GL_FLOAT, GL_FALSE, 0, 0); + glVertexAttribPointer(1, 1, GL_FLOAT, GL_FALSE, 0, nullptr); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); @@ -848,7 +832,7 @@ void RenderableFluxNodes::updateVertexFilteringBuffer() { ); glEnableVertexAttribArray(2); - glVertexAttribPointer(2, 1, GL_FLOAT, GL_FALSE, 0, 0); + glVertexAttribPointer(2, 1, GL_FLOAT, GL_FALSE, 0, nullptr); glBindBuffer(GL_ARRAY_BUFFER, 0); glBindVertexArray(0); diff --git a/modules/space/rendering/renderablefluxnodes.h b/modules/space/rendering/renderablefluxnodes.h index bd8cd7965b..5e85dd24f2 100644 --- a/modules/space/rendering/renderablefluxnodes.h +++ b/modules/space/rendering/renderablefluxnodes.h @@ -100,8 +100,7 @@ private: nodeSkipFluxThreshold, nodeSkipRadiusThreshold, fluxColorAlpha, earthPos, distanceThreshold, time, maxNodeDistanceSize, usingCameraPerspective, drawCircles, drawHollow, useGaussian, perspectiveDistanceFactor, minMaxNodeSize, - usingPulse, usingGaussianPulse) - _uniformCache; + usingPulse, usingGaussianPulse) _uniformCache; std::filesystem::path _binarySourceFolderPath; @@ -121,8 +120,6 @@ private: GLuint _vertexColorBuffer = 0; // OpenGL Vertex Buffer Object containing the positions to filter the nodes GLuint _vertexFilteringBuffer = 0; - // OpenGL Vertex Buffer Object containing the index of nodes - GLuint _vertexindexBuffer = 0; std::unique_ptr _shaderProgram; diff --git a/modules/space/rendering/renderablehabitablezone.cpp b/modules/space/rendering/renderablehabitablezone.cpp index 3933b32ce6..e17643090b 100644 --- a/modules/space/rendering/renderablehabitablezone.cpp +++ b/modules/space/rendering/renderablehabitablezone.cpp @@ -40,8 +40,6 @@ #include namespace { - constexpr const char* _loggerCat = "RenderableHabitableZone"; - constexpr const std::array UniformNames = { "modelViewProjectionTransform", "opacity", "width", "transferFunctionTexture", "conservativeBounds", "showOptimistic" diff --git a/modules/space/rendering/renderableorbitalkepler.cpp b/modules/space/rendering/renderableorbitalkepler.cpp index 6ac142722c..eb1cc5034e 100644 --- a/modules/space/rendering/renderableorbitalkepler.cpp +++ b/modules/space/rendering/renderableorbitalkepler.cpp @@ -45,7 +45,6 @@ #include namespace { - constexpr const char* _loggerCat = "OrbitalKepler"; constexpr const char* ProgramName = "OrbitalKepler"; // Fragile! Keep in sync with documentation diff --git a/modules/space/rendering/renderabletravelspeed.cpp b/modules/space/rendering/renderabletravelspeed.cpp index e49b8daf17..0fc22fe23d 100644 --- a/modules/space/rendering/renderabletravelspeed.cpp +++ b/modules/space/rendering/renderabletravelspeed.cpp @@ -37,8 +37,6 @@ #include namespace { - constexpr const char* _loggerCat = "renderableTravelSpeed"; - constexpr const std::array UniformNames = {"lineColor", "opacity"}; constexpr openspace::properties::Property::PropertyInfo SpeedInfo = { @@ -126,9 +124,9 @@ RenderableTravelSpeed::RenderableTravelSpeed(const ghoul::Dictionary& dictionary ) , _indicatorLength(IndicatorLengthInfo, 1, 1, 360) , _fadeLength(FadeLengthInfo, 1, 0, 360) - , _lineColor(LineColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f)) - , _opacity(LineOpacityInfo, 1.f, 0.f, 1.f) , _lineWidth(LineWidthInfo, 2.f, 1.f, 20.f) + , _opacity(LineOpacityInfo, 1.f, 0.f, 1.f) + , _lineColor(LineColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f)) { const Parameters p = codegen::bake(dictionary); setRenderBin(RenderBin::Overlay); diff --git a/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp b/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp index dbe9064322..baf9843b89 100644 --- a/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp @@ -38,8 +38,6 @@ #include namespace { - constexpr const char* _loggerCat = "RenderableModelProjection"; - constexpr const char* DestinationFrame = "GALACTIC"; constexpr const std::array MainUniformNames = { diff --git a/modules/sync/syncmodule.cpp b/modules/sync/syncmodule.cpp index f73c96dc59..a9e519394b 100644 --- a/modules/sync/syncmodule.cpp +++ b/modules/sync/syncmodule.cpp @@ -44,10 +44,6 @@ #include "syncmodule_lua.inl" namespace { - constexpr const char* KeyHttpSynchronizationRepositories = - "HttpSynchronizationRepositories"; - constexpr const char* KeySynchronizationRoot = "SynchronizationRoot"; - struct [[codegen::Dictionary(SyncModule)]] Parameters { // The list of all repository URLs that are used to fetch data from for // HTTPSynchronizations diff --git a/modules/sync/syncs/httpsynchronization.cpp b/modules/sync/syncs/httpsynchronization.cpp index ded9c93f63..be69996846 100644 --- a/modules/sync/syncs/httpsynchronization.cpp +++ b/modules/sync/syncs/httpsynchronization.cpp @@ -35,9 +35,6 @@ namespace { constexpr const char* TempSuffix = ".tmp"; - constexpr const char* QueryKeyIdentifier = "identifier"; - constexpr const char* QueryKeyFileVersion = "file_version"; - constexpr const char* QueryKeyApplicationVersion = "application_version"; constexpr const int ApplicationVersion = 1; struct [[codegen::Dictionary(HttpSynchronization)]] Parameters { diff --git a/modules/volume/rawvolumereader.inl b/modules/volume/rawvolumereader.inl index 59988317a2..784adaa99f 100644 --- a/modules/volume/rawvolumereader.inl +++ b/modules/volume/rawvolumereader.inl @@ -104,7 +104,7 @@ std::unique_ptr> RawVolumeReader::read(bool inve std::unique_ptr> newVolume = std::make_unique>(dims); - for (int i = 0; i < volume->nCells(); ++i) { + for (size_t i = 0; i < volume->nCells(); ++i) { const glm::uvec3& coords = volume->indexToCoords(i); glm::uvec3 newcoords = glm::uvec3(coords.x, coords.y, dims.z - coords.z - 1); diff --git a/modules/volume/textureslicevolumereader.inl b/modules/volume/textureslicevolumereader.inl index a07dc6cb31..e00c579881 100644 --- a/modules/volume/textureslicevolumereader.inl +++ b/modules/volume/textureslicevolumereader.inl @@ -82,8 +82,10 @@ TextureSliceVolumeReader::getSlice(int sliceIndex) const std::shared_ptr texture = ghoul::io::TextureReader::ref().loadTexture(_paths[sliceIndex], 2); - glm::ivec2 dimensions = glm::uvec2(texture->dimensions()); - ghoul_assert(dimensions == _sliceDimensions, "Slice dimensions do not agree."); + ghoul_assert( + glm::ivec2(texture->dimensions()) == _sliceDimensions, + "Slice dimensions do not agree" + ); _cache.set(sliceIndex, std::move(texture)); } return *_cache.get(sliceIndex).get(); diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 80aaeb84ba..6147cac6d0 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -740,7 +740,6 @@ void OpenSpaceEngine::loadAssets() { _loadingScreen->setPhase(LoadingScreen::Phase::Construction); _loadingScreen->postMessage("Loading assets"); - bool loading = true; while (true) { _loadingScreen->render(); _assetManager->update(); @@ -756,16 +755,16 @@ void OpenSpaceEngine::loadAssets() { if (sync->isSyncing()) { LoadingScreen::ProgressInfo progressInfo; - progressInfo.progress = [](const ResourceSynchronization* sync) { - if (!sync->nTotalBytesIsKnown()) { + progressInfo.progress = [](const ResourceSynchronization* s) { + if (!s->nTotalBytesIsKnown()) { return 0.f; } - if (sync->nTotalBytes() == 0) { + if (s->nTotalBytes() == 0) { return 1.f; } return - static_cast(sync->nSynchronizedBytes()) / - static_cast(sync->nTotalBytes()); + static_cast(s->nSynchronizedBytes()) / + static_cast(s->nTotalBytes()); }(sync); _loadingScreen->updateItem( @@ -801,7 +800,6 @@ void OpenSpaceEngine::loadAssets() { break; } - loading = false; auto it = allSyncs.begin(); while (it != allSyncs.end()) { if ((*it)->isSyncing()) { @@ -824,7 +822,6 @@ void OpenSpaceEngine::loadAssets() { progressInfo.totalSize = (*it)->nTotalBytes(); } - loading = true; _loadingScreen->updateItem( (*it)->identifier(), (*it)->name(), diff --git a/src/interaction/actionmanager.cpp b/src/interaction/actionmanager.cpp index 6a70bc3b05..6ad8f27df7 100644 --- a/src/interaction/actionmanager.cpp +++ b/src/interaction/actionmanager.cpp @@ -33,10 +33,6 @@ #include "actionmanager_lua.inl" -namespace { - constexpr const char* _loggerCat = "ActionManager"; -} // namespace - namespace openspace::interaction { bool ActionManager::hasAction(const std::string& identifier) const { @@ -76,7 +72,7 @@ const Action& ActionManager::action(const std::string& identifier) const { std::vector ActionManager::actions() const { std::vector result; result.reserve(_actions.size()); - for (const std::pair& p : _actions) { + for (const std::pair& p : _actions) { result.push_back(p.second); } return result; diff --git a/src/interaction/keybindingmanager.cpp b/src/interaction/keybindingmanager.cpp index 6acdf2ea36..3e1645443d 100644 --- a/src/interaction/keybindingmanager.cpp +++ b/src/interaction/keybindingmanager.cpp @@ -35,10 +35,6 @@ #include "keybindingmanager_lua.inl" -namespace { - constexpr const char* _loggerCat = "KeyBindingManager"; -} // namespace - namespace openspace::interaction { KeybindingManager::KeybindingManager() diff --git a/src/navigation/navigationhandler.cpp b/src/navigation/navigationhandler.cpp index dcd746c604..39aa4bbf65 100644 --- a/src/navigation/navigationhandler.cpp +++ b/src/navigation/navigationhandler.cpp @@ -55,8 +55,6 @@ namespace { constexpr const char* _loggerCat = "NavigationHandler"; - const double Epsilon = 1E-7; - using namespace openspace; constexpr const properties::Property::PropertyInfo KeyDisableMouseInputInfo = { "DisableMouseInputs", diff --git a/src/navigation/pathcurve.cpp b/src/navigation/pathcurve.cpp index 79c1f14a18..e8f8eb0368 100644 --- a/src/navigation/pathcurve.cpp +++ b/src/navigation/pathcurve.cpp @@ -35,7 +35,6 @@ #include namespace { - constexpr const char* _loggerCat = "PathCurve"; constexpr const int NrSamplesPerSegment = 100; } // namespace diff --git a/src/navigation/waypoint.cpp b/src/navigation/waypoint.cpp index 48a6a68329..4c29170702 100644 --- a/src/navigation/waypoint.cpp +++ b/src/navigation/waypoint.cpp @@ -90,7 +90,7 @@ double Waypoint::validBoundingSphere() const { } double Waypoint::findValidBoundingSphere(const SceneGraphNode* node) { - double bs = static_cast(node->boundingSphere()); + double bs = node->boundingSphere(); const double minValidBoundingSphere = global::navigationHandler->pathNavigator().minValidBoundingSphere(); @@ -101,7 +101,7 @@ double Waypoint::findValidBoundingSphere(const SceneGraphNode* node) { // Alsp. the chance to find a bounding sphere that represents the visual size of // the target well is higher for these nodes for (SceneGraphNode* child : node->children()) { - bs = static_cast(child->boundingSphere()); + bs = child->boundingSphere(); if (bs > minValidBoundingSphere) { LWARNING(fmt::format( "The scene graph node '{}' has no, or a very small, bounding sphere. " diff --git a/src/rendering/texturecomponent.cpp b/src/rendering/texturecomponent.cpp index f447169119..317d7c68eb 100644 --- a/src/rendering/texturecomponent.cpp +++ b/src/rendering/texturecomponent.cpp @@ -112,7 +112,7 @@ void TextureComponent::loadFromFile(const std::filesystem::path& path) { void TextureComponent::update() { if (_fileIsDirty) { - loadFromFile(_textureFile->path()), _nDimensions; + loadFromFile(_textureFile->path()); } if (_textureIsDirty) { diff --git a/src/scene/assetmanager.cpp b/src/scene/assetmanager.cpp index 935ebb4d0f..06a6c61cd8 100644 --- a/src/scene/assetmanager.cpp +++ b/src/scene/assetmanager.cpp @@ -629,8 +629,7 @@ void AssetManager::setUpAssetLuaTable(Asset* asset) { exportName = identifier; targetLocation = 1; } - - if (n == 2) { + else if (n == 2) { exportName = ghoul::lua::value( L, 1, @@ -654,6 +653,9 @@ void AssetManager::setUpAssetLuaTable(Asset* asset) { } } } + else { + throw ghoul::MissingCaseException(); + } lua_rawgeti(L, LUA_REGISTRYINDEX, manager->_assetsTableRef); diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp index 6afce70cf0..dc0eb9ad36 100644 --- a/src/scene/scene.cpp +++ b/src/scene/scene.cpp @@ -652,17 +652,17 @@ void Scene::propertyPushProfileValueToLua(ghoul::lua::LuaState& L, ProfilePropertyLua elem = propertyProcessValue(L, value); if (!_valueIsTable) { std::visit(overloaded{ - [&L](const bool value) { - ghoul::lua::push(L, value); + [&L](bool v) { + ghoul::lua::push(L, v); }, - [&L](const float value) { - ghoul::lua::push(L, value); + [&L](float v) { + ghoul::lua::push(L, v); }, - [&L](const std::string value) { - ghoul::lua::push(L, value); + [&L](const std::string& v) { + ghoul::lua::push(L, v); }, - [&L](const ghoul::lua::nil_t nilValue) { - ghoul::lua::push(L, nilValue); + [&L](ghoul::lua::nil_t v) { + ghoul::lua::push(L, v); } }, elem); } diff --git a/src/util/planegeometry.cpp b/src/util/planegeometry.cpp index fb1873bbda..bef8ca990e 100644 --- a/src/util/planegeometry.cpp +++ b/src/util/planegeometry.cpp @@ -27,10 +27,6 @@ #include #include -namespace { - constexpr const char* _loggerCat = "PlaneGeometry"; -} // namespace - namespace openspace { PlaneGeometry::PlaneGeometry(glm::vec2 size) : _size(std::move(size)) {} diff --git a/src/util/task.cpp b/src/util/task.cpp index 26918b0aff..713ba28ae8 100644 --- a/src/util/task.cpp +++ b/src/util/task.cpp @@ -55,4 +55,3 @@ std::unique_ptr Task::createFromDictionary(const ghoul::Dictionary& dictio } } // namespace openspace -\ diff --git a/support/cmake/set_openspace_compile_settings.cmake b/support/cmake/set_openspace_compile_settings.cmake index 6aa9f26290..6a1ffc3e70 100644 --- a/support/cmake/set_openspace_compile_settings.cmake +++ b/support/cmake/set_openspace_compile_settings.cmake @@ -175,6 +175,7 @@ function (set_openspace_compile_settings target) "-Wzero-length-array" "-Wno-missing-braces" "-Wno-ignored-attributes" + "-Wno-unknown-attributes" ) if (OPENSPACE_WARNINGS_AS_ERRORS) set(CLANG_WARNINGS ${CLANG_WARNINGS} "-Werror") diff --git a/support/coding/codegen b/support/coding/codegen index ff569901b6..815e975020 160000 --- a/support/coding/codegen +++ b/support/coding/codegen @@ -1 +1 @@ -Subproject commit ff569901b6e6877c69029e22735796d2bc26b8b3 +Subproject commit 815e9750201a6bcf40b1b8768c88d4dc4ac9674a diff --git a/tests/test_assetloader.cpp b/tests/test_assetloader.cpp index 03c2ec3c98..7fa2ed5a8b 100644 --- a/tests/test_assetloader.cpp +++ b/tests/test_assetloader.cpp @@ -39,16 +39,6 @@ #include #include -class AssetLoaderTest; - -namespace { - int passTest(lua_State* state) { - bool* test = reinterpret_cast(lua_touserdata(state, lua_upvalueindex(1))); - *test = true; - return 0; - } -} // namespace - TEST_CASE("AssetLoader: Assertion", "[assetloader]") { openspace::Scene scene(std::make_unique()); ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState(); @@ -82,22 +72,3 @@ TEST_CASE("AssetLoader: Asset Functions", "[assetloader]") { CHECK_NOTHROW(assetLoader.add("assetfunctionsexist")); } - -//TEST_CASE("AssetLoader: Asset Initialization", "[assetloader]") { -// openspace::Scene scene(std::make_unique()); -// ghoul::lua::LuaState* state = openspace::global::scriptEngine->luaState(); -// openspace::SynchronizationWatcher syncWatcher; -// openspace::AssetManager assetLoader( -// state, -// absPath("${TESTDIR}/AssetLoaderTest/").string() -// ); -// -// bool passed; -// lua_pushlightuserdata(*state, &passed); -// lua_pushcclosure(*state, &passTest, 1); -// lua_setglobal(*state, "passTest"); -// -// std::shared_ptr asset = assetLoader.add("initialization"); -// REQUIRE_NOTHROW(asset->initialize()); -// REQUIRE(passed); -//} diff --git a/tests/test_profile.cpp b/tests/test_profile.cpp index 687c59d115..98f07c5692 100644 --- a/tests/test_profile.cpp +++ b/tests/test_profile.cpp @@ -153,16 +153,6 @@ namespace { return Profile(content); } - - /// Loads the contents of the file and returns the raw contents - std::string loadFile(const std::string& filename) { - std::ifstream f(absPath(filename)); - std::string content( - (std::istreambuf_iterator(f)), - std::istreambuf_iterator() - ); - return content; - } } // namespace //