From d52c5dd0d97bc2682db2d1a47fdf77f2e99898c0 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sun, 22 Jan 2023 23:01:32 +0100 Subject: [PATCH] Cleanup code with designated initializer lists --- .../launcher/include/sgctedit/monitorbox.h | 8 +- .../include/sgctedit/settingswidget.h | 2 +- .../ext/launcher/src/launcherwindow.cpp | 4 +- .../launcher/src/profile/assettreemodel.cpp | 2 +- .../ext/launcher/src/profile/cameradialog.cpp | 4 +- .../launcher/src/profile/deltatimesdialog.cpp | 14 +-- .../launcher/src/profile/modulesdialog.cpp | 2 +- .../ext/launcher/src/sgctedit/monitorbox.cpp | 6 +- .../ext/launcher/src/sgctedit/sgctedit.cpp | 10 +- .../launcher/src/sgctedit/windowcontrol.cpp | 18 +-- apps/OpenSpace/ext/sgct | 2 +- data/assets/util/joysticks/ps4.asset | 8 +- .../assets/util/joysticks/xbox-wireless.asset | 4 +- data/assets/util/joysticks/xbox.asset | 4 +- ext/ghoul | 2 +- .../base/dashboard/dashboarditemdistance.cpp | 4 +- .../dashboarditemsimulationincrement.cpp | 12 +- .../base/dashboard/dashboarditemvelocity.cpp | 4 +- .../base/rendering/screenspacedashboard.cpp | 2 +- modules/base/rotation/fixedrotation.cpp | 2 +- modules/debugging/debuggingmodule_lua.inl | 4 +- modules/debugging/rendering/debugrenderer.h | 10 +- modules/fitsfilereader/src/fitsfilereader.cpp | 20 +++- modules/gaia/gaiamodule.cpp | 10 +- modules/globebrowsing/globebrowsingmodule.cpp | 49 ++++---- modules/globebrowsing/src/ellipsoid.cpp | 4 +- modules/globebrowsing/src/geodeticpatch.cpp | 8 +- modules/globebrowsing/src/globerotation.cpp | 4 +- modules/globebrowsing/src/layergroupid.h | 105 ++++++++++++++---- modules/globebrowsing/src/rawtile.h | 2 +- .../globebrowsing/src/rawtiledatareader.cpp | 99 +++++++++-------- modules/globebrowsing/src/rawtiledatareader.h | 2 +- modules/globebrowsing/src/renderableglobe.cpp | 8 +- .../src/tileprovider/defaulttileprovider.cpp | 15 ++- .../sizereferencetileprovider.cpp | 4 +- .../src/tileprovider/tileprovider.cpp | 9 +- modules/imgui/imguimodule.cpp | 12 +- modules/imgui/src/renderproperties.cpp | 24 ++-- modules/kameleon/src/kameleonwrapper.cpp | 56 +++++----- .../skybrowser/src/renderableskytarget.cpp | 2 +- modules/space/kepler.cpp | 58 +++++----- .../space/translation/keplertranslation.cpp | 10 +- .../dashboard/dashboarditeminstruments.cpp | 2 +- .../rendering/renderablefov.cpp | 26 +++-- .../util/hongkangparser.cpp | 28 ++--- .../util/instrumenttimesparser.cpp | 12 +- .../util/labelparser.cpp | 12 +- modules/touch/src/directinputsolver.cpp | 12 +- modules/touch/src/touchinteraction.cpp | 8 +- src/documentation/verifier.cpp | 12 +- src/engine/downloadmanager.cpp | 6 +- src/engine/moduleengine.cpp | 2 +- src/engine/openspaceengine.cpp | 6 +- src/interaction/joystickcamerastates.cpp | 10 +- src/interaction/sessionrecording.cpp | 6 +- src/interaction/websocketcamerastates.cpp | 10 +- src/navigation/orbitalnavigator.cpp | 8 +- src/navigation/waypoint.cpp | 2 +- src/properties/optionproperty.cpp | 2 +- src/rendering/framebufferrenderer.cpp | 13 +-- src/rendering/loadingscreen.cpp | 39 +++---- src/rendering/luaconsole.cpp | 12 +- src/rendering/renderengine.cpp | 12 +- src/scene/scenegraphnode.cpp | 12 +- src/scripting/scriptengine.cpp | 4 +- src/util/timemanager.cpp | 42 ++++++- src/util/transformationmanager.cpp | 6 +- support/coding/codegen | 2 +- .../test_property_selectionproperty.cpp | 8 +- 69 files changed, 532 insertions(+), 411 deletions(-) diff --git a/apps/OpenSpace/ext/launcher/include/sgctedit/monitorbox.h b/apps/OpenSpace/ext/launcher/include/sgctedit/monitorbox.h index b60f7eb525..c8f080fc24 100644 --- a/apps/OpenSpace/ext/launcher/include/sgctedit/monitorbox.h +++ b/apps/OpenSpace/ext/launcher/include/sgctedit/monitorbox.h @@ -81,10 +81,10 @@ private: std::vector _monitorDimensionsScaled; std::array _windowRendering = { - QRectF{ 0.f, 0.f, 0.f, 0.f }, - QRectF{ 0.f, 0.f, 0.f, 0.f }, - QRectF{ 0.f, 0.f, 0.f, 0.f }, - QRectF{ 0.f, 0.f, 0.f, 0.f } + QRectF(0.f, 0.f, 0.f, 0.f), + QRectF(0.f, 0.f, 0.f, 0.f), + QRectF(0.f, 0.f, 0.f, 0.f), + QRectF(0.f, 0.f, 0.f, 0.f) }; int _nWindows = 1; const std::array _colorsForWindows; diff --git a/apps/OpenSpace/ext/launcher/include/sgctedit/settingswidget.h b/apps/OpenSpace/ext/launcher/include/sgctedit/settingswidget.h index f9d1105a87..1ff9fd8578 100644 --- a/apps/OpenSpace/ext/launcher/include/sgctedit/settingswidget.h +++ b/apps/OpenSpace/ext/launcher/include/sgctedit/settingswidget.h @@ -63,7 +63,7 @@ public: bool showUiOnFirstWindow() const; private: - sgct::quat _orientationValue = { 0.f, 0.f, 0.f, 0.f }; + sgct::quat _orientationValue = sgct::quat(0.f, 0.f, 0.f, 0.f); QCheckBox* _checkBoxVsync = nullptr; QCheckBox* _showUiOnFirstWindow = nullptr; }; diff --git a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp index cb8a736fc3..a78ff7a12a 100644 --- a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp +++ b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp @@ -158,11 +158,11 @@ namespace { std::ofstream outFile; try { outFile.open(path, std::ofstream::out); - sgct::config::GeneratorVersion genEntry = { + sgct::config::GeneratorVersion genEntry = sgct::config::GeneratorVersion( "OpenSpace", OPENSPACE_VERSION_MAJOR, OPENSPACE_VERSION_MINOR - }; + ); outFile << sgct::serializeConfig( cluster, genEntry diff --git a/apps/OpenSpace/ext/launcher/src/profile/assettreemodel.cpp b/apps/OpenSpace/ext/launcher/src/profile/assettreemodel.cpp index d071b87c36..fa3283d4a1 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/assettreemodel.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/assettreemodel.cpp @@ -156,7 +156,7 @@ void AssetTreeModel::importModelData(const std::string& assetBasePath, std::string assetList = assets.useQtFileSystemModelToTraverseDir(assetBasePath); assetList += assets.useQtFileSystemModelToTraverseDir(userAssetBasePath, true); std::istringstream iss(assetList); - ImportElement rootElem = { "", 0, false }; + ImportElement rootElem = ImportElement("", 0, false); if (importGetNextLine(rootElem, iss)) { importInsertItem(iss, _rootItem.get(), rootElem, 0); diff --git a/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp index 09f697fec9..fdcf33ea8d 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp @@ -384,11 +384,11 @@ void CameraDialog::approved() { !_navState.upY->text().isEmpty() && !_navState.upZ->text().isEmpty()) { - glm::dvec3 u = { + glm::dvec3 u = glm::dvec3( _navState.upX->text().toDouble(), _navState.upY->text().toDouble(), _navState.upZ->text().toDouble() - }; + ); nav.up = u; } else { diff --git a/apps/OpenSpace/ext/launcher/src/profile/deltatimesdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/deltatimesdialog.cpp index 8b20e26989..c984f729b7 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/deltatimesdialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/deltatimesdialog.cpp @@ -49,13 +49,13 @@ namespace { }; const std::array TimeIntervals = { - TimeInterval{ 31536000, "year" }, - TimeInterval{ 18144000, "month" }, - TimeInterval{ 604800, "week" }, - TimeInterval{ 86400, "day" }, - TimeInterval{ 3600, "hour" }, - TimeInterval{ 60, "minute" }, - TimeInterval{ 1, "second" } + TimeInterval(31536000, "year"), + TimeInterval(18144000, "month"), + TimeInterval(604800, "week"), + TimeInterval(86400, "day"), + TimeInterval(3600, "hour"), + TimeInterval(60, "minute"), + TimeInterval(1, "second") }; std::string checkForTimeDescription(int intervalIndex, double value) { diff --git a/apps/OpenSpace/ext/launcher/src/profile/modulesdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/modulesdialog.cpp index 954ba9a9fd..1a3112b340 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/modulesdialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/modulesdialog.cpp @@ -37,7 +37,7 @@ using namespace openspace; namespace { - const Profile::Module Blank = { "", "", "" }; + const Profile::Module Blank = Profile::Module("", std::nullopt, std::nullopt); } // namespace ModulesDialog::ModulesDialog(QWidget* parent, diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/monitorbox.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/monitorbox.cpp index f7e46f4fd2..ebb1b80c0c 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/monitorbox.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/monitorbox.cpp @@ -31,7 +31,7 @@ namespace { constexpr int WindowOpacity = 170; QRectF computeUnion(const std::vector& monitorResolutions) { - QRectF res = { 0.f, 0.f, 0.f, 0.f }; + QRectF res = QRectF(0.f, 0.f, 0.f, 0.f); for (const QRect& m : monitorResolutions) { res |= m; } @@ -145,12 +145,12 @@ void MonitorBox::paintEvent(QPaintEvent*) { void MonitorBox::windowDimensionsChanged(unsigned int mIdx, unsigned int wIdx, const QRectF& newDimensions) { - _windowRendering[wIdx] = { + _windowRendering[wIdx] = QRectF( _monitorDimensionsScaled[mIdx].x() + newDimensions.left() * _monitorScaleFactor, _monitorDimensionsScaled[mIdx].y() + newDimensions.top() * _monitorScaleFactor, newDimensions.width() * _monitorScaleFactor, newDimensions.height() * _monitorScaleFactor - }; + ); update(); } diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp index d7388833b3..f4ec6f5888 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp @@ -39,7 +39,7 @@ #include namespace { - constexpr QRect MonitorWidgetSize = { 0, 0, 500, 500 }; + constexpr QRect MonitorWidgetSize = QRect(0, 0, 500, 500); constexpr int MaxNumberWindows = 4; // Returns true if the windows are not ordered correctly. 'Correct' in this means that @@ -48,10 +48,10 @@ namespace { // https://github.com/OpenSpace/OpenSpace/issues/507 // is fixed bool hasWindowIssues(const sgct::config::Cluster& cluster) { - sgct::ivec2 size = { + sgct::ivec2 size = sgct::ivec2( std::numeric_limits::max(), std::numeric_limits::max() - }; + ); for (const sgct::config::Window& window : cluster.nodes.front().windows) { if (window.size.x <= size.x && window.size.y <= size.y) { size = window.size; @@ -96,7 +96,7 @@ void SgctEdit::createWidgets(const std::vector& monitorSizes) { QBoxLayout* layout = new QVBoxLayout(this); layout->setSizeConstraint(QLayout::SetFixedSize); - sgct::quat orientation = { 0.f, 0.f, 0.f, 0.f }; + sgct::quat orientation = sgct::quat(0.f, 0.f, 0.f, 0.f); if (_cluster.scene.has_value() && _cluster.scene->orientation.has_value()) { orientation = *_cluster.scene->orientation; } @@ -283,7 +283,7 @@ sgct::config::Cluster SgctEdit::generateConfiguration() const { sgct::config::User user; user.eyeSeparation = 0.065f; - user.position = { 0.f, 0.f, 4.f }; + user.position = sgct::vec3(0.f, 0.f, 4.f); cluster.users = { user }; return cluster; diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp index 88e8cb24d1..b1bdd0b3ae 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp @@ -52,10 +52,10 @@ namespace { }; constexpr std::array DefaultWindowSizes = { - QRectF{ 50.f, 50.f, 1280.f, 720.f }, - QRectF{ 150.f, 150.f, 1280.f, 720.f }, - QRectF{ 50.f, 50.f, 1280.f, 720.f }, - QRectF{ 150.f, 150.f, 1280.f, 720.f } + QRectF(50.f, 50.f, 1280.f, 720.f), + QRectF(150.f, 150.f, 1280.f, 720.f), + QRectF(50.f, 50.f, 1280.f, 720.f), + QRectF(150.f, 150.f, 1280.f, 720.f) }; constexpr int LineEditWidthFixedWindowSize = 50; @@ -707,17 +707,17 @@ sgct::config::Projections WindowControl::generateProjectionInformation() const { sgct::config::Window WindowControl::generateWindowInformation() const { sgct::config::Window window; - window.size = { _sizeX->text().toInt(), _sizeY->text().toInt() }; + window.size = sgct::ivec2(_sizeX->text().toInt(), _sizeY->text().toInt()); QRect resolution = _monitorResolutions[_monitor->currentIndex()]; - window.pos = { + window.pos = sgct::ivec2( resolution.x() + _offsetX->text().toInt(), resolution.y() + _offsetY->text().toInt() - }; + ); sgct::config::Viewport vp; vp.isTracked = true; - vp.position = { 0.f, 0.f }; - vp.size = { 1.f, 1.f }; + vp.position = sgct::vec2(0.f, 0.f); + vp.size = sgct::vec2(1.f, 1.f); vp.projection = generateProjectionInformation(); window.viewports.push_back(vp); diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index ad7ac43b19..4602896765 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit ad7ac43b194ea2178d4fa509f899f3928d3cbec5 +Subproject commit 4602896765972555e80cb5edaecd6a0e0fc8261d diff --git a/data/assets/util/joysticks/ps4.asset b/data/assets/util/joysticks/ps4.asset index 58441ee338..770f138fcd 100644 --- a/data/assets/util/joysticks/ps4.asset +++ b/data/assets/util/joysticks/ps4.asset @@ -182,7 +182,7 @@ asset.onInitialize(function() name, controller.Square, [[ - -- <-- Copy paste your custum script here + -- <-- Copy paste your custom script here ]], "" -- <-- Description of your custom script here (optional) ) @@ -192,7 +192,7 @@ asset.onInitialize(function() name, controller.Share, [[ - -- <-- Copy paste your custum script here + -- <-- Copy paste your custom script here ]], "" -- <-- Description of your custom script here (optional) ) @@ -202,7 +202,7 @@ asset.onInitialize(function() name, controller.LeftStickButton, [[ - -- <-- Copy paste your custum script here + -- <-- Copy paste your custom script here ]], "" -- <-- Description of your custom script here (optional) ) @@ -212,7 +212,7 @@ asset.onInitialize(function() name, controller.PS, [[ - -- <-- Copy paste your custum script here + -- <-- Copy paste your custom script here ]], "" -- <-- Description of your custom script here (optional) ) diff --git a/data/assets/util/joysticks/xbox-wireless.asset b/data/assets/util/joysticks/xbox-wireless.asset index c6d3a087df..0c98947505 100644 --- a/data/assets/util/joysticks/xbox-wireless.asset +++ b/data/assets/util/joysticks/xbox-wireless.asset @@ -180,7 +180,7 @@ asset.onInitialize(function() name, controller.X, [[ - -- <-- Copy paste your custum script here + -- <-- Copy paste your custom script here ]], "" -- <-- Description of your custom script here (optional) ) @@ -190,7 +190,7 @@ asset.onInitialize(function() name, controller.LeftStickButton, [[ - -- <-- Copy paste your custum script here + -- <-- Copy paste your custom script here ]], "" -- <-- Description of your custom script here (optional) ) diff --git a/data/assets/util/joysticks/xbox.asset b/data/assets/util/joysticks/xbox.asset index e1e93600fb..03685efbfe 100644 --- a/data/assets/util/joysticks/xbox.asset +++ b/data/assets/util/joysticks/xbox.asset @@ -180,7 +180,7 @@ asset.onInitialize(function() name, controller.X, [[ - -- <-- Copy paste your custum script here + -- <-- Copy paste your custom script here ]], "" -- <-- Description of your custom script here (optional) ) @@ -190,7 +190,7 @@ asset.onInitialize(function() name, controller.LeftStickButton, [[ - -- <-- Copy paste your custum script here + -- <-- Copy paste your custom script here ]], "" -- <-- Description of your custom script here (optional) ) diff --git a/ext/ghoul b/ext/ghoul index e2d607f75a..cd5c1ca7f6 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit e2d607f75a128914585b21f9bd70e1c1ccf06580 +Subproject commit cd5c1ca7f6454b35f3981d0750f91095d18fa922 diff --git a/modules/base/dashboard/dashboarditemdistance.cpp b/modules/base/dashboard/dashboarditemdistance.cpp index df869afcc2..733b528dcb 100644 --- a/modules/base/dashboard/dashboarditemdistance.cpp +++ b/modules/base/dashboard/dashboarditemdistance.cpp @@ -354,7 +354,7 @@ void DashboardItemDistance::render(glm::vec2& penPosition) { else { const DistanceUnit unit = static_cast(_requestedUnit.value()); const double convertedD = convertMeters(d, unit); - dist = { convertedD, nameForDistanceUnit(unit, convertedD != 1.0) }; + dist = std::pair(convertedD, nameForDistanceUnit(unit, convertedD != 1.0)); } std::fill(_buffer.begin(), _buffer.end(), char(0)); @@ -385,7 +385,7 @@ glm::vec2 DashboardItemDistance::size() const { else { DistanceUnit unit = static_cast(_requestedUnit.value()); double convertedD = convertMeters(d, unit); - dist = { convertedD, nameForDistanceUnit(unit, convertedD != 1.0) }; + dist = std::pair(convertedD, nameForDistanceUnit(unit, convertedD != 1.0)); } return _font->boundingBox( diff --git a/modules/base/dashboard/dashboarditemsimulationincrement.cpp b/modules/base/dashboard/dashboarditemsimulationincrement.cpp index 10f950819d..d70db523b4 100644 --- a/modules/base/dashboard/dashboarditemsimulationincrement.cpp +++ b/modules/base/dashboard/dashboarditemsimulationincrement.cpp @@ -167,17 +167,17 @@ void DashboardItemSimulationIncrement::render(glm::vec2& penPosition) { const TimeUnit unit = static_cast(_requestedUnit.value()); const double convTarget = convertTime(targetDt, TimeUnit::Second, unit); - targetDeltaTime = { + targetDeltaTime = std::pair( convTarget, std::string(nameForTimeUnit(unit, convTarget != 1.0)) - }; + ); if (targetDt != currentDt) { const double convCurrent = convertTime(currentDt, TimeUnit::Second, unit); - currentDeltaTime = { + currentDeltaTime = std::pair( convCurrent, std::string(nameForTimeUnit(unit, convCurrent != 1.0)) - }; + ); } } @@ -225,10 +225,10 @@ glm::vec2 DashboardItemSimulationIncrement::size() const { else { TimeUnit unit = static_cast(_requestedUnit.value()); double convertedT = convertTime(t, TimeUnit::Second, unit); - deltaTime = { + deltaTime = std::pair( convertedT, std::string(nameForTimeUnit(unit, convertedT != 1.0)) - }; + ); } return _font->boundingBox( diff --git a/modules/base/dashboard/dashboarditemvelocity.cpp b/modules/base/dashboard/dashboarditemvelocity.cpp index b749d439e5..c5e3e86168 100644 --- a/modules/base/dashboard/dashboarditemvelocity.cpp +++ b/modules/base/dashboard/dashboarditemvelocity.cpp @@ -137,7 +137,7 @@ void DashboardItemVelocity::render(glm::vec2& penPosition) { else { const DistanceUnit unit = static_cast(_requestedUnit.value()); const double convertedD = convertMeters(speedPerSecond, unit); - dist = { convertedD, nameForDistanceUnit(unit, convertedD != 1.0) }; + dist = std::pair(convertedD, nameForDistanceUnit(unit, convertedD != 1.0)); } RenderFont( @@ -163,7 +163,7 @@ glm::vec2 DashboardItemVelocity::size() const { else { DistanceUnit unit = static_cast(_requestedUnit.value()); double convertedD = convertMeters(d, unit); - dist = { convertedD, nameForDistanceUnit(unit, convertedD != 1.0) }; + dist = std::pair(convertedD, nameForDistanceUnit(unit, convertedD != 1.0)); } return _font->boundingBox( diff --git a/modules/base/rendering/screenspacedashboard.cpp b/modules/base/rendering/screenspacedashboard.cpp index 2225beda35..35a5bdc657 100644 --- a/modules/base/rendering/screenspacedashboard.cpp +++ b/modules/base/rendering/screenspacedashboard.cpp @@ -119,7 +119,7 @@ bool ScreenSpaceDashboard::isReady() const { void ScreenSpaceDashboard::update() { if (global::windowDelegate->windowHasResized()) { const glm::ivec2 size = global::windowDelegate->currentDrawBufferResolution(); - _size = { 0.f, 0.f, size.x, size.y }; + _size = glm::vec4(0.f, 0.f, size.x, size.y); createFramebuffer(); } } diff --git a/modules/base/rotation/fixedrotation.cpp b/modules/base/rotation/fixedrotation.cpp index d12cafd58a..480c41816f 100644 --- a/modules/base/rotation/fixedrotation.cpp +++ b/modules/base/rotation/fixedrotation.cpp @@ -469,7 +469,7 @@ bool FixedRotation::initialize() { } // No need to hold on to the data - _constructorDictionary = {}; + _constructorDictionary = ghoul::Dictionary(); return res; } diff --git a/modules/debugging/debuggingmodule_lua.inl b/modules/debugging/debuggingmodule_lua.inl index 6dac57ec39..febff86860 100644 --- a/modules/debugging/debuggingmodule_lua.inl +++ b/modules/debugging/debuggingmodule_lua.inl @@ -28,8 +28,8 @@ constexpr const char RenderedPathIdentifier[] = "CurrentCameraPath"; constexpr const char RenderedPointsIdentifier[] = "CurrentPathControlPoints"; constexpr const char DebuggingGuiPath[] = "/Debugging"; -constexpr glm::vec3 PathColor = { 1.0, 1.0, 0.0 }; -constexpr glm::vec3 OrientationLineColor = { 0.0, 1.0, 1.0 }; +constexpr glm::vec3 PathColor = glm::vec3(1.0, 1.0, 0.0); +constexpr glm::vec3 OrientationLineColor = glm::vec3(0.0, 1.0, 1.0); // Conver the input string to a format that is valid as an identifier std::string makeIdentifier(std::string s) { diff --git a/modules/debugging/rendering/debugrenderer.h b/modules/debugging/rendering/debugrenderer.h index 8fdaccf292..b0132ec3ce 100644 --- a/modules/debugging/rendering/debugrenderer.h +++ b/modules/debugging/rendering/debugrenderer.h @@ -68,7 +68,7 @@ public: * Render the vector of clipping space points in the specified mode and color. */ void renderVertices(const Vertices& clippingSpacePoints, GLenum mode, - const glm::vec4& color = { 1.f, 0.f, 0.f, 1.f }) const; + const glm::vec4& color = glm::vec4(1.f, 0.f, 0.f, 1.f)) const; /** * Takes a vector of exactly 8 vertices, i.e. corner points in a box. @@ -84,7 +84,7 @@ public: * */ void renderBoxFaces(const Vertices& clippingSpaceBoxCorners, - const glm::vec4& rgba = { 1.f, 0.f, 0.f, 1.f }) const; + const glm::vec4& rgba = glm::vec4(1.f, 0.f, 0.f, 1.f)) const; /** * Takes a vector of exactly 8 vertices, i.e. corner points in a box. @@ -100,7 +100,7 @@ public: * */ void renderBoxEdges(const Vertices& clippingSpaceBoxCorners, - const glm::vec4& rgba = { 1.f, 0.f, 0.f, 1.f }) const; + const glm::vec4& rgba = glm::vec4(1.f, 0.f, 0.f, 1.f)) const; /** * Takes a vector of exactly 8 vertices, i.e. corner points in a box. @@ -116,7 +116,7 @@ public: * */ void renderNiceBox(const Vertices& clippingSpaceBoxCorners, - const glm::vec4& rgba = { 1.f, 0.f, 0.f, 0.3f }) const; + const glm::vec4& rgba = glm::vec4(1.f, 0.f, 0.f, 0.3f)) const; /** * Input arguments: @@ -126,7 +126,7 @@ public: * 3. RGBA rgba Color to draw the view frustum with */ void renderCameraFrustum(const RenderData& data, const Camera& otherCamera, - const glm::vec4& rgba = { 1.f, 1.f, 1.f, 0.3f }) const; + const glm::vec4& rgba = glm::vec4(1.f, 1.f, 1.f, 0.3f)) const; protected: std::unique_ptr _programObject; diff --git a/modules/fitsfilereader/src/fitsfilereader.cpp b/modules/fitsfilereader/src/fitsfilereader.cpp index 63cd6ad1d2..1ac6ed09a8 100644 --- a/modules/fitsfilereader/src/fitsfilereader.cpp +++ b/modules/fitsfilereader/src/fitsfilereader.cpp @@ -174,10 +174,10 @@ std::shared_ptr> FitsFileReader::readTable(const std::filesystem::p // Create TableData object of table contents. TableData loadedTable = { - std::move(contents), - static_cast(table.rows()), - table.getRowsize(), - table.name() + .contents = std::move(contents), + .readRows = static_cast(table.rows()), + .optimalRowsize = table.getRowsize(), + .name = table.name() }; return std::make_shared>(loadedTable); @@ -660,7 +660,11 @@ const std::shared_ptr> FitsFileReader::readImageInternal(ExtHDU& im try { std::valarray contents; image.read(contents); - ImageData im = { std::move(contents), image.axis(0), image.axis(1) }; + ImageData im = { + .contents = std::move(contents), + .width = image.axis(0), + .height = image.axis(1) + }; return std::make_shared>(im); } catch (const FitsException& e){ LERROR("Could not read FITS image EXTHDU. " + e.message()); @@ -673,7 +677,11 @@ const std::shared_ptr> FitsFileReader::readImageInternal(PHDU& imag try { std::valarray contents; image.read(contents); - ImageData im = { std::move(contents), image.axis(0), image.axis(1) }; + ImageData im = { + .contents = std::move(contents), + .width = image.axis(0), + .height = image.axis(1) + }; return std::make_shared>(im); } catch (const FitsException& e){ LERROR("Could not read FITS image PHDU. " + e.message()); diff --git a/modules/gaia/gaiamodule.cpp b/modules/gaia/gaiamodule.cpp index cbd1ef62cd..6120886dae 100644 --- a/modules/gaia/gaiamodule.cpp +++ b/modules/gaia/gaiamodule.cpp @@ -62,12 +62,12 @@ std::vector GaiaModule::documentations() const { } scripting::LuaLibrary GaiaModule::luaLibrary() const { - scripting::LuaLibrary res; - res.name = "gaia"; - res.scripts = { - absPath("${MODULE_GAIA}/scripts/filtering.lua") + return { + .name = "gaia", + .scripts = { + absPath("${MODULE_GAIA}/scripts/filtering.lua") + } }; - return res; } } // namespace openspace diff --git a/modules/globebrowsing/globebrowsingmodule.cpp b/modules/globebrowsing/globebrowsingmodule.cpp index f632897ef1..f353633f99 100644 --- a/modules/globebrowsing/globebrowsingmodule.cpp +++ b/modules/globebrowsing/globebrowsingmodule.cpp @@ -392,7 +392,7 @@ glm::vec3 GlobeBrowsingModule::cartesianCoordinatesFromGeo( using namespace globebrowsing; const Geodetic3 pos = { - { glm::radians(latitude), glm::radians(longitude) }, + { .lat = glm::radians(latitude), .lon = glm::radians(longitude) }, altitude }; @@ -451,8 +451,8 @@ void GlobeBrowsingModule::goToChunk(const globebrowsing::RenderableGlobe& globe, positionOnPatch.lat *= uv.y; positionOnPatch.lon *= uv.x; const Geodetic2 pointPosition = { - corner.lat + positionOnPatch.lat, - corner.lon + positionOnPatch.lon + .lat = corner.lat + positionOnPatch.lat, + .lon = corner.lon + positionOnPatch.lon }; // Compute altitude @@ -688,29 +688,28 @@ uint64_t GlobeBrowsingModule::wmsCacheSize() const { } scripting::LuaLibrary GlobeBrowsingModule::luaLibrary() const { - scripting::LuaLibrary res; - res.name = "globebrowsing"; - res.functions = { - codegen::lua::AddLayer, - codegen::lua::DeleteLayer, - codegen::lua::GetLayers, - codegen::lua::MoveLayer, - codegen::lua::GoToChunk, - codegen::lua::GoToGeo, - // @TODO (2021-06-23, emmbr) Combine with the above function when the camera - // paths work really well close to surfaces - codegen::lua::FlyToGeo, - codegen::lua::GetLocalPositionFromGeo, - codegen::lua::GetGeoPositionForCamera, - codegen::lua::LoadWMSCapabilities, - codegen::lua::RemoveWMSServer, - codegen::lua::CapabilitiesWMS + return { + .name = "globebrowsing", + .functions = { + codegen::lua::AddLayer, + codegen::lua::DeleteLayer, + codegen::lua::GetLayers, + codegen::lua::MoveLayer, + codegen::lua::GoToChunk, + codegen::lua::GoToGeo, + // @TODO (2021-06-23, emmbr) Combine with the above function when the camera + // paths work really well close to surfaces + codegen::lua::FlyToGeo, + codegen::lua::GetLocalPositionFromGeo, + codegen::lua::GetGeoPositionForCamera, + codegen::lua::LoadWMSCapabilities, + codegen::lua::RemoveWMSServer, + codegen::lua::CapabilitiesWMS + }, + .scripts = { + absPath("${MODULE_GLOBEBROWSING}/scripts/layer_support.lua") + } }; - res.scripts = { - absPath("${MODULE_GLOBEBROWSING}/scripts/layer_support.lua") - }; - - return res; } } // namespace openspace diff --git a/modules/globebrowsing/src/ellipsoid.cpp b/modules/globebrowsing/src/ellipsoid.cpp index 1e7f701cec..76ecc160dd 100644 --- a/modules/globebrowsing/src/ellipsoid.cpp +++ b/modules/globebrowsing/src/ellipsoid.cpp @@ -133,8 +133,8 @@ double Ellipsoid::greatCircleDistance(const Geodetic2& p1, const Geodetic2& p2) ); const Geodetic2 pMid = { - (p1.lat + p2.lat) / 2.0, - (p1.lon + p2.lon) / 2.0 + .lat = (p1.lat + p2.lat) / 2.0, + .lon = (p1.lon + p2.lon) / 2.0 }; const glm::dvec3 centralNormal = cartesianSurfacePosition(pMid); diff --git a/modules/globebrowsing/src/geodeticpatch.cpp b/modules/globebrowsing/src/geodeticpatch.cpp index d5d9189729..7d8167f8dd 100644 --- a/modules/globebrowsing/src/geodeticpatch.cpp +++ b/modules/globebrowsing/src/geodeticpatch.cpp @@ -132,8 +132,8 @@ double GeodeticPatch::maxLon() const { bool GeodeticPatch::contains(const Geodetic2& p) const { const Geodetic2 diff = { - _center.lat - p.lat, - _center.lon - p.lon + .lat = _center.lat - p.lat, + .lon = _center.lon - p.lon }; return glm::abs(diff.lat) <= _halfSize.lat && glm::abs(diff.lon) <= _halfSize.lon; } @@ -166,8 +166,8 @@ Geodetic2 GeodeticPatch::clamp(const Geodetic2& p) const { Geodetic2 GeodeticPatch::closestCorner(const Geodetic2& p) const { // LatLon vector from patch center to the point const Geodetic2 centerToPoint = { - p.lat - _center.lat, - p.lon - _center.lon + .lat = p.lat - _center.lat, + .lon = p.lon - _center.lon }; // Normalize the difference angles to be centered around 0. diff --git a/modules/globebrowsing/src/globerotation.cpp b/modules/globebrowsing/src/globerotation.cpp index 14dd58d221..be621a2642 100644 --- a/modules/globebrowsing/src/globerotation.cpp +++ b/modules/globebrowsing/src/globerotation.cpp @@ -232,11 +232,11 @@ glm::dmat3 GlobeRotation::matrix(const UpdateData&) const { zAxis = glm::normalize(zAxis); const glm::dvec3 xAxis = glm::normalize(glm::cross(yAxis, zAxis)); - const glm::dmat3 mat = { + const glm::dmat3 mat = glm::dmat3( xAxis.x, xAxis.y, xAxis.z, yAxis.x, yAxis.y, yAxis.z, zAxis.x, zAxis.y, zAxis.z - }; + ); const glm::dquat q = glm::angleAxis(glm::radians(_angle.value()), yAxis); _matrix = glm::toMat3(q) * mat; diff --git a/modules/globebrowsing/src/layergroupid.h b/modules/globebrowsing/src/layergroupid.h index eed9b05ae8..2feb9b1a2a 100644 --- a/modules/globebrowsing/src/layergroupid.h +++ b/modules/globebrowsing/src/layergroupid.h @@ -47,11 +47,31 @@ struct Group { }; constexpr std::array Groups = { - Group{ Group::ID::HeightLayers, "HeightLayers", "Height Layers" }, - Group{ Group::ID::ColorLayers, "ColorLayers", "Color Layers" }, - Group{ Group::ID::Overlays, "Overlays", "Overlays" }, - Group{ Group::ID::NightLayers, "NightLayers", "Night Layers" }, - Group{ Group::ID::WaterMasks, "WaterMasks", "Water Masks" } + Group { + .id = Group::ID::HeightLayers, + .identifier = "HeightLayers", + .name = "Height Layers" + }, + Group { + .id = Group::ID::ColorLayers, + .identifier = "ColorLayers", + .name = "Color Layers" + }, + Group { + .id = Group::ID::Overlays, + .identifier = "Overlays", + .name = "Overlays" + }, + Group { + .id = Group::ID::NightLayers, + .identifier = "NightLayers", + .name = "Night Layers" + }, + Group { + .id = Group::ID::WaterMasks, + .identifier = "WaterMasks", + .name = "Water Masks" + } }; @@ -76,16 +96,46 @@ struct Layer { }; constexpr std::array Layers = { - Layer{ Layer::ID::DefaultTileLayer, "DefaultTileLayer" }, - Layer{ Layer::ID::SingleImageTileLayer, "SingleImageTileLayer" }, - Layer{ Layer::ID::ImageSequenceTileLayer, "ImageSequenceTileLayer" }, - Layer{ Layer::ID::SizeReferenceTileLayer, "SizeReferenceTileLayer" }, - Layer{ Layer::ID::TemporalTileLayer, "TemporalTileLayer" }, - Layer{ Layer::ID::TileIndexTileLayer, "TileIndexTileLayer" }, - Layer{ Layer::ID::ByIndexTileLayer, "ByIndexTileLayer" }, - Layer{ Layer::ID::ByLevelTileLayer, "ByLevelTileLayer" }, - Layer{ Layer::ID::SolidColor, "SolidColor" }, - Layer{ Layer::ID::SpoutImageTileLayer, "SpoutImageTileLayer" } + Layer { + .id = Layer::ID::DefaultTileLayer, + .identifier = "DefaultTileLayer" + }, + Layer { + .id = Layer::ID::SingleImageTileLayer, + .identifier = "SingleImageTileLayer" + }, + Layer { + .id = Layer::ID::ImageSequenceTileLayer, + .identifier = "ImageSequenceTileLayer" + }, + Layer { + .id = Layer::ID::SizeReferenceTileLayer, + .identifier = "SizeReferenceTileLayer" + }, + Layer { + .id = Layer::ID::TemporalTileLayer, + .identifier = "TemporalTileLayer" + }, + Layer { + .id = Layer::ID::TileIndexTileLayer, + .identifier = "TileIndexTileLayer" + }, + Layer { + .id = Layer::ID::ByIndexTileLayer, + .identifier = "ByIndexTileLayer" + }, + Layer { + .id = Layer::ID::ByLevelTileLayer, + .identifier = "ByLevelTileLayer" + }, + Layer { + .id = Layer::ID::SolidColor, + .identifier = "SolidColor" + }, + Layer { + .id = Layer::ID::SpoutImageTileLayer, + .identifier = "SpoutImageTileLayer" + } }; @@ -102,9 +152,18 @@ struct Adjustment { }; constexpr std::array Adjustments = { - Adjustment{ Adjustment::ID::None, "None" }, - Adjustment{ Adjustment::ID::ChromaKey, "ChromaKey" }, - Adjustment{ Adjustment::ID::TransferFunction, "TransferFunction" } + Adjustment { + .id = Adjustment::ID::None, + .identifier = "None" + }, + Adjustment { + .id = Adjustment::ID::ChromaKey, + .identifier = "ChromaKey" + }, + Adjustment { + .id = Adjustment::ID::TransferFunction, + .identifier = "TransferFunction" + } }; @@ -123,11 +182,11 @@ struct Blend { }; constexpr std::array Blends = { - Blend{ Blend::ID::Normal, "Normal" }, - Blend{ Blend::ID::Multiply, "Multiply" }, - Blend{ Blend::ID::Add, "Add" }, - Blend{ Blend::ID::Subtract, "Subtract" }, - Blend{ Blend::ID::Color, "Color" } + Blend { .id = Blend::ID::Normal, .identifier = "Normal" }, + Blend { .id = Blend::ID::Multiply, .identifier = "Multiply" }, + Blend { .id = Blend::ID::Add, .identifier = "Add" }, + Blend { .id = Blend::ID::Subtract, .identifier = "Subtract" }, + Blend { .id = Blend::ID::Color, .identifier = "Color" } }; } // namespace openspace::globebrowsing::layers diff --git a/modules/globebrowsing/src/rawtile.h b/modules/globebrowsing/src/rawtile.h index 09be69e9fc..8014ed0ca0 100644 --- a/modules/globebrowsing/src/rawtile.h +++ b/modules/globebrowsing/src/rawtile.h @@ -50,7 +50,7 @@ struct RawTile { std::unique_ptr imageData; TileMetaData tileMetaData; std::optional textureInitData; - TileIndex tileIndex = { 0, 0, 0 }; + TileIndex tileIndex = TileIndex(0, 0, 0); ReadError error = ReadError::None; GLuint pbo = 0; }; diff --git a/modules/globebrowsing/src/rawtiledatareader.cpp b/modules/globebrowsing/src/rawtiledatareader.cpp index fb751278e0..9f156b5e66 100644 --- a/modules/globebrowsing/src/rawtiledatareader.cpp +++ b/modules/globebrowsing/src/rawtiledatareader.cpp @@ -69,51 +69,51 @@ struct MemoryLocation { // The memory locations are grouped to be mostly cache-aligned constexpr std::array NoDataAvailableData = { - MemoryLocation{ 296380, std::byte(205) }, - MemoryLocation{ 296381, std::byte(205) }, - MemoryLocation{ 296382, std::byte(205) }, - MemoryLocation{ 296383, std::byte(255) }, - MemoryLocation{ 296384, std::byte(224) }, - MemoryLocation{ 296385, std::byte(224) }, - MemoryLocation{ 296386, std::byte(224) }, - MemoryLocation{ 296387, std::byte(255) }, - MemoryLocation{ 296388, std::byte(244) }, - MemoryLocation{ 296389, std::byte(244) }, - MemoryLocation{ 296390, std::byte(244) }, - MemoryLocation{ 296391, std::byte(255) }, + MemoryLocation { .offset = 296380, .value = std::byte(205) }, + MemoryLocation { .offset = 296381, .value = std::byte(205) }, + MemoryLocation { .offset = 296382, .value = std::byte(205) }, + MemoryLocation { .offset = 296383, .value = std::byte(255) }, + MemoryLocation { .offset = 296384, .value = std::byte(224) }, + MemoryLocation { .offset = 296385, .value = std::byte(224) }, + MemoryLocation { .offset = 296386, .value = std::byte(224) }, + MemoryLocation { .offset = 296387, .value = std::byte(255) }, + MemoryLocation { .offset = 296388, .value = std::byte(244) }, + MemoryLocation { .offset = 296389, .value = std::byte(244) }, + MemoryLocation { .offset = 296390, .value = std::byte(244) }, + MemoryLocation { .offset = 296391, .value = std::byte(255) }, - MemoryLocation{ 269840, std::byte(209) }, - MemoryLocation{ 269841, std::byte(209) }, - MemoryLocation{ 269842, std::byte(209) }, - MemoryLocation{ 269844, std::byte(203) }, - MemoryLocation{ 269845, std::byte(203) }, - MemoryLocation{ 269846, std::byte(203) }, - MemoryLocation{ 269852, std::byte(221) }, - MemoryLocation{ 269853, std::byte(221) }, - MemoryLocation{ 269854, std::byte(221) }, - MemoryLocation{ 269856, std::byte(225) }, - MemoryLocation{ 269857, std::byte(225) }, - MemoryLocation{ 269858, std::byte(225) }, - MemoryLocation{ 269860, std::byte(218) }, - MemoryLocation{ 269861, std::byte(218) }, + MemoryLocation { .offset = 269840, .value = std::byte(209) }, + MemoryLocation { .offset = 269841, .value = std::byte(209) }, + MemoryLocation { .offset = 269842, .value = std::byte(209) }, + MemoryLocation { .offset = 269844, .value = std::byte(203) }, + MemoryLocation { .offset = 269845, .value = std::byte(203) }, + MemoryLocation { .offset = 269846, .value = std::byte(203) }, + MemoryLocation { .offset = 269852, .value = std::byte(221) }, + MemoryLocation { .offset = 269853, .value = std::byte(221) }, + MemoryLocation { .offset = 269854, .value = std::byte(221) }, + MemoryLocation { .offset = 269856, .value = std::byte(225) }, + MemoryLocation { .offset = 269857, .value = std::byte(225) }, + MemoryLocation { .offset = 269858, .value = std::byte(225) }, + MemoryLocation { .offset = 269860, .value = std::byte(218) }, + MemoryLocation { .offset = 269861, .value = std::byte(218) }, - MemoryLocation{ 240349, std::byte(203) }, - MemoryLocation{ 240350, std::byte(203) }, - MemoryLocation{ 240352, std::byte(205) }, - MemoryLocation{ 240353, std::byte(204) }, - MemoryLocation{ 240354, std::byte(205) }, + MemoryLocation { .offset = 240349, .value = std::byte(203) }, + MemoryLocation { .offset = 240350, .value = std::byte(203) }, + MemoryLocation { .offset = 240352, .value = std::byte(205) }, + MemoryLocation { .offset = 240353, .value = std::byte(204) }, + MemoryLocation { .offset = 240354, .value = std::byte(205) }, - MemoryLocation{ 0, std::byte(204) }, - MemoryLocation{ 7, std::byte(255) }, - MemoryLocation{ 520, std::byte(204) }, - MemoryLocation{ 880, std::byte(204) }, - MemoryLocation{ 883, std::byte(255) }, - MemoryLocation{ 91686, std::byte(204) }, - MemoryLocation{ 372486, std::byte(204) }, - MemoryLocation{ 670483, std::byte(255) }, - MemoryLocation{ 231684, std::byte(202) }, - MemoryLocation{ 232092, std::byte(202) }, - MemoryLocation{ 235921, std::byte(203) }, + MemoryLocation { .offset = 0, .value = std::byte(204) }, + MemoryLocation { .offset = 7, .value = std::byte(255) }, + MemoryLocation { .offset = 520, .value = std::byte(204) }, + MemoryLocation { .offset = 880, .value = std::byte(204) }, + MemoryLocation { .offset = 883, .value = std::byte(255) }, + MemoryLocation { .offset = 91686, .value = std::byte(204) }, + MemoryLocation { .offset = 372486, .value = std::byte(204) }, + MemoryLocation { .offset = 670483, .value = std::byte(255) }, + MemoryLocation { .offset = 231684, .value = std::byte(202) }, + MemoryLocation { .offset = 232092, .value = std::byte(202) }, + MemoryLocation { .offset = 235921, .value = std::byte(203) }, }; enum class Side { @@ -304,10 +304,10 @@ bool isInside(const PixelRegion& lhs, const PixelRegion& rhs) { } IODescription cutIODescription(IODescription& io, Side side, int pos) { - glm::dvec2 ratio = { + glm::dvec2 ratio = glm::dvec2( io.write.region.numPixels.x / static_cast(io.read.region.numPixels.x), io.write.region.numPixels.y / static_cast(io.read.region.numPixels.y) - }; + ); IODescription whatCameOff = io; whatCameOff.read.region = globalCut(io.read.region, side, pos); @@ -785,13 +785,14 @@ IODescription RawTileDataReader::ioDescription(const TileIndex& tileIndex) const io.write.region.numPixels = _initData.dimensions; io.read.overview = 0; - io.read.fullRegion.start = { 0, 0 }; - io.read.fullRegion.numPixels = { _rasterXSize, _rasterYSize }; + io.read.fullRegion.start = glm::ivec2(0, 0); + io.read.fullRegion.numPixels = glm::ivec2(_rasterXSize, _rasterYSize); // For correct sampling in dataset, we need to pad the texture tile - PixelRegion scaledPadding; - scaledPadding.start = _initData.tilePixelStartOffset; - scaledPadding.numPixels = _initData.tilePixelSizeDifference; + PixelRegion scaledPadding = { + .start = _initData.tilePixelStartOffset, + .numPixels = _initData.tilePixelSizeDifference + }; const double scale = static_cast(io.read.region.numPixels.x) / static_cast(io.write.region.numPixels.x); diff --git a/modules/globebrowsing/src/rawtiledatareader.h b/modules/globebrowsing/src/rawtiledatareader.h index b935ad2b20..c58ea2da80 100644 --- a/modules/globebrowsing/src/rawtiledatareader.h +++ b/modules/globebrowsing/src/rawtiledatareader.h @@ -98,7 +98,7 @@ private: const TileTextureInitData _initData; const PerformPreprocessing _preprocess; - TileDepthTransform _depthTransform = { 0.f, 0.f }; + TileDepthTransform _depthTransform = { .scale = 0.f, .offset = 0.f }; mutable std::mutex _datasetLock; }; diff --git a/modules/globebrowsing/src/renderableglobe.cpp b/modules/globebrowsing/src/renderableglobe.cpp index 43b52e579d..89c2b8c908 100644 --- a/modules/globebrowsing/src/renderableglobe.cpp +++ b/modules/globebrowsing/src/renderableglobe.cpp @@ -1875,13 +1875,13 @@ float RenderableGlobe::getHeight(const glm::dvec3& position) const { const Geodetic2 southWest = patch.corner(Quad::SOUTH_WEST); const Geodetic2 geoDiffPatch = { - northEast.lat - southWest.lat, - northEast.lon - southWest.lon + .lat = northEast.lat - southWest.lat, + .lon = northEast.lon - southWest.lon }; const Geodetic2 geoDiffPoint = { - geodeticPosition.lat - southWest.lat, - geodeticPosition.lon - southWest.lon + .lat = geodeticPosition.lat - southWest.lat, + .lon = geodeticPosition.lon - southWest.lon }; const glm::vec2 patchUV = glm::vec2( geoDiffPoint.lon / geoDiffPatch.lon, diff --git a/modules/globebrowsing/src/tileprovider/defaulttileprovider.cpp b/modules/globebrowsing/src/tileprovider/defaulttileprovider.cpp index c499bbf767..61a190908f 100644 --- a/modules/globebrowsing/src/tileprovider/defaulttileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/defaulttileprovider.cpp @@ -135,7 +135,10 @@ Tile DefaultTileProvider::tile(const TileIndex& tileIndex) { if (tileIndex.level > maxLevel()) { return Tile{ nullptr, std::nullopt, Tile::Status::OutOfRange }; } - const cache::ProviderTileKey key = { tileIndex, uniqueIdentifier }; + const cache::ProviderTileKey key = { + .tileIndex = tileIndex, + .providerID = uniqueIdentifier + }; cache::MemoryAwareTileCache* tileCache = global::moduleEngine->module()->tileCache(); Tile tile = tileCache->get(key); @@ -154,7 +157,10 @@ Tile::Status DefaultTileProvider::tileStatus(const TileIndex& index) { return Tile::Status::OutOfRange; } - const cache::ProviderTileKey key = { index, uniqueIdentifier }; + const cache::ProviderTileKey key = { + .tileIndex = index, + .providerID = uniqueIdentifier + }; cache::MemoryAwareTileCache* tileCache = global::moduleEngine->module()->tileCache(); return tileCache->get(key).status; @@ -171,7 +177,10 @@ void DefaultTileProvider::update() { std::optional tile = _asyncTextureDataProvider->popFinishedRawTile(); if (tile) { - const cache::ProviderTileKey key = { tile->tileIndex, uniqueIdentifier }; + const cache::ProviderTileKey key = { + .tileIndex = tile->tileIndex, + .providerID = uniqueIdentifier + }; cache::MemoryAwareTileCache* tileCache = global::moduleEngine->module()->tileCache(); ghoul_assert(!tileCache->exist(key), "Tile must not be existing in cache"); diff --git a/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.cpp b/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.cpp index bd71538b67..9d911b321c 100644 --- a/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.cpp @@ -94,12 +94,12 @@ Tile SizeReferenceTileProvider::tile(const TileIndex& tileIndex) { } std::string text = fmt::format(" {:.0f} {:s}", tileLongitudalLength, unit); - glm::vec2 textPosition = { + glm::vec2 textPosition = glm::vec2( 0.f, aboveEquator ? fontSize / 2.f : initData.dimensions.y - 3.f * fontSize / 2.f - }; + ); return TextTileProvider::renderTile(tileIndex, text, textPosition, glm::vec4(1.f)); } diff --git a/modules/globebrowsing/src/tileprovider/tileprovider.cpp b/modules/globebrowsing/src/tileprovider/tileprovider.cpp index 8d6d17c85d..abdb8c77b2 100644 --- a/modules/globebrowsing/src/tileprovider/tileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/tileprovider.cpp @@ -169,7 +169,10 @@ ChunkTile TileProvider::chunkTile(TileIndex tileIndex, int parents, int maxParen ti.level--; }; - TileUvTransform uvTransform = { glm::vec2(0.f, 0.f), glm::vec2(1.f, 1.f) }; + TileUvTransform uvTransform = { + .uvOffset = glm::vec2(0.f, 0.f), + .uvScale = glm::vec2(1.f, 1.f) + }; // Step 1. Traverse 0 or more parents up the chunkTree as requested by the caller for (int i = 0; i < parents && tileIndex.level > 1; i++) { @@ -221,8 +224,8 @@ ChunkTilePile TileProvider::chunkTilePile(TileIndex tileIndex, int pileSize) { if (i == 0) { // First iteration chunkTilePile[i]->tile = DefaultTile; - chunkTilePile[i]->uvTransform.uvOffset = { 0.f, 0.f }; - chunkTilePile[i]->uvTransform.uvScale = { 1.f, 1.f }; + chunkTilePile[i]->uvTransform.uvOffset = glm::vec2(0.f, 0.f); + chunkTilePile[i]->uvTransform.uvScale = glm::vec2(1.f, 1.f); } else { // We are iterating through the array one-by-one, so we are guaranteed diff --git a/modules/imgui/imguimodule.cpp b/modules/imgui/imguimodule.cpp index 676bc403a7..a7c178bf1a 100644 --- a/modules/imgui/imguimodule.cpp +++ b/modules/imgui/imguimodule.cpp @@ -322,13 +322,13 @@ void ImGUIModule::internalInitializeGL() { ); ImGuiStyle& style = ImGui::GetStyle(); - style.WindowPadding = { 4.f, 4.f }; + style.WindowPadding = ImVec2(4.f, 4.f); style.WindowRounding = 0.f; - style.FramePadding = { 3.f, 3.f }; + style.FramePadding = ImVec2(3.f, 3.f); style.FrameRounding = 0.f; - style.ItemSpacing = { 3.f, 2.f }; - style.ItemInnerSpacing = { 3.f, 2.f }; - style.TouchExtraPadding = { 1.f, 1.f }; + style.ItemSpacing = ImVec2(3.f, 2.f); + style.ItemInnerSpacing = ImVec2(3.f, 2.f); + style.TouchExtraPadding = ImVec2(1.f, 1.f); style.IndentSpacing = 15.f; style.ScrollbarSize = 10.f; style.ScrollbarRounding = 0.f; @@ -713,7 +713,7 @@ bool ImGUIModule::touchDetectedCallback(TouchInput input) { return false; } if (_validTouchStates.empty()) { - io.MousePos = { windowPos.x, windowPos.y }; + io.MousePos = ImVec2(windowPos.x, windowPos.y); io.MouseClicked[0] = true; } _validTouchStates.push_back(input); diff --git a/modules/imgui/src/renderproperties.cpp b/modules/imgui/src/renderproperties.cpp index 3e3d14db7d..2fa228cf55 100644 --- a/modules/imgui/src/renderproperties.cpp +++ b/modules/imgui/src/renderproperties.cpp @@ -695,16 +695,16 @@ void renderDMat2Property(Property* prop, const std::string& ownerName, ImGui::Text("%s", name.c_str()); glm::mat2 value = glm::dmat2(*p); - glm::dvec2 minValues = { + glm::dvec2 minValues = glm::dvec2( glm::compMin(p->minValue()[0]), glm::compMin(p->minValue()[1]) - }; + ); float min = static_cast(glm::compMin(minValues)); - glm::dvec2 maxValues = { + glm::dvec2 maxValues = glm::dvec2( glm::compMax(p->maxValue()[0]), glm::compMax(p->maxValue()[1]) - }; + ); float max = static_cast(glm::compMax(maxValues)); bool changed = false; @@ -747,18 +747,18 @@ void renderDMat3Property(Property* prop, const std::string& ownerName, ImGui::Text("%s", name.c_str()); glm::mat3 value = glm::dmat3(*p); - glm::dvec3 minValues = { + glm::dvec3 minValues = glm::dvec3( glm::compMin(p->minValue()[0]), glm::compMin(p->minValue()[1]), glm::compMin(p->minValue()[2]) - }; + ); float min = static_cast(glm::compMin(minValues)); - glm::dvec3 maxValues = { + glm::dvec3 maxValues = glm::dvec3( glm::compMax(p->maxValue()[0]), glm::compMax(p->maxValue()[1]), glm::compMax(p->maxValue()[2]) - }; + ); float max = static_cast(glm::compMax(maxValues)); bool changed = false; @@ -809,20 +809,20 @@ void renderDMat4Property(Property* prop, const std::string& ownerName, ImGui::Text("%s", name.c_str()); glm::mat4 value = glm::dmat4(*p); - glm::dvec4 minValues = { + glm::dvec4 minValues = glm::dvec4( glm::compMin(p->minValue()[0]), glm::compMin(p->minValue()[1]), glm::compMin(p->minValue()[2]), glm::compMin(p->minValue()[3]) - }; + ); float min = static_cast(glm::compMin(minValues)); - glm::dvec4 maxValues = { + glm::dvec4 maxValues = glm::dvec4( glm::compMax(p->maxValue()[0]), glm::compMax(p->maxValue()[1]), glm::compMax(p->maxValue()[2]), glm::compMax(p->maxValue()[3]) - }; + ); float max = static_cast(glm::compMax(maxValues)); bool changed = false; diff --git a/modules/kameleon/src/kameleonwrapper.cpp b/modules/kameleon/src/kameleonwrapper.cpp index ff614e3a78..d1515b89af 100644 --- a/modules/kameleon/src/kameleonwrapper.cpp +++ b/modules/kameleon/src/kameleonwrapper.cpp @@ -136,29 +136,29 @@ bool KameleonWrapper::open(const std::string& filename) { LDEBUG(fmt::format("y: {}", _yCoordVar)); LDEBUG(fmt::format("z: {}", _zCoordVar)); - _min = { + _min = glm::vec3( _model->getVariableAttribute(_xCoordVar, "actual_min").getAttributeFloat(), _model->getVariableAttribute(_yCoordVar, "actual_min").getAttributeFloat(), _model->getVariableAttribute(_zCoordVar, "actual_min").getAttributeFloat() - }; + ); - _max = { + _max = glm::vec3( _model->getVariableAttribute(_xCoordVar, "actual_max").getAttributeFloat(), _model->getVariableAttribute(_yCoordVar, "actual_max").getAttributeFloat(), _model->getVariableAttribute(_zCoordVar, "actual_max").getAttributeFloat() - }; + ); - _validMin = { + _validMin = glm::vec3( _model->getVariableAttribute(_xCoordVar, "valid_min").getAttributeFloat(), _model->getVariableAttribute(_yCoordVar, "valid_min").getAttributeFloat(), _model->getVariableAttribute(_zCoordVar, "valid_min").getAttributeFloat() - }; + ); - _validMax = { + _validMax = glm::vec3( _model->getVariableAttribute(_xCoordVar, "valid_max").getAttributeFloat(), _model->getVariableAttribute(_yCoordVar, "valid_max").getAttributeFloat(), _model->getVariableAttribute(_zCoordVar, "valid_max").getAttributeFloat() - }; + ); return true; } @@ -700,11 +700,11 @@ glm::vec3 KameleonWrapper::modelBarycenterOffset() const { return glm::vec3(0.f); } - glm::vec3 offset = { + glm::vec3 offset = glm::vec3( _min.x + (std::abs(_min.x) + std::abs(_max.x)) / 2.f, _min.y + (std::abs(_min.y) + std::abs(_max.y)) / 2.f, _min.z + (std::abs(_min.z) + std::abs(_max.z)) / 2.f - }; + ); return offset; } @@ -725,11 +725,11 @@ glm::vec3 KameleonWrapper::modelScale() const { return glm::vec3(1.f); } - glm::vec3 scale = { + glm::vec3 scale = glm::vec3( _max.x - _min.x, _max.y - _min.y, _max.z - _min.z - }; + ); return scale; } @@ -907,57 +907,57 @@ KameleonWrapper::TraceLine KameleonWrapper::traceLorentzTrajectory( trajectory.push_back(pos); // Calculate new position with Lorentz force quation and Runge-Kutta 4th order - glm::vec3 B = { + glm::vec3 B = glm::vec3( _interpolator->interpolate(bxID, pos.x, pos.y, pos.z), _interpolator->interpolate(byID, pos.x, pos.y, pos.z), _interpolator->interpolate(bzID, pos.x, pos.y, pos.z) - }; + ); - glm::vec3 E = { + glm::vec3 E = glm::vec3( _interpolator->interpolate(jxID, pos.x, pos.y, pos.z), _interpolator->interpolate(jyID, pos.x, pos.y, pos.z), _interpolator->interpolate(jzID, pos.x, pos.y, pos.z) - }; + ); const glm::vec3 k1 = glm::normalize(eCharge * (E + glm::cross(v0, B))); const glm::vec3 k1Pos = pos + step / 2.f * v0 + step * step / 8.f * k1; - B = { + B = glm::vec3( _interpolator->interpolate(bxID, k1Pos.x, k1Pos.y, k1Pos.z), _interpolator->interpolate(byID, k1Pos.x, k1Pos.y, k1Pos.z), _interpolator->interpolate(bzID, k1Pos.x, k1Pos.y, k1Pos.z) - }; - E = { + ); + E = glm::vec3( _interpolator->interpolate(jxID, k1Pos.x, k1Pos.y, k1Pos.z), _interpolator->interpolate(jyID, k1Pos.x, k1Pos.y, k1Pos.z), _interpolator->interpolate(jzID, k1Pos.x, k1Pos.y, k1Pos.z) - }; + ); const glm::vec3 v1 = v0 + step / 2.f * k1; const glm::vec3 k2 = glm::normalize(eCharge * (E + glm::cross(v1, B))); - B = { + B = glm::vec3( _interpolator->interpolate(bxID, k1Pos.x, k1Pos.y, k1Pos.z), _interpolator->interpolate(byID, k1Pos.x, k1Pos.y, k1Pos.z), _interpolator->interpolate(bzID, k1Pos.x, k1Pos.y, k1Pos.z) - }; - E = { + ); + E = glm::vec3( _interpolator->interpolate(jxID, k1Pos.x, k1Pos.y, k1Pos.z), _interpolator->interpolate(jyID, k1Pos.x, k1Pos.y, k1Pos.z), _interpolator->interpolate(jzID, k1Pos.x, k1Pos.y, k1Pos.z) - }; + ); const glm::vec3 v2 = v0 + step / 2.f * k2; const glm::vec3 k3 = glm::normalize(eCharge * (E + glm::cross(v2, B))); const glm::vec3 k3Pos = pos + step * v0 + step * step / 2.f * k1; - B = { + B = glm::vec3( _interpolator->interpolate(bxID, k3Pos.x, k3Pos.y, k3Pos.z), _interpolator->interpolate(byID, k3Pos.x, k3Pos.y, k3Pos.z), _interpolator->interpolate(bzID, k3Pos.x, k3Pos.y, k3Pos.z) - }; - E = { + ); + E = glm::vec3( _interpolator->interpolate(jxID, k3Pos.x, k3Pos.y, k3Pos.z), _interpolator->interpolate(jyID, k3Pos.x, k3Pos.y, k3Pos.z), _interpolator->interpolate(jzID, k3Pos.x, k3Pos.y, k3Pos.z) - }; + ); const glm::vec3 v3 = v0 + step * k3; const glm::vec3 k4 = glm::normalize(eCharge * (E + glm::cross(v3, B))); diff --git a/modules/skybrowser/src/renderableskytarget.cpp b/modules/skybrowser/src/renderableskytarget.cpp index dec6890321..ffafd90740 100644 --- a/modules/skybrowser/src/renderableskytarget.cpp +++ b/modules/skybrowser/src/renderableskytarget.cpp @@ -188,7 +188,7 @@ void RenderableSkyTarget::render(const RenderData& data, RendererTasks&) { ZoneScoped const bool showRectangle = _verticalFov > _showRectangleThreshold; - glm::vec4 color = { glm::vec3(_borderColor) / 255.f, 1.0 }; + glm::vec4 color = glm::vec4(glm::vec3(_borderColor) / 255.f, 1.0); _shader->activate(); _shader->setUniform("opacity", opacity()); diff --git a/modules/space/kepler.cpp b/modules/space/kepler.cpp index d1059826be..3f88c558e5 100644 --- a/modules/space/kepler.cpp +++ b/modules/space/kepler.cpp @@ -93,38 +93,38 @@ namespace { } }; - constexpr const LeapSecond LeapEpoch = { 2000, 1 }; + constexpr const LeapSecond LeapEpoch = { .year = 2000, .dayOfYear = 1 }; // List taken from: https://www.ietf.org/timezones/data/leap-seconds.list constexpr const std::array LeapSeconds = { - LeapSecond{ 1972, 1 }, - LeapSecond{ 1972, 183 }, - LeapSecond{ 1973, 1 }, - LeapSecond{ 1974, 1 }, - LeapSecond{ 1975, 1 }, - LeapSecond{ 1976, 1 }, - LeapSecond{ 1977, 1 }, - LeapSecond{ 1978, 1 }, - LeapSecond{ 1979, 1 }, - LeapSecond{ 1980, 1 }, - LeapSecond{ 1981, 182 }, - LeapSecond{ 1982, 182 }, - LeapSecond{ 1983, 182 }, - LeapSecond{ 1985, 182 }, - LeapSecond{ 1988, 1 }, - LeapSecond{ 1990, 1 }, - LeapSecond{ 1991, 1 }, - LeapSecond{ 1992, 183 }, - LeapSecond{ 1993, 182 }, - LeapSecond{ 1994, 182 }, - LeapSecond{ 1996, 1 }, - LeapSecond{ 1997, 182 }, - LeapSecond{ 1999, 1 }, - LeapSecond{ 2006, 1 }, - LeapSecond{ 2009, 1 }, - LeapSecond{ 2012, 183 }, - LeapSecond{ 2015, 182 }, - LeapSecond{ 2017, 1 } + LeapSecond { .year = 1972, .dayOfYear = 1 }, + LeapSecond { .year = 1972, .dayOfYear = 183 }, + LeapSecond { .year = 1973, .dayOfYear = 1 }, + LeapSecond { .year = 1974, .dayOfYear = 1 }, + LeapSecond { .year = 1975, .dayOfYear = 1 }, + LeapSecond { .year = 1976, .dayOfYear = 1 }, + LeapSecond { .year = 1977, .dayOfYear = 1 }, + LeapSecond { .year = 1978, .dayOfYear = 1 }, + LeapSecond { .year = 1979, .dayOfYear = 1 }, + LeapSecond { .year = 1980, .dayOfYear = 1 }, + LeapSecond { .year = 1981, .dayOfYear = 182 }, + LeapSecond { .year = 1982, .dayOfYear = 182 }, + LeapSecond { .year = 1983, .dayOfYear = 182 }, + LeapSecond { .year = 1985, .dayOfYear = 182 }, + LeapSecond { .year = 1988, .dayOfYear = 1 }, + LeapSecond { .year = 1990, .dayOfYear = 1 }, + LeapSecond { .year = 1991, .dayOfYear = 1 }, + LeapSecond { .year = 1992, .dayOfYear = 183 }, + LeapSecond { .year = 1993, .dayOfYear = 182 }, + LeapSecond { .year = 1994, .dayOfYear = 182 }, + LeapSecond { .year = 1996, .dayOfYear = 1 }, + LeapSecond { .year = 1997, .dayOfYear = 182 }, + LeapSecond { .year = 1999, .dayOfYear = 1 }, + LeapSecond { .year = 2006, .dayOfYear = 1 }, + LeapSecond { .year = 2009, .dayOfYear = 1 }, + LeapSecond { .year = 2012, .dayOfYear = 183 }, + LeapSecond { .year = 2015, .dayOfYear = 182 }, + LeapSecond { .year = 2017, .dayOfYear = 1 } }; // Get the position of the last leap second before the desired date LeapSecond date{ year, dayOfYear }; diff --git a/modules/space/translation/keplertranslation.cpp b/modules/space/translation/keplertranslation.cpp index 7aacf36986..c6d7e1c94f 100644 --- a/modules/space/translation/keplertranslation.cpp +++ b/modules/space/translation/keplertranslation.cpp @@ -258,11 +258,11 @@ glm::dvec3 KeplerTranslation::position(const UpdateData& data) const { const double e = eccentricAnomaly(meanAnomaly); // Use the eccentric anomaly to compute the actual location - const glm::dvec3 p = { + const glm::dvec3 p = glm::dvec3( _semiMajorAxis * 1000.0 * (cos(e) - _eccentricity), _semiMajorAxis * 1000.0 * sin(e) * sqrt(1.0 - _eccentricity * _eccentricity), 0.0 - }; + ); return _orbitPlaneRotation * p; } @@ -278,9 +278,9 @@ void KeplerTranslation::computeOrbitPlane() const { // inclination // 3. Around the new z axis to place the closest approach to the correct location - const glm::vec3 ascendingNodeAxisRot = { 0.f, 0.f, 1.f }; - const glm::vec3 inclinationAxisRot = { 1.f, 0.f, 0.f }; - const glm::vec3 argPeriapsisAxisRot = { 0.f, 0.f, 1.f }; + const glm::vec3 ascendingNodeAxisRot = glm::vec3(0.f, 0.f, 1.f); + const glm::vec3 inclinationAxisRot = glm::vec3(1.f, 0.f, 0.f); + const glm::vec3 argPeriapsisAxisRot = glm::vec3(0.f, 0.f, 1.f); const double asc = glm::radians(_ascendingNode.value()); const double inc = glm::radians(_inclination.value()); diff --git a/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp b/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp index aa75f1c4f5..a2559daee9 100644 --- a/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp +++ b/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp @@ -148,7 +148,7 @@ void DashboardItemInstruments::render(glm::vec2& penPosition) { // If the remaining time is below 5 minutes, we switch over to seconds display if (remaining < 5 * 60) { - remainingConv = { remaining, "seconds" }; + remainingConv = std::pair(remaining, "seconds"); } const int Size = 25; diff --git a/modules/spacecraftinstruments/rendering/renderablefov.cpp b/modules/spacecraftinstruments/rendering/renderablefov.cpp index a34e2574a9..018846e1c0 100644 --- a/modules/spacecraftinstruments/rendering/renderablefov.cpp +++ b/modules/spacecraftinstruments/rendering/renderablefov.cpp @@ -480,7 +480,10 @@ void RenderableFov::computeIntercepts(double time, const std::string& target, // Regardless of what happens next, the position of every second element is going // to be the same. Only the color attribute might change - first = { { 0.f, 0.f, 0.f }, RenderInformation::VertexColorTypeDefaultStart}; + first = { + .position = { 0.f, 0.f, 0.f }, + .color = RenderInformation::VertexColorTypeDefaultStart + }; if (!isInFov) { // If the target is not in the field of view, we don't need to perform any @@ -488,9 +491,8 @@ void RenderableFov::computeIntercepts(double time, const std::string& target, const glm::vec3 o = orthogonalProjection(bound, time, target); second = { - { o.x, o.y, o.z }, - // This had a different color (0.4) before ---abock - RenderInformation::VertexColorTypeDefaultEnd + .position = { o.x, o.y, o.z }, + .color = RenderInformation::VertexColorTypeDefaultEnd }; } else { @@ -531,16 +533,16 @@ void RenderableFov::computeIntercepts(double time, const std::string& target, srfVec *= _standOffDistance; second = { - { srfVec.x, srfVec.y, srfVec.z }, - RenderInformation::VertexColorTypeIntersectionEnd + .position = { srfVec.x, srfVec.y, srfVec.z }, + .color = RenderInformation::VertexColorTypeIntersectionEnd }; } else { // This point did not intersect the target though others did const glm::vec3 o = orthogonalProjection(bound, time, target); second = { - { o.x, o.y, o.z }, - RenderInformation::VertexColorTypeInFieldOfView + .position = { o.x, o.y, o.z }, + .color = RenderInformation::VertexColorTypeInFieldOfView }; } } @@ -626,15 +628,15 @@ void RenderableFov::computeIntercepts(double time, const std::string& target, if (intercepts(tBound)) { const glm::vec3 icpt = interceptVector(tBound); _orthogonalPlane.data[indexForBounds(i) + m] = { - { icpt.x, icpt.y, icpt.z }, - RenderInformation::VertexColorTypeSquare + .position = { icpt.x, icpt.y, icpt.z }, + .color = RenderInformation::VertexColorTypeSquare }; } else { const glm::vec3 o = orthogonalProjection(tBound, time, target); _orthogonalPlane.data[indexForBounds(i) + m] = { - { o.x, o.y, o.z }, - RenderInformation::VertexColorTypeSquare + .position = { o.x, o.y, o.z }, + .color = RenderInformation::VertexColorTypeSquare }; } } diff --git a/modules/spacecraftinstruments/util/hongkangparser.cpp b/modules/spacecraftinstruments/util/hongkangparser.cpp index 13789c585a..f895523c67 100644 --- a/modules/spacecraftinstruments/util/hongkangparser.cpp +++ b/modules/spacecraftinstruments/util/hongkangparser.cpp @@ -197,12 +197,12 @@ bool HongKangParser::create() { // fill image Image image = { - TimeRange(time, time + Exposure), - _defaultCaptureImage.string(), - std::move(cameraSpiceID), - cameraTarget, - true, - false + .timeRange = TimeRange(time, time + Exposure), + .path = _defaultCaptureImage.string(), + .activeInstruments = std::move(cameraSpiceID), + .target = cameraTarget, + .isPlaceholder = true, + .projected = false }; // IFF spacecraft has decided to switch target, store in target @@ -239,18 +239,18 @@ bool HongKangParser::create() { ); std::string scannerTarget = findPlaybookSpecifiedTarget(line); - TimeRange scanRange = { scanStart, scanStop }; + TimeRange scanRange = TimeRange(scanStart, scanStop); ghoul_assert(scanRange.isDefined(), "Invalid time range"); _instrumentTimes.emplace_back(it->first, scanRange); // store individual image Image image = { - scanRange, - _defaultCaptureImage.string(), - it->second->translations(), - cameraTarget, - true, - false + .timeRange = scanRange, + .path = _defaultCaptureImage.string(), + .activeInstruments = it->second->translations(), + .target = cameraTarget, + .isPlaceholder = true, + .projected = false }; _subsetMap[scannerTarget]._subset.push_back(std::move(image)); _subsetMap[scannerTarget]._range.include(scanStart); @@ -265,7 +265,7 @@ bool HongKangParser::create() { // we have reached the end of a scan or consecutive capture sequence if (captureStart != -1) { // end of capture sequence for camera, store end time of this sequence - TimeRange cameraRange = { captureStart, time }; + TimeRange cameraRange = TimeRange(captureStart, time); ghoul_assert(cameraRange.isDefined(), "Invalid time range"); _instrumentTimes.emplace_back(previousCamera, cameraRange); captureStart = -1; diff --git a/modules/spacecraftinstruments/util/instrumenttimesparser.cpp b/modules/spacecraftinstruments/util/instrumenttimesparser.cpp index 70160af00a..eb3395aaa7 100644 --- a/modules/spacecraftinstruments/util/instrumenttimesparser.cpp +++ b/modules/spacecraftinstruments/util/instrumenttimesparser.cpp @@ -127,12 +127,12 @@ bool InstrumentTimesParser::create() { _captureProgression.push_back(tr.start); Image image = { - tr, - std::string(), - { instrumentID }, - _target, - true, - false + .timeRange = tr, + .path = std::string(), + .activeInstruments = { instrumentID }, + .target = _target, + .isPlaceholder = true, + .projected = false }; _subsetMap[_target]._subset.push_back(std::move(image)); } diff --git a/modules/spacecraftinstruments/util/labelparser.cpp b/modules/spacecraftinstruments/util/labelparser.cpp index 4a63cf47a8..44df4c49f3 100644 --- a/modules/spacecraftinstruments/util/labelparser.cpp +++ b/modules/spacecraftinstruments/util/labelparser.cpp @@ -274,12 +274,12 @@ bool LabelParser::create() { spiceInstrument.push_back(_instrumentID); Image image = { - TimeRange(startTime, stopTime), - imagePath, - spiceInstrument, - _target, - false, - false + .timeRange = TimeRange(startTime, stopTime), + .path = imagePath, + .activeInstruments = spiceInstrument, + .target = _target, + .isPlaceholder = false, + .projected = false }; _subsetMap[image.target]._subset.push_back(image); diff --git a/modules/touch/src/directinputsolver.cpp b/modules/touch/src/directinputsolver.cpp index 2b5bc05b92..b0665ce5da 100644 --- a/modules/touch/src/directinputsolver.cpp +++ b/modules/touch/src/directinputsolver.cpp @@ -229,12 +229,12 @@ bool DirectInputSolver::solve(const std::vector& list, } FunctionData fData = { - selectedPoints, - screenPoints, - _nDof, - &camera, - selectedBodies.at(0).node, - _lmstat + .selectedPoints = selectedPoints, + .screenPoints = screenPoints, + .nDOF = _nDof, + .camera = &camera, + .node = selectedBodies.at(0).node, + .stats = _lmstat }; void* dataPtr = reinterpret_cast(&fData); diff --git a/modules/touch/src/touchinteraction.cpp b/modules/touch/src/touchinteraction.cpp index 57d481bc06..8a12adba52 100644 --- a/modules/touch/src/touchinteraction.cpp +++ b/modules/touch/src/touchinteraction.cpp @@ -591,7 +591,7 @@ void TouchInteraction::findSelectedNode(const std::vector& lis const bool isVisibleX = (ndc.x >= -1.0 && ndc.x <= 1.0); const bool isVisibleY = (ndc.y >= -1.0 && ndc.y <= 1.0); if (isVisibleX && isVisibleY) { - glm::dvec2 cursor = { xCo, yCo }; + glm::dvec2 cursor = glm::dvec2(xCo, yCo); const double ndcDist = glm::length(ndc - cursor); // We either want to select the object if it's bounding sphere as been @@ -607,10 +607,10 @@ void TouchInteraction::findSelectedNode(const std::vector& lis "Picking candidate based on direct touch" ); #endif //#ifdef TOUCH_DEBUG_NODE_PICK_MESSAGES - currentlyPicked = { + currentlyPicked = std::pair( node, -std::numeric_limits::max() - }; + ); } else if (ndcDist <= _pickingRadiusMinimum) { // The node was considered due to minimum picking distance radius @@ -644,7 +644,7 @@ int TouchInteraction::interpretInteraction(const std::vector& const std::vector& lastProcessed) { glm::fvec2 lastCentroid = _centroid; - _centroid = { 0.f, 0.f }; + _centroid = glm::vec2(0.f, 0.f); for (const TouchInputHolder& inputHolder : list) { _centroid += glm::vec2( inputHolder.latestInput().x, diff --git a/src/documentation/verifier.cpp b/src/documentation/verifier.cpp index c6c6616449..dc52dcfbac 100644 --- a/src/documentation/verifier.cpp +++ b/src/documentation/verifier.cpp @@ -418,10 +418,10 @@ TestResult TemplateVerifier::operator()(const ghoul::Dictionary& dic if (dict.hasValue(key)) { glm::dvec2 value = dict.value(key); glm::dvec2 intPart; - glm::bvec2 isInt = { + glm::bvec2 isInt = glm::bvec2( modf(value.x, &intPart.x) == 0.0, modf(value.y, &intPart.y) == 0.0 - }; + ); if (isInt.x && isInt.y) { TestResult res; res.success = true; @@ -473,11 +473,11 @@ TestResult TemplateVerifier::operator()(const ghoul::Dictionary& dic if (dict.hasValue(key)) { glm::dvec3 value = dict.value(key); glm::dvec3 intPart; - glm::bvec3 isInt = { + glm::bvec3 isInt = glm::bvec3( modf(value.x, &intPart.x) == 0.0, modf(value.y, &intPart.y) == 0.0, modf(value.z, &intPart.z) == 0.0 - }; + ); if (isInt.x && isInt.y && isInt.z) { TestResult res; res.success = true; @@ -529,12 +529,12 @@ TestResult TemplateVerifier::operator()(const ghoul::Dictionary& dic if (dict.hasValue(key)) { glm::dvec4 value = dict.value(key); glm::dvec4 intPart; - glm::bvec4 isInt = { + glm::bvec4 isInt = glm::bvec4( modf(value.x, &intPart.x) == 0.0, modf(value.y, &intPart.y) == 0.0, modf(value.z, &intPart.z) == 0.0, modf(value.w, &intPart.w) == 0.0 - }; + ); if (isInt.x && isInt.y && isInt.z && isInt.w) { TestResult res; res.success = true; diff --git a/src/engine/downloadmanager.cpp b/src/engine/downloadmanager.cpp index d3f0f0ab00..7c05e3cb07 100644 --- a/src/engine/downloadmanager.cpp +++ b/src/engine/downloadmanager.cpp @@ -172,9 +172,9 @@ std::shared_ptr DownloadManager::downloadFile( } ProgressInformation p = { - future, - std::chrono::system_clock::now(), - &progressCb + .future = future, + .startTime = std::chrono::system_clock::now(), + .callback = &progressCb }; #if LIBCURL_VERSION_NUM >= 0x072000 // xferinfo was introduced in 7.32.0, if a lower curl version is used the diff --git a/src/engine/moduleengine.cpp b/src/engine/moduleengine.cpp index e52cd63a7b..7e559ec041 100644 --- a/src/engine/moduleengine.cpp +++ b/src/engine/moduleengine.cpp @@ -171,7 +171,7 @@ std::vector ModuleEngine::modules() const { } ghoul::systemcapabilities::Version ModuleEngine::requiredOpenGLVersion() const { - ghoul::systemcapabilities::Version version = { 0, 0, 0 }; + ghoul::systemcapabilities::Version version = { .major = 0, .minor = 0, .release = 0 }; for (const std::unique_ptr& m : _modules) { version = std::max(version, m->requiredOpenGLVersion()); diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 86fbc15cd2..36a9e8e3d5 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -486,7 +486,11 @@ void OpenSpaceEngine::initializeGL() { bool debugActive = global::configuration->openGLDebugContext.isActive; // Debug output is not available before 4.3 - const ghoul::systemcapabilities::Version minVersion = { 4, 3, 0 }; + const ghoul::systemcapabilities::Version minVersion = { + .major = 4, + .minor = 3, + .release = 0 + }; if (debugActive && OpenGLCap.openGLVersion() < minVersion) { LINFO("OpenGL Debug context requested, but insufficient version available"); debugActive = false; diff --git a/src/interaction/joystickcamerastates.cpp b/src/interaction/joystickcamerastates.cpp index 98f6b424b9..8970fe73f3 100644 --- a/src/interaction/joystickcamerastates.cpp +++ b/src/interaction/joystickcamerastates.cpp @@ -54,11 +54,11 @@ void JoystickCameraStates::updateStateFromInput( return; } - std::pair globalRotation = { false, glm::dvec2(0.0) }; - std::pair zoom = { false, 0.0 }; - std::pair localRoll = { false, glm::dvec2(0.0) }; - std::pair globalRoll = { false, glm::dvec2(0.0) }; - std::pair localRotation = { false, glm::dvec2(0.0) }; + std::pair globalRotation = std::pair(false, glm::dvec2(0.0)); + std::pair zoom = std::pair(false, 0.0); + std::pair localRoll = std::pair(false, glm::dvec2(0.0)); + std::pair globalRoll = std::pair(false, glm::dvec2(0.0)); + std::pair localRotation = std::pair(false, glm::dvec2(0.0)); for (const JoystickInputState& joystickInputState : joystickInputStates) { if (joystickInputState.name.empty()) { diff --git a/src/interaction/sessionrecording.cpp b/src/interaction/sessionrecording.cpp index bad86629f6..f43eca5b69 100644 --- a/src/interaction/sessionrecording.cpp +++ b/src/interaction/sessionrecording.cpp @@ -231,9 +231,9 @@ bool SessionRecording::startRecording(const std::string& filename) { // Record the current delta time as the first property to save in the file. // This needs to be saved as a baseline whether or not it changes during recording _timestamps3RecordStarted = { - _timestampRecordStarted, - 0.0, - global::timeManager->time().j2000Seconds() + .timeOs = _timestampRecordStarted, + .timeRec = 0.0, + .timeSim = global::timeManager->time().j2000Seconds() }; recordCurrentTimePauseState(); diff --git a/src/interaction/websocketcamerastates.cpp b/src/interaction/websocketcamerastates.cpp index b1afae9c10..5315b104da 100644 --- a/src/interaction/websocketcamerastates.cpp +++ b/src/interaction/websocketcamerastates.cpp @@ -42,11 +42,11 @@ void WebsocketCameraStates::updateStateFromInput( const WebsocketInputStates& websocketInputStates, double deltaTime) { - std::pair globalRotation = { false, glm::dvec2(0.0) }; - std::pair zoom = { false, 0.0 }; - std::pair localRoll = { false, glm::dvec2(0.0) }; - std::pair globalRoll = { false, glm::dvec2(0.0) }; - std::pair localRotation = { false, glm::dvec2(0.0) }; + std::pair globalRotation = std::pair(false, glm::dvec2(0.0)); + std::pair zoom = std::pair(false, 0.0); + std::pair localRoll = std::pair(false, glm::dvec2(0.0)); + std::pair globalRoll = std::pair(false, glm::dvec2(0.0)); + std::pair localRotation = std::pair(false, glm::dvec2(0.0)); if (!websocketInputStates.empty()) { for (int i = 0; i < WebsocketInputState::MaxAxes; ++i) { diff --git a/src/navigation/orbitalnavigator.cpp b/src/navigation/orbitalnavigator.cpp index 5d189d5c93..276f02c0a4 100644 --- a/src/navigation/orbitalnavigator.cpp +++ b/src/navigation/orbitalnavigator.cpp @@ -589,8 +589,8 @@ void OrbitalNavigator::updateCameraStateFromStates(double deltaTime) { glm::dvec3(0.0); CameraPose pose = { - _camera->positionVec3() + anchorDisplacement, - _camera->rotationQuaternion() + .position = _camera->positionVec3() + anchorDisplacement, + .rotation = _camera->rotationQuaternion() }; const bool hasPreviousPositions = @@ -602,10 +602,10 @@ void OrbitalNavigator::updateCameraStateFromStates(double deltaTime) { const glm::dvec3 cameraToAnchor = *_previousAnchorNodePosition - prevCameraPosition; - Displacement anchorToAim = { + Displacement anchorToAim = Displacement( *_previousAimNodePosition - *_previousAnchorNodePosition, aimPos - anchorPos - }; + ); anchorToAim = interpolateRetargetAim( deltaTime, diff --git a/src/navigation/waypoint.cpp b/src/navigation/waypoint.cpp index 73b6a27570..2a4c81235a 100644 --- a/src/navigation/waypoint.cpp +++ b/src/navigation/waypoint.cpp @@ -42,7 +42,7 @@ namespace openspace::interaction { Waypoint::Waypoint(const glm::dvec3& pos, const glm::dquat& rot, const std::string& ref) : _nodeIdentifier(ref) { - _pose = { pos, rot }; + _pose = { .position = pos, .rotation = rot }; const SceneGraphNode* node = sceneGraphNode(_nodeIdentifier); if (!node) { diff --git a/src/properties/optionproperty.cpp b/src/properties/optionproperty.cpp index 49dc6d39c1..ba0a38e95b 100644 --- a/src/properties/optionproperty.cpp +++ b/src/properties/optionproperty.cpp @@ -59,7 +59,7 @@ const std::vector& OptionProperty::options() const { } void OptionProperty::addOption(int value, std::string desc) { - Option option = { std::move(value), std::move(desc) }; + Option option = { .value = std::move(value), .description = std::move(desc) }; for (const Option& o : _options) { if (o.value == option.value) { diff --git a/src/rendering/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp index c4abee51fc..aec9577c4e 100644 --- a/src/rendering/framebufferrenderer.cpp +++ b/src/rendering/framebufferrenderer.cpp @@ -51,7 +51,7 @@ namespace { constexpr std::string_view _loggerCat = "FramebufferRenderer"; - constexpr glm::vec4 PosBufferClearVal = { 1e32, 1e32, 1e32, 1.f }; + constexpr glm::vec4 PosBufferClearVal = glm::vec4(1e32, 1e32, 1e32, 1.f); constexpr std::array HDRUniformNames = { "hdrFeedingTexture", "blackoutFactor", "hdrExposure", "gamma", @@ -964,7 +964,7 @@ void FramebufferRenderer::updateRaycastData() { for (VolumeRaycaster* raycaster : raycasters) { ZoneScopedN("raycaster") - RaycastData data = { nextId++, "Helper" }; + RaycastData data = { .id = nextId++, .namespaceName = "Helper" }; const std::string& vsPath = raycaster->boundsVertexShaderPath(); std::string fsPath = raycaster->boundsFragmentShaderPath(); @@ -1033,7 +1033,7 @@ void FramebufferRenderer::updateDeferredcastData() { global::deferredcasterManager->deferredcasters(); int nextId = 0; for (Deferredcaster* caster : deferredcasters) { - DeferredcastData data = { nextId++, "HELPER" }; + DeferredcastData data = { .id = nextId++, .namespaceName = "HELPER" }; std::filesystem::path vsPath = caster->deferredcastVSPath(); std::filesystem::path fsPath = caster->deferredcastFSPath(); @@ -1133,10 +1133,9 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac Time time = global::timeManager->time(); RenderData data = { - *camera, - std::move(time), - 0, - {} + .camera = *camera, + .time = std::move(time), + .renderBinMask = 0 }; RendererTasks tasks; diff --git a/src/rendering/loadingscreen.cpp b/src/rendering/loadingscreen.cpp index 32af36dcdc..3b081b05da 100644 --- a/src/rendering/loadingscreen.cpp +++ b/src/rendering/loadingscreen.cpp @@ -174,10 +174,10 @@ void LoadingScreen::render() { ghoul::fontrendering::FontRenderer::defaultRenderer().setFramebufferSize(res); - const glm::vec2 size = { + const glm::vec2 size = glm::vec2( LogoSize.x, LogoSize.y * textureAspectRatio * screenAspectRatio - }; + ); // // Clear background @@ -204,10 +204,10 @@ void LoadingScreen::render() { // // Render progress bar // - const glm::vec2 progressbarSize = { + const glm::vec2 progressbarSize = glm::vec2( ProgressbarSize.x, ProgressbarSize.y * screenAspectRatio - }; + ); if (_showProgressbar) { const float progress = _nItems != 0 ? @@ -300,17 +300,17 @@ void LoadingScreen::render() { std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); - const glm::vec2 logoLl = { LogoCenter.x - size.x, LogoCenter.y - size.y }; - const glm::vec2 logoUr = { LogoCenter.x + size.x, LogoCenter.y + size.y }; + const glm::vec2 logoLl = glm::vec2(LogoCenter.x - size.x, LogoCenter.y - size.y); + const glm::vec2 logoUr = glm::vec2(LogoCenter.x + size.x, LogoCenter.y + size.y); - const glm::vec2 progressbarLl = { + const glm::vec2 progressbarLl = glm::vec2( ProgressbarCenter.x - progressbarSize.x, ProgressbarCenter.y - progressbarSize.y - }; - const glm::vec2 progressbarUr = { + ); + const glm::vec2 progressbarUr = glm::vec2( ProgressbarCenter.x + progressbarSize.x , ProgressbarCenter.y + progressbarSize.y - }; + ); for (Item& item : _items) { if (!item.hasLocation) { @@ -333,7 +333,7 @@ void LoadingScreen::render() { static_cast(res.y - b.y - 15) ); - ll = { distX(_randomEngine), distY(_randomEngine) }; + ll = glm::vec2(distX(_randomEngine), distY(_randomEngine)); ur = ll + b; // Test against logo and text @@ -553,17 +553,12 @@ void LoadingScreen::updateItem(const std::string& itemIdentifier, // We are not computing the location in here since doing it this way might stall // the main thread while trying to find a position for the new item Item item = { - itemIdentifier, - itemName, - ItemStatus::Started, - std::move(progressInfo), - false, -#ifdef LOADINGSCREEN_DEBUGGING - false, -#endif // LOADINGSCREEN_DEBUGGING - {}, - {}, - std::chrono::system_clock::from_time_t(0) + .identifier = itemIdentifier, + .name = itemName, + .status = ItemStatus::Started, + .progress = std::move(progressInfo), + .hasLocation = false, + .finishedTime = std::chrono::system_clock::from_time_t(0) }; if (newStatus == ItemStatus::Finished) { diff --git a/src/rendering/luaconsole.cpp b/src/rendering/luaconsole.cpp index a326e7c278..307c28dba3 100644 --- a/src/rendering/luaconsole.cpp +++ b/src/rendering/luaconsole.cpp @@ -528,7 +528,11 @@ bool LuaConsole::keyboardCallback(Key key, KeyModifier modifier, KeyAction actio // We only want to remove the autocomplete info if we just // entered the 'default' openspace namespace if (command.substr(0, pos + 1) == "openspace.") { - _autoCompleteInfo = { NoAutoComplete, false, "" }; + _autoCompleteInfo = { + .lastIndex = NoAutoComplete, + .hasInitialValue = false, + .initialValue = "" + }; } } } @@ -542,7 +546,11 @@ bool LuaConsole::keyboardCallback(Key key, KeyModifier modifier, KeyAction actio // If any other key is pressed, we want to remove our previous findings // The special case for Shift is necessary as we want to allow Shift+TAB if (!modifierShift) { - _autoCompleteInfo = { NoAutoComplete, false, "" }; + _autoCompleteInfo = { + .lastIndex = NoAutoComplete, + .hasInitialValue = false, + .initialValue = "" + }; } } diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 0ddea37906..231240b0f1 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -1144,12 +1144,12 @@ void RenderEngine::renderCameraInformation() { using FR = ghoul::fontrendering::FontRenderer; - _cameraButtonLocations.rotation = { + _cameraButtonLocations.rotation = glm::ivec4( fontResolution().x - rotationBox.x - XSeparation, fontResolution().y - penPosY, rotationBox.x, rotationBox.y - }; + ); FR::defaultRenderer().render( *_fontCameraInfo, glm::vec2(fontResolution().x - rotationBox.x - XSeparation, penPosY), @@ -1160,12 +1160,12 @@ void RenderEngine::renderCameraInformation() { const glm::vec2 zoomBox = _fontCameraInfo->boundingBox("Zoom"); - _cameraButtonLocations.zoom = { + _cameraButtonLocations.zoom = glm::ivec4( fontResolution().x - zoomBox.x - XSeparation, fontResolution().y - penPosY, zoomBox.x, zoomBox.y - }; + ); FR::defaultRenderer().render( *_fontCameraInfo, glm::vec2(fontResolution().x - zoomBox.x - XSeparation, penPosY), @@ -1176,12 +1176,12 @@ void RenderEngine::renderCameraInformation() { const glm::vec2 rollBox = _fontCameraInfo->boundingBox("Roll"); - _cameraButtonLocations.roll = { + _cameraButtonLocations.roll = glm::ivec4( fontResolution().x - rollBox.x - XSeparation, fontResolution().y - penPosY, rollBox.x, rollBox.y - }; + ); FR::defaultRenderer().render( *_fontCameraInfo, glm::vec2(fontResolution().x - rollBox.x - XSeparation, penPosY), diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index 08c01a5fb8..6d65b7c742 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -727,10 +727,14 @@ void SceneGraphNode::render(const RenderData& data, RendererTasks& tasks) { TracyGpuZone("Render") RenderData newData = { - data.camera, - data.time, - data.renderBinMask, - { _worldPositionCached, _worldRotationCached, _worldScaleCached } + .camera = data.camera, + .time = data.time, + .renderBinMask = data.renderBinMask, + .modelTransform = { + .translation = _worldPositionCached, + .rotation = _worldRotationCached, + .scale = _worldScaleCached + } }; _renderable->render(newData, tasks); diff --git a/src/scripting/scriptengine.cpp b/src/scripting/scriptengine.cpp index c149bc6618..03fae5f5ab 100644 --- a/src/scripting/scriptengine.cpp +++ b/src/scripting/scriptengine.cpp @@ -673,8 +673,8 @@ void ScriptEngine::addBaseLibrary() { ZoneScoped LuaLibrary lib = { - "", - { + .name = "", + .functions = { { "printTrace", &luascriptfunctions::printTrace, diff --git a/src/util/timemanager.cpp b/src/util/timemanager.cpp index c5d406c7fe..1aafa8977d 100644 --- a/src/util/timemanager.cpp +++ b/src/util/timemanager.cpp @@ -125,8 +125,18 @@ void TimeManager::interpolateTime(double targetTime, double durationSeconds) { const double now = currentApplicationTimeForInterpolation(); const bool pause = isPaused(); - const TimeKeyframeData current = { time(), deltaTime(), false, false }; - const TimeKeyframeData next = { Time(targetTime), targetDeltaTime(), pause, false }; + const TimeKeyframeData current = { + .time = time(), + .delta = deltaTime(), + .pause = false, + .jump = false + }; + const TimeKeyframeData next = { + .time = Time(targetTime), + .delta = targetDeltaTime(), + .pause = pause, + .jump = false + }; clearKeyframes(); addKeyframe(now, current); @@ -748,8 +758,18 @@ void TimeManager::interpolateDeltaTime(double newDeltaTime, double interpolation time().j2000Seconds() + (_deltaTime + newDeltaTime) * 0.5 * interpolationDuration ); - TimeKeyframeData currentKeyframe = { time(), _deltaTime, false, false }; - TimeKeyframeData futureKeyframe = { newTime, newDeltaTime, false, false }; + TimeKeyframeData currentKeyframe = { + .time = time(), + .delta = _deltaTime, + .pause = false, + .jump = false + }; + TimeKeyframeData futureKeyframe = { + .time = newTime, + .delta = newDeltaTime, + .pause = false, + .jump = false + }; _targetDeltaTime = newDeltaTime; @@ -854,8 +874,18 @@ void TimeManager::interpolatePause(bool pause, double interpolationDuration) { time().j2000Seconds() + (_deltaTime + targetDelta) * 0.5 * interpolationDuration ); - TimeKeyframeData currentKeyframe = { time(), _deltaTime, false, false }; - TimeKeyframeData futureKeyframe = { newTime, _targetDeltaTime, pause, false }; + TimeKeyframeData currentKeyframe = { + .time = time(), + .delta = _deltaTime, + .pause = false, + .jump = false + }; + TimeKeyframeData futureKeyframe = { + .time = newTime, + .delta = _targetDeltaTime, + .pause = pause, + .jump = false + }; _timePaused = pause; double now = isPlayingBackSessionRecording() ? diff --git a/src/util/transformationmanager.cpp b/src/util/transformationmanager.cpp index 574178f0d1..549c51262d 100644 --- a/src/util/transformationmanager.cpp +++ b/src/util/transformationmanager.cpp @@ -93,9 +93,9 @@ glm::dmat3 TransformationManager::kameleonTransformationMatrix( [[maybe_unused]] double ephemerisTime) const { #ifdef OPENSPACE_MODULE_KAMELEON_ENABLED - ccmc::Position in0 = {1.f, 0.f, 0.f}; - ccmc::Position in1 = {0.f, 1.f, 0.f}; - ccmc::Position in2 = {0.f, 0.f, 1.f}; + ccmc::Position in0 = ccmc::Position(1.f, 0.f, 0.f); + ccmc::Position in1 = ccmc::Position(0.f, 1.f, 0.f); + ccmc::Position in2 = ccmc::Position(0.f, 0.f, 1.f); ccmc::Position out0; ccmc::Position out1; diff --git a/support/coding/codegen b/support/coding/codegen index 13eb7efff1..63d7ae2731 160000 --- a/support/coding/codegen +++ b/support/coding/codegen @@ -1 +1 @@ -Subproject commit 13eb7efff1f843b6d23f1b32bb8b25271b144261 +Subproject commit 63d7ae2731112b9f7e0e9188fc80b4028541346a diff --git a/tests/property/test_property_selectionproperty.cpp b/tests/property/test_property_selectionproperty.cpp index 3bd5a5ace2..96e882896e 100644 --- a/tests/property/test_property_selectionproperty.cpp +++ b/tests/property/test_property_selectionproperty.cpp @@ -208,7 +208,7 @@ TEST_CASE("SelectionProperty: Value From Copying Variable", "[selectionproperty] openspace::properties::SelectionProperty p({ "id", "gui", "desc" }); p.setOptions({ "a", "b", "c" }); - p = { "a", "b" }; + p = std::set{ "a", "b" }; CHECK(p.value() == std::set{ "a", "b" }); } @@ -217,10 +217,10 @@ TEST_CASE("SelectionProperty: Re-set Options After Selection", "[selectionproper openspace::properties::SelectionProperty p({ "id", "gui", "desc" }); p.setOptions({ "a", "b", "c" }); - p = { "a", "b" }; + p = std::set{ "a", "b" }; - p.setOptions({ "a", "c", "d" }); // b no longer included - // => should be removed from selection + p.setOptions(std::vector{ "a", "c", "d" }); // b no longer included + // => should be removed CHECK(p.value() == std::set{ "a" }); }