From fbd4128b34ab9fe69f6ef0fcc204fc89ce2c14e0 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 5 Jun 2025 10:59:58 +0200 Subject: [PATCH] Pass through the coding styles --- apps/OpenSpace/main.cpp | 5 +- include/openspace/events/event.h | 4 +- .../interaction/sessionrecordinghandler.h | 3 +- .../properties/numericalproperty.inl | 26 +++++++--- include/openspace/properties/property.h | 2 +- .../openspace/rendering/transferfunction.h | 2 +- include/openspace/scene/assetmanager.h | 5 +- include/openspace/scripting/scriptengine.h | 2 +- modules/base/basemodule.cpp | 4 +- .../dashboarditemtimevaryingtext.cpp | 2 +- .../grids/renderablesphericalgrid.cpp | 6 +-- .../rendering/renderabledistancelabel.cpp | 4 +- modules/base/rendering/renderableplane.cpp | 9 ++-- modules/base/rendering/renderableswitch.cpp | 4 +- modules/base/rendering/renderableswitch.h | 1 - .../base/rendering/screenspaceimageonline.cpp | 2 +- .../rendering/screenspaceinsetblackout.cpp | 48 +++++++++++-------- .../base/rendering/screenspaceinsetblackout.h | 2 +- .../screenspacetimevaryingimageonline.cpp | 7 +-- modules/base/scale/timelinescale.h | 2 +- modules/base/task/convertmodeltask.cpp | 4 +- modules/base/task/convertmodeltask.h | 6 +-- .../include/opensoundcontrolconnection.h | 2 +- .../opensoundcontrol/opensoundcontrolmodule.h | 2 +- modules/server/include/topics/errorlogtopic.h | 2 +- .../src/topics/flightcontrollertopic.cpp | 12 +++-- .../server/src/topics/subscriptiontopic.cpp | 2 +- modules/skybrowser/skybrowsermodule.cpp | 3 +- modules/space/kepler.cpp | 2 +- modules/space/kepler.h | 2 +- .../renderableconstellationbounds.cpp | 20 ++++++-- modules/space/timeframe/timeframekernel.cpp | 4 +- modules/space/timeframe/timeframekernel.h | 6 +-- modules/space/translation/gptranslation.cpp | 3 +- .../rendering/renderableplaneprojection.cpp | 9 ++-- .../include/general/anglemodetelemetry.h | 2 +- .../include/general/cameratelemetry.h | 2 +- .../include/general/focustelemetry.h | 2 +- .../include/general/nodestelemetry.h | 2 +- .../telemetry/include/general/timetelemetry.h | 2 +- .../specific/planetscomparesonification.h | 2 +- .../specific/planetsoverviewsonification.h | 2 +- .../include/specific/planetssonification.h | 6 +-- modules/telemetry/include/telemetrybase.h | 2 +- modules/telemetry/include/util.h | 2 +- .../src/general/anglemodetelemetry.cpp | 4 +- modules/telemetry/telemetrymodule.cpp | 3 +- modules/telemetry/telemetrymodule.h | 2 +- modules/webbrowser/include/browserclient.h | 4 +- modules/webbrowser/src/browserclient.cpp | 5 +- modules/webbrowser/src/eventhandler.cpp | 2 +- src/interaction/keybindingmanager_lua.inl | 2 +- .../sessionrecordinghandler_lua.inl | 3 +- src/navigation/path.cpp | 3 +- src/properties/property.cpp | 4 +- src/scene/scene.cpp | 16 ++++++- 56 files changed, 179 insertions(+), 112 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 7e84e5db3b..b9db56db6d 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -1480,7 +1480,10 @@ int main(int argc, char* argv[]) { config = launcher.selectedWindowConfig(); if (config.find(labelFromCfgFile) != std::string::npos) { if (config.find("sgct.config") == std::string::npos) { - config = config.substr(0, config.length() - labelFromCfgFile.length()); + config = config.substr( + 0, + config.length() - labelFromCfgFile.length() + ); } else { config = windowConfiguration; diff --git a/include/openspace/events/event.h b/include/openspace/events/event.h index 19311832d3..563e4c5a44 100644 --- a/include/openspace/events/event.h +++ b/include/openspace/events/event.h @@ -266,7 +266,7 @@ struct EventMissionAdded : public Event { /** * Creates an instance of an EventMissionAdded event. - * + * * \param identifier The identifier of the mission added */ EventMissionAdded(std::string_view identifier); @@ -310,7 +310,7 @@ struct EventPlanetEclipsed : public Event { /** * Creates an instance of an EventPlanetEclipsed event. - + * \param eclipsee_ The scene graph node that is eclipsed by another object * \param eclipser_ The scene graph node that is eclipsing the other object * diff --git a/include/openspace/interaction/sessionrecordinghandler.h b/include/openspace/interaction/sessionrecordinghandler.h index 3a92fe3c63..a3cc99fba9 100644 --- a/include/openspace/interaction/sessionrecordinghandler.h +++ b/include/openspace/interaction/sessionrecordinghandler.h @@ -106,7 +106,8 @@ public: * and all keyframes deleted from memory. * \param filename File saved with recorded keyframes */ - void stopRecording(const std::filesystem::path& filename, DataMode dataMode, bool overwrite = false); + void stopRecording(const std::filesystem::path& filename, DataMode dataMode, + bool overwrite = false); /** * Used to check if a session recording is in progress. diff --git a/include/openspace/properties/numericalproperty.inl b/include/openspace/properties/numericalproperty.inl index 9c053298c2..708cf9b224 100644 --- a/include/openspace/properties/numericalproperty.inl +++ b/include/openspace/properties/numericalproperty.inl @@ -62,7 +62,7 @@ T NumericalProperty::minValue() const { template void NumericalProperty::setMinValue(T value) { _minimumValue = std::move(value); - Property::notifyMetaDataChangeListeners(); + Property::notifyMetaDataChangeListeners(); } template @@ -73,7 +73,7 @@ T NumericalProperty::maxValue() const { template void NumericalProperty::setMaxValue(T value) { _maximumValue = std::move(value); - Property::notifyMetaDataChangeListeners(); + Property::notifyMetaDataChangeListeners(); } template @@ -84,7 +84,7 @@ T NumericalProperty::steppingValue() const { template void NumericalProperty::setSteppingValue(T value) { _stepping = std::move(value); - Property::notifyMetaDataChangeListeners(); + Property::notifyMetaDataChangeListeners(); } template @@ -127,10 +127,22 @@ void NumericalProperty::setExponent(float exponent) { template nlohmann::json NumericalProperty::generateAdditionalJsonDescription() const { nlohmann::json result = { - { MinimumValueKey, nlohmann::json::parse(luaToJson(ghoul::to_string(_minimumValue))) }, - { MaximumValueKey, nlohmann::json::parse(luaToJson(ghoul::to_string(_maximumValue))) }, - { SteppingValueKey, nlohmann::json::parse(luaToJson(ghoul::to_string(_stepping))) }, - { ExponentValueKey, nlohmann::json::parse(luaToJson(ghoul::to_string(_exponent))) } + { + MinimumValueKey, + nlohmann::json::parse(luaToJson(ghoul::to_string(_minimumValue))) + }, + { + MaximumValueKey, + nlohmann::json::parse(luaToJson(ghoul::to_string(_maximumValue))) + }, + { + SteppingValueKey, + nlohmann::json::parse(luaToJson(ghoul::to_string(_stepping))) + }, + { + ExponentValueKey, + nlohmann::json::parse(luaToJson(ghoul::to_string(_exponent))) + } }; return result; } diff --git a/include/openspace/properties/property.h b/include/openspace/properties/property.h index 5713729e55..230d7040c1 100644 --- a/include/openspace/properties/property.h +++ b/include/openspace/properties/property.h @@ -463,7 +463,7 @@ public: /** * Creates the information that is general to every Property and adds the - * `description`, `guiName`, `group`, `isReadOnly`, `needsConfirmation` `type`, + * `description`, `guiName`, `group`, `isReadOnly`, `needsConfirmation` `type`, * and `visibility` keys and their values. * * \return The base description common to all Property classes diff --git a/include/openspace/rendering/transferfunction.h b/include/openspace/rendering/transferfunction.h index 6f672a0548..1b0fe415c5 100644 --- a/include/openspace/rendering/transferfunction.h +++ b/include/openspace/rendering/transferfunction.h @@ -39,7 +39,7 @@ namespace openspace { class TransferFunction { public: using TfChangedCallback = std::function; - + explicit TransferFunction(const std::filesystem::path& filepath, TfChangedCallback tfChangedCallback = TfChangedCallback()); ~TransferFunction(); diff --git a/include/openspace/scene/assetmanager.h b/include/openspace/scene/assetmanager.h index bb10f252d0..45bcf91302 100644 --- a/include/openspace/scene/assetmanager.h +++ b/include/openspace/scene/assetmanager.h @@ -78,8 +78,9 @@ public: void remove(const std::string& path); /** - * Reloads the asset at the provided \p path as a new root asset of the AssetManager. If the - * asset at that path was not previously loaded, acts the same as the add function. + * Reloads the asset at the provided \p path as a new root asset of the AssetManager. + * If the asset at that path was not previously loaded, acts the same as the add + * function. * * \param path The path from which the Asset is loaded. This path can be either * relative to the base directory (the path starting with . or ..), an absolute diff --git a/include/openspace/scripting/scriptengine.h b/include/openspace/scripting/scriptengine.h index ce73d11f47..9a72e2fa53 100644 --- a/include/openspace/scripting/scriptengine.h +++ b/include/openspace/scripting/scriptengine.h @@ -110,7 +110,7 @@ public: void queueScript(Script script); void queueScript(std::string script); - // Runs the `script` every `timeout` seconds wallclock time + // Runs the `script` every `timeout` seconds wallclock time void registerRepeatedScript(std::string identifier, std::string script, double timeout, std::string preScript = "", std::string postScript = ""); void removeRepeatedScript(std::string_view identifier); diff --git a/modules/base/basemodule.cpp b/modules/base/basemodule.cpp index 17a83b2820..f37d0b9961 100644 --- a/modules/base/basemodule.cpp +++ b/modules/base/basemodule.cpp @@ -122,7 +122,9 @@ void BaseModule::internalInitialize(const ghoul::Dictionary&) { fSsRenderable->registerClass( "ScreenSpaceRenderableRenderable" ); - fSsRenderable->registerClass("ScreenSpaceTimeVaryingImageOnline"); + fSsRenderable->registerClass( + "ScreenSpaceTimeVaryingImageOnline" + ); ghoul::TemplateFactory* fDashboard = diff --git a/modules/base/dashboard/dashboarditemtimevaryingtext.cpp b/modules/base/dashboard/dashboarditemtimevaryingtext.cpp index f539715570..f23a730774 100644 --- a/modules/base/dashboard/dashboarditemtimevaryingtext.cpp +++ b/modules/base/dashboard/dashboarditemtimevaryingtext.cpp @@ -84,7 +84,7 @@ DashboardItemTimeVaryingText::DashboardItemTimeVaryingText( _formatString = p.formatString.value_or(_formatString); addProperty(_formatString); - + _dataFile.onChange([this]() { loadDataFromJson(_dataFile); }); _dataFile = p.dataFile.string(); addProperty(_dataFile); diff --git a/modules/base/rendering/grids/renderablesphericalgrid.cpp b/modules/base/rendering/grids/renderablesphericalgrid.cpp index ea5894d11e..d59b05aafb 100644 --- a/modules/base/rendering/grids/renderablesphericalgrid.cpp +++ b/modules/base/rendering/grids/renderablesphericalgrid.cpp @@ -82,9 +82,9 @@ namespace { // will always be given a radius of one meter. To change its size, use a `Scale` // transform, such as the [StaticScale](#base_transform_scale_static). // - // The grid may be split up into equal segments in both directions using the `Segments` - // parameter, or different number of segments in the latitudal and longtudal direction - // using the `LatSegments` and `LongSegments` parameters. + // The grid may be split up into equal segments in both directions using the + // `Segments` parameter, or different number of segments in the latitudal and + // longtudal direction using the `LatSegments` and `LongSegments` parameters. struct [[codegen::Dictionary(RenderableSphericalGrid)]] Parameters { // [[codegen::verbatim(ColorInfo.description)]] std::optional color [[codegen::color()]]; diff --git a/modules/base/rendering/renderabledistancelabel.cpp b/modules/base/rendering/renderabledistancelabel.cpp index a9c81ad198..b695c9a09a 100644 --- a/modules/base/rendering/renderabledistancelabel.cpp +++ b/modules/base/rendering/renderabledistancelabel.cpp @@ -167,7 +167,9 @@ void RenderableDistanceLabel::update(const UpdateData&) { // Get distance as string const double convertedDistance = convertMeters(nodeline->distance(), unit); - std::string distanceText = std::format("{:.{}f}", convertedDistance, _precision.value()); + std::string distanceText = std::format( + "{:.{}f}", convertedDistance, _precision.value() + ); // Create final label text and set it const std::string finalText = std::format("{} {}", distanceText, unitDescriptor); diff --git a/modules/base/rendering/renderableplane.cpp b/modules/base/rendering/renderableplane.cpp index e57aa6f94f..7934970c16 100644 --- a/modules/base/rendering/renderableplane.cpp +++ b/modules/base/rendering/renderableplane.cpp @@ -224,9 +224,12 @@ RenderablePlane::DistanceScalingSettings::DistanceScalingSettings( const Parameters::DistanceScalingSettings settings = *p.distanceScalingSettings; scaleByDistance = settings.scaleByDistance.value_or(scaleByDistance); - apparentSizeMultiplier = settings.apparentSizeMultiplier.value_or(apparentSizeMultiplier); - scaleByDistanceMaxHeight = settings.scaleByDistanceMaxHeight.value_or(scaleByDistanceMaxHeight); - scaleByDistanceMinHeight = settings.scaleByDistanceMinHeight.value_or(scaleByDistanceMinHeight); + apparentSizeMultiplier = + settings.apparentSizeMultiplier.value_or(apparentSizeMultiplier); + scaleByDistanceMaxHeight = + settings.scaleByDistanceMaxHeight.value_or(scaleByDistanceMaxHeight); + scaleByDistanceMinHeight = + settings.scaleByDistanceMinHeight.value_or(scaleByDistanceMinHeight); } addProperty(scaleByDistance); diff --git a/modules/base/rendering/renderableswitch.cpp b/modules/base/rendering/renderableswitch.cpp index 1022f1aa17..1d4dbc0e9c 100644 --- a/modules/base/rendering/renderableswitch.cpp +++ b/modules/base/rendering/renderableswitch.cpp @@ -46,10 +46,10 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; - // A RenderableSwitch can be used to render one of two renderables depending on the + // A RenderableSwitch can be used to render one of two renderables depending on the // distance between the camera and the object's position. // - // The two renderables are specified separately: `RenderableNear` and `RenderableFar`. + // The two renderables are specified separately: `RenderableNear` and `RenderableFar`. // These can be any renderable types. // // The `DistanceThreshold` property determines which renderable will be shown. diff --git a/modules/base/rendering/renderableswitch.h b/modules/base/rendering/renderableswitch.h index 597236c888..48b8eda97d 100644 --- a/modules/base/rendering/renderableswitch.h +++ b/modules/base/rendering/renderableswitch.h @@ -55,7 +55,6 @@ protected: ghoul::mm_unique_ptr _renderableNear; ghoul::mm_unique_ptr _renderableFar; - }; } // namespace openspace diff --git a/modules/base/rendering/screenspaceimageonline.cpp b/modules/base/rendering/screenspaceimageonline.cpp index b0ff9527fa..76eb5dd421 100644 --- a/modules/base/rendering/screenspaceimageonline.cpp +++ b/modules/base/rendering/screenspaceimageonline.cpp @@ -144,7 +144,7 @@ void ScreenSpaceImageOnline::update() { _textureIsDirty = false; LERRORC(e.component, e.message); } - } + } } std::future ScreenSpaceImageOnline::downloadImageToMemory( diff --git a/modules/base/rendering/screenspaceinsetblackout.cpp b/modules/base/rendering/screenspaceinsetblackout.cpp index b46190a416..583dc15236 100644 --- a/modules/base/rendering/screenspaceinsetblackout.cpp +++ b/modules/base/rendering/screenspaceinsetblackout.cpp @@ -198,44 +198,44 @@ namespace { openspace::properties::Property::Visibility::Developer }; - // A ScreenSpaceInsetBlackout can be used to render a screen-space shape used to - // black out part of the rendering. This can be useful in a dome environment where - // you have a secondary presentation projector that can project on the dome surface. + // A ScreenSpaceInsetBlackout can be used to render a screen-space shape used to + // black out part of the rendering. This can be useful in a dome environment where + // you have a secondary presentation projector that can project on the dome surface. // The blackout is used to avoid overlapping rendering between the dome projectors // and the presentation projector. struct [[codegen::Dictionary(ScreenSpaceInsetBlackout)]] Parameters { struct BlackoutShape { - // List of corner positions for the blackout shape. The order of - // corner points are Top-Left, Top-Right, Bottom-Right, Bottom-Left with the - // range of 0 to 1 for `{X,Y}`, where `{0,1}` is the Top-Left corner and + // List of corner positions for the blackout shape. The order of + // corner points are Top-Left, Top-Right, Bottom-Right, Bottom-Left with the + // range of 0 to 1 for `{X,Y}`, where `{0,1}` is the Top-Left corner and // `{1,0}` is the Bottom-Right corner. std::vector corners; - // List of points between the Top-Left and Top-Right corners that will be - // used to define top spline of the blackout shape. Each point is specified - // in the range of 0 to 1, where `{0,1}` is the Top-Left corner and `{1,1}` + // List of points between the Top-Left and Top-Right corners that will be + // used to define top spline of the blackout shape. Each point is specified + // in the range of 0 to 1, where `{0,1}` is the Top-Left corner and `{1,1}` // is the Top-Right corner. std::optional> top; - // List of points between the Bottom-Right and Bottom-Left corners that will - // be used to define bottom spline of the blackout shape. Each point is - // specified in the range of 0 to 1, where `{1,0}` is the Bottom-Right + // List of points between the Bottom-Right and Bottom-Left corners that will + // be used to define bottom spline of the blackout shape. Each point is + // specified in the range of 0 to 1, where `{1,0}` is the Bottom-Right // corner and `{0,0}` is the Bottom-Left corner. std::optional> bottom; - // List of points between the Bottom-Left and Top-Left corners that will be - // used to define left spline of the blackout shape. Each point is specified - // in the range of 0 to 1, where `{0,0}` is the Bottom-Left corner and + // List of points between the Bottom-Left and Top-Left corners that will be + // used to define left spline of the blackout shape. Each point is specified + // in the range of 0 to 1, where `{0,0}` is the Bottom-Left corner and // `{0,1}` is the Top-Left corner. std::optional> left; - // List of points between the Top-Right and Bottom-Right corners that will - // be used to define right spline of the blackout shape. Each point is - // specified in the range of 0 to 1, where `{1,1}` is the Top-Right corner + // List of points between the Top-Right and Bottom-Right corners that will + // be used to define right spline of the blackout shape. Each point is + // specified in the range of 0 to 1, where `{1,1}` is the Top-Right corner // and `{1,0}` is the Bottom-Right corner. std::optional> right; - // File path for the texture that should be used when displaying the + // File path for the texture that should be used when displaying the // calibration grid. std::optional calibrationTexturePath; }; @@ -280,7 +280,12 @@ ScreenSpaceInsetBlackout::BlackoutShape::Spline::Spline(std::vector& std::string baseString) : properties::PropertyOwner({ baseString , baseString, "" }) , data(inData) - , newPointPosition(NewPointPositionInfo, glm::vec2(0.f), glm::vec2(0.f), glm::vec2(1.f)) + , newPointPosition( + NewPointPositionInfo, + glm::vec2(0.f), + glm::vec2(0.f), + glm::vec2(1.f) + ) , addSelector(AddSelectorInfo) , addButton(AddControlPointInfo) , removeSelector(RemoveSelectorInfo) @@ -362,7 +367,8 @@ ScreenSpaceInsetBlackout::BlackoutShape::Corners::Corners(std::vector } } -ScreenSpaceInsetBlackout::BlackoutShape::BlackoutShape(const ghoul::Dictionary& dictionary) +ScreenSpaceInsetBlackout::BlackoutShape::BlackoutShape( + const ghoul::Dictionary& dictionary) : properties::PropertyOwner({ "BlackoutShape", "Blackout Shape", "" }) , enableCalibrationColor(CalibrationColorInfo, false) , enableCalibrationPattern(CalibrationPatternInfo, false) diff --git a/modules/base/rendering/screenspaceinsetblackout.h b/modules/base/rendering/screenspaceinsetblackout.h index df817e21ec..3ca71e64b8 100644 --- a/modules/base/rendering/screenspaceinsetblackout.h +++ b/modules/base/rendering/screenspaceinsetblackout.h @@ -84,7 +84,7 @@ private: /// Selects which point to remove properties::OptionProperty removeSelector; /// Removes a point - properties::TriggerProperty removeButton; + properties::TriggerProperty removeButton; }; class Corners : public properties::PropertyOwner { diff --git a/modules/base/rendering/screenspacetimevaryingimageonline.cpp b/modules/base/rendering/screenspacetimevaryingimageonline.cpp index f89bba7a39..00cc5f7bcb 100644 --- a/modules/base/rendering/screenspacetimevaryingimageonline.cpp +++ b/modules/base/rendering/screenspacetimevaryingimageonline.cpp @@ -41,7 +41,8 @@ namespace { constexpr openspace::properties::Property::PropertyInfo FileInfo = { "FilePath", "File Path", - "The file path to the data containing information about when to display which image.", + "The file path to the data containing information about when to display which " + "image.", openspace::properties::Property::Visibility::User }; @@ -129,7 +130,7 @@ void ScreenSpaceTimeVaryingImageOnline::computeSequenceEndTime() { if (_timestamps.size() <= 1) { return; } - + double first = _timestamps.front(); double last = _timestamps.back(); double avg = (last - first) / static_cast(_timestamps.size() - 1); @@ -224,7 +225,7 @@ void ScreenSpaceTimeVaryingImageOnline::loadImage(const std::string& imageUrl) { if (_imageFuture.valid()) { return; } - + _imageFuture = global::downloadManager->fetchFile( imageUrl, [](const DownloadManager::MemoryFile&) {}, diff --git a/modules/base/scale/timelinescale.h b/modules/base/scale/timelinescale.h index 224c943fe6..f264281118 100644 --- a/modules/base/scale/timelinescale.h +++ b/modules/base/scale/timelinescale.h @@ -52,4 +52,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_MODULE_BASE___TIMELINETRANSLATION___H__ +#endif // __OPENSPACE_MODULE_BASE___TIMELINESCALE___H__ diff --git a/modules/base/task/convertmodeltask.cpp b/modules/base/task/convertmodeltask.cpp index 6288ce7d3b..a39724d713 100644 --- a/modules/base/task/convertmodeltask.cpp +++ b/modules/base/task/convertmodeltask.cpp @@ -33,10 +33,10 @@ namespace { // proprietary format that can be loaded more efficiently, but more important can be // distributed without violating terms of service for various 3D model hosting // websites. - // + // // The resulting output file can be used everywhere in OpenSpace in place of the // source material. - // + // // The list of supported files can be found here: // https://github.com/assimp/assimp/blob/master/doc/Fileformats.md struct [[codegen::Dictionary(ConvertModelTask)]] Parameters { diff --git a/modules/base/task/convertmodeltask.h b/modules/base/task/convertmodeltask.h index 289651f1c0..d481b0e19d 100644 --- a/modules/base/task/convertmodeltask.h +++ b/modules/base/task/convertmodeltask.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___CONVERTMODELTASK___H__ -#define __OPENSPACE_CORE___CONVERTMODELTASK___H__ +#ifndef __OPENSPACE_MODULE_BASE___CONVERTMODELTASK___H__ +#define __OPENSPACE_MODULE_BASE___CONVERTMODELTASK___H__ #include @@ -49,4 +49,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_CORE___CONVERTMODELTASK___H__ +#endif // __OPENSPACE_MODULE_BASE___CONVERTMODELTASK___H__ diff --git a/modules/opensoundcontrol/include/opensoundcontrolconnection.h b/modules/opensoundcontrol/include/opensoundcontrolconnection.h index 666a5feb1c..c2a76ae6fa 100644 --- a/modules/opensoundcontrol/include/opensoundcontrolconnection.h +++ b/modules/opensoundcontrol/include/opensoundcontrolconnection.h @@ -50,4 +50,4 @@ private: } // namespace openspace -#endif __OPENSPACE_MODULE_OPENSOUNDCONTROL___OPENSOUNDCONTROLCONNECTION___H__ +#endif // __OPENSPACE_MODULE_OPENSOUNDCONTROL___OPENSOUNDCONTROLCONNECTION___H__ diff --git a/modules/opensoundcontrol/opensoundcontrolmodule.h b/modules/opensoundcontrol/opensoundcontrolmodule.h index 4164c2a3c3..f420dad013 100644 --- a/modules/opensoundcontrol/opensoundcontrolmodule.h +++ b/modules/opensoundcontrol/opensoundcontrolmodule.h @@ -39,4 +39,4 @@ public: } // namespace openspace -#endif __OPENSPACE_MODULE_OPENSOUNDCONTROL___OPENSOUNDCONTROLMODULE___H__ +#endif // __OPENSPACE_MODULE_OPENSOUNDCONTROL___OPENSOUNDCONTROLMODULE___H__ diff --git a/modules/server/include/topics/errorlogtopic.h b/modules/server/include/topics/errorlogtopic.h index 606d421687..163df34f2e 100644 --- a/modules/server/include/topics/errorlogtopic.h +++ b/modules/server/include/topics/errorlogtopic.h @@ -52,4 +52,4 @@ private: } // namespace openspace -#endif // !__OPENSPACE_MODULE_SERVER___ERRORLOGTOPIC____H__ +#endif // __OPENSPACE_MODULE_SERVER___ERRORLOGTOPIC____H__ diff --git a/modules/server/src/topics/flightcontrollertopic.cpp b/modules/server/src/topics/flightcontrollertopic.cpp index 5088478107..1c2c364e6c 100644 --- a/modules/server/src/topics/flightcontrollertopic.cpp +++ b/modules/server/src/topics/flightcontrollertopic.cpp @@ -338,7 +338,8 @@ void FlightControllerTopic::setRenderableEnabled(const nlohmann::json& json) con const SceneGraphNode* node = global::renderEngine->scene()->sceneGraphNode(name); if (node && node->renderable() != nullptr) { properties::Property* prop = node->renderable()->property(RenderableEnabled); - properties::BoolProperty* boolProp = dynamic_cast(prop); + properties::BoolProperty* boolProp = + dynamic_cast(prop); ghoul_assert(boolProp, "Enabled is not a boolean property"); *boolProp = enabled; } @@ -367,17 +368,20 @@ void FlightControllerTopic::setFriction(bool roll, bool rotation, bool zoom) con global::navigationHandler->orbitalNavigator(); properties::Property* rollProp = navigator.property(RollFriction); - properties::BoolProperty* rollBoolProp = dynamic_cast(rollProp); + properties::BoolProperty* rollBoolProp = + dynamic_cast(rollProp); ghoul_assert(rollBoolProp, "RollFriction is not a boolean property"); *rollBoolProp = roll; properties::Property* rotProp = navigator.property(RotationalFriction); - properties::BoolProperty* rotBoolProp = dynamic_cast(rotProp); + properties::BoolProperty* rotBoolProp = + dynamic_cast(rotProp); ghoul_assert(rotBoolProp, "RotationFriction is not a boolean property"); *rotBoolProp = rotation; properties::Property* zoomProp = navigator.property(ZoomFriction); - properties::BoolProperty* zoomBoolProp = dynamic_cast(zoomProp); + properties::BoolProperty* zoomBoolProp = + dynamic_cast(zoomProp); ghoul_assert(zoomBoolProp, "ZoomFriction is not a boolean property"); *zoomBoolProp = zoom; diff --git a/modules/server/src/topics/subscriptiontopic.cpp b/modules/server/src/topics/subscriptiontopic.cpp index 00f1d433ca..d6e011bbda 100644 --- a/modules/server/src/topics/subscriptiontopic.cpp +++ b/modules/server/src/topics/subscriptiontopic.cpp @@ -105,7 +105,7 @@ void SubscriptionTopic::handleJson(const nlohmann::json& json) { // Immediately send the value and meta data onChange(); - onMetaDataChange(); + onMetaDataChange(); } else { LWARNING(std::format("Could not subscribe. Property '{}' not found", uri)); diff --git a/modules/skybrowser/skybrowsermodule.cpp b/modules/skybrowser/skybrowsermodule.cpp index 5a532a3ba9..fe50ba3371 100644 --- a/modules/skybrowser/skybrowsermodule.cpp +++ b/modules/skybrowser/skybrowsermodule.cpp @@ -363,7 +363,8 @@ void SkyBrowserModule::disableHoverCircle(bool useScript) { } else { properties::Property* prop = _hoverCircle->renderable()->property("Fade"); - properties::FloatProperty* floatProp = dynamic_cast(prop); + properties::FloatProperty* floatProp = + dynamic_cast(prop); ghoul_assert(floatProp, "Fade property is not a float property"); *floatProp = 0.f; } diff --git a/modules/space/kepler.cpp b/modules/space/kepler.cpp index 10469799d7..0d8c821d97 100644 --- a/modules/space/kepler.cpp +++ b/modules/space/kepler.cpp @@ -425,7 +425,7 @@ namespace { throw ghoul::RuntimeError(std::format( "Illformed packed date. Illegal year marker. {}", packedDate )); - }; + }; }(packedDate[0]); auto yearRes = scn::scan(packedDate.substr(1, 2), "{}"); diff --git a/modules/space/kepler.h b/modules/space/kepler.h index 4e145d70fc..0970937d0a 100644 --- a/modules/space/kepler.h +++ b/modules/space/kepler.h @@ -104,7 +104,7 @@ enum class Format { TLE, //< Two-line elements OMM, //< Orbit Mean-Elements Message SBDB, //< Small-Body Database - MPC //< Minor Planet Center + MPC //< Minor Planet Center }; /** * Reads the object information from the provided file. diff --git a/modules/space/rendering/renderableconstellationbounds.cpp b/modules/space/rendering/renderableconstellationbounds.cpp index 60f4937b8b..7aa36841d3 100644 --- a/modules/space/rendering/renderableconstellationbounds.cpp +++ b/modules/space/rendering/renderableconstellationbounds.cpp @@ -212,14 +212,26 @@ bool RenderableConstellationBounds::isReady() const { void RenderableConstellationBounds::render(const RenderData& data, RendererTasks& tasks) { _program->activate(); - _program->setUniform(_uniformCache.campos, glm::vec4(data.camera.positionVec3(), 1.f)); - _program->setUniform(_uniformCache.objpos, glm::vec4(data.modelTransform.translation, 0.f)); - _program->setUniform(_uniformCache.camrot, glm::mat4(data.camera.viewRotationMatrix())); + _program->setUniform( + _uniformCache.campos, + glm::vec4(data.camera.positionVec3(), 1.f) + ); + _program->setUniform( + _uniformCache.objpos, + glm::vec4(data.modelTransform.translation, 0.f) + ); + _program->setUniform( + _uniformCache.camrot, + glm::mat4(data.camera.viewRotationMatrix()) + ); _program->setUniform(_uniformCache.scaling, glm::vec2(1.f, 0.f)); const glm::dmat4 modelTransform = calcModelTransform(data); - _program->setUniform(_uniformCache.ViewProjection, data.camera.viewProjectionMatrix()); + _program->setUniform( + _uniformCache.ViewProjection, + data.camera.viewProjectionMatrix() + ); _program->setUniform(_uniformCache.ModelTransform, glm::mat4(modelTransform)); _program->setUniform(_uniformCache.color, _color); _program->setUniform(_uniformCache.opacity, opacity()); diff --git a/modules/space/timeframe/timeframekernel.cpp b/modules/space/timeframe/timeframekernel.cpp index cf12dc09cf..0413964ecf 100644 --- a/modules/space/timeframe/timeframekernel.cpp +++ b/modules/space/timeframe/timeframekernel.cpp @@ -63,7 +63,7 @@ namespace { ghoul_assert(std::holds_alternative(object), "Additional variant type"); id = std::get(object); } - + // Set up variables constexpr unsigned int MaxObj = 1024; @@ -351,7 +351,7 @@ namespace { // kernel must be provided as the latter is required to be able to interpret the time // codes of the former. For this reason it is not possible to provide only a single // kernel to the CK struct in this class. - // + // // The resulting validity of the time frame is based on the following conditions: // // 1. If either SPK or CK (but not both) are specified, the time frame depends on diff --git a/modules/space/timeframe/timeframekernel.h b/modules/space/timeframe/timeframekernel.h index 568325f338..0bbc04c9ed 100644 --- a/modules/space/timeframe/timeframekernel.h +++ b/modules/space/timeframe/timeframekernel.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_BASE___TIMEFRAMEKERNEL___H__ -#define __OPENSPACE_MODULE_BASE___TIMEFRAMEKERNEL___H__ +#ifndef __OPENSPACE_MODULE_SPACE___TIMEFRAMEKERNEL___H__ +#define __OPENSPACE_MODULE_SPACE___TIMEFRAMEKERNEL___H__ #include @@ -49,4 +49,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_MODULE_BASE___TIMEFRAMEKERNEL___H__ +#endif // __OPENSPACE_MODULE_SPACE___TIMEFRAMEKERNEL___H__ diff --git a/modules/space/translation/gptranslation.cpp b/modules/space/translation/gptranslation.cpp index f39cace673..a03b0dac0b 100644 --- a/modules/space/translation/gptranslation.cpp +++ b/modules/space/translation/gptranslation.cpp @@ -68,7 +68,8 @@ namespace { if (element > static_cast(parameters.size())) { throw ghoul::RuntimeError(std::format( - "Requested element {} but only {} are available", element, parameters.size() + "Requested element {} but only {} are available", + element, parameters.size() )); } diff --git a/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp b/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp index 775916887e..172c239eca 100644 --- a/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp @@ -46,10 +46,11 @@ namespace { // This specialized Renderable type is used as a target for projections from a // spacecraft instrument. Similarly to the - // [RenderablePlanetProject](spacecraftinstruments_renderableplanetprojection) it uses the spacecraft's - // position and orientation and information about an instruments field-of-view and - // set of images to project a captured image. In the case of this renderable the - // target geometry is a two-dimensional plane that the image is projected on. + // [RenderablePlanetProject](spacecraftinstruments_renderableplanetprojection) it + // uses the spacecraft's position and orientation and information about an instruments + // field-of-view and set of images to project a captured image. In the case of this + // renderable the target geometry is a two-dimensional plane that the image is + // projected on. struct [[codegen::Dictionary(RenderablePlaneProjection)]] Parameters { // The SPICE name of the spacecraft from which the projection is performed. std::string spacecraft; diff --git a/modules/telemetry/include/general/anglemodetelemetry.h b/modules/telemetry/include/general/anglemodetelemetry.h index 1c44df47d4..566fa5c485 100644 --- a/modules/telemetry/include/general/anglemodetelemetry.h +++ b/modules/telemetry/include/general/anglemodetelemetry.h @@ -61,4 +61,4 @@ private: } // namespace openspace -#endif __OPENSPACE_MODULE_TELEMETRY___ANGLEMODETELEMETRY___H__ +#endif // __OPENSPACE_MODULE_TELEMETRY___ANGLEMODETELEMETRY___H__ diff --git a/modules/telemetry/include/general/cameratelemetry.h b/modules/telemetry/include/general/cameratelemetry.h index b394e30d12..ad38f30d15 100644 --- a/modules/telemetry/include/general/cameratelemetry.h +++ b/modules/telemetry/include/general/cameratelemetry.h @@ -71,4 +71,4 @@ private: } // namespace openspace -#endif __OPENSPACE_MODULE_TELEMETRY___CAMERATELEMETRY___H__ +#endif // __OPENSPACE_MODULE_TELEMETRY___CAMERATELEMETRY___H__ diff --git a/modules/telemetry/include/general/focustelemetry.h b/modules/telemetry/include/general/focustelemetry.h index d68607c02f..4b2f235b45 100644 --- a/modules/telemetry/include/general/focustelemetry.h +++ b/modules/telemetry/include/general/focustelemetry.h @@ -56,4 +56,4 @@ private: } // namespace openspace -#endif __OPENSPACE_MODULE_TELEMETRY___FOCUSTELEMETRY___H__ +#endif // __OPENSPACE_MODULE_TELEMETRY___FOCUSTELEMETRY___H__ diff --git a/modules/telemetry/include/general/nodestelemetry.h b/modules/telemetry/include/general/nodestelemetry.h index 7eebc150e6..2989541254 100644 --- a/modules/telemetry/include/general/nodestelemetry.h +++ b/modules/telemetry/include/general/nodestelemetry.h @@ -144,4 +144,4 @@ private: } // namespace openspace -#endif __OPENSPACE_MODULE_TELEMETRY___NODESTELEMETRY___H__ +#endif // __OPENSPACE_MODULE_TELEMETRY___NODESTELEMETRY___H__ diff --git a/modules/telemetry/include/general/timetelemetry.h b/modules/telemetry/include/general/timetelemetry.h index 207485a990..af549e92e0 100644 --- a/modules/telemetry/include/general/timetelemetry.h +++ b/modules/telemetry/include/general/timetelemetry.h @@ -68,4 +68,4 @@ private: } // namespace openspace -#endif __OPENSPACE_MODULE_TELEMETRY___TIMETELEMETRY___H__ +#endif // __OPENSPACE_MODULE_TELEMETRY___TIMETELEMETRY___H__ diff --git a/modules/telemetry/include/specific/planetscomparesonification.h b/modules/telemetry/include/specific/planetscomparesonification.h index 25fed74315..ce28b28d77 100644 --- a/modules/telemetry/include/specific/planetscomparesonification.h +++ b/modules/telemetry/include/specific/planetscomparesonification.h @@ -115,4 +115,4 @@ private: } // namespace openspace -#endif __OPENSPACE_MODULE_SONIFICATION___PLANETSCOMPARESONIFICATION___H__ +#endif // __OPENSPACE_MODULE_TELEMETRY___PLANETSCOMPARESONIFICATION___H__ diff --git a/modules/telemetry/include/specific/planetsoverviewsonification.h b/modules/telemetry/include/specific/planetsoverviewsonification.h index faec9127e8..a43f11bc32 100644 --- a/modules/telemetry/include/specific/planetsoverviewsonification.h +++ b/modules/telemetry/include/specific/planetsoverviewsonification.h @@ -78,4 +78,4 @@ private: } // namespace openspace -#endif __OPENSPACE_MODULE_TELEMETRY___PLANETSOVERVIEWSONIFICATION___H__ +#endif // __OPENSPACE_MODULE_TELEMETRY___PLANETSOVERVIEWSONIFICATION___H__ diff --git a/modules/telemetry/include/specific/planetssonification.h b/modules/telemetry/include/specific/planetssonification.h index 1824f94c50..a861d1de40 100644 --- a/modules/telemetry/include/specific/planetssonification.h +++ b/modules/telemetry/include/specific/planetssonification.h @@ -90,8 +90,8 @@ private: /** * Create an osc::Blob object with the current sonification settings for the indicated * planet. - * Order of settings: Size/day, gravity, temperature, and optionally atmosphere, moons, - * and rings. + * Order of settings: Size/day, gravity, temperature, and optionally atmosphere, + * moons, and rings. * * \param planetIndex The index of the planet to create the settings blob for * \return An osc::Blob object with current sonification settings for the indicated @@ -208,4 +208,4 @@ private: } // namespace openspace -#endif __OPENSPACE_MODULE_TELEMETRY___PLANETSSONIFICATION___H__ +#endif // __OPENSPACE_MODULE_TELEMETRY___PLANETSSONIFICATION___H__ diff --git a/modules/telemetry/include/telemetrybase.h b/modules/telemetry/include/telemetrybase.h index e20fc8e861..999c2b5d14 100644 --- a/modules/telemetry/include/telemetrybase.h +++ b/modules/telemetry/include/telemetrybase.h @@ -84,4 +84,4 @@ protected: } // namespace openspace -#endif __OPENSPACE_MODULE_TELEMETRY___TELEMETRYBASE___H__ +#endif // __OPENSPACE_MODULE_TELEMETRY___TELEMETRYBASE___H__ diff --git a/modules/telemetry/include/util.h b/modules/telemetry/include/util.h index 0c7eac2d34..92f7ee9b3a 100644 --- a/modules/telemetry/include/util.h +++ b/modules/telemetry/include/util.h @@ -203,4 +203,4 @@ double calculateElevationAngleFromAToB(const Camera* camera, } // namespace openspace -#endif __OPENSPACE_MODULE_TELEMETRY___UTIL___H__ +#endif // __OPENSPACE_MODULE_TELEMETRY___UTIL___H__ diff --git a/modules/telemetry/src/general/anglemodetelemetry.cpp b/modules/telemetry/src/general/anglemodetelemetry.cpp index 6bcb1dd4c3..1959d4172e 100644 --- a/modules/telemetry/src/general/anglemodetelemetry.cpp +++ b/modules/telemetry/src/general/anglemodetelemetry.cpp @@ -41,8 +41,8 @@ namespace { { "AngleModeTelemetry", "Angle Mode Telemetry", - "Telemetry that gathers data of what angle calculation mode is currently used for " - "all telemetries in the telemetry module" + "Telemetry that gathers data of what angle calculation mode is currently used " + "for all telemetries in the telemetry module" }; } // namespace diff --git a/modules/telemetry/telemetrymodule.cpp b/modules/telemetry/telemetrymodule.cpp index a1fccb700f..9e29a990cc 100644 --- a/modules/telemetry/telemetrymodule.cpp +++ b/modules/telemetry/telemetrymodule.cpp @@ -211,7 +211,8 @@ void TelemetryModule::internalInitialize(const ghoul::Dictionary& dictionary) { }); // When the program shuts down, make sure this module turns itself off. - // If the module is turned on while the scene is being destroyed, then it will crash. + // If the module is turned on while the scene is being destroyed, then it will + // crash global::callback::deinitialize->emplace_back([this]() { _enabled = false; }); diff --git a/modules/telemetry/telemetrymodule.h b/modules/telemetry/telemetrymodule.h index 331c718b0c..f96b6cc4ec 100644 --- a/modules/telemetry/telemetrymodule.h +++ b/modules/telemetry/telemetrymodule.h @@ -167,4 +167,4 @@ private: } // namespace openspace -#endif __OPENSPACE_MODULE_TELEMETRY___TELEMETRYMODULE___H__ +#endif // __OPENSPACE_MODULE_TELEMETRY___TELEMETRYMODULE___H__ diff --git a/modules/webbrowser/include/browserclient.h b/modules/webbrowser/include/browserclient.h index 8eb2e934be..eb256bc185 100644 --- a/modules/webbrowser/include/browserclient.h +++ b/modules/webbrowser/include/browserclient.h @@ -65,7 +65,7 @@ public: // TODO (ylvse 2025-02-18): Update CEF when they have fixed this issue // https://github.com/chromiumembedded/cef/issues/3870 class FocusHandler : public CefFocusHandler { - void OnTakeFocus(CefRefPtr, bool) override; + void OnTakeFocus(CefRefPtr, bool) override; bool OnSetFocus(CefRefPtr, FocusSource) override; IMPLEMENT_REFCOUNTING(FocusHandler); @@ -73,7 +73,7 @@ public: class LoadHandler : public CefLoadHandler { void OnLoadEnd(CefRefPtr browser, CefRefPtr, int) override; - + IMPLEMENT_REFCOUNTING(LoadHandler); }; diff --git a/modules/webbrowser/src/browserclient.cpp b/modules/webbrowser/src/browserclient.cpp index 1fa075b290..8a83925537 100644 --- a/modules/webbrowser/src/browserclient.cpp +++ b/modules/webbrowser/src/browserclient.cpp @@ -103,8 +103,9 @@ bool BrowserClient::FocusHandler::OnSetFocus(CefRefPtr, FocusSource) return false; } -void BrowserClient::LoadHandler::OnLoadEnd(CefRefPtr browser, CefRefPtr, - int) { +void BrowserClient::LoadHandler::OnLoadEnd(CefRefPtr browser, + CefRefPtr, int) +{ // Focus status can be lost. Try to restore it if (_hasFocus && browser && browser->GetHost()) { browser->GetHost()->SetFocus(true); diff --git a/modules/webbrowser/src/eventhandler.cpp b/modules/webbrowser/src/eventhandler.cpp index 344a6ecb9d..a09f6fcb16 100644 --- a/modules/webbrowser/src/eventhandler.cpp +++ b/modules/webbrowser/src/eventhandler.cpp @@ -457,7 +457,7 @@ bool EventHandler::keyboardCallback(Key key, KeyModifier modifier, KeyAction act return charCallback(static_cast(Key::Enter), modifier); } - return KeyEventFlag; + return KeyEventFlag; } bool EventHandler::specialKeyEvent(Key key, KeyModifier mod, KeyAction action) { diff --git a/src/interaction/keybindingmanager_lua.inl b/src/interaction/keybindingmanager_lua.inl index bdece5ab8b..77deee3321 100644 --- a/src/interaction/keybindingmanager_lua.inl +++ b/src/interaction/keybindingmanager_lua.inl @@ -83,7 +83,7 @@ namespace { } // Actions might be bound to different actions - std::unique(res.begin(), res.end()); + res.erase(std::unique(res.begin(), res.end()), res.end()); } return res; } diff --git a/src/interaction/sessionrecordinghandler_lua.inl b/src/interaction/sessionrecordinghandler_lua.inl index 04314ed18b..8bb83297a5 100644 --- a/src/interaction/sessionrecordinghandler_lua.inl +++ b/src/interaction/sessionrecordinghandler_lua.inl @@ -39,7 +39,8 @@ namespace { * true, any existing session recording file will be overwritten, false by default. */ [[codegen::luawrap]] void stopRecording(std::filesystem::path recordFilePath, - std::string dataMode, std::optional overwrite) + std::string dataMode, + std::optional overwrite) { if (recordFilePath.empty()) { throw ghoul::lua::LuaError("Filepath string is empty"); diff --git a/src/navigation/path.cpp b/src/navigation/path.cpp index 40437f7f7c..8d4215c85e 100644 --- a/src/navigation/path.cpp +++ b/src/navigation/path.cpp @@ -514,7 +514,8 @@ double Path::speedAlongPath(double traveledDistance) const { void checkVisibilityAndShowMessage(const SceneGraphNode* node) { auto isEnabled = [](const Renderable* r) { properties::Property* prop = r->property("Enabled"); - properties::BoolProperty* boolProp = dynamic_cast(prop); + properties::BoolProperty* boolProp = + dynamic_cast(prop); ghoul_assert(boolProp, "Enabled is not a boolean property"); return boolProp; }; diff --git a/src/properties/property.cpp b/src/properties/property.cpp index c6a2d0300e..c99739d5b4 100644 --- a/src/properties/property.cpp +++ b/src/properties/property.cpp @@ -169,7 +169,9 @@ Property::OnChangeHandle Property::onDelete(std::function callback) { return handle; } -Property::OnMetaDataChangeHandle Property::onMetaDataChange(std::function callback) { +Property::OnMetaDataChangeHandle Property::onMetaDataChange( + std::function callback) +{ ghoul_assert(callback, "The callback must not be empty"); const OnMetaDataChangeHandle handle = _currentHandleValue++; diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp index cafe598911..808fe371fb 100644 --- a/src/scene/scene.cpp +++ b/src/scene/scene.cpp @@ -158,14 +158,26 @@ namespace { case openspace::PropertyValueType::Float: { std::vector vals; - processPropertyValueTableEntries(L, value, vals, isTableValue, propertyName); + processPropertyValueTableEntries( + L, + value, + vals, + isTableValue, + propertyName + ); ghoul::lua::push(L, vals); } break; case openspace::PropertyValueType::String: { std::vector vals; - processPropertyValueTableEntries(L, value, vals, isTableValue, propertyName); + processPropertyValueTableEntries( + L, + value, + vals, + isTableValue, + propertyName + ); ghoul::lua::push(L, vals); } break;