From 4a860fb01d77440e1168e996bb924f931cb94a8f Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 14 Oct 2021 10:31:46 +0200 Subject: [PATCH] Some code facelifting --- ext/ghoul | 2 +- include/openspace/documentation/verifier.inl | 12 +++---- include/openspace/events/event.h | 34 ++++++++++--------- include/openspace/events/eventengine.h | 8 ++--- .../openspace/navigation/orbitalnavigator.h | 18 +++++----- include/openspace/navigation/path.h | 32 ++++++++--------- include/openspace/navigation/pathcurve.h | 6 ++-- .../pathcurves/avoidcollisioncurve.h | 2 +- include/openspace/navigation/waypoint.h | 3 +- .../openspace/properties/selectionproperty.h | 3 +- include/openspace/util/distanceconversion.h | 4 ++- include/openspace/util/tstring.h | 11 ++++-- .../rendering/atmospheredeferredcaster.cpp | 24 ++++++------- .../rendering/atmospheredeferredcaster.h | 4 +-- modules/base/rendering/renderablemodel.cpp | 9 ++--- modules/base/rendering/renderableprism.cpp | 7 +++- modules/debugging/debuggingmodule_lua.inl | 4 +-- modules/exoplanets/exoplanetsmodule_lua.inl | 2 +- modules/gaia/tasks/constructoctreetask.cpp | 2 +- modules/gaia/tasks/readfitstask.cpp | 2 +- modules/gaia/tasks/readspecktask.cpp | 2 +- modules/globebrowsing/globebrowsingmodule.cpp | 2 +- .../globebrowsing/globebrowsingmodule_lua.inl | 3 +- .../globebrowsing/src/globetranslation.cpp | 4 +-- modules/globebrowsing/src/renderableglobe.cpp | 4 +-- modules/globebrowsing/src/ringscomponent.cpp | 13 +++++-- modules/globebrowsing/src/shadowcomponent.cpp | 2 +- modules/globebrowsing/src/tileprovider.cpp | 2 +- modules/imgui/include/guiactioncomponent.h | 6 ++-- modules/imgui/src/renderproperties.cpp | 5 ++- modules/space/rendering/renderablestars.cpp | 16 ++++----- modules/space/speckloader.cpp | 18 +++++----- .../rendering/renderablefov.cpp | 2 +- .../rendering/renderableplanetprojection.cpp | 2 +- .../util/imagesequencer.h | 10 +++--- .../util/projectioncomponent.cpp | 18 +++++----- modules/statemachine/statemachinemodule.cpp | 3 +- modules/sync/syncs/urlsynchronization.cpp | 10 +++--- .../rendering/renderabletimevaryingvolume.cpp | 2 +- .../volume/tasks/generaterawvolumetask.cpp | 2 +- src/documentation/verifier.cpp | 10 +++--- src/events/event.cpp | 2 +- src/interaction/actionmanager_lua.inl | 2 +- src/interaction/sessionrecording.cpp | 8 +++-- src/navigation/navigationhandler.cpp | 4 +-- src/navigation/navigationhandler_lua.inl | 2 +- src/navigation/navigationstate.cpp | 4 +-- src/navigation/orbitalnavigator.cpp | 12 ++++--- src/navigation/path.cpp | 13 ++++--- .../pathcurves/zoomoutoverviewcurve.cpp | 3 +- src/navigation/pathnavigator.cpp | 9 +++-- src/navigation/pathnavigator_lua.inl | 9 ++--- src/navigation/waypoint.cpp | 4 +-- src/rendering/helper.cpp | 2 +- src/rendering/renderengine.cpp | 4 +-- src/rendering/screenspacerenderable.cpp | 2 +- src/scene/scene.cpp | 6 ++-- src/scene/scene_lua.inl | 2 +- src/scene/scenelicensewriter.cpp | 30 ++++++++++++---- src/scripting/scriptscheduler.cpp | 2 +- src/scripting/scriptscheduler_lua.inl | 2 +- src/util/keys.cpp | 8 ++--- src/util/resourcesynchronization.cpp | 2 +- src/util/spicemanager.cpp | 18 +++++----- src/util/spicemanager_lua.inl | 4 +-- src/util/time_lua.inl | 18 +++++----- 66 files changed, 279 insertions(+), 218 deletions(-) diff --git a/ext/ghoul b/ext/ghoul index 4a17b2a165..874300a089 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 4a17b2a1653cc596ab8610d93a53c639930ddb85 +Subproject commit 874300a08923cf366a487825c93d6309d016fbcd diff --git a/include/openspace/documentation/verifier.inl b/include/openspace/documentation/verifier.inl index 7363b325ec..6b86ff0918 100644 --- a/include/openspace/documentation/verifier.inl +++ b/include/openspace/documentation/verifier.inl @@ -175,7 +175,7 @@ TestResult OperatorVerifier::operator()(const ghoul::Dictionary& di o.offender = key; o.reason = TestResult::Offense::Reason::Verification; r.offenses.push_back(o); - return r; + return r; } } else { @@ -290,7 +290,7 @@ TestResult NotInListVerifier::operator()(const ghoul::Dictionary& dict, o.offender = key; o.reason = TestResult::Offense::Reason::Verification; r.offenses.push_back(o); - return r; + return r; } } else { @@ -346,7 +346,7 @@ TestResult InRangeVerifier::operator()(const ghoul::Dictionary& dict, o.offender = key; o.reason = TestResult::Offense::Reason::WrongType; r.offenses.push_back(o); - return r; + return r; } } else { @@ -363,7 +363,7 @@ TestResult InRangeVerifier::operator()(const ghoul::Dictionary& dict, o.offender = key; o.reason = TestResult::Offense::Reason::Verification; r.offenses.push_back(o); - return r; + return r; } } else { @@ -405,7 +405,7 @@ TestResult NotInRangeVerifier::operator()(const ghoul::Dictionary& dict, o.offender = key; o.reason = TestResult::Offense::Reason::WrongType; r.offenses.push_back(o); - return r; + return r; } } else { @@ -419,7 +419,7 @@ TestResult NotInRangeVerifier::operator()(const ghoul::Dictionary& dict, o.offender = key; o.reason = TestResult::Offense::Reason::Verification; r.offenses.push_back(o); - return r; + return r; } else { return { true, {}, {} }; diff --git a/include/openspace/events/event.h b/include/openspace/events/event.h index 9c903917be..201814da55 100644 --- a/include/openspace/events/event.h +++ b/include/openspace/events/event.h @@ -52,7 +52,7 @@ struct Event { // to see all events. // 4. Add a new case into the logAllEvents function that handles the new enum entry // 5. If the new event type has any parameters it takes in its constructor, go into - // the `toParameter` function and add a case label for the new enum type and + // the `toParameter` function and add a case label for the new enum type and // return a dictionary with these parameters. This dictionary is passed to actions // if they are triggered by events // 6. Add the new enum entry into the `toString` and `fromString` methods @@ -107,7 +107,7 @@ void logAllEvents(const Event* e); * This event is created whenever a new scene graph node is added to the system. By the * time this event is signalled, the scene graph node has already been created and added * to the scene. - * + * * \param Node The identifier of the node that was added */ struct EventSceneGraphNodeAdded : public Event { @@ -125,7 +125,7 @@ struct EventSceneGraphNodeAdded : public Event { */ struct EventSceneGraphNodeRemoved : public Event { static const Type Type = Event::Type::SceneGraphNodeRemoved; - + explicit EventSceneGraphNodeRemoved(const SceneGraphNode* node_); const tstring node; }; @@ -164,7 +164,7 @@ struct EventProfileLoadingFinished : public Event { * This event is created whenever some information about the application shutdown sequence * changes. This can either be that the seqeuence started, was aborted, or is finished, * which means that OpenSpace is just about the shutdown. - * + * * \param State The next state of the application shutdown sequence; is one of `Started`, * `Aborted`, or `Finished` */ @@ -184,7 +184,7 @@ struct EventApplicationShutdown : public Event { /** * This event is created when a new screenspace renderable has been created. By the time * this event is craeted, the screenspace renderable is already registered and available. - * + * * \param Renderable The identifier of the new screenspace renderable that was just added * to the system */ @@ -199,7 +199,7 @@ struct EventScreenSpaceRenderableAdded : public Event { * This event is created when a screenspace renderable has been removed from the system. * When this event is created, the screenspace renderable has already been removed and is * no longer available - * + * * \param Renderable The identifier of the screenspace renderable that was removed */ struct EventScreenSpaceRenderableRemoved : public Event { @@ -215,11 +215,13 @@ struct EventScreenSpaceRenderableRemoved : public Event { * Each scene graph node has an interaction sphere radius that serves as the reference * distance for all spheres. ``` -Diagram of events for a camera moving from right-to-left. Interaction sphere is 'O' in middle, and ')' are spherical boundaries. The approach factor, reach factor, and interaction sphere radius are all taken from the current focus node. +Diagram of events for a camera moving from right-to-left. Interaction sphere is 'O' in +middle, and ')' are spherical boundaries. The approach factor, reach factor, and +interaction sphere radius are all taken from the current focus node. |<------------------->| Approach factor * Interaction sphere |<------>| Reach Factor * Interaction sphere - + ( ( O ) ) ^ ^ ^ ^ Exiting Receding Reaching Approaching @@ -227,7 +229,7 @@ Exiting Receding Reaching Approachi * * \param Node The name of the node the camera is transitioning relative to. Currently is * always the same as the camera's focus node - * \param Transition The transition type that the camera just finished; is one of + * \param Transition The transition type that the camera just finished; is one of * `Approaching`, `Reaching`, `Receding`, or `Exiting` */ struct EventCameraFocusTransition : public Event { @@ -293,7 +295,7 @@ struct EventPlanetEclipsed : public Event { /** * This event is created when the interpolation of a property value is finished. If the * interpolation time of a property change is 0s, this event is not fired - * + * * \param Property The URI of the property whose interpolation has finished */ struct EventInterpolationFinished : public Event { @@ -307,7 +309,7 @@ struct EventInterpolationFinished : public Event { * This event is created when the camera changes focus nodes. Even if the camera position * is interpolated, the node change happens instantaneously and the event is fired at the * same time. - * + * * \param OldNode The identifier of the scene graph node which was the old focus node * \param NewNode The identifier of the scene graph node that is the new focus node */ @@ -321,7 +323,7 @@ struct EventFocusNodeChanged : public Event { /** * This event is created when a layer is added to to a globe. - * + * * \param Globe The identifier of the globe to which the layer is added * \param Group The identifier of the layer group to which the layer is added * \param Layer The identifier of the layer that was added @@ -329,7 +331,7 @@ struct EventFocusNodeChanged : public Event { struct EventLayerAdded : public Event { static const Type Type = Event::Type::LayerAdded; - explicit EventLayerAdded(std::string_view node_, std::string_view layerGroup_, + explicit EventLayerAdded(std::string_view node_, std::string_view layerGroup_, std::string_view layer_); const tstring node; const tstring layerGroup; @@ -338,7 +340,7 @@ struct EventLayerAdded : public Event { /** * This event is created when a layer is removed from a globe. - * + * * \param Globe The identifier of the globe from which the layer is removed * \param Group The identifier of the layer group from which the layer is removed * \param Layer The identifier of the layer that was removed @@ -346,7 +348,7 @@ struct EventLayerAdded : public Event { struct EventLayerRemoved : public Event { static const Type Type = Event::Type::LayerRemoved; - explicit EventLayerRemoved(std::string_view node_, std::string_view layerGroup_, + explicit EventLayerRemoved(std::string_view node_, std::string_view layerGroup_, std::string_view layer_); const tstring node; const tstring layerGroup; @@ -356,7 +358,7 @@ struct EventLayerRemoved : public Event { /** * This event is created when something regarding a session recording playback changes. * The event contains information about the new state of the session recording subsystem. - * + * * \param State The new state of the session recording; one of `Started`, `Paused`, * `Resumed`, `Finished` */ diff --git a/include/openspace/events/eventengine.h b/include/openspace/events/eventengine.h index 70e945012b..4e98175572 100644 --- a/include/openspace/events/eventengine.h +++ b/include/openspace/events/eventengine.h @@ -41,7 +41,7 @@ public: * no event exists. To navigate the full list of events, you can access the returned * Event's next function. If the end of the list is reached, the next pointer will be * a nullptr - * + * * \return The first event stored in the EventEngine or nullptr if no event exists */ events::Event* firstEvent() const; @@ -51,7 +51,7 @@ public: * constructor. An example of usage is * engine.publishEvent("a", 2.0); which would call the * constructor of \c MyEvent with a const char* and \c double parameter. - * + * * \param args The arguments that are passed to the constructor of T * \tparam T The subclass of Event that is to be published */ @@ -81,7 +81,7 @@ public: /** * Removing registration for a type/action combination. - * + * * \param type The type of the action that should be unregistered * \param actionIdentifier The identifier of the action that should be unregistered * \param filter The optional filter applied to the event-action combination @@ -97,7 +97,7 @@ public: void triggerActions() const; static scripting::LuaLibrary luaLibrary(); - + private: /// The storage space in which Events are stored ghoul::MemoryPool<4096> _memory; diff --git a/include/openspace/navigation/orbitalnavigator.h b/include/openspace/navigation/orbitalnavigator.h index b2b6c8556e..c964e1eef9 100644 --- a/include/openspace/navigation/orbitalnavigator.h +++ b/include/openspace/navigation/orbitalnavigator.h @@ -371,10 +371,10 @@ private: /** * Orbit the current anchor node, in a right-bound orbit, by updating the position - * and global rotation of the camera. - * + * and global rotation of the camera. + * * Used for IdleBehavior::Behavior::Orbit - * + * * \param deltaTime The time step to use for the motion. Controls the rotation angle * \param position The position of the camera. Will be changed by the function * \param globalRotation The camera's global rotation. Will be changed by the function @@ -384,15 +384,15 @@ private: glm::dquat& globalRotation, double speedScale); /** - * Orbit the current anchor node, by adding a rotation around the given axis. For - * example, when the axis is the north vector, the camera will stay on the current - * latitude band. Note that this creates a rolling motion if the camera's forward - * vector coincides with the axis, and should be used with care. - * + * Orbit the current anchor node, by adding a rotation around the given axis. For + * example, when the axis is the north vector, the camera will stay on the current + * latitude band. Note that this creates a rolling motion if the camera's forward + * vector coincides with the axis, and should be used with care. + * * Used for: * IdleBehavior::Behavior::OrbitAtConstantLat ( axis = north = z-axis ) and * IdleBehavior::Behavior::OrbitAroundUp ( axis = up = y-axis ) - * + * * \param axis The axis to arbit around, given in model coordinates of the anchor * \param deltaTime The time step to use for the motion. Controls the rotation angle * \param position The position of the camera. Will be changed by the function diff --git a/include/openspace/navigation/path.h b/include/openspace/navigation/path.h index 7a1a33bc3e..baec1ad261 100644 --- a/include/openspace/navigation/path.h +++ b/include/openspace/navigation/path.h @@ -31,8 +31,8 @@ #include #include -namespace openspace { - struct CameraPose; +namespace openspace { + struct CameraPose; } // namespace openspace namespace openspace::interaction { @@ -44,10 +44,10 @@ public: Linear, ZoomOutOverview, AvoidCollisionWithLookAt // @TODO (2021-08-13, emmbr) This type right now leads - // to rapid rotations, but is useful in specific - // scenarios, e.g. close to surfaces. Later we want to + // to rapid rotations, but is useful in specific + // scenarios, e.g. close to surfaces. Later we want to // remove it, and create a curve type that looks nicely - // at the targets when moving, avoids collisions and + // at the targets when moving, avoids collisions and // doesn't introduce sudden large changes in rotation }; @@ -63,21 +63,21 @@ public: double pathLength() const; /** - * Return a vector of positions corresponding to the control points of the path's + * Return a vector of positions corresponding to the control points of the path's * spline curve */ std::vector controlPoints() const; /** * Take a step along the current path, corresponding to the delta time step \p dt, and - * return the resulting camera pose. The \p speedScale is a factor that will be + * return the resulting camera pose. The \p speedScale is a factor that will be * multiplied with the traversal speed */ CameraPose traversePath(double dt, float speedScale = 1.f); /** - * Return the identifer of the node that is the current appropriate anchor node, of - * the start and end waypoint's reference node. Dtermined based on how far along the + * Return the identifer of the node that is the current appropriate anchor node, of + * the start and end waypoint's reference node. Dtermined based on how far along the * path we have traveled */ std::string currentAnchor() const; @@ -94,7 +94,7 @@ public: private: /** - * Interpolate between the paths start and end rotation using the approach that + * Interpolate between the paths start and end rotation using the approach that * corresponds to the path's curve type. The interpolation parameter \p t is the * same as for the position interpolation, i.e. the relative traveled in distance * along the path, in [0, 1] @@ -107,14 +107,14 @@ private: glm::dquat easedSlerpRotation(double t) const; /** - * Compute the interpolated rotation quaternion using an approach that first - * interpolates to look at the start node, and then the end node, before + * Compute the interpolated rotation quaternion using an approach that first + * interpolates to look at the start node, and then the end node, before * interpolating to the end rotation */ glm::dquat lookAtTargetsRotation(double t) const; /** - * Evaluate the current traversal speed along the path, based on the currently + * Evaluate the current traversal speed along the path, based on the currently * traveled distance. The final speed will be scaled to match the desired duration * for the path (which might have been specified by the user) */ @@ -134,9 +134,9 @@ private: }; -// Create a path of the given type based on an instruction given as a dictionary. -// See top of cpp file for documentation on keys and values for the dictionary. -// Returns the created path. +// Create a path of the given type based on an instruction given as a dictionary. +// See top of cpp file for documentation on keys and values for the dictionary. +// Returns the created path. Path createPathFromDictionary(const ghoul::Dictionary& dictionary, Path::Type type); } // namespace openspace::interaction diff --git a/include/openspace/navigation/pathcurve.h b/include/openspace/navigation/pathcurve.h index e00da37583..ed0a4c5991 100644 --- a/include/openspace/navigation/pathcurve.h +++ b/include/openspace/navigation/pathcurve.h @@ -46,9 +46,9 @@ public: glm::dvec3 positionAt(double relativeDistance) const; /** - * Get the intorlatied position along the spline, based on the given curve parameter - * u in range [0, 1]. A curve parameter of 0 returns the start position and 1 the end - * position. Note that u does not correspond to the relatively traveled distance. + * Get the intorlatied position along the spline, based on the given curve parameter + * u in range [0, 1]. A curve parameter of 0 returns the start position and 1 the end + * position. Note that u does not correspond to the relatively traveled distance. */ virtual glm::dvec3 interpolate(double u) const; diff --git a/include/openspace/navigation/pathcurves/avoidcollisioncurve.h b/include/openspace/navigation/pathcurves/avoidcollisioncurve.h index 5cd95ddd5a..b48a0529a7 100644 --- a/include/openspace/navigation/pathcurves/avoidcollisioncurve.h +++ b/include/openspace/navigation/pathcurves/avoidcollisioncurve.h @@ -45,4 +45,4 @@ private: } // namespace openspace::interaction -#endif // __OPENSPACE_MODULE_AUTONAVIGATION___AVOIDCOLLISIONCURVE___H__ +#endif // __OPENSPACE_CORE___AVOIDCOLLISIONCURVE___H__ diff --git a/include/openspace/navigation/waypoint.h b/include/openspace/navigation/waypoint.h index 79506318e5..09970bb261 100644 --- a/include/openspace/navigation/waypoint.h +++ b/include/openspace/navigation/waypoint.h @@ -53,7 +53,8 @@ public: private: CameraPose _pose; std::string _nodeIdentifier; - double _validBoundingSphere = 0.0; // to be able to handle nodes with faulty bounding spheres + // to be able to handle nodes with faulty bounding spheres + double _validBoundingSphere = 0.0; }; } // namespace openspace::interaction diff --git a/include/openspace/properties/selectionproperty.h b/include/openspace/properties/selectionproperty.h index b17f580a52..f8d4b59ba8 100644 --- a/include/openspace/properties/selectionproperty.h +++ b/include/openspace/properties/selectionproperty.h @@ -114,7 +114,8 @@ public: using TemplateProperty>::operator=; protected: - std::set fromLuaConversion(lua_State* state, bool& success) const override; + std::set fromLuaConversion(lua_State* state, + bool& success) const override; void toLuaConversion(lua_State* state) const override; diff --git a/include/openspace/util/distanceconversion.h b/include/openspace/util/distanceconversion.h index 252948c720..1c1176c5f0 100644 --- a/include/openspace/util/distanceconversion.h +++ b/include/openspace/util/distanceconversion.h @@ -357,7 +357,9 @@ constexpr double convertUnit(DistanceUnit fromUnit, DistanceUnit toUnit) { return convertMeters(toMeter(fromUnit), toUnit); } -constexpr double convertDistance(double distance, DistanceUnit fromUnit, DistanceUnit toUnit) { +constexpr double convertDistance(double distance, DistanceUnit fromUnit, + DistanceUnit toUnit) +{ return distance * convertUnit(fromUnit, toUnit); } diff --git a/include/openspace/util/tstring.h b/include/openspace/util/tstring.h index 26f41e7ea9..01390c49fd 100644 --- a/include/openspace/util/tstring.h +++ b/include/openspace/util/tstring.h @@ -22,6 +22,9 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#ifndef __OPENSPACE_CORE___TSTRING___H__ +#define __OPENSPACE_CORE___TSTRING___H__ + #include #include @@ -39,7 +42,7 @@ using tstring = std::string_view; /** * Allocate and create a temporary string from the passed std::string. - * + * * \param str The string to be copied into a newly allocated tstring * \return The copy of the str as a temporary string */ @@ -47,7 +50,7 @@ tstring temporaryString(const std::string& str); /** * Allocate and create a temporary string from the passed std::string_view. - * + * * \param str The string to be copied into a newly allocated tstring * \return The copy of the str as a temporary string */ @@ -55,10 +58,12 @@ tstring temporaryString(std::string_view str); /** * Allocate and create a temporary string from the passed char array. - * + * * \param str The string to be copied into a newly allocated tstring * \return The copy of the str as a temporary string */ tstring temporaryString(const char str[]); } // namespace openspace + +#endif // __OPENSPACE_CORE___TSTRING___H__ diff --git a/modules/atmosphere/rendering/atmospheredeferredcaster.cpp b/modules/atmosphere/rendering/atmospheredeferredcaster.cpp index 8bc8f1061c..dc29181555 100644 --- a/modules/atmosphere/rendering/atmospheredeferredcaster.cpp +++ b/modules/atmosphere/rendering/atmospheredeferredcaster.cpp @@ -498,7 +498,7 @@ void AtmosphereDeferredcaster::setParameters(float atmosphereRadius, float plane float averageGroundReflectance, float groundRadianceEmission, float rayleighHeightScale, bool enableOzone, - float ozoneHeightScale, float mieHeightScale, + float ozoneHeightScale, float mieHeightScale, float miePhaseConstant, float sunRadiance, glm::vec3 rayScatteringCoefficients, glm::vec3 ozoneExtinctionCoefficients, @@ -529,7 +529,7 @@ void AtmosphereDeferredcaster::setHardShadows(bool enabled) { void AtmosphereDeferredcaster::calculateTransmittance() { ZoneScoped - + glFramebufferTexture( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, @@ -566,7 +566,7 @@ void AtmosphereDeferredcaster::calculateTransmittance() { GLuint AtmosphereDeferredcaster::calculateDeltaE() { ZoneScoped - + GLuint deltaE = createTexture(_deltaETableSize, "DeltaE"); glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, deltaE, 0); glViewport(0, 0, _deltaETableSize.x, _deltaETableSize.y); @@ -595,7 +595,7 @@ GLuint AtmosphereDeferredcaster::calculateDeltaE() { std::pair AtmosphereDeferredcaster::calculateDeltaS() { ZoneScoped - + GLuint deltaSRayleigh = createTexture(_textureSize, "DeltaS Rayleigh", 3); glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, deltaSRayleigh, 0); GLuint deltaSMie = createTexture(_textureSize, "DeltaS Mie", 3); @@ -649,7 +649,7 @@ std::pair AtmosphereDeferredcaster::calculateDeltaS() { void AtmosphereDeferredcaster::calculateIrradiance() { ZoneScoped - + glFramebufferTexture( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, @@ -678,7 +678,7 @@ void AtmosphereDeferredcaster::calculateInscattering(GLuint deltaSRayleigh, GLuint deltaSMie) { ZoneScoped - + glFramebufferTexture( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, @@ -726,7 +726,7 @@ void AtmosphereDeferredcaster::calculateDeltaJ(int scatteringOrder, GLuint deltaSRayleigh, GLuint deltaSMie) { ZoneScoped - + glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, deltaJ, 0); glViewport(0, 0, _textureSize.x, _textureSize.y); program.activate(); @@ -745,7 +745,7 @@ void AtmosphereDeferredcaster::calculateDeltaJ(int scatteringOrder, deltaSRayleighUnit.activate(); glBindTexture(GL_TEXTURE_3D, deltaSRayleigh); program.setUniform("deltaSRTexture", deltaSRayleighUnit); - + ghoul::opengl::TextureUnit deltaSMieUnit; deltaSMieUnit.activate(); glBindTexture(GL_TEXTURE_3D, deltaSMie); @@ -784,7 +784,7 @@ void AtmosphereDeferredcaster::calculateDeltaE(int scatteringOrder, GLuint deltaSMie) { ZoneScoped - + glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, deltaE, 0); glViewport(0, 0, _deltaETableSize.x, _deltaETableSize.y); program.activate(); @@ -823,7 +823,7 @@ void AtmosphereDeferredcaster::calculateDeltaS(int scatteringOrder, GLuint deltaSRayleigh, GLuint deltaJ) { ZoneScoped - + glFramebufferTexture(GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, deltaSRayleigh, 0); glViewport(0, 0, _textureSize.x, _textureSize.y); program.activate(); @@ -863,7 +863,7 @@ void AtmosphereDeferredcaster::calculateIrradiance(int scatteringOrder, GLuint deltaE) { ZoneScoped - + glFramebufferTexture( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, @@ -895,7 +895,7 @@ void AtmosphereDeferredcaster::calculateInscattering(int scatteringOrder, { ZoneScoped - + glFramebufferTexture( GL_FRAMEBUFFER, GL_COLOR_ATTACHMENT0, diff --git a/modules/atmosphere/rendering/atmospheredeferredcaster.h b/modules/atmosphere/rendering/atmospheredeferredcaster.h index 6836352c0a..1f3608e2d6 100644 --- a/modules/atmosphere/rendering/atmospheredeferredcaster.h +++ b/modules/atmosphere/rendering/atmospheredeferredcaster.h @@ -114,9 +114,9 @@ private: UniformCache(cullAtmosphere, Rg, Rt, groundRadianceEmission, HR, betaRayleigh, HM, betaMieExtinction, mieG, sunRadiance, ozoneLayerEnabled, HO, betaOzoneExtinction, - SAMPLES_R, SAMPLES_MU, SAMPLES_MU_S, SAMPLES_NU, inverseModelTransformMatrix, + SAMPLES_R, SAMPLES_MU, SAMPLES_MU_S, SAMPLES_NU, inverseModelTransformMatrix, modelTransformMatrix, projectionToModelTransform, viewToWorldMatrix, - camPosObj, sunDirectionObj, hardShadows, transmittanceTexture, irradianceTexture, + camPosObj, sunDirectionObj, hardShadows, transmittanceTexture, irradianceTexture, inscatterTexture) _uniformCache; ghoul::opengl::TextureUnit _transmittanceTableTextureUnit; diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index 6f00faa4b5..8f236ec978 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -649,8 +649,8 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) { // Model transform and view transform needs to be in double precision const glm::dmat4 modelTransform = - glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * // Translation - glm::dmat4(data.modelTransform.rotation) * // Spice rotation + glm::translate(glm::dmat4(1.0), data.modelTransform.translation) * + glm::dmat4(data.modelTransform.rotation) * glm::scale(glm::dmat4(1.0), glm::dvec3(data.modelTransform.scale)) * glm::scale( glm::dmat4(_modelTransform.value()), @@ -770,8 +770,9 @@ void RenderableModel::update(const UpdateData& data) { // be converted to the animation time range, so the animation knows which // keyframes it should interpolate between for each frame. The conversion is // done in different ways depending on the animation mode. - // Explanation: s indicates start time, / indicates animation is played once forwards, - // \ indicates animation is played once backwards, time moves to the right. + // Explanation: s indicates start time, / indicates animation is played once + // forwards, \ indicates animation is played once backwards, time moves to the + // right. switch (_animationMode) { case AnimationMode::LoopFromStart: // Start looping from the start time diff --git a/modules/base/rendering/renderableprism.cpp b/modules/base/rendering/renderableprism.cpp index c14798a604..65bb509a68 100644 --- a/modules/base/rendering/renderableprism.cpp +++ b/modules/base/rendering/renderableprism.cpp @@ -329,7 +329,12 @@ void RenderablePrism::render(const RenderData& data, RendererTasks&) { glLineWidth(_lineWidth); glBindVertexArray(_vaoId); - glDrawElements(GL_LINE_LOOP, static_cast(_indexArray.size()), GL_UNSIGNED_BYTE, nullptr); + glDrawElements( + GL_LINE_LOOP, + static_cast(_indexArray.size()), + GL_UNSIGNED_BYTE, + nullptr + ); glBindVertexArray(0); global::renderEngine->openglStateCache().resetLineState(); diff --git a/modules/debugging/debuggingmodule_lua.inl b/modules/debugging/debuggingmodule_lua.inl index 2f90b92376..c5dba570e0 100644 --- a/modules/debugging/debuggingmodule_lua.inl +++ b/modules/debugging/debuggingmodule_lua.inl @@ -151,7 +151,7 @@ int renderCameraPath(lua_State* L) { }; auto addDirectionLine = [addPoint, addLineBetweenPoints] - (const std::string& pointId, const CameraPose& p, + (const std::string& pointId, const CameraPose& p, double lineLength) { const glm::dvec3 dir = glm::normalize(p.rotation * glm::dvec3(0.0, 0.0, -1.0)); @@ -291,7 +291,7 @@ int removePathControlPoints(lua_State* L) { int addCartesianAxes(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, { 1, 2 }, "lua::addCartesianAxes"); - auto [nodeIdentifier, scale] = + auto [nodeIdentifier, scale] = ghoul::lua::values>(L); SceneGraphNode* n = global::renderEngine->scene()->sceneGraphNode(nodeIdentifier); diff --git a/modules/exoplanets/exoplanetsmodule_lua.inl b/modules/exoplanets/exoplanetsmodule_lua.inl index 4a2128b9dc..385f43aefa 100644 --- a/modules/exoplanets/exoplanetsmodule_lua.inl +++ b/modules/exoplanets/exoplanetsmodule_lua.inl @@ -557,7 +557,7 @@ void createExoplanetSystem(const std::string& starName) { int addExoplanetSystem(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::addExoplanetSystem"); - std::variant v = + std::variant v = ghoul::lua::value>(L); if (std::holds_alternative(v)) { diff --git a/modules/gaia/tasks/constructoctreetask.cpp b/modules/gaia/tasks/constructoctreetask.cpp index 1239a65960..19bfc8d463 100644 --- a/modules/gaia/tasks/constructoctreetask.cpp +++ b/modules/gaia/tasks/constructoctreetask.cpp @@ -462,7 +462,7 @@ void ConstructOctreeTask::constructOctreeFromFolder( } } } - + std::vector filterValues; auto writeThreads = std::vector(8); diff --git a/modules/gaia/tasks/readfitstask.cpp b/modules/gaia/tasks/readfitstask.cpp index a23d128073..720abd9f66 100644 --- a/modules/gaia/tasks/readfitstask.cpp +++ b/modules/gaia/tasks/readfitstask.cpp @@ -193,7 +193,7 @@ void ReadFitsTask::readAllFitsFilesFromFolder(const Task::ProgressCallback&) { } } } - + size_t nInputFiles = allInputFiles.size(); LINFO("Files to read: " + std::to_string(nInputFiles)); diff --git a/modules/gaia/tasks/readspecktask.cpp b/modules/gaia/tasks/readspecktask.cpp index 7a0b45917e..4ba384ab43 100644 --- a/modules/gaia/tasks/readspecktask.cpp +++ b/modules/gaia/tasks/readspecktask.cpp @@ -39,7 +39,7 @@ namespace { struct [[codegen::Dictionary(ReadSpeckTask)]] Parameters { // The path to the SPECK file that are to be read std::string inFilePath; - + // The path to the file to export raw VBO data to std::string outFilePath; }; diff --git a/modules/globebrowsing/globebrowsingmodule.cpp b/modules/globebrowsing/globebrowsingmodule.cpp index f2d103a4b6..f4fd899794 100644 --- a/modules/globebrowsing/globebrowsingmodule.cpp +++ b/modules/globebrowsing/globebrowsingmodule.cpp @@ -406,7 +406,7 @@ scripting::LuaLibrary GlobeBrowsingModule::luaLibrary() const { { // @TODO (2021-06-23, emmbr) Combine with the above function when the camera // paths work really well close to surfaces - "flyToGeo", + "flyToGeo", &globebrowsing::luascriptfunctions::flyToGeo, {}, "[string], number, number, number [, bool, number]", diff --git a/modules/globebrowsing/globebrowsingmodule_lua.inl b/modules/globebrowsing/globebrowsingmodule_lua.inl index 394f768118..e94f6beb81 100644 --- a/modules/globebrowsing/globebrowsingmodule_lua.inl +++ b/modules/globebrowsing/globebrowsingmodule_lua.inl @@ -301,9 +301,8 @@ int flyToGeo(lua_State* L) { altitude ); - using namespace std::string_literals; ghoul::Dictionary instruction; - instruction.setValue("TargetType", "Node"s); + instruction.setValue("TargetType", std::string("Node")); instruction.setValue("Target", n->identifier()); instruction.setValue("Position", positionModelCoords); diff --git a/modules/globebrowsing/src/globetranslation.cpp b/modules/globebrowsing/src/globetranslation.cpp index e935cb723c..12e6f4f883 100644 --- a/modules/globebrowsing/src/globetranslation.cpp +++ b/modules/globebrowsing/src/globetranslation.cpp @@ -122,7 +122,7 @@ GlobeTranslation::GlobeTranslation(const ghoul::Dictionary& dictionary) _altitude = p.altitude.value_or(_altitude); // @TODO (emmbr) uncomment when ranges with negative values are supported - //_altitude.setExponent(8.f); + //_altitude.setExponent(8.f); _altitude.onChange([this]() { setUpdateVariables(); }); addProperty(_altitude); @@ -171,7 +171,7 @@ glm::dvec3 GlobeTranslation::position(const UpdateData&) const { const_cast(this)->fillAttachedNode(); _positionIsDirty = true; } - + if (!_positionIsDirty) { return _position; } diff --git a/modules/globebrowsing/src/renderableglobe.cpp b/modules/globebrowsing/src/renderableglobe.cpp index b36fab95eb..f194eb4be6 100644 --- a/modules/globebrowsing/src/renderableglobe.cpp +++ b/modules/globebrowsing/src/renderableglobe.cpp @@ -1209,8 +1209,8 @@ void RenderableGlobe::renderChunks(const RenderData& data, RendererTasks&, if (global::sessionRecording->isSavingFramesDuringPlayback()) { // If our tile cache is very full, we assume we need to adjust the level of detail // dynamically to not keep rendering frames with unavailable data - // After certain number of iterations(_debugProperties.dynamicLodIterationCount) of - // unavailable/available data in a row, we assume that a change could be made. + // After certain number of iterations(_debugProperties.dynamicLodIterationCount) + // of unavailable/available data in a row, we assume that a change could be made. const int iterCount = _debugProperties.dynamicLodIterationCount; const bool exceededIterations = static_cast(_iterationsOfUnavailableData) > iterCount; diff --git a/modules/globebrowsing/src/ringscomponent.cpp b/modules/globebrowsing/src/ringscomponent.cpp index b04cf026ca..f8c2ff1f1d 100644 --- a/modules/globebrowsing/src/ringscomponent.cpp +++ b/modules/globebrowsing/src/ringscomponent.cpp @@ -64,7 +64,8 @@ namespace { "modelViewProjectionMatrix", "textureOffset", "colorFilterValue", "nightFactor", "sunPosition", "sunPositionObj", "camPositionObj", "ringTextureFwrd", "ringTextureBckwrd", "ringTextureUnlit", "ringTextureColor", - "ringTextureTransparency", "shadowMatrix", "shadowMapTexture", "zFightingPercentage" + "ringTextureTransparency", "shadowMatrix", "shadowMapTexture", + "zFightingPercentage" }; constexpr const std::array GeomUniformNames = { @@ -413,7 +414,10 @@ void RingsComponent::draw(const RenderData& data, RenderPass renderPass, modelViewProjectionTransform ); _shader->setUniform(_uniformCacheAdvancedRings.textureOffset, _offset); - _shader->setUniform(_uniformCacheAdvancedRings.colorFilterValue, _colorFilter); + _shader->setUniform( + _uniformCacheAdvancedRings.colorFilterValue, + _colorFilter + ); _shader->setUniform(_uniformCacheAdvancedRings.nightFactor, _nightFactor); _shader->setUniform(_uniformCacheAdvancedRings.sunPosition, _sunPosition); @@ -496,7 +500,10 @@ void RingsComponent::draw(const RenderData& data, RenderPass renderPass, ghoul::opengl::TextureUnit shadowMapUnit; shadowMapUnit.activate(); glBindTexture(GL_TEXTURE_2D, shadowData.shadowDepthTexture); - _shader->setUniform(_uniformCacheAdvancedRings.shadowMapTexture, shadowMapUnit); + _shader->setUniform( + _uniformCacheAdvancedRings.shadowMapTexture, + shadowMapUnit + ); glEnable(GL_DEPTH_TEST); glEnablei(GL_BLEND, 0); diff --git a/modules/globebrowsing/src/shadowcomponent.cpp b/modules/globebrowsing/src/shadowcomponent.cpp index 71daef9b4a..4266192eae 100644 --- a/modules/globebrowsing/src/shadowcomponent.cpp +++ b/modules/globebrowsing/src/shadowcomponent.cpp @@ -171,7 +171,7 @@ ShadowComponent::ShadowComponent(const ghoul::Dictionary& dictionary) return; } ghoul::Dictionary d = dictionary.value("Shadows"); - + const Parameters p = codegen::bake(d); addProperty(_enabled); diff --git a/modules/globebrowsing/src/tileprovider.cpp b/modules/globebrowsing/src/tileprovider.cpp index 033a47089f..0e21fc43e2 100644 --- a/modules/globebrowsing/src/tileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider.cpp @@ -868,7 +868,7 @@ TemporalTileProvider::TemporalTileProvider(const ghoul::Dictionary& dictionary) useFixedTime = dictionary.value(temporal::UseFixedTimeInfo.identifier); } addProperty(useFixedTime); - + if (dictionary.hasValue(temporal::FixedTimeInfo.identifier)) { fixedTime = dictionary.value(temporal::FixedTimeInfo.identifier); } diff --git a/modules/imgui/include/guiactioncomponent.h b/modules/imgui/include/guiactioncomponent.h index 40e708c093..1395ff6c89 100644 --- a/modules/imgui/include/guiactioncomponent.h +++ b/modules/imgui/include/guiactioncomponent.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_IMGUI___GUISHORTCUTSCOMPONENT___H__ -#define __OPENSPACE_MODULE_IMGUI___GUISHORTCUTSCOMPONENT___H__ +#ifndef __OPENSPACE_MODULE_IMGUI___GUIACTIONCOMPONENT___H__ +#define __OPENSPACE_MODULE_IMGUI___GUIACTIONCOMPONENT___H__ #include @@ -38,4 +38,4 @@ public: } // namespace openspace::gui -#endif // __OPENSPACE_MODULE_IMGUI___GUISHORTCUTSCOMPONENT___H__ +#endif // __OPENSPACE_MODULE_IMGUI___GUIACTIONCOMPONENT___H__ diff --git a/modules/imgui/src/renderproperties.cpp b/modules/imgui/src/renderproperties.cpp index 71f566af29..620745e581 100644 --- a/modules/imgui/src/renderproperties.cpp +++ b/modules/imgui/src/renderproperties.cpp @@ -270,7 +270,10 @@ void renderStringProperty(Property* prop, const std::string& ownerName, void renderListProperty(const std::string& name, const std::string& fullIdentifier, const std::string& stringValue, IsRegularProperty isRegular) { - ghoul_assert(stringValue.size() > 2, "an empty list should have the string value '[]'"); + ghoul_assert( + stringValue.size() > 2, + "an empty list should have the string value '[]'" + ); // Remove brackets from the string value std::string value = stringValue.substr(1, stringValue.size() - 2); diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index 3b42e10193..f8aa080ae6 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -529,35 +529,35 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary) _dataMapping.bvColor = p.dataMapping.bv.value_or(""); _dataMapping.bvColor.onChange([this]() { _dataIsDirty = true; }); _dataMappingContainer.addProperty(_dataMapping.bvColor); - + _dataMapping.luminance = p.dataMapping.luminance.value_or(""); _dataMapping.luminance.onChange([this]() { _dataIsDirty = true; }); _dataMappingContainer.addProperty(_dataMapping.luminance); - + _dataMapping.absoluteMagnitude = p.dataMapping.absoluteMagnitude.value_or(""); _dataMapping.absoluteMagnitude.onChange([this]() { _dataIsDirty = true; }); _dataMappingContainer.addProperty(_dataMapping.absoluteMagnitude); - + _dataMapping.apparentMagnitude = p.dataMapping.apparentMagnitude.value_or(""); _dataMapping.apparentMagnitude.onChange([this]() { _dataIsDirty = true; }); _dataMappingContainer.addProperty(_dataMapping.apparentMagnitude); - + _dataMapping.vx = p.dataMapping.vx.value_or(""); _dataMapping.vx.onChange([this]() { _dataIsDirty = true; }); _dataMappingContainer.addProperty(_dataMapping.vx); - + _dataMapping.vy = p.dataMapping.vy.value_or(""); _dataMapping.vy.onChange([this]() { _dataIsDirty = true; }); _dataMappingContainer.addProperty(_dataMapping.vy); - + _dataMapping.vz = p.dataMapping.vz.value_or(""); _dataMapping.vz.onChange([this]() { _dataIsDirty = true; }); _dataMappingContainer.addProperty(_dataMapping.vz); - + _dataMapping.speed = p.dataMapping.speed.value_or(""); _dataMapping.speed.onChange([this]() { _dataIsDirty = true; }); _dataMappingContainer.addProperty(_dataMapping.speed); - + addPropertySubOwner(_dataMappingContainer); _speckFile = p.speckFile.string(); diff --git a/modules/space/speckloader.cpp b/modules/space/speckloader.cpp index 4bf46d86cf..d4165fa3b6 100644 --- a/modules/space/speckloader.cpp +++ b/modules/space/speckloader.cpp @@ -172,7 +172,7 @@ Dataset loadFile(std::filesystem::path path, SkipAllZeroLines skipAllZeroLines) if (startsWith(line, "datavar")) { // each datavar line is following the form: // datavar - // with being the index of the data variable + // with being the index of the data variable std::stringstream str(line); std::string dummy; @@ -197,7 +197,7 @@ Dataset loadFile(std::filesystem::path path, SkipAllZeroLines skipAllZeroLines) std::stringstream str(line); std::string dummy; str >> dummy >> res.textureDataIndex; - + continue; } @@ -216,8 +216,8 @@ Dataset loadFile(std::filesystem::path path, SkipAllZeroLines skipAllZeroLines) std::stringstream str(line); std::string dummy; str >> dummy >> res.orientationDataIndex; - - // Ok.. this is kind of weird. Speck unfortunately doesn't tell us in the + + // Ok.. this is kind of weird. Speck unfortunately doesn't tell us in the // specification how many values a datavar has. Usually this is 1 value per // datavar, unless it is a polygon orientation thing. Now, the datavar name // for these can be anything (have seen 'orientation' and 'ori' before, so we @@ -268,7 +268,7 @@ Dataset loadFile(std::filesystem::path path, SkipAllZeroLines skipAllZeroLines) return lhs.index < rhs.index; } ); - + std::sort( res.textures.begin(), res.textures.end(), [](const Dataset::Texture& lhs, const Dataset::Texture& rhs) { @@ -292,7 +292,7 @@ Dataset loadFile(std::filesystem::path path, SkipAllZeroLines skipAllZeroLines) if (line.back() == '\r') { line = line.substr(0, line.length() - 1); } - + strip(line); if (line.empty()) { @@ -357,7 +357,7 @@ std::optional loadCachedFile(std::filesystem::path path) { if (!file.good()) { return std::nullopt; } - + Dataset result; int8_t fileVersion; @@ -394,7 +394,7 @@ std::optional loadCachedFile(std::filesystem::path path) { result.textures.resize(nTextures); for (int i = 0; i < nTextures; i += 1) { Dataset::Texture tex; - + int16_t idx; file.read(reinterpret_cast(&idx), sizeof(int16_t)); tex.index = idx; @@ -784,7 +784,7 @@ ColorMap loadFile(std::filesystem::path path, SkipAllZeroLines) { if (nColorLines == -1) { // This is the first time we get this far, it will have to be the first number // meaning that it is the number of color values - + str >> nColorLines; res.entries.reserve(nColorLines); } diff --git a/modules/spacecraftinstruments/rendering/renderablefov.cpp b/modules/spacecraftinstruments/rendering/renderablefov.cpp index 9435d3b3bb..8a4971bc32 100644 --- a/modules/spacecraftinstruments/rendering/renderablefov.cpp +++ b/modules/spacecraftinstruments/rendering/renderablefov.cpp @@ -254,7 +254,7 @@ RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary) _alwaysDrawFov = p.alwaysDrawFov.value_or(_alwaysDrawFov); addProperty(_alwaysDrawFov); - + _simplifyBounds = p.simplifyBounds.value_or(_simplifyBounds); addProperty(_colors.defaultStart); diff --git a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp index 6be4be39c5..72845c2ecb 100644 --- a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp @@ -50,7 +50,7 @@ namespace { }; constexpr const std::array FboUniformNames = { - "projectionTexture", "ProjectorMatrix", "ModelTransform", + "projectionTexture", "ProjectorMatrix", "ModelTransform", "boresight", "radius", "segments" }; diff --git a/modules/spacecraftinstruments/util/imagesequencer.h b/modules/spacecraftinstruments/util/imagesequencer.h index 9e258310ca..7c837c741c 100644 --- a/modules/spacecraftinstruments/util/imagesequencer.h +++ b/modules/spacecraftinstruments/util/imagesequencer.h @@ -42,9 +42,9 @@ class SequenceParser; * large image data-sets across all openspace renderable instances, both for past and * future unmanned-spacecraft missions. To load the instance with data the client must * provide a parser inherited from the abstract base class SequenceParser. Hence, there is - * no restriction imposed on data input, whether its data in the form of existing images or - * in the form of a planned observation schedule. Notably, in order for the sequencer to - * function the client must provide or write a parser that fills the ImageSequencers + * no restriction imposed on data input, whether its data in the form of existing images + * or in the form of a planned observation schedule. Notably, in order for the sequencer + * to function the client must provide or write a parser that fills the ImageSequencers * private members. * * \see SequenceParser @@ -136,7 +136,7 @@ private: void sortData(); /** - * This handles any types of ambiguities between the data and SPICE calls. This map is + * This handles any types of ambiguities between the data and SPICE calls. This map is * composed of a key that is a string in the data to be translated and a Decoder that * holds the corresponding translation provided through as asset. * \see Decoder @@ -179,7 +179,7 @@ private: std::string _defaultCaptureImage; std::map _latestImages; - + // if no data, no run bool _hasData = false; }; diff --git a/modules/spacecraftinstruments/util/projectioncomponent.cpp b/modules/spacecraftinstruments/util/projectioncomponent.cpp index b51cf27352..729abeb98b 100644 --- a/modules/spacecraftinstruments/util/projectioncomponent.cpp +++ b/modules/spacecraftinstruments/util/projectioncomponent.cpp @@ -109,8 +109,8 @@ namespace { InstrumentTimes [[codegen::key("instrument-times")]], ImageAndInstrumentTimes [[codegen::key("image-and-instrument-times")]] }; - // This value determines which type of sequencer is used for generating image - // schedules. The 'playbook' is using a custom format designed by the New Horizons + // This value determines which type of sequencer is used for generating image + // schedules. The 'playbook' is using a custom format designed by the New Horizons // team, the 'image-sequence' uses lbl files from a directory, and the 'hybrid' // uses both methods std::optional sequenceType; @@ -128,7 +128,7 @@ namespace { // SPICE integer std::string target [[codegen::annotation("A SPICE name of the observed object")]]; - // The aberration correction that is supposed to be used for the projection. The + // The aberration correction that is supposed to be used for the projection. The // values for the correction correspond to the SPICE definition as described in // ftp://naif.jpl.nasa.gov/pub/naif/toolkit_docs/IDL/cspice/spkezr_c.html std::string aberration [[codegen::inlist("NONE", "LT", "LT+S", "CN", "CN+S", @@ -137,18 +137,18 @@ namespace { // The list of potential targets that are involved with the image projection std::optional> potentialTargets; - // Determines whether the object requires a self-shadowing algorithm. This is - // necessary if the object is concave and might cast a shadow on itself during + // Determines whether the object requires a self-shadowing algorithm. This is + // necessary if the object is concave and might cast a shadow on itself during // presentation. The default value is 'false' std::optional textureMap; - // Determines whether the object requires a self-shadowing algorithm. This is - // necessary if the object is concave and might cast a shadow on itself during + // Determines whether the object requires a self-shadowing algorithm. This is + // necessary if the object is concave and might cast a shadow on itself during // presentation. The default value is 'false' std::optional shadowMap; - // Sets the desired aspect ratio of the projected texture. This might be necessary - // as planets usually have 2x1 aspect ratios, whereas this does not hold for + // Sets the desired aspect ratio of the projected texture. This might be necessary + // as planets usually have 2x1 aspect ratios, whereas this does not hold for // non-planet objects (comets, asteroids, etc). The default value is '1.0' std::optional aspectRatio; diff --git a/modules/statemachine/statemachinemodule.cpp b/modules/statemachine/statemachinemodule.cpp index c8b306ba6f..2a52bfd0d4 100644 --- a/modules/statemachine/statemachinemodule.cpp +++ b/modules/statemachine/statemachinemodule.cpp @@ -194,7 +194,8 @@ scripting::LuaLibrary StateMachineModule::luaLibrary() const { &luascriptfunctions::printCurrentStateInfo, {}, "", - "Prints information about the current state and possible transitions to the log." + "Prints information about the current state and possible transitions to the " + "log." }, { "saveToDotFile", diff --git a/modules/sync/syncs/urlsynchronization.cpp b/modules/sync/syncs/urlsynchronization.cpp index f0c418b02c..2f1fac6b81 100644 --- a/modules/sync/syncs/urlsynchronization.cpp +++ b/modules/sync/syncs/urlsynchronization.cpp @@ -49,22 +49,22 @@ namespace { // provided, all files will be downloaded to the same directory std::variant> url; - // This optional identifier will be part of the used folder structure and, if + // This optional identifier will be part of the used folder structure and, if // provided, can be used to manually find the downloaded folder in the // synchronization folder. If this value is not specified, 'UseHash' has to be set // to 'true' std::optional identifier; // If this value is set to 'true' and it is not overwritten by the global - // settings, the file(s) pointed to by this URLSynchronization will always be - // downloaded, thus overwriting the local files. This is useful for files that are + // settings, the file(s) pointed to by this URLSynchronization will always be + // downloaded, thus overwriting the local files. This is useful for files that are // updated regularly remotely and should be fetch at every startup std::optional forceOverride [[codegen::key("override")]]; // If this value is set to 'true' (the default), the hash of the URL is appended - // to the directory name to produce a unique directory under all circumstances. If + // to the directory name to produce a unique directory under all circumstances. If // this is not desired, the URLSynchronization use the bare directory name alone - // if this value is 'false'. If this value is 'false', the identifier has to be + // if this value is 'false'. If this value is 'false', the identifier has to be // specified std::optional useHash; diff --git a/modules/volume/rendering/renderabletimevaryingvolume.cpp b/modules/volume/rendering/renderabletimevaryingvolume.cpp index cd748315cb..363719f835 100644 --- a/modules/volume/rendering/renderabletimevaryingvolume.cpp +++ b/modules/volume/rendering/renderabletimevaryingvolume.cpp @@ -134,7 +134,7 @@ namespace { // actual time. The default value is 0 std::optional secondsBefore; - // Specifies the number of seconds to show the the last timestep after its + // Specifies the number of seconds to show the the last timestep after its // actual time float secondsAfter; diff --git a/modules/volume/tasks/generaterawvolumetask.cpp b/modules/volume/tasks/generaterawvolumetask.cpp index 109703d6f6..771d875782 100644 --- a/modules/volume/tasks/generaterawvolumetask.cpp +++ b/modules/volume/tasks/generaterawvolumetask.cpp @@ -93,7 +93,7 @@ std::string GenerateRawVolumeTask::description() { "value by evaluating the lua function: `{}`, with three arguments (x, y, z) " "ranging from ({}, {}, {}) to ({}, {}, {}). Write raw volume data into {} and " "dictionary with metadata to {}", - _dimensions.x, _dimensions.y, _dimensions.z, _valueFunctionLua, + _dimensions.x, _dimensions.y, _dimensions.z, _valueFunctionLua, _lowerDomainBound.x, _lowerDomainBound.y, _lowerDomainBound.z, _upperDomainBound.x, _upperDomainBound.y, _upperDomainBound.z, _rawVolumeOutputPath, _dictionaryOutputPath diff --git a/src/documentation/verifier.cpp b/src/documentation/verifier.cpp index 22ffdec0a6..857764daa6 100644 --- a/src/documentation/verifier.cpp +++ b/src/documentation/verifier.cpp @@ -462,7 +462,7 @@ TestResult TemplateVerifier::operator()(const ghoul::Dictionary& dic o.offender = key; o.reason = TestResult::Offense::Reason::MissingKey; res.offenses.push_back(o); - return res; + return res; } } } @@ -498,7 +498,7 @@ TestResult TemplateVerifier::operator()(const ghoul::Dictionary& dic o.offender = key; o.reason = TestResult::Offense::Reason::WrongType; res.offenses.push_back(o); - return res; + return res; } } else { @@ -508,7 +508,7 @@ TestResult TemplateVerifier::operator()(const ghoul::Dictionary& dic o.offender = key; o.reason = TestResult::Offense::Reason::WrongType; res.offenses.push_back(o); - return res; + return res; } } else { @@ -565,7 +565,7 @@ TestResult TemplateVerifier::operator()(const ghoul::Dictionary& dic o.offender = key; o.reason = TestResult::Offense::Reason::WrongType; res.offenses.push_back(o); - return res; + return res; } } else { @@ -575,7 +575,7 @@ TestResult TemplateVerifier::operator()(const ghoul::Dictionary& dic o.offender = key; o.reason = TestResult::Offense::Reason::MissingKey; res.offenses.push_back(o); - return res; + return res; } } } diff --git a/src/events/event.cpp b/src/events/event.cpp index f056c2ad33..ad314e99b8 100644 --- a/src/events/event.cpp +++ b/src/events/event.cpp @@ -280,7 +280,7 @@ ghoul::Dictionary toParameter(const Event& e) { case EventParallelConnection::State::Lost: d.setValue("State", "Lost"s); break; - case EventParallelConnection::State::HostshipGained: + case EventParallelConnection::State::HostshipGained: d.setValue("State", "HostshipGained"s); break; case EventParallelConnection::State::HostshipLost: diff --git a/src/interaction/actionmanager_lua.inl b/src/interaction/actionmanager_lua.inl index 1c677d5226..2c03117c5a 100644 --- a/src/interaction/actionmanager_lua.inl +++ b/src/interaction/actionmanager_lua.inl @@ -200,7 +200,7 @@ int actions(lua_State* L) { action.synchronization == interaction::Action::IsSynchronized::Yes ); lua_settable(L, -3); - + lua_settable(L, -3); } diff --git a/src/interaction/sessionrecording.cpp b/src/interaction/sessionrecording.cpp index 2c4b8da045..44ab5daab0 100644 --- a/src/interaction/sessionrecording.cpp +++ b/src/interaction/sessionrecording.cpp @@ -1979,9 +1979,13 @@ bool SessionRecording::processCameraKeyframe(double now) { } // getPrevTimestamp(); - double prevTime = appropriateTimestamp(_timeline[_idxTimeline_cameraPtrPrev].t3stamps); + double prevTime = appropriateTimestamp( + _timeline[_idxTimeline_cameraPtrPrev].t3stamps + ); // getNextTimestamp(); - double nextTime = appropriateTimestamp(_timeline[_idxTimeline_cameraPtrNext].t3stamps); + double nextTime = appropriateTimestamp( + _timeline[_idxTimeline_cameraPtrNext].t3stamps + ); double t; if ((nextTime - prevTime) < 1e-7) { diff --git a/src/navigation/navigationhandler.cpp b/src/navigation/navigationhandler.cpp index f3d18229d5..10fd242a53 100644 --- a/src/navigation/navigationhandler.cpp +++ b/src/navigation/navigationhandler.cpp @@ -215,7 +215,7 @@ void NavigationHandler::applyNavigationState(const NavigationState& ns) { void NavigationHandler::updateCameraTransitions() { // This function is concerned with managing transitions of the camera between - // different distances of interest relative to the focus node. For each transition two + // different distances of interest relative to the focus node. For each transition two // scenarios are handled; SceneGraphNodes can have attached actions for each // transition, which are automatically triggered. Additionally, an // EventCameraTransition event is fired that contains information about the focus node @@ -228,7 +228,7 @@ void NavigationHandler::updateCameraTransitions() { // // |<------------------->| Approach factor * Interaction sphere // |<------>| Reach Factor * Interaction sphere - // + // // ( ( O ) ) // ^ ^ ^ ^ // OnExit OnMoveAway OnReach OnApproach diff --git a/src/navigation/navigationhandler_lua.inl b/src/navigation/navigationhandler_lua.inl index c3c9b1e4a4..02cb94216c 100644 --- a/src/navigation/navigationhandler_lua.inl +++ b/src/navigation/navigationhandler_lua.inl @@ -217,7 +217,7 @@ int bindJoystickButton(lua_State* L) { actionStr = actionStr.value_or("Press"); isRemote = isRemote.value_or(true); - interaction::JoystickAction action = + interaction::JoystickAction action = ghoul::from_string(*actionStr); global::navigationHandler->bindJoystickButtonCommand( diff --git a/src/navigation/navigationstate.cpp b/src/navigation/navigationstate.cpp index 52a0346170..7d99eb4095 100644 --- a/src/navigation/navigationstate.cpp +++ b/src/navigation/navigationstate.cpp @@ -80,8 +80,8 @@ NavigationState::NavigationState(const ghoul::Dictionary& dictionary) { } NavigationState::NavigationState(std::string anchor_, std::string aim_, - std::string referenceFrame_, glm::dvec3 position_, - std::optional up_, + std::string referenceFrame_, glm::dvec3 position_, + std::optional up_, double yaw_, double pitch_) : anchor(std::move(anchor_)) , aim(std::move(aim_)) diff --git a/src/navigation/orbitalnavigator.cpp b/src/navigation/orbitalnavigator.cpp index 13623fb3e3..fded5fca7f 100644 --- a/src/navigation/orbitalnavigator.cpp +++ b/src/navigation/orbitalnavigator.cpp @@ -463,7 +463,9 @@ OrbitalNavigator::OrbitalNavigator() addPropertySubOwner(_linearFlight); addPropertySubOwner(_idleBehavior); - _idleBehaviorDampenInterpolator.setTransferFunction(ghoul::quadraticEaseInOut); + _idleBehaviorDampenInterpolator.setTransferFunction( + ghoul::quadraticEaseInOut + ); _idleBehavior.dampenInterpolationTime.onChange([&]() { _idleBehaviorDampenInterpolator.setInterpolationTime( _idleBehavior.dampenInterpolationTime @@ -1631,8 +1633,8 @@ void OrbitalNavigator::applyIdleBehavior(double deltaTime, glm::dvec3& position, break; case IdleBehavior::Behavior::OrbitAtConstantLat: { // Assume that "north" coincides with the local z-direction - // @TODO (2021-07-09, emmbr) Make each scene graph node aware of its own - // north/up, so that we can query this information rather than assuming it. + // @TODO (2021-07-09, emmbr) Make each scene graph node aware of its own + // north/up, so that we can query this information rather than assuming it. // The we could also combine this idle behavior with the next const glm::dvec3 north = glm::dvec3(0.0, 0.0, 1.0); orbitAroundAxis(north, deltaTime, position, globalRotation, speedScale); @@ -1672,14 +1674,14 @@ void OrbitalNavigator::orbitAnchor(double deltaTime, glm::dvec3& position, position += rotationDiffVec3; } -void OrbitalNavigator::orbitAroundAxis(const glm::dvec3 axis, double deltaTime, +void OrbitalNavigator::orbitAroundAxis(const glm::dvec3 axis, double deltaTime, glm::dvec3& position, glm::dquat& globalRotation, double speedScale) { ghoul_assert(_anchorNode != nullptr, "Node to orbit must be set!"); const glm::dmat4 modelTransform = _anchorNode->modelTransform(); - const glm::dvec3 axisInWorldCoords = + const glm::dvec3 axisInWorldCoords = glm::dmat3(modelTransform) * glm::normalize(axis); // Compute rotation to be applied around the axis diff --git a/src/navigation/path.cpp b/src/navigation/path.cpp index 8e6b03cdff..97a937cd41 100644 --- a/src/navigation/path.cpp +++ b/src/navigation/path.cpp @@ -59,7 +59,8 @@ namespace { // The desired duration traversing the specified path segment should take std::optional duration; - // (Node): The target node of the camera path. Not optional for 'Node' instructions + // (Node): The target node of the camera path. Not optional for 'Node' + // instructions std::optional target; // (Node): An optional position in relation to the target node, in model @@ -271,9 +272,11 @@ double Path::speedAlongPath(double traveledDistance) const { speed *= remainingDistance / closeUpDistance + 0.01; } - // TODO: also dampen speed based on curvature, or make sure the curve has a rounder shape + // TODO: also dampen speed based on curvature, or make sure the curve has a rounder + // shape - // TODO: check for when path is shorter than the starUpDistance or closeUpDistance variables + // TODO: check for when path is shorter than the starUpDistance or closeUpDistance + // variables return _speedFactorFromDuration * speed; } @@ -384,7 +387,9 @@ Waypoint computeWaypointFromNodeInfo(const NodeInfo& info, const Waypoint& start if (info.position.has_value()) { // The position in instruction is given in the targetNode's local coordinates. // Convert to world coordinates - targetPos = glm::dvec3(targetNode->modelTransform() * glm::dvec4(*info.position, 1.0)); + targetPos = glm::dvec3( + targetNode->modelTransform() * glm::dvec4(*info.position, 1.0) + ); } else { const double radius = Waypoint::findValidBoundingSphere(targetNode); diff --git a/src/navigation/pathcurves/zoomoutoverviewcurve.cpp b/src/navigation/pathcurves/zoomoutoverviewcurve.cpp index 965fbfe3ab..4f96553a44 100644 --- a/src/navigation/pathcurves/zoomoutoverviewcurve.cpp +++ b/src/navigation/pathcurves/zoomoutoverviewcurve.cpp @@ -80,7 +80,8 @@ ZoomOutOverviewCurve::ZoomOutOverviewCurve(const Waypoint& start, const Waypoint goodStepDirection = glm::normalize(n1 + n2); } - // Find a direction that is orthogonal to the line between the start and end position + // Find a direction that is orthogonal to the line between the start and end + // position const glm::dvec3 startPosToEndPos = end.position() - start.position(); const glm::dvec3 outwardStepVector = 0.5 * glm::length(startPosToEndPos) * goodStepDirection; diff --git a/src/navigation/pathnavigator.cpp b/src/navigation/pathnavigator.cpp index 87edf005e7..94dff5aa2c 100644 --- a/src/navigation/pathnavigator.cpp +++ b/src/navigation/pathnavigator.cpp @@ -72,7 +72,8 @@ namespace { "triggered once the path has reached its target." }; - constexpr const openspace::properties::Property::PropertyInfo MinBoundingSphereInfo = { + constexpr const openspace::properties::Property::PropertyInfo MinBoundingSphereInfo = + { "MinimalValidBoundingSphere", "Minimal Valid Bounding Sphere", "The minimal allowed value for a bounding sphere, in meters. Used for " @@ -203,8 +204,10 @@ void PathNavigator::updateCamera(double deltaTime) { if (_applyIdleBehaviorOnFinish) { constexpr const char* ApplyIdleBehaviorScript = - "local f = 'NavigationHandler.OrbitalNavigator.IdleBehavior.ApplyIdleBehavior';" - "openspace.setPropertyValueSingle(f, true);"; + "openspace.setPropertyValueSingle(" + "'NavigationHandler.OrbitalNavigator.IdleBehavior.ApplyIdleBehavior'," + "true" + ");"; global::scriptEngine->queueScript( ApplyIdleBehaviorScript, diff --git a/src/navigation/pathnavigator_lua.inl b/src/navigation/pathnavigator_lua.inl index a5a71f1c59..2e946a8492 100644 --- a/src/navigation/pathnavigator_lua.inl +++ b/src/navigation/pathnavigator_lua.inl @@ -86,9 +86,8 @@ int goTo(lua_State* L) { return ghoul::lua::luaError(L, "Unknown node name: " + nodeIdentifier); } - using namespace std::string_literals; ghoul::Dictionary insDict; - insDict.setValue("TargetType", "Node"s); + insDict.setValue("TargetType", std::string("Node")); insDict.setValue("Target", nodeIdentifier); if (useUpFromTargetOrDuration.has_value()) { if (std::holds_alternative(*useUpFromTargetOrDuration)) { @@ -134,9 +133,8 @@ int goToHeight(lua_State* L) { return ghoul::lua::luaError(L, "Unknown node name: " + nodeIdentifier); } - using namespace std::string_literals; ghoul::Dictionary insDict; - insDict.setValue("TargetType", "Node"s); + insDict.setValue("TargetType", std::string("Node")); insDict.setValue("Target", nodeIdentifier); insDict.setValue("Height", height); if (useUpFromTargetOrDuration.has_value()) { @@ -190,9 +188,8 @@ int goToNavigationState(lua_State* L) { ); } - using namespace std::string_literals; ghoul::Dictionary instruction; - instruction.setValue("TargetType", "NavigationState"s); + instruction.setValue("TargetType", std::string("NavigationState")); instruction.setValue("NavigationState", navigationState); if (duration.has_value()) { diff --git a/src/navigation/waypoint.cpp b/src/navigation/waypoint.cpp index 5799a92635..c1080533bb 100644 --- a/src/navigation/waypoint.cpp +++ b/src/navigation/waypoint.cpp @@ -53,7 +53,7 @@ Waypoint::Waypoint(const glm::dvec3& pos, const glm::dquat& rot, const std::stri } Waypoint::Waypoint(const NavigationState& ns) { - const SceneGraphNode* anchorNode = sceneGraphNode(ns.anchor); + const SceneGraphNode* anchorNode = sceneGraphNode(ns.anchor); if (!anchorNode) { LERROR(fmt::format("Could not find node '{}' to target", ns.anchor)); @@ -92,7 +92,7 @@ double Waypoint::validBoundingSphere() const { double Waypoint::findValidBoundingSphere(const SceneGraphNode* node) { double bs = static_cast(node->boundingSphere()); - const double minValidBoundingSphere = + const double minValidBoundingSphere = global::navigationHandler->pathNavigator().minValidBoundingSphere(); if (bs < minValidBoundingSphere) { diff --git a/src/rendering/helper.cpp b/src/rendering/helper.cpp index cfa790b3d0..9d5d6f8138 100644 --- a/src/rendering/helper.cpp +++ b/src/rendering/helper.cpp @@ -458,7 +458,7 @@ std::pair, std::vector> createSphere(int nSegments // 0 -> PI // azimuth angle (east to west) const float theta = fi * glm::pi() / nSegments; - + // 0 -> 2*PI const float phi = fj * glm::pi() * 2.f / nSegments; diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 7bdb20d222..b9c4bafc9f 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -260,7 +260,7 @@ namespace { "Enabled Font Color", "The font color used for enabled options." }; - + constexpr openspace::properties::Property::PropertyInfo DisabledFontColorInfo = { "DisabledFontColor", "Disabled Font Color", @@ -399,7 +399,7 @@ RenderEngine::RenderEngine() _enabledFontColor.setViewOption(openspace::properties::Property::ViewOptions::Color); addProperty(_enabledFontColor); - + _disabledFontColor.setViewOption(openspace::properties::Property::ViewOptions::Color); addProperty(_disabledFontColor); } diff --git a/src/rendering/screenspacerenderable.cpp b/src/rendering/screenspacerenderable.cpp index ef4b358966..d001481b64 100644 --- a/src/rendering/screenspacerenderable.cpp +++ b/src/rendering/screenspacerenderable.cpp @@ -258,7 +258,7 @@ namespace { std::optional opacity [[codegen::inrange(0.f, 1.f)]]; // Defines either a single or multiple tags that apply to this - // ScreenSpaceRenderable, thus making it possible to address multiple, separate + // ScreenSpaceRenderable, thus making it possible to address multiple, separate // Renderables with a single property change std::optional>> tag; }; diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp index f673ecf336..dacc2d65c0 100644 --- a/src/scene/scene.cpp +++ b/src/scene/scene.cpp @@ -911,14 +911,16 @@ scripting::LuaLibrary Scene::luaLibrary() { &luascriptfunctions::worldPosition, {}, "string", - "Returns the world position of the scene graph node with the given string as identifier" + "Returns the world position of the scene graph node with the given " + "string as identifier" }, { "worldRotation", & luascriptfunctions::worldRotation, {}, "string", - "Returns the world rotation matrix of the scene graph node with the given string as identifier" + "Returns the world rotation matrix of the scene graph node with the " + "given string as identifier" } } }; diff --git a/src/scene/scene_lua.inl b/src/scene/scene_lua.inl index c05919350a..539e4ca1fa 100644 --- a/src/scene/scene_lua.inl +++ b/src/scene/scene_lua.inl @@ -618,7 +618,7 @@ int addSceneGraphNode(lua_State* L) { d.value("Identifier") : "Scene"; LERRORC(cat, ghoul::to_string(e.result)); - + return ghoul::lua::luaError( L, fmt::format("Error loading scene graph node: {}", e.what()) diff --git a/src/scene/scenelicensewriter.cpp b/src/scene/scenelicensewriter.cpp index 8e1f9149e3..e9eba3ce1a 100644 --- a/src/scene/scenelicensewriter.cpp +++ b/src/scene/scenelicensewriter.cpp @@ -70,12 +70,30 @@ std::string SceneLicenseWriter::generateJson() const { constexpr const char* replStr = R"("{}": "{}", )"; constexpr const char* replStr2 = R"("{}": "{}")"; json << "{"; - json << fmt::format(replStr, "name", escapedJson(global::profile->meta->name.value())); - json << fmt::format(replStr, "version", escapedJson(global::profile->meta->version.value())); - json << fmt::format(replStr, "description", escapedJson(global::profile->meta->description.value())); - json << fmt::format(replStr, "author", escapedJson(global::profile->meta->author.value())); - json << fmt::format(replStr, "url", escapedJson(global::profile->meta->url.value())); - json << fmt::format(replStr2, "license", escapedJson(global::profile->meta->license.value())); + json << fmt::format( + replStr, + "name", escapedJson(global::profile->meta->name.value_or("")) + ); + json << fmt::format( + replStr, + "version", escapedJson(global::profile->meta->version.value_or("")) + ); + json << fmt::format( + replStr, + "description", escapedJson(global::profile->meta->description.value_or("")) + ); + json << fmt::format( + replStr, + "author", escapedJson(global::profile->meta->author.value_or("")) + ); + json << fmt::format( + replStr, + "url", escapedJson(global::profile->meta->url.value_or("")) + ); + json << fmt::format( + replStr2, + "license", escapedJson(global::profile->meta->license.value_or("")) + ); json << "}"; if (++metaCount != metaTotal) { diff --git a/src/scripting/scriptscheduler.cpp b/src/scripting/scriptscheduler.cpp index c80e1487fb..5d32959f01 100644 --- a/src/scripting/scriptscheduler.cpp +++ b/src/scripting/scriptscheduler.cpp @@ -40,7 +40,7 @@ namespace { // executed instead std::string time; - // The Lua script that will be executed when the specified time is passed + // The Lua script that will be executed when the specified time is passed // independent of its direction. This script will be executed before the // specific scripts if both versions are specified std::optional script; diff --git a/src/scripting/scriptscheduler_lua.inl b/src/scripting/scriptscheduler_lua.inl index 2fe74d9ede..9bf64dad5e 100644 --- a/src/scripting/scriptscheduler_lua.inl +++ b/src/scripting/scriptscheduler_lua.inl @@ -46,7 +46,7 @@ int loadFile(lua_State* L) { for (size_t i = 1; i <= scriptsDict.size(); ++i) { ghoul::Dictionary d = scriptsDict.value(std::to_string(i)); - scripting::ScriptScheduler::ScheduledScript script = + scripting::ScriptScheduler::ScheduledScript script = scripting::ScriptScheduler::ScheduledScript(d); scripts.push_back(script); } diff --git a/src/util/keys.cpp b/src/util/keys.cpp index 0078b379bd..8eb94c13e1 100644 --- a/src/util/keys.cpp +++ b/src/util/keys.cpp @@ -93,9 +93,9 @@ std::string keyToString(KeyWithModifier keyWithModifier) { std::string modifier; if (keyWithModifier.modifier != KeyModifier::None) { for (const openspace::KeyModifierInfo& kmi : openspace::KeyModifierInfos) { - // No need for an extra check for the empty modifier since that is mapped to 0, - // meaning that the `hasKeyModifier` will always fail for it since it checks - // internally against != 0 + // No need for an extra check for the empty modifier since that is mapped + // to 0, meaning that the `hasKeyModifier` will always fail for it since it + // checks internally against != 0 if (hasKeyModifier(keyWithModifier.modifier, kmi.modifier)) { modifier += fmt::format("{}+", kmi.identifier); @@ -126,7 +126,7 @@ std::string to_string(const openspace::Key& key) { return std::string(ki.name); } } - + throw ghoul::MissingCaseException(); } diff --git a/src/util/resourcesynchronization.cpp b/src/util/resourcesynchronization.cpp index 45b655ea30..06948ff505 100644 --- a/src/util/resourcesynchronization.cpp +++ b/src/util/resourcesynchronization.cpp @@ -33,7 +33,7 @@ namespace { struct [[codegen::Dictionary(ResourceSynchronization)]] Parameters { // This key specifies the type of ResourceSyncrhonization that gets created. It // has to be one of the valid ResourceSyncrhonizations that are available for - // creation (see the FactoryDocumentation for a list of possible + // creation (see the FactoryDocumentation for a list of possible // ResourceSyncrhonizations), which depends on the configration of the application std::string type [[codegen::annotation("A ResourceSynchronization created by a factory")]]; diff --git a/src/util/spicemanager.cpp b/src/util/spicemanager.cpp index b5500e1690..6bb9810180 100644 --- a/src/util/spicemanager.cpp +++ b/src/util/spicemanager.cpp @@ -1377,20 +1377,22 @@ scripting::LuaLibrary SpiceManager::luaLibrary() { &luascriptfunctions::rotationMatrix, {}, "{string, string, string}", - "Returns the rotationMatrix for a given body in a frame of reference at a specific" - "time. The first agument is the target body, the second is the frame of reference," - " the third is the time. Example: openspace.spice.rotationMatrix('" - "INSIGHT_LANDER_CRUISE','MARS', '2018 NOV 26 19:45:34')." + "Returns the rotationMatrix for a given body in a frame of reference at " + "a specific time. The first agument is the target body, the second is " + "the frame of reference, the third is the time. Example: " + "openspace.spice.rotationMatrix('INSIGHT_LANDER_CRUISE','MARS'," + "'2018 NOV 26 19:45:34')." }, { "position", &luascriptfunctions::position, {}, "{string, string, string, string}", - "Returns the position for a target by an observer in a frame of reference at a specific" - "time. The first agument is the target body, the second is the observer body, the third" - "is the frame of reference, and the fourth is the time. Example: openspace.spice." - "position('INSIGHT','MARS','GALACTIC', '2018 NOV 26 19:45:34')." + "Returns the position for a target by an observer in a frame of " + "reference at a specific time. The first agument is the target body, the " + "second is the observer body, the third is the frame of reference, and " + "the fourth is the time. Example: openspace.spice.position('INSIGHT'," + "'MARS','GALACTIC', '2018 NOV 26 19:45:34')." }, { "getSpiceBodies", diff --git a/src/util/spicemanager_lua.inl b/src/util/spicemanager_lua.inl index 268de67d63..9a00ecca00 100644 --- a/src/util/spicemanager_lua.inl +++ b/src/util/spicemanager_lua.inl @@ -58,7 +58,7 @@ int loadKernel(lua_State* L) { */ int unloadKernel(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 1, "lua::unloadKernel"); - std::variant argument = + std::variant argument = ghoul::lua::value>(L); if (std::holds_alternative(argument)) { @@ -161,7 +161,7 @@ int rotationMatrix(lua_State* L) { /** * position({string, string, string, string}): - * Returns the position for a given body relative to another body, + * Returns the position for a given body relative to another body, * in a given frame of reference, at a specific time. */ int position(lua_State* L) { diff --git a/src/util/time_lua.inl b/src/util/time_lua.inl index 9c519ae5c2..76fb105660 100644 --- a/src/util/time_lua.inl +++ b/src/util/time_lua.inl @@ -227,7 +227,7 @@ int time_interpolateTogglePause(lua_State* L) { */ int time_pauseToggleViaKeyboard(lua_State* L) { ghoul::lua::checkArgumentsAndThrow(L, 0, "lua::time_pauseToggleViaKeyboard"); - + if (global::sessionRecording->isPlayingBack()) { bool isPlaybackPaused = global::sessionRecording->isPlaybackPaused(); global::sessionRecording->setPlaybackPause(!isPlaybackPaused); @@ -462,17 +462,17 @@ int time_advancedTime(lua_State* L) { try { double value = std::stod(std::string(modifier.begin(), it)); - std::string unitName = std::string(it, modifier.end()); + std::string uName = std::string(it, modifier.end()); TimeUnit unit = TimeUnit::Second; - if (unitName == "s") { unit = TimeUnit::Second; } - else if (unitName == "m") { unit = TimeUnit::Minute; } - else if (unitName == "h") { unit = TimeUnit::Hour; } - else if (unitName == "d") { unit = TimeUnit::Day; } - else if (unitName == "M") { unit = TimeUnit::Month; } - else if (unitName == "y") { unit = TimeUnit::Year; } + if (uName == "s") { unit = TimeUnit::Second; } + else if (uName == "m") { unit = TimeUnit::Minute; } + else if (uName == "h") { unit = TimeUnit::Hour; } + else if (uName == "d") { unit = TimeUnit::Day; } + else if (uName == "M") { unit = TimeUnit::Month; } + else if (uName == "y") { unit = TimeUnit::Year; } else { - return ghoul::lua::luaError(L, fmt::format("Unknown unit '{}'", unitName)); + return ghoul::lua::luaError(L, fmt::format("Unknown unit '{}'", uName)); } dt = convertTime(value, unit, TimeUnit::Second);