From afa1d6d33edf4eaa62bd629721d5a6d5135e3739 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Thu, 9 Nov 2017 23:47:51 -0500 Subject: [PATCH] Add strict test for whitespace at end of line More work on coding style --- apps/OpenSpace/main.cpp | 4 +- apps/TimelineView/main.cpp | 2 +- apps/TimelineView/timelinewidget.h | 2 +- ext/ghoul | 2 +- .../openspace/documentation/documentation.h | 8 +- .../documentation/documentationengine.h | 2 +- .../documentation/documentationgenerator.h | 8 +- include/openspace/documentation/verifier.h | 14 +- include/openspace/documentation/verifier.inl | 2 +- include/openspace/engine/moduleengine.h | 2 +- include/openspace/engine/syncengine.h | 4 +- .../openspace/engine/wrapper/windowwrapper.h | 7 +- .../openspace/interaction/keybindingmanager.h | 2 +- include/openspace/interaction/mousestate.h | 2 +- .../openspace/interaction/navigationhandler.h | 6 +- .../openspace/interaction/orbitalnavigator.h | 6 +- include/openspace/mission/mission.h | 2 +- include/openspace/mission/missionmanager.h | 8 +- include/openspace/network/messagestructures.h | 2 +- .../properties/numericalproperty.inl | 2 +- include/openspace/properties/optionproperty.h | 4 +- include/openspace/properties/property.h | 8 +- include/openspace/properties/propertyowner.h | 4 +- .../properties/scalar/boolproperty.h | 4 +- .../properties/scalar/charproperty.h | 4 +- .../properties/scalar/doubleproperty.h | 4 +- .../properties/scalar/floatproperty.h | 4 +- .../openspace/properties/scalar/intproperty.h | 4 +- .../properties/scalar/longdoubleproperty.h | 4 +- .../properties/scalar/longlongproperty.h | 4 +- .../properties/scalar/longproperty.h | 4 +- .../properties/scalar/shortproperty.h | 4 +- .../properties/scalar/signedcharproperty.h | 4 +- .../properties/scalar/ucharproperty.h | 4 +- .../properties/scalar/uintproperty.h | 4 +- .../properties/scalar/ulonglongproperty.h | 4 +- .../properties/scalar/ulongproperty.h | 4 +- .../properties/scalar/ushortproperty.h | 4 +- .../properties/scalar/wcharproperty.h | 4 +- .../openspace/properties/triggerproperty.h | 2 +- include/openspace/rendering/abufferrenderer.h | 2 +- include/openspace/rendering/renderable.h | 2 +- .../rendering/screenspacerenderable.h | 4 +- include/openspace/rendering/volume.h | 12 +- include/openspace/rendering/volumeraycaster.h | 10 +- include/openspace/scripting/scriptscheduler.h | 8 +- include/openspace/util/concurrentjobmanager.h | 2 +- include/openspace/util/gpudata.h | 8 +- include/openspace/util/histogram.h | 4 +- include/openspace/util/openspacemodule.h | 2 +- include/openspace/util/spicemanager.h | 8 +- include/openspace/util/syncdata.h | 12 +- include/openspace/util/threadpool.h | 2 +- include/openspace/util/time.h | 8 +- include/openspace/util/timerange.h | 2 +- modules/base/rendering/multimodelgeometry.cpp | 2 +- modules/base/rendering/renderablemodel.cpp | 2 +- modules/base/rendering/renderablemodel.h | 2 +- modules/base/rendering/renderableplane.cpp | 4 +- modules/base/rendering/renderabletrail.h | 10 +- .../base/rendering/renderabletrailorbit.cpp | 10 +- modules/base/rendering/renderabletrailorbit.h | 2 +- .../base/rendering/screenspaceframebuffer.cpp | 2 +- modules/base/rendering/wavefrontgeometry.cpp | 2 +- modules/base/translation/luatranslation.cpp | 4 +- modules/debugging/debuggingmodule.cpp | 2 +- modules/debugging/rendering/debugrenderer.cpp | 6 +- modules/debugging/rendering/debugrenderer.h | 10 +- .../rendering/renderablepoints.cpp | 12 +- .../rendering/renderablepoints.h | 4 +- .../rendering/renderablefieldlines.cpp | 4 +- modules/galaxy/rendering/renderablegalaxy.cpp | 2 +- .../galaxy/tasks/milkywayconversiontask.cpp | 2 +- modules/globebrowsing/chunk/chunk.cpp | 8 +- modules/globebrowsing/chunk/chunk.h | 2 +- .../projectedareaevaluator.cpp | 14 +- modules/globebrowsing/chunk/chunknode.cpp | 4 +- .../chunk/culling/horizonculler.cpp | 2 +- modules/globebrowsing/geometry/angle.h | 4 +- modules/globebrowsing/geometry/angle.inl | 2 +- modules/globebrowsing/geometry/ellipsoid.cpp | 2 +- .../globebrowsing/geometry/geodeticpatch.cpp | 34 +- .../globebrowsing/geometry/geodeticpatch.h | 2 +- .../globebrowsing/globes/chunkedlodglobe.cpp | 2 +- .../globebrowsing/globes/chunkedlodglobe.h | 2 +- modules/globebrowsing/globes/pointglobe.cpp | 4 +- .../globebrowsing/globes/renderableglobe.cpp | 8 +- .../globebrowsing/globes/renderableglobe.h | 4 +- modules/globebrowsing/meshes/basicgrid.h | 2 +- modules/globebrowsing/meshes/grid.h | 2 +- modules/globebrowsing/other/distanceswitch.h | 4 +- modules/globebrowsing/other/lruthreadpool.h | 2 +- modules/globebrowsing/other/pixelbuffer.h | 2 +- .../globebrowsing/rendering/chunkrenderer.cpp | 2 +- .../rendering/gpu/gpuchunktile.h | 8 +- .../rendering/gpu/gpuchunktilepile.h | 8 +- .../rendering/gpu/gpuheightlayer.h | 6 +- .../globebrowsing/rendering/gpu/gpulayer.h | 6 +- .../rendering/gpu/gpulayergroup.cpp | 2 +- .../rendering/gpu/gpulayergroup.h | 6 +- .../rendering/gpu/gpulayermanager.cpp | 2 +- .../rendering/gpu/gpulayermanager.h | 6 +- .../rendering/gpu/gpulayerrendersettings.h | 6 +- .../rendering/gpu/gputiledepthtransform.h | 8 +- .../rendering/gpu/gputileuvtransform.h | 8 +- .../globebrowsing/rendering/layer/layer.cpp | 4 +- modules/globebrowsing/tile/pixelregion.cpp | 18 +- modules/globebrowsing/tile/pixelregion.h | 2 +- .../gdalrawtiledatareader.cpp | 4 +- .../rawtiledatareader/gdalrawtiledatareader.h | 4 +- .../rawtiledatareader/rawtiledatareader.cpp | 34 +- .../tile/rawtiledatareader/tiledatatype.cpp | 14 +- modules/globebrowsing/tile/tileindex.cpp | 2 +- modules/globebrowsing/tile/tileloadjob.h | 2 +- .../tile/tileprovider/defaulttileprovider.cpp | 4 +- .../tile/tileprovider/defaulttileprovider.h | 8 +- .../tileprovider/temporaltileprovider.cpp | 8 +- .../tile/tileprovider/temporaltileprovider.h | 46 +- .../tile/tileprovider/texttileprovider.h | 14 +- .../tile/tileprovider/tileprovider.cpp | 6 +- .../tile/tileprovider/tileprovider.h | 38 +- modules/imgui/src/gui.cpp | 12 +- modules/imgui/src/guipropertycomponent.cpp | 2 +- modules/imgui/src/guispacetimecomponent.cpp | 4 +- modules/iswa/rendering/datacygnet.cpp | 12 +- modules/iswa/rendering/datacygnet.h | 4 +- modules/iswa/rendering/dataplane.cpp | 6 +- modules/iswa/rendering/dataplane.h | 2 +- modules/iswa/rendering/datasphere.cpp | 4 +- modules/iswa/rendering/datasphere.h | 4 +- modules/iswa/rendering/iswabasegroup.cpp | 12 +- modules/iswa/rendering/iswacygnet.h | 4 +- modules/iswa/rendering/iswadatagroup.cpp | 6 +- modules/iswa/rendering/kameleonplane.cpp | 10 +- modules/iswa/rendering/kameleonplane.h | 12 +- modules/iswa/rendering/texturecygnet.cpp | 11 +- modules/iswa/rendering/texturecygnet.h | 2 +- modules/iswa/rendering/textureplane.h | 2 +- modules/iswa/util/dataprocessor.cpp | 16 +- modules/iswa/util/dataprocessor.h | 2 +- modules/iswa/util/dataprocessorjson.cpp | 9 +- modules/iswa/util/dataprocessorkameleon.cpp | 8 +- modules/iswa/util/dataprocessortext.cpp | 14 +- modules/iswa/util/iswamanager.cpp | 26 +- modules/iswa/util/iswamanager.h | 2 +- modules/iswa/util/iswamanager_lua.inl | 8 +- .../rendering/renderablekameleonvolume.cpp | 27 +- .../tasks/kameleondocumentationtask.cpp | 30 +- modules/space/rendering/renderableplanet.cpp | 14 +- modules/space/rendering/renderableplanet.h | 2 +- modules/space/rendering/renderablestars.cpp | 2 +- .../space/translation/keplertranslation.cpp | 2 +- modules/space/translation/tletranslation.h | 2 +- .../rendering/renderablecrawlingline.cpp | 4 +- .../rendering/renderablefov.cpp | 20 +- .../rendering/renderablefov.h | 2 +- .../rendering/renderablemodelprojection.h | 2 +- .../rendering/renderableplaneprojection.cpp | 6 +- .../rendering/renderableplanetprojection.cpp | 10 +- .../util/hongkangparser.cpp | 22 +- .../util/hongkangparser.h | 2 +- .../util/imagesequencer.cpp | 149 ++-- .../util/imagesequencer.h | 54 +- .../util/instrumenttimesparser.cpp | 2 +- .../util/labelparser.cpp | 13 +- .../spacecraftinstruments/util/labelparser.h | 6 +- .../util/projectioncomponent.cpp | 2 +- .../util/projectioncomponent.h | 2 +- modules/touch/include/touchinteraction.h | 16 +- modules/touch/src/touchinteraction.cpp | 711 ++++++++++++------ modules/touch/src/touchmarker.cpp | 38 +- modules/touch/src/tuioear.cpp | 8 +- modules/touch/touchmodule.cpp | 38 +- .../rendering/renderabletoyvolume.cpp | 62 +- .../rendering/toyvolumeraycaster.cpp | 12 +- .../toyvolume/rendering/toyvolumeraycaster.h | 2 +- modules/volume/rawvolumewriter.h | 4 +- modules/volume/rawvolumewriter.inl | 2 +- .../volume/rendering/basicvolumeraycaster.h | 4 +- modules/volume/rendering/volumeclipplanes.cpp | 2 +- modules/volume/volumeutils.cpp | 2 +- src/documentation/documentation.cpp | 2 +- src/documentation/documentationgenerator.cpp | 2 +- src/documentation/verifier.cpp | 2 +- src/engine/downloadmanager.cpp | 2 +- src/engine/openspaceengine.cpp | 4 +- src/engine/syncengine.cpp | 2 +- src/engine/wrapper/sgctwindowwrapper.cpp | 2 +- src/interaction/navigationhandler.cpp | 2 +- src/interaction/orbitalnavigator.cpp | 8 +- src/mission/mission.cpp | 4 +- src/network/networkengine.cpp | 4 +- src/network/parallelconnection.cpp | 2 +- src/properties/matrix/dmat2property.cpp | 2 +- src/properties/matrix/dmat2x3property.cpp | 2 +- src/properties/matrix/dmat2x4property.cpp | 2 +- src/properties/matrix/dmat3property.cpp | 4 +- src/properties/matrix/dmat3x2property.cpp | 2 +- src/properties/matrix/dmat3x4property.cpp | 4 +- src/properties/matrix/dmat4property.cpp | 6 +- src/properties/matrix/dmat4x2property.cpp | 2 +- src/properties/matrix/dmat4x3property.cpp | 4 +- src/properties/matrix/mat3x4property.cpp | 4 +- src/properties/matrix/mat4property.cpp | 6 +- src/properties/matrix/mat4x2property.cpp | 2 +- src/properties/matrix/mat4x3property.cpp | 4 +- src/properties/property.cpp | 2 +- src/rendering/abufferrenderer.cpp | 10 +- src/rendering/framebufferrenderer.cpp | 2 +- src/rendering/renderengine.cpp | 6 +- src/rendering/screenspacerenderable.cpp | 4 +- src/scene/rotation.cpp | 2 +- src/scene/scene_doc.inl | 2 +- src/scene/scene_lua.inl | 2 +- src/scripting/scriptengine_lua.inl | 8 +- src/scripting/scriptscheduler.cpp | 4 +- src/util/openspacemodule.cpp | 2 +- src/util/progressbar.cpp | 2 +- src/util/spicemanager.cpp | 12 +- src/util/time.cpp | 2 +- src/util/timerange.cpp | 4 +- src/util/transformationmanager.cpp | 2 +- support/coding/check_style_guide.py | 28 +- 223 files changed, 1402 insertions(+), 961 deletions(-) diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 61d991897a..986a1908fc 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -268,7 +268,7 @@ void mainInitFunc() { const sgct::SGCTWindow::StereoMode sm = windowPtr->getStereoMode(); const bool hasStereo = - (sm != sgct::SGCTWindow::No_Stereo) && + (sm != sgct::SGCTWindow::No_Stereo) && (sm < sgct::SGCTWindow::Side_By_Side_Stereo); if (hasStereo) { @@ -624,7 +624,7 @@ int main_main(int argc, char** argv) { cleanup(); // Exit program - exit(EXIT_SUCCESS); + exit(EXIT_SUCCESS); } } // namespace diff --git a/apps/TimelineView/main.cpp b/apps/TimelineView/main.cpp index 420f02fcd7..6add883ca7 100644 --- a/apps/TimelineView/main.cpp +++ b/apps/TimelineView/main.cpp @@ -112,7 +112,7 @@ QCombobox { } QComboBox:editable { - background: lightgrey; + background: lightgrey; } QComboBox QAbstractItemView { diff --git a/apps/TimelineView/timelinewidget.h b/apps/TimelineView/timelinewidget.h index 3ad24c33b5..ca0618f065 100644 --- a/apps/TimelineView/timelinewidget.h +++ b/apps/TimelineView/timelinewidget.h @@ -48,7 +48,7 @@ public: std::string nextTarget() const; protected: - void paintEvent(QPaintEvent* event); + void paintEvent(QPaintEvent* event); void drawContent(QPainter& painter, QRectF rect); void drawLegend(QPainter& painter, QRectF rect); void drawImages(QPainter& painter, QRectF timelineRect, std::vector images, double minimumTime, double maximumTime); diff --git a/ext/ghoul b/ext/ghoul index a6244a16f9..4dce717aac 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit a6244a16f98687c9196c4ba8ced11a3d68a88b46 +Subproject commit 4dce717aac293edd8662d03cc336da355c797343 diff --git a/include/openspace/documentation/documentation.h b/include/openspace/documentation/documentation.h index c82ba9ac90..82cfcde267 100644 --- a/include/openspace/documentation/documentation.h +++ b/include/openspace/documentation/documentation.h @@ -47,7 +47,7 @@ using Optional = ghoul::Boolean; struct TestResult { /** * An Offense is a violation against a specific verifier. The Offense::offender is the - * key that caused the offense (in the case of nested tables, it will be fully + * key that caused the offense (in the case of nested tables, it will be fully * qualified identifier) and the Offense::Reason is the reason that caused the * offense. */ @@ -142,8 +142,8 @@ struct DocumentationEntry { /** * The constructor for a DocumentationEntry describing a \p key in a Documentation. - * The value for the key (or each value in the case of the - * DocumentationEntry::Wildcard) is tested using the \p verifier, that specifies the + * The value for the key (or each value in the case of the + * DocumentationEntry::Wildcard) is tested using the \p verifier, that specifies the * conditions that the \p key%'s value has to fulfill. The textual documentation * \p doc shall describe the usage of the key-value pair and will be printed for human * consumption for example in the DocumentationEngine. Each DocumentationEntry can @@ -211,7 +211,7 @@ Documentation doc = { { // A list of DocumentationEntry%s; also specified using initializer lists { "key1", new IntVerifier, "Documentation key1", Optional::Yes }, { "key2", new FloatVerifier, "Documentation key2" }, - { "key3", new StringVerifier } + { "key3", new StringVerifier } } }; \endverbatim diff --git a/include/openspace/documentation/documentationengine.h b/include/openspace/documentation/documentationengine.h index 9e73e9f8c5..5d313a5ee8 100644 --- a/include/openspace/documentation/documentationengine.h +++ b/include/openspace/documentation/documentationengine.h @@ -62,7 +62,7 @@ public: DocumentationEngine(); /** - * Adds the \p documentation to the list of Documentation%s that are written to a + * Adds the \p documentation to the list of Documentation%s that are written to a * documentation file with the writeDocumentation method. * \param documentation The Documentation object that is to be stored for later use * \throws DuplicateDocumentationException If the \p documentation has a non-empty diff --git a/include/openspace/documentation/documentationgenerator.h b/include/openspace/documentation/documentationgenerator.h index ff51c29aba..430823c3f1 100644 --- a/include/openspace/documentation/documentationgenerator.h +++ b/include/openspace/documentation/documentationgenerator.h @@ -33,10 +33,10 @@ namespace openspace { /* * This abstract class is used for instances when another class has the ability to * generate a Handlebar generated documentation file that contains valuable information - * for the user. Instances of this are the DocumentationEngine results, the list of + * for the user. Instances of this are the DocumentationEngine results, the list of * Property%s generated by the Scene, or the FactoryEngine results. The documentation is * generated through the writeDocumentation method. - * + * * The concrete subclass needs to overload the generateJson class that will return the * Json that is parsed by Handlebar to generate the webpage. * @@ -57,7 +57,7 @@ public: * writeDocumentation method. * \param name The name of the written documentation * \param jsonName The variable name of the value generated by the generateJson - * \param handlebarTemplates A list of Handlebar templates that is added to the + * \param handlebarTemplates A list of Handlebar templates that is added to the * documentation file * \param javascriptFilename The path to a Javascript source file that is added to the * documentation and that can contain additional functionality @@ -76,7 +76,7 @@ public: /** * Create the documentation into the provided filename. Any existing file will be * silently overwritten. This method will call the generateJson method that can be - * used by concrete subclasses to provide the actual data that is provided in the + * used by concrete subclasses to provide the actual data that is provided in the * documentation. * \param filename The filename in which the documentation is written */ diff --git a/include/openspace/documentation/verifier.h b/include/openspace/documentation/verifier.h index 7c231d02e9..123f3ec1f3 100644 --- a/include/openspace/documentation/verifier.h +++ b/include/openspace/documentation/verifier.h @@ -61,7 +61,7 @@ struct Verifier { * \post If the return values' TestResult::success is \c true, its * TestResult::offenders is empty */ - virtual TestResult operator()(const ghoul::Dictionary& dictionary, + virtual TestResult operator()(const ghoul::Dictionary& dictionary, const std::string& key) const = 0; /** @@ -116,7 +116,7 @@ struct TemplateVerifier : public Verifier { }; /** - * A Verifier that checks whether a given key inside a ghoul::Dictionary is of type + * A Verifier that checks whether a given key inside a ghoul::Dictionary is of type * \c bool. No implicit conversion is considered in this testing. */ struct BoolVerifier : public TemplateVerifier { @@ -258,7 +258,7 @@ struct Vector4Verifier : public TemplateVerifier>, public VectorVe }; /** -* A Verifier that checks whether all values contained in a Table are of +* A Verifier that checks whether all values contained in a Table are of * type glm::tvec2 */ template @@ -627,7 +627,7 @@ struct InListVerifier : public T { * Tests whether the \p key exists in the \p dictionary, whether it has the correct * type by invoking the template parameter \c T, and then tests if the \p key's value * is part of the list passed to the constructor. - * \param dictionary The ghoul::Dictionary that contains the \p key + * \param dictionary The ghoul::Dictionary that contains the \p key * \param key The key that is contained in the \p dictionary and whose value is tested * \return A TestResult containing the results of the specification testing. If the * \p key%'s value has the wrong type, it will be added to the TestResult's offense @@ -688,7 +688,7 @@ struct NotInListVerifier : public T { * This Verifier checks whether the incoming value is of the correct type, using the * Verifier passed as a template parameter \c T and then checks whether it is greater or * equal to a lower limit and less or equal to a higher limit. To the missing comparison -* operators, \c T cannot be a subclass of (or the same as) BoolVerifier, StringVerifier, +* operators, \c T cannot be a subclass of (or the same as) BoolVerifier, StringVerifier, * TableVerifier, or VectorVerifier. Both the lower and the higher limit are inclusive). */ template @@ -890,7 +890,7 @@ struct ReferencingVerifier : public TableVerifier { std::string documentation() const override; - /// The identifier that references another Documentation registered with the + /// The identifier that references another Documentation registered with the /// DocumentationEngine std::string identifier; }; @@ -900,7 +900,7 @@ struct ReferencingVerifier : public TableVerifier { //---------------------------------------------------------------------------------------- /** - * This Verifier takes two Verifiers and performs a boolean \c and operation on their + * This Verifier takes two Verifiers and performs a boolean \c and operation on their * results. In essence, a value only passes this Verifier if it passes both Verifier%s * that are passed in the constructor. Opposed to the C++ && * operator, the AndVerifier does not perform any short-circut evaluation. diff --git a/include/openspace/documentation/verifier.inl b/include/openspace/documentation/verifier.inl index 9ace596fb3..012591802c 100644 --- a/include/openspace/documentation/verifier.inl +++ b/include/openspace/documentation/verifier.inl @@ -122,7 +122,7 @@ OperatorVerifier::OperatorVerifier(typename T::Type val) template TestResult OperatorVerifier::operator()(const ghoul::Dictionary& dict, - const std::string& key) const + const std::string& key) const { TestResult res = T::operator()(dict, key); if (res.success) { diff --git a/include/openspace/engine/moduleengine.h b/include/openspace/engine/moduleengine.h index 22b15f142f..2b750e31ab 100644 --- a/include/openspace/engine/moduleengine.h +++ b/include/openspace/engine/moduleengine.h @@ -68,7 +68,7 @@ public: * Registers the passed \p module with this ModuleEngine. The OpenSpaceModule::create * method will be called on the \p module in the process. * \param module The OpenSpaceModule that is to be registered - * \throw ghoul::RuntimeError If the name of the \p module was already registered + * \throw ghoul::RuntimeError If the name of the \p module was already registered * previously * \pre \p module must not be nullptr */ diff --git a/include/openspace/engine/syncengine.h b/include/openspace/engine/syncengine.h index a23dc78c22..847a80a5f6 100644 --- a/include/openspace/engine/syncengine.h +++ b/include/openspace/engine/syncengine.h @@ -51,7 +51,7 @@ public: SyncEngine(unsigned int syncBufferSize); /** - * Encodes all added Syncables in the injected SyncBuffer. + * Encodes all added Syncables in the injected SyncBuffer. * This method is only called on the SGCT master node */ void encodeSyncables(); @@ -95,7 +95,7 @@ public: void removeSyncables(const std::vector& syncables); private: - /** + /** * Vector of Syncables. The vectors ensures consistent encode/decode order */ std::vector _syncables; diff --git a/include/openspace/engine/wrapper/windowwrapper.h b/include/openspace/engine/wrapper/windowwrapper.h index 2498addbfd..ea290776d3 100644 --- a/include/openspace/engine/wrapper/windowwrapper.h +++ b/include/openspace/engine/wrapper/windowwrapper.h @@ -125,7 +125,7 @@ public: * is 1 if mouse button i is pressed down; * false otherwise. On default, this method returns that none of the * buttons is pressed. - * \param maxNumber The maximum number of mouse buttons that should be queried + * \param maxNumber The maximum number of mouse buttons that should be queried * \return A bitmask showing the status of all mouse buttons (up to \p maxNumber) */ virtual uint32_t mouseButtons(int maxNumber = 8) const; @@ -201,8 +201,9 @@ public: virtual bool isUsingSwapGroups() const; /** - * Returns true if the current rendering window is master of the swap its group. - */ + * Returns true if the current rendering window is master of the swap its + * group. + */ virtual bool isSwapGroupMaster() const; /** diff --git a/include/openspace/interaction/keybindingmanager.h b/include/openspace/interaction/keybindingmanager.h index 8682fecc6a..7426610a99 100644 --- a/include/openspace/interaction/keybindingmanager.h +++ b/include/openspace/interaction/keybindingmanager.h @@ -61,7 +61,7 @@ public: static scripting::LuaLibrary luaLibrary(); - // Callback functions + // Callback functions void keyboardCallback(Key key, KeyModifier modifier, KeyAction action); private: diff --git a/include/openspace/interaction/mousestate.h b/include/openspace/interaction/mousestate.h index 7db9a94d53..5d39ef7bad 100644 --- a/include/openspace/interaction/mousestate.h +++ b/include/openspace/interaction/mousestate.h @@ -46,7 +46,7 @@ public: /** * \param sensitivity * \param velocityScaleFactor can be set to 60 to remove the inertia of the - * interaction. Lower value will make it harder to move the camera. + * interaction. Lower value will make it harder to move the camera. */ MouseStates(double sensitivity, double velocityScaleFactor); void updateMouseStatesFromInput(const InputState& inputState, double deltaTime); diff --git a/include/openspace/interaction/navigationhandler.h b/include/openspace/interaction/navigationhandler.h index 6e8d4fad76..d09966ce4e 100644 --- a/include/openspace/interaction/navigationhandler.h +++ b/include/openspace/interaction/navigationhandler.h @@ -57,7 +57,7 @@ public: void setCamera(Camera* camera); void resetCameraDirection(); - void setCameraStateFromDictionary(const ghoul::Dictionary& cameraDict); + void setCameraStateFromDictionary(const ghoul::Dictionary& cameraDict); void updateCamera(double deltaTime); @@ -69,9 +69,9 @@ public: Camera* camera() const; const InputState& inputState() const; const OrbitalNavigator& orbitalNavigator() const; - KeyframeNavigator& keyframeNavigator() const; + KeyframeNavigator& keyframeNavigator() const; - // Callback functions + // Callback functions void keyboardCallback(Key key, KeyModifier modifier, KeyAction action); void mouseButtonCallback(MouseButton button, MouseAction action); void mousePositionCallback(double x, double y); diff --git a/include/openspace/interaction/orbitalnavigator.h b/include/openspace/interaction/orbitalnavigator.h index 8a99f752e6..3887023cde 100644 --- a/include/openspace/interaction/orbitalnavigator.h +++ b/include/openspace/interaction/orbitalnavigator.h @@ -55,7 +55,7 @@ public: void setFocusNode(SceneGraphNode* focusNode); void startInterpolateCameraDirection(const Camera& camera); - bool followingNodeRotation() const; + bool followingNodeRotation() const; SceneGraphNode* focusNode() const; bool hasRotationalFriction() const; @@ -99,7 +99,7 @@ private: * camera points towards the focus node in the direction opposite to the direction * out from the surface of the object. The local rotation defines the differential * from the global to the current total rotation so that - * cameraRotation = globalRotation * localRotation. + * cameraRotation = globalRotation * localRotation. */ CameraRotationDecomposition decomposeCameraRotation(const glm::dvec3& cameraPosition, const glm::dquat& cameraRotation, const glm::dvec3& cameraLookUp, @@ -139,7 +139,7 @@ private: /* * Adds rotation to the camera position so that it follows the rotation of the focus - * node defined by the differential focusNodeRotationDiff. + * node defined by the differential focusNodeRotationDiff. * \returns a position updated with the rotation defined by focusNodeRotationDiff */ glm::dvec3 followFocusNodeRotation(const glm::dvec3& cameraPosition, diff --git a/include/openspace/mission/mission.h b/include/openspace/mission/mission.h index a7036bfb44..7dfb165522 100644 --- a/include/openspace/mission/mission.h +++ b/include/openspace/mission/mission.h @@ -41,7 +41,7 @@ namespace documentation { struct Documentation; } * Used to represent a named period of time within a mission. Allows nested phases, i.e. * phases within phases. Designed for WORM usage (Write Once, Read Multiple), and, * therefore, has only accessors. - * + * * Each MissionPhase is characterized by its MissionPhase::name, a TimeRange, an * optional MissionPhase::description, and optional subphases. */ diff --git a/include/openspace/mission/missionmanager.h b/include/openspace/mission/missionmanager.h index 2d31f89ba4..06dae81df3 100644 --- a/include/openspace/mission/missionmanager.h +++ b/include/openspace/mission/missionmanager.h @@ -38,7 +38,7 @@ namespace openspace { namespace scripting { struct LuaLibrary; } /** -* Singleton class keeping track of space missions. +* Singleton class keeping track of space missions. */ class MissionManager : public ghoul::Singleton { public: @@ -50,7 +50,7 @@ public: /** * Reads a mission from file and maps the mission name to the Mission object. If - * this is the first mission to be loaded, the mission will also be set as the + * this is the first mission to be loaded, the mission will also be set as the * current active mission. * \pre \p filename must not be empty * \pre \p filename must not contain tokens @@ -79,8 +79,8 @@ public: bool hasCurrentMission() const; /** - * Returns the latest mission specified to `setCurrentMission()`. If no mission has - * been specified, the first mission loaded will be returned. If no mission has been + * Returns the latest mission specified to `setCurrentMission()`. If no mission has + * been specified, the first mission loaded will be returned. If no mission has been * loaded, a warning will be printed and a dummy mission will be returned. */ const Mission& currentMission(); diff --git a/include/openspace/network/messagestructures.h b/include/openspace/network/messagestructures.h index eb3c9eea09..6d7c3d5d6a 100644 --- a/include/openspace/network/messagestructures.h +++ b/include/openspace/network/messagestructures.h @@ -94,7 +94,7 @@ struct CameraKeyframe { // Focus node int nodeNameLength; size = sizeof(int); - memcpy(&nodeNameLength, buffer.data() + offset, size); + memcpy(&nodeNameLength, buffer.data() + offset, size); offset += size; size = nodeNameLength; _focusNode = std::string(buffer.data() + offset, buffer.data() + offset + size); diff --git a/include/openspace/properties/numericalproperty.inl b/include/openspace/properties/numericalproperty.inl index 39a4ea2cf9..3a64404e31 100644 --- a/include/openspace/properties/numericalproperty.inl +++ b/include/openspace/properties/numericalproperty.inl @@ -231,7 +231,7 @@ const std::string NumericalProperty::SteppingValueKey = "SteppingValue"; // Delegating constructors are necessary; automatic template deduction cannot // deduce template argument for 'U' if 'default' methods are used as default values in -// a single constructor +// a single constructor template NumericalProperty::NumericalProperty(Property::PropertyInfo info) diff --git a/include/openspace/properties/optionproperty.h b/include/openspace/properties/optionproperty.h index b465c33039..cb87fc2532 100644 --- a/include/openspace/properties/optionproperty.h +++ b/include/openspace/properties/optionproperty.h @@ -32,7 +32,7 @@ namespace openspace::properties { /** - * The OptionProperty is a property that provides a number of predefined (using the + * The OptionProperty is a property that provides a number of predefined (using the * addOption method) options consisting of a description and a * value. The available options can be queried using the options method. * Only values representing valid options can be used to set this property, or an error @@ -119,7 +119,7 @@ public: /** * Get the description of the option that matches value - * \param value The value of the option + * \param value The value of the option */ std::string getDescriptionByValue(int value); diff --git a/include/openspace/properties/property.h b/include/openspace/properties/property.h index 83301f87d1..da89a1c809 100644 --- a/include/openspace/properties/property.h +++ b/include/openspace/properties/property.h @@ -88,7 +88,7 @@ public: Visibility visibility = Visibility::All; }; - /// An OnChangeHandle is returned by the onChange method to uniquely identify an + /// An OnChangeHandle is returned by the onChange method to uniquely identify an /// onChange callback using OnChangeHandle = uint32_t; @@ -102,7 +102,7 @@ public: * to be accessed by the GUI elements using the guiName key. The default * visibility settings is Visibility::All, whereas the default read-only state is * false. - * \param info The PropertyInfo structure that contains all the required static + * \param info The PropertyInfo structure that contains all the required static * information for initializing this Property. * \pre \p info.identifier must not be empty * \pre \p info.guiName must not be empty @@ -399,7 +399,7 @@ protected: * generateAdditionalDescription()}, which #generateMetaDataDescription * and this method being the override points to customize the behavior. * \return The information specific to each subclass of Property - */ + */ virtual std::string generateAdditionalDescription() const; /** @@ -409,7 +409,7 @@ protected: void notifyListener(); /// The PropetyOwner this Property belongs to, or nullptr - PropertyOwner* _owner; + PropertyOwner* _owner; /// The identifier for this Property std::string _identifier; diff --git a/include/openspace/properties/propertyowner.h b/include/openspace/properties/propertyowner.h index c0f8bc8914..1720a2e90a 100644 --- a/include/openspace/properties/propertyowner.h +++ b/include/openspace/properties/propertyowner.h @@ -39,7 +39,7 @@ class Property; * sub-owners must be unique to this PropertyOwner. A Property cannot have the same name * as a PropertyOwner owned by this PropertyOwner. * Propertys can be added using the Property::addProperty methods and be removed by the - * Property::removeProperty method. The same holds true for sub-owners + * Property::removeProperty method. The same holds true for sub-owners * (Property::addPropertySubOwner, Property::removePropertySubOwner). These methods will * inform the passed object about the new ownership automatically. * Stored properties can be accessed using the Property::properties method or the @@ -231,7 +231,7 @@ public: void addTag(std::string tag); /** - * Removes a tag from this PropertyOwner. No error is reported if the tag does not + * Removes a tag from this PropertyOwner. No error is reported if the tag does not * exist * @param tag The tag is that is to be removed from this PropertyOwner */ diff --git a/include/openspace/properties/scalar/boolproperty.h b/include/openspace/properties/scalar/boolproperty.h index ee74bbfcf8..d38576b698 100644 --- a/include/openspace/properties/scalar/boolproperty.h +++ b/include/openspace/properties/scalar/boolproperty.h @@ -28,9 +28,9 @@ /** * \file boolproperty.h * - * \addtogroup openspace + * \addtogroup openspace * @{ - * \addtogroup properties + * \addtogroup properties * @{ * \class BoolProperty diff --git a/include/openspace/properties/scalar/charproperty.h b/include/openspace/properties/scalar/charproperty.h index 3151c53ebe..f1178e42a1 100644 --- a/include/openspace/properties/scalar/charproperty.h +++ b/include/openspace/properties/scalar/charproperty.h @@ -28,9 +28,9 @@ /** * \file charproperty.h * - * \addtogroup openspace + * \addtogroup openspace * @{ - * \addtogroup properties + * \addtogroup properties * @{ * \class CharProperty diff --git a/include/openspace/properties/scalar/doubleproperty.h b/include/openspace/properties/scalar/doubleproperty.h index 0ef4ed259c..4ac78f8602 100644 --- a/include/openspace/properties/scalar/doubleproperty.h +++ b/include/openspace/properties/scalar/doubleproperty.h @@ -28,9 +28,9 @@ /** * \file doubleproperty.h * - * \addtogroup openspace + * \addtogroup openspace * @{ - * \addtogroup properties + * \addtogroup properties * @{ * \class DoubleProperty diff --git a/include/openspace/properties/scalar/floatproperty.h b/include/openspace/properties/scalar/floatproperty.h index bf7957d4f0..838521aa3f 100644 --- a/include/openspace/properties/scalar/floatproperty.h +++ b/include/openspace/properties/scalar/floatproperty.h @@ -28,9 +28,9 @@ /** * \file floatproperty.h * - * \addtogroup openspace + * \addtogroup openspace * @{ - * \addtogroup properties + * \addtogroup properties * @{ * \class FloatProperty diff --git a/include/openspace/properties/scalar/intproperty.h b/include/openspace/properties/scalar/intproperty.h index b0fbdd9acb..43214ce1c8 100644 --- a/include/openspace/properties/scalar/intproperty.h +++ b/include/openspace/properties/scalar/intproperty.h @@ -28,9 +28,9 @@ /** * \file intproperty.h * - * \addtogroup openspace + * \addtogroup openspace * @{ - * \addtogroup properties + * \addtogroup properties * @{ * \class IntProperty diff --git a/include/openspace/properties/scalar/longdoubleproperty.h b/include/openspace/properties/scalar/longdoubleproperty.h index f02ac8f44f..72455378ee 100644 --- a/include/openspace/properties/scalar/longdoubleproperty.h +++ b/include/openspace/properties/scalar/longdoubleproperty.h @@ -28,9 +28,9 @@ /** * \file longdoubleproperty.h * - * \addtogroup openspace + * \addtogroup openspace * @{ - * \addtogroup properties + * \addtogroup properties * @{ * \class LongDoubleProperty diff --git a/include/openspace/properties/scalar/longlongproperty.h b/include/openspace/properties/scalar/longlongproperty.h index d8f86f3351..645c0cd54d 100644 --- a/include/openspace/properties/scalar/longlongproperty.h +++ b/include/openspace/properties/scalar/longlongproperty.h @@ -28,9 +28,9 @@ /** * \file longlongproperty.h * - * \addtogroup openspace + * \addtogroup openspace * @{ - * \addtogroup properties + * \addtogroup properties * @{ * \class LongLongProperty diff --git a/include/openspace/properties/scalar/longproperty.h b/include/openspace/properties/scalar/longproperty.h index 85576f258c..0adfbf881c 100644 --- a/include/openspace/properties/scalar/longproperty.h +++ b/include/openspace/properties/scalar/longproperty.h @@ -28,9 +28,9 @@ /** * \file longproperty.h * - * \addtogroup openspace + * \addtogroup openspace * @{ - * \addtogroup properties + * \addtogroup properties * @{ * \class LongProperty diff --git a/include/openspace/properties/scalar/shortproperty.h b/include/openspace/properties/scalar/shortproperty.h index 90cb81af0c..93cae8a937 100644 --- a/include/openspace/properties/scalar/shortproperty.h +++ b/include/openspace/properties/scalar/shortproperty.h @@ -28,9 +28,9 @@ /** * \file shortproperty.h * - * \addtogroup openspace + * \addtogroup openspace * @{ - * \addtogroup properties + * \addtogroup properties * @{ * \class ShortProperty diff --git a/include/openspace/properties/scalar/signedcharproperty.h b/include/openspace/properties/scalar/signedcharproperty.h index fae4a5e2ed..3b45631b6d 100644 --- a/include/openspace/properties/scalar/signedcharproperty.h +++ b/include/openspace/properties/scalar/signedcharproperty.h @@ -28,9 +28,9 @@ /** * \file signedcharproperty.h * - * \addtogroup openspace + * \addtogroup openspace * @{ - * \addtogroup properties + * \addtogroup properties * @{ * \class SignedCharProperty diff --git a/include/openspace/properties/scalar/ucharproperty.h b/include/openspace/properties/scalar/ucharproperty.h index 04f799179a..55f3cc5da3 100644 --- a/include/openspace/properties/scalar/ucharproperty.h +++ b/include/openspace/properties/scalar/ucharproperty.h @@ -28,9 +28,9 @@ /** * \file ucharproperty.h * - * \addtogroup openspace + * \addtogroup openspace * @{ - * \addtogroup properties + * \addtogroup properties * @{ * \class UCharProperty diff --git a/include/openspace/properties/scalar/uintproperty.h b/include/openspace/properties/scalar/uintproperty.h index bb3b346a40..43b3debcbc 100644 --- a/include/openspace/properties/scalar/uintproperty.h +++ b/include/openspace/properties/scalar/uintproperty.h @@ -28,9 +28,9 @@ /** * \file uintproperty.h * - * \addtogroup openspace + * \addtogroup openspace * @{ - * \addtogroup properties + * \addtogroup properties * @{ * \class UIntProperty diff --git a/include/openspace/properties/scalar/ulonglongproperty.h b/include/openspace/properties/scalar/ulonglongproperty.h index b0b36b5eb3..e571fcf1f9 100644 --- a/include/openspace/properties/scalar/ulonglongproperty.h +++ b/include/openspace/properties/scalar/ulonglongproperty.h @@ -28,9 +28,9 @@ /** * \file ulonglongproperty.h * - * \addtogroup openspace + * \addtogroup openspace * @{ - * \addtogroup properties + * \addtogroup properties * @{ * \class ULongLongProperty diff --git a/include/openspace/properties/scalar/ulongproperty.h b/include/openspace/properties/scalar/ulongproperty.h index 8372f62938..e27839dc75 100644 --- a/include/openspace/properties/scalar/ulongproperty.h +++ b/include/openspace/properties/scalar/ulongproperty.h @@ -28,9 +28,9 @@ /** * \file ulongproperty.h * - * \addtogroup openspace + * \addtogroup openspace * @{ - * \addtogroup properties + * \addtogroup properties * @{ * \class ULongProperty diff --git a/include/openspace/properties/scalar/ushortproperty.h b/include/openspace/properties/scalar/ushortproperty.h index 10fac45e29..15a0acb3c8 100644 --- a/include/openspace/properties/scalar/ushortproperty.h +++ b/include/openspace/properties/scalar/ushortproperty.h @@ -28,9 +28,9 @@ /** * \file ushortproperty.h * - * \addtogroup openspace + * \addtogroup openspace * @{ - * \addtogroup properties + * \addtogroup properties * @{ * \class UShortProperty diff --git a/include/openspace/properties/scalar/wcharproperty.h b/include/openspace/properties/scalar/wcharproperty.h index d9b2ca546a..73683b857d 100644 --- a/include/openspace/properties/scalar/wcharproperty.h +++ b/include/openspace/properties/scalar/wcharproperty.h @@ -28,9 +28,9 @@ /** * \file wcharproperty.h * - * \addtogroup openspace + * \addtogroup openspace * @{ - * \addtogroup properties + * \addtogroup properties * @{ * \class WCharProperty diff --git a/include/openspace/properties/triggerproperty.h b/include/openspace/properties/triggerproperty.h index 3ddb7619c4..089f579536 100644 --- a/include/openspace/properties/triggerproperty.h +++ b/include/openspace/properties/triggerproperty.h @@ -54,7 +54,7 @@ public: /** * Accepts only the LUA_TNIL type and will notify all the listeners * that the event has been triggered. - * \param state The unused Lua state + * \param state The unused Lua state * \return Returns always true */ bool setLuaValue(lua_State* state) override; diff --git a/include/openspace/rendering/abufferrenderer.h b/include/openspace/rendering/abufferrenderer.h index 5a1a7becdf..ce9c356e47 100644 --- a/include/openspace/rendering/abufferrenderer.h +++ b/include/openspace/rendering/abufferrenderer.h @@ -109,7 +109,7 @@ private: * The _volumes map keeps track of which volumes that can * be rendered using the current resolve program, along with their raycast data * (id, namespace, etc) - */ + */ std::map _raycastData; std::map> _boundsPrograms; std::vector _helperPaths; diff --git a/include/openspace/rendering/renderable.h b/include/openspace/rendering/renderable.h index 57b89d29e2..bef7b25d43 100644 --- a/include/openspace/rendering/renderable.h +++ b/include/openspace/rendering/renderable.h @@ -42,7 +42,7 @@ struct UpdateData; struct RendererTasks; struct SurfacePositionHandle; -namespace documentation { struct Documentation; } +namespace documentation { struct Documentation; } // Forward declare to minimize dependencies diff --git a/include/openspace/rendering/screenspacerenderable.h b/include/openspace/rendering/screenspacerenderable.h index 7db38d281e..1c912c0c83 100644 --- a/include/openspace/rendering/screenspacerenderable.h +++ b/include/openspace/rendering/screenspacerenderable.h @@ -44,7 +44,7 @@ namespace documentation { struct Documentation; } /** * The base class for screen space images and screen space framebuffers. - * This base class handles general functionality specific to planes that are rendered in + * This base class handles general functionality specific to planes that are rendered in * front of the camera. It implements protected methods and properties for converting * the planes from Spherical to Euclidean coordinates and back. It also specifies the * interface that its children need to implement. @@ -79,7 +79,7 @@ protected: * Converts Spherical coordinates to Euclidean. * \param spherical The coordinates theta and phi * \param radius The radius position value of the plane - * \return The x and y position value of the plane + * \return The x and y position value of the plane */ glm::vec2 toEuclidean(const glm::vec2& spherical, float radius); diff --git a/include/openspace/rendering/volume.h b/include/openspace/rendering/volume.h index 8d954ab531..a9fda2e452 100644 --- a/include/openspace/rendering/volume.h +++ b/include/openspace/rendering/volume.h @@ -40,7 +40,7 @@ public: /** * Constructor */ - Volume() {}; + Volume() {}; /** * Destructor @@ -76,7 +76,7 @@ public: * * The shader preprocessor will have acceess to * A #{namespace} variable (unique per helper file) - * + * * Should define the function: * vec4 getVertex() */ @@ -84,14 +84,14 @@ public: /* * Return a path to a file with the functions, uniforms and fragment shader in variables - * required to generate the fragment color and depth. + * required to generate the fragment color and depth. * * Should define the function: * Fragment getFragment() - * + * * The shader preprocessor will have acceess to * A #{namespace} variable (unique per helper file) - */ + */ //virtual std::string getBoundsFsPath() = 0; /** @@ -116,7 +116,7 @@ public: * This file will be included once per shader program generated, * regardless of how many volumes say they require the file. * Ideal to avoid redefinitions of helper functions. - * + * * The shader preprocessor will have access to the #{namespace} variable (unique per helper file) * which should be a prefix to all symbols defined by the helper */ diff --git a/include/openspace/rendering/volumeraycaster.h b/include/openspace/rendering/volumeraycaster.h index 14db9e5eab..b01517a22b 100644 --- a/include/openspace/rendering/volumeraycaster.h +++ b/include/openspace/rendering/volumeraycaster.h @@ -84,14 +84,14 @@ public: /* * Return a path to a file with the functions, uniforms and fragment shader in variables - * required to generate the fragment color and depth. + * required to generate the fragment color and depth. * * Should define the function: * Fragment getFragment() - * + * * The shader preprocessor will have acceess to * A #{namespace} variable (unique per helper file) - */ + */ virtual std::string getBoundsFsPath() const = 0 ; /** @@ -116,7 +116,7 @@ public: * This file will be included once per shader program generated, * regardless of how many volumes say they require the file. * Ideal to avoid redefinitions of helper functions. - * + * * The shader preprocessor will have access to the #{namespace} variable (unique per helper file) * which should be a prefix to all symbols defined by the helper */ @@ -125,4 +125,4 @@ public: } // namespace openspace -#endif // __OPENSPACE_CORE___VOLUMERAYCASTER___H__ +#endif // __OPENSPACE_CORE___VOLUMERAYCASTER___H__ diff --git a/include/openspace/scripting/scriptscheduler.h b/include/openspace/scripting/scriptscheduler.h index 6641e47f3f..67e66948cc 100644 --- a/include/openspace/scripting/scriptscheduler.h +++ b/include/openspace/scripting/scriptscheduler.h @@ -37,7 +37,7 @@ namespace openspace::documentation { struct Documentation; } namespace openspace::scripting { /** - * Maintains an ordered list of ScheduledScripts and provides a simple + * Maintains an ordered list of ScheduledScripts and provides a simple * interface for retrieveing scheduled scripts */ class ScriptScheduler { @@ -72,8 +72,8 @@ public: void clearSchedule(); /** - * Progresses the script schedulers time and returns all scripts that has been - * scheduled to run between \param newTime and the time provided in the last invocation + * Progresses the script schedulers time and returns all scripts that has been + * scheduled to run between \param newTime and the time provided in the last invocation * of this method. * * \param newTime A j2000 time value specifying the new time stamp that @@ -96,7 +96,7 @@ public: > progressTo(double newTime); /** - * Returns the the j2000 time value that the script scheduler is currently at + * Returns the the j2000 time value that the script scheduler is currently at */ double currentTime() const; diff --git a/include/openspace/util/concurrentjobmanager.h b/include/openspace/util/concurrentjobmanager.h index a0c446a2e6..72f66312c1 100644 --- a/include/openspace/util/concurrentjobmanager.h +++ b/include/openspace/util/concurrentjobmanager.h @@ -43,7 +43,7 @@ struct Job { virtual std::shared_ptr

product() = 0; }; -/* +/* * Templated Concurrent Job Manager * This class is used execute specific jobs on one (1) parallell thread */ diff --git a/include/openspace/util/gpudata.h b/include/openspace/util/gpudata.h index bf030e3c7d..b5189cbd65 100644 --- a/include/openspace/util/gpudata.h +++ b/include/openspace/util/gpudata.h @@ -41,7 +41,7 @@ class UniformLocation { public: /** - * Updates the uniform location of the uniform variable named + * Updates the uniform location of the uniform variable named * in the provided shader program. */ void bind(ghoul::opengl::ProgramObject* program, const std::string& name); @@ -53,7 +53,7 @@ protected: /** * Manages a GPU representation of the templated data type T. - * This class provides a simple interface setting the value of + * This class provides a simple interface setting the value of * the binded GLSL variable. */ template @@ -71,13 +71,13 @@ public: /** * Manages a Texture on the GPU. - * This class provides a simple interface binding texture to the + * This class provides a simple interface binding texture to the * named uniform. */ class GPUTexture : public UniformLocation{ public: /** - * Sets and assignes a texture unit within the provided shader + * Sets and assignes a texture unit within the provided shader * program. * OBS! Users must ensure bind has been called before using this method. */ diff --git a/include/openspace/util/histogram.h b/include/openspace/util/histogram.h index 408cc2222c..8029951bf6 100644 --- a/include/openspace/util/histogram.h +++ b/include/openspace/util/histogram.h @@ -49,10 +49,10 @@ public: * Enter value into the histogram. The add method takes the given * value, works out which bin this corresponds to, and increments * this bin by 'repeat'. - * + * * @param value The Value to insert into the histogram * @param repeat How many times you want to insert it - * + * * @return Returns true if succesful insertion, otherwise return false */ bool add(float value, float repeat = 1.0f); diff --git a/include/openspace/util/openspacemodule.h b/include/openspace/util/openspacemodule.h index 791c6cfef3..97eaf3c9d0 100644 --- a/include/openspace/util/openspacemodule.h +++ b/include/openspace/util/openspacemodule.h @@ -45,7 +45,7 @@ namespace documentation { struct Documentation; } class OpenSpaceModule : public properties::PropertyOwner { public: /** - * Constructs the OpenSpaceModule with a specific \p name. The uniqueness of the + * Constructs the OpenSpaceModule with a specific \p name. The uniqueness of the * \p name will be checked at a later stage. * \param name The name of this OpenSpace module * \pre \p name must not be empty diff --git a/include/openspace/util/spicemanager.h b/include/openspace/util/spicemanager.h index e40d0509a9..aa38bd9c25 100644 --- a/include/openspace/util/spicemanager.h +++ b/include/openspace/util/spicemanager.h @@ -630,7 +630,7 @@ public: }; /** - * Returns the state vector (position and velocity) of a \p target body relative to an + * Returns the state vector (position and velocity) of a \p target body relative to an * \p observer in a specific \p referenceFrame, optionally corrected for aberration * (\p aberrationCorrection). * \param target The target body name or the target body's NAIF ID @@ -660,7 +660,7 @@ public: const std::string& observer, const std::string& referenceFrame, AberrationCorrection aberrationCorrection, double ephemerisTime) const; - /** + /** * Returns the state transformation matrix used to convert from the \p sourceFrame to * the \p destinationFrame at a specific \p ephemerisTime. * \param sourceFrame The name of the source reference frame @@ -824,7 +824,7 @@ public: bool addFrame(std::string body, std::string frame); /** - * This function returns the frame of a body if defined, otherwise it returns + * This function returns the frame of a body if defined, otherwise it returns * IAU_ + body (most frames are known by the International Astronomical Union) * \param body - the name of the body * \return the frame of the body @@ -833,7 +833,7 @@ public: std::string frameFromBody(const std::string& body) const; /** - * Sets the SpiceManager's exception handling. If UseException::No is passed to this + * Sets the SpiceManager's exception handling. If UseException::No is passed to this * function, all subsequent calls will not throw an error, but fail silently instead. * If set to UseException::Yes, a SpiceException is thrown whenever an error occurs. * \param useException The new exeception handling method that the SpiceManager should diff --git a/include/openspace/util/syncdata.h b/include/openspace/util/syncdata.h index ec22cea74a..6b688ac068 100644 --- a/include/openspace/util/syncdata.h +++ b/include/openspace/util/syncdata.h @@ -53,13 +53,13 @@ protected: }; /** - * A double buffered implementation of the Syncable interface. - * Users are encouraged to used this class as a default way to synchronize different + * A double buffered implementation of the Syncable interface. + * Users are encouraged to used this class as a default way to synchronize different * C++ data types using the SyncEngine * - * This class aims to handle the synchronization parts and yet act like a regular - * instance of T. Implicit casts are supported, however, when accessing member functions or - * or variables, user may have to do explicit casts. + * This class aims to handle the synchronization parts and yet act like a regular + * instance of T. Implicit casts are supported, however, when accessing member functions + * or variables, user may have to do explicit casts. * * ((T&) t).method(); * @@ -71,7 +71,7 @@ public: SyncData() {}; SyncData(const T& val) : data(val) {}; SyncData(const SyncData& o) : data(o.data) { - // Should not have to be copied! + // Should not have to be copied! }; /** diff --git a/include/openspace/util/threadpool.h b/include/openspace/util/threadpool.h index f83b622b2f..556d0cba1f 100644 --- a/include/openspace/util/threadpool.h +++ b/include/openspace/util/threadpool.h @@ -40,7 +40,7 @@ namespace openspace { class ThreadPool; class Worker { -public: +public: Worker(ThreadPool& pool); void operator()(); private: diff --git a/include/openspace/util/time.h b/include/openspace/util/time.h index 06a4a629b2..a3f23059e5 100644 --- a/include/openspace/util/time.h +++ b/include/openspace/util/time.h @@ -36,7 +36,7 @@ namespace openspace { /** * This singleton class represents the current simulation time in OpenSpace. It * internally stores the time and provides methods to set the time directly - * (setTime(double), setTime(std::string)) using a double value using the + * (setTime(double), setTime(std::string)) using a double value using the * number of seconds passed since the J2000 epoch or a string that denotes * a valid date string in accordance to the Spice library * (http://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/str2et_c.html). The time can @@ -47,12 +47,12 @@ namespace openspace { * the number of seconds that pass for each real-time second. This value is set with * setDeltaTime(double), retrieved with deltaTime() and solely used in the * advanceTime(double), which takes a tickTime parameter. The value of the - * parameter is dependent on the usage of the class and must be equal to the real-world + * parameter is dependent on the usage of the class and must be equal to the real-world * time that has passed since the last call to the method. For example, if the * advanceTime(double) method is called each frame, the tickTime has to be * equal to the frame time. * - * The synchronization of the simulation time requires + * The synchronization of the simulation time requires */ class Time { public: @@ -144,7 +144,7 @@ public: double deltaTime() const; /** - * Sets the pause function, i.e. setting the deltaTime to 0 (pause = + * Sets the pause function, i.e. setting the deltaTime to 0 (pause = * true) and restoring it when the function is called with a parameter of * false. * \param pause If true, the simulation time stops; diff --git a/include/openspace/util/timerange.h b/include/openspace/util/timerange.h index 4b2e567249..90a532a64c 100644 --- a/include/openspace/util/timerange.h +++ b/include/openspace/util/timerange.h @@ -38,7 +38,7 @@ struct TimeRange { TimeRange(); /** - * Initializes a TimeRange with both start and end time. Initializing empty timeranges + * Initializes a TimeRange with both start and end time. Initializing empty timeranges * is OK. */ TimeRange(double startTime, double endTime); diff --git a/modules/base/rendering/multimodelgeometry.cpp b/modules/base/rendering/multimodelgeometry.cpp index 94638e5cd5..bb18d0663d 100644 --- a/modules/base/rendering/multimodelgeometry.cpp +++ b/modules/base/rendering/multimodelgeometry.cpp @@ -52,7 +52,7 @@ bool MultiModelGeometry::loadModel(const std::string& filename) { _vertices.push_back(vv); } - _indices.resize(indices.size()); + _indices.resize(indices.size()); std::copy(indices.begin(), indices.end(), _indices.begin()); return true; diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index faf34d5477..ae1e1732b0 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -165,7 +165,7 @@ void RenderableModel::initialize() { loadTexture(); - _geometry->initialize(this); + _geometry->initialize(this); } void RenderableModel::deinitialize() { diff --git a/modules/base/rendering/renderablemodel.h b/modules/base/rendering/renderablemodel.h index 86b8d1c35f..c0d6a80dae 100644 --- a/modules/base/rendering/renderablemodel.h +++ b/modules/base/rendering/renderablemodel.h @@ -35,7 +35,7 @@ #include namespace ghoul::opengl { - class ProgramObject; + class ProgramObject; class Texture; } // namespace ghoul::opengl diff --git a/modules/base/rendering/renderableplane.cpp b/modules/base/rendering/renderableplane.cpp index d867404864..8e4c90795f 100644 --- a/modules/base/rendering/renderableplane.cpp +++ b/modules/base/rendering/renderableplane.cpp @@ -210,7 +210,7 @@ void RenderablePlane::deinitialize() { void RenderablePlane::render(const RenderData& data, RendererTasks&) { _shader->activate(); //if (_projectionListener){ - // //get parent node-texture and set with correct dimensions + // //get parent node-texture and set with correct dimensions // SceneGraphNode* textureNode = OsEng.renderEngine().scene()->sceneGraphNode( // _nodeName // )->parent(); @@ -342,7 +342,7 @@ void RenderablePlane::createPlane() { glEnableVertexAttribArray(1); glVertexAttribPointer( - 1, + 1, 2, GL_FLOAT, GL_FALSE, diff --git a/modules/base/rendering/renderabletrail.h b/modules/base/rendering/renderabletrail.h index 8dd51a5c78..ed45eab5be 100644 --- a/modules/base/rendering/renderabletrail.h +++ b/modules/base/rendering/renderabletrail.h @@ -60,7 +60,7 @@ class Translation; * * Trails can be rendered either as lines, as points, or a combination of both with * varying colors, line thicknesses, or fading settings. If trails are rendered as points, - * the RenderInformation's \c stride parameter determines the number of points between + * the RenderInformation's \c stride parameter determines the number of points between * larger points. A potential use case for this is showing the passage of time along a * trail by using a point separation of one hour and a subsampling of 4, you would get a * point every 15 minutes with every hourly point being bigger. @@ -109,7 +109,7 @@ protected: std::unique_ptr _translation; /// The RenderInformation contains information filled in by the concrete subclasses to - /// be used by this class. + /// be used by this class. struct RenderInformation { enum class VertexSorting { NewestFirst = 0, ///< Newer vertices have a lower index than older ones @@ -117,13 +117,13 @@ protected: NoSorting ///< No ordering in the vertices; no fading applied }; /// The first element in the vertex buffer to be rendered - GLint first = 0; + GLint first = 0; /// The number of values to be rendered GLsizei count = 0; /// The stride between 'major' points in the array int stride = 1; /// Sorting of the vertices; required for correct fading - VertexSorting sorting = VertexSorting::NoSorting; + VertexSorting sorting = VertexSorting::NoSorting; /// Local model matrix transformation, used for rendering in camera space glm::dmat4 _localTransform = glm::dmat4(1.0); @@ -156,7 +156,7 @@ private: /// The option determining which rendering method to use properties::OptionProperty _renderingModes; - /// Program object used to render the data stored in RenderInformation + /// Program object used to render the data stored in RenderInformation std::unique_ptr _programObject; }; diff --git a/modules/base/rendering/renderabletrailorbit.cpp b/modules/base/rendering/renderabletrailorbit.cpp index 3818d7f965..8688c032d8 100644 --- a/modules/base/rendering/renderabletrailorbit.cpp +++ b/modules/base/rendering/renderabletrailorbit.cpp @@ -39,11 +39,11 @@ // --------------------------------------------------------------------------------- // | FF | | | | | | | | | | | | | | | | // --------------------------------------------------------------------------------- -// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 +// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // <------ newer in time oldest // // In the begining the floating value starts at 0; this means that array element 0 is -// updated and uploaded to the GPU at every frame. The FF+1 element is the newest fixed +// updated and uploaded to the GPU at every frame. The FF+1 element is the newest fixed // location and FF-1 element is the oldest fixed location (including wrapping around the // array) with the times of _lastPointTime and _firstPointTime. // @@ -53,7 +53,7 @@ // --------------------------------------------------------------------------------- // | | | | | | | | | | | | | | | | FF | // --------------------------------------------------------------------------------- -// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 +// 0 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 // <------ newer in time oldest // // Thus making the floating point traverse backwards through the array and element 0 being @@ -257,7 +257,7 @@ void RenderableTrailOrbit::update(const UpdateData& data) { // Only update the changed ones // Since we are using a ring buffer, the number of updated needed might be // bigger than our current points, which means we have to split the upload - // into two calls. + // into two calls. if (report.nUpdated > 0) { // deltaT is positive, so the pointer is moving backwards and update has // to happen towards the front @@ -277,7 +277,7 @@ void RenderableTrailOrbit::update(const UpdateData& data) { // The current index is too close to the wrap around part, so we need // to split the upload into two parts: // 1. from the current index to the end of the array - // 2. the rest starting from the beginning of the array + // 2. the rest starting from the beginning of the array int first = s - i; int second = n - first; upload(i, first); // 1 diff --git a/modules/base/rendering/renderabletrailorbit.h b/modules/base/rendering/renderabletrailorbit.h index 1c74839b23..2e6b7be12b 100644 --- a/modules/base/rendering/renderabletrailorbit.h +++ b/modules/base/rendering/renderabletrailorbit.h @@ -68,7 +68,7 @@ private: static const int All = 0; ///< The entire array was touched in the update /// If \c true at least one point was touched - bool needsUpdate; + bool needsUpdate; /// Returns the number of fixed points that were touched in the update method /// If this value is negative, the newest values were replaced, if positive the /// oldest diff --git a/modules/base/rendering/screenspaceframebuffer.cpp b/modules/base/rendering/screenspaceframebuffer.cpp index 25d11833ee..de508f4fe9 100644 --- a/modules/base/rendering/screenspaceframebuffer.cpp +++ b/modules/base/rendering/screenspaceframebuffer.cpp @@ -54,7 +54,7 @@ documentation::Documentation ScreenSpaceFramebuffer::Documentation() { }; } -ScreenSpaceFramebuffer::ScreenSpaceFramebuffer(const ghoul::Dictionary& dictionary) +ScreenSpaceFramebuffer::ScreenSpaceFramebuffer(const ghoul::Dictionary& dictionary) : ScreenSpaceRenderable(dictionary) , _size(SizeInfo, glm::vec4(0), glm::vec4(0), glm::vec4(16384)) , _framebuffer(nullptr) diff --git a/modules/base/rendering/wavefrontgeometry.cpp b/modules/base/rendering/wavefrontgeometry.cpp index bbf4f25ba8..853c1e1d00 100644 --- a/modules/base/rendering/wavefrontgeometry.cpp +++ b/modules/base/rendering/wavefrontgeometry.cpp @@ -35,7 +35,7 @@ namespace openspace { namespace modelgeometry { WavefrontGeometry::WavefrontGeometry(const ghoul::Dictionary& dictionary) - : ModelGeometry(dictionary) + : ModelGeometry(dictionary) { loadObj(_file); } diff --git a/modules/base/translation/luatranslation.cpp b/modules/base/translation/luatranslation.cpp index 139fa48cf8..7dd8353d9e 100644 --- a/modules/base/translation/luatranslation.cpp +++ b/modules/base/translation/luatranslation.cpp @@ -78,8 +78,8 @@ LuaTranslation::LuaTranslation() _luaScriptFile.onChange([&](){ _fileHandle = std::make_unique(_luaScriptFile); - _fileHandle->setCallback([&](const ghoul::filesystem::File&){ - notifyObservers(); + _fileHandle->setCallback([&](const ghoul::filesystem::File&) { + notifyObservers(); }); }); } diff --git a/modules/debugging/debuggingmodule.cpp b/modules/debugging/debuggingmodule.cpp index 4b009b91d4..ff873e22e0 100644 --- a/modules/debugging/debuggingmodule.cpp +++ b/modules/debugging/debuggingmodule.cpp @@ -43,7 +43,7 @@ void DebuggingModule::internalInitialize() { fRenderable->registerClass("RenderableDebugPlane"); } -std::vector DebuggingModule::documentations() const { +std::vector DebuggingModule::documentations() const { return { RenderableDebugPlane::Documentation() }; diff --git a/modules/debugging/rendering/debugrenderer.cpp b/modules/debugging/rendering/debugrenderer.cpp index c6f348857a..bfabe1cd25 100644 --- a/modules/debugging/rendering/debugrenderer.cpp +++ b/modules/debugging/rendering/debugrenderer.cpp @@ -44,15 +44,15 @@ DebugRenderer* DebugRenderer::_reference = nullptr; DebugRenderer::DebugRenderer() { _programObject = OsEng.renderEngine().buildRenderProgram( - "BasicDebugShader", + "BasicDebugShader", "${MODULE_DEBUGGING}/rendering/debugshader_vs.glsl", "${MODULE_DEBUGGING}/rendering/debugshader_fs.glsl" ); } DebugRenderer::DebugRenderer(std::unique_ptr programObject) - : _programObject(std::move(programObject)) -{ + : _programObject(std::move(programObject)) +{ // nothing to do } diff --git a/modules/debugging/rendering/debugrenderer.h b/modules/debugging/rendering/debugrenderer.h index 1d86ecf8c0..da6b87af56 100644 --- a/modules/debugging/rendering/debugrenderer.h +++ b/modules/debugging/rendering/debugrenderer.h @@ -40,7 +40,7 @@ namespace openspace { /** - * A helper class for quick rendering of vertices IN clipping space. + * A helper class for quick rendering of vertices IN clipping space. * The class is practically stateless. It only stores a ghoul::opengl::ProgramObject * which can be reused despite the fact that rendering calls are invoked from different * callers. Therefore a static reference is provided for convenience which is accessed @@ -77,7 +77,7 @@ public: /** * Takes a vector of exactly 8 vertices, i.e. corner points in a box. * The box corners should be ordered from smaller to larger, - * first by x, the, y and finally z. + * first by x, the, y and finally z. * * 6-------7 * |\ |\ @@ -93,7 +93,7 @@ public: /** * Takes a vector of exactly 8 vertices, i.e. corner points in a box. * The box corners should be ordered from smaller to larger, - * first by x, the, y and finally z. + * first by x, the, y and finally z. * * 6-------7 * |\ |\ @@ -124,7 +124,7 @@ public: /** * Input arguments: - * 1. const RenderData& data: defines position and camera that we will see the + * 1. const RenderData& data: defines position and camera that we will see the * other cameras view frustum from * 2. const Camera& otherCamera: The camera who's view frustum is to be rendered * 3. RGBA rgba Color to draw the view frustum with @@ -143,7 +143,7 @@ public: #ifdef OPENSPACE_MODULE_GLOBEBROWSING_ENABLED /** - * Takes a AABB3 in screen space and returns vertices representing the corner points + * Takes a AABB3 in screen space and returns vertices representing the corner points * of the AABB. The ordering of the corner points is compatible with the box * rendering methods in this class. */ diff --git a/modules/digitaluniverse/rendering/renderablepoints.cpp b/modules/digitaluniverse/rendering/renderablepoints.cpp index d5147a7c0a..707c2a0b70 100644 --- a/modules/digitaluniverse/rendering/renderablepoints.cpp +++ b/modules/digitaluniverse/rendering/renderablepoints.cpp @@ -62,7 +62,7 @@ namespace { static const openspace::properties::Property::PropertyInfo SpriteTextureInfo = { "Texture", "Point Sprite Texture", - "The path to the texture that should be used as the point sprite." + "The path to the texture that should be used as the point sprite." }; static const openspace::properties::Property::PropertyInfo TransparencyInfo = { @@ -112,7 +112,7 @@ namespace openspace { "The path to the SPECK file that contains information about the astronomical " "object being rendered." }, - { + { keyColor, new Vector3Verifier, Optional::No, @@ -184,7 +184,7 @@ namespace openspace { } else if (unit == KilometerUnit) { _unit = Kilometer; - } + } else if (unit == ParsecUnit) { _unit = Parsec; } @@ -298,7 +298,7 @@ namespace openspace { using IgnoreError = ghoul::opengl::ProgramObject::IgnoreError; _program->setIgnoreUniformLocationError(IgnoreError::Yes); - _program->setUniform("modelViewProjectionTransform", glm::dmat4(data.camera.projectionMatrix()) * + _program->setUniform("modelViewProjectionTransform", glm::dmat4(data.camera.projectionMatrix()) * data.camera.combinedViewMatrix() * modelMatrix); _program->setUniform("color", _pointColor); @@ -334,7 +334,7 @@ namespace openspace { glDepthMask(true); } - void RenderablePoints::update(const UpdateData&) { + void RenderablePoints::update(const UpdateData&) { if (_dataIsDirty) { LDEBUG("Regenerating data"); @@ -653,7 +653,7 @@ namespace openspace { // Converting untis if (_unit == Kilometer) { p *= 1E3; - } + } else if (_unit == Parsec) { p *= PARSEC; } diff --git a/modules/digitaluniverse/rendering/renderablepoints.h b/modules/digitaluniverse/rendering/renderablepoints.h index 51cb4b819e..afcdaed93f 100644 --- a/modules/digitaluniverse/rendering/renderablepoints.h +++ b/modules/digitaluniverse/rendering/renderablepoints.h @@ -35,8 +35,8 @@ #include -namespace ghoul::filesystem { - class File; +namespace ghoul::filesystem { + class File; } namespace ghoul::opengl { diff --git a/modules/fieldlines/rendering/renderablefieldlines.cpp b/modules/fieldlines/rendering/renderablefieldlines.cpp index 7253e7ff86..863a89d530 100644 --- a/modules/fieldlines/rendering/renderablefieldlines.cpp +++ b/modules/fieldlines/rendering/renderablefieldlines.cpp @@ -104,7 +104,7 @@ namespace { namespace openspace { -RenderableFieldlines::RenderableFieldlines(const ghoul::Dictionary& dictionary) +RenderableFieldlines::RenderableFieldlines(const ghoul::Dictionary& dictionary) : Renderable(dictionary) , _stepSize(StepSizeInfo, defaultFieldlineStepSize, 0.f, 10.f) , _classification(Classification, true) @@ -427,7 +427,7 @@ RenderableFieldlines::generateFieldlinesVolumeKameleon() if (model != vectorFieldKameleonModelBATSRUS) { //modelType = KameleonWrapper::Model::BATSRUS; //else { - LERROR(keyVectorField << "." << keyVectorFieldVolumeModel << " model '" << + LERROR(keyVectorField << "." << keyVectorFieldVolumeModel << " model '" << model << "' not supported"); return {}; } diff --git a/modules/galaxy/rendering/renderablegalaxy.cpp b/modules/galaxy/rendering/renderablegalaxy.cpp index 2c62310399..be5aaa79a3 100644 --- a/modules/galaxy/rendering/renderablegalaxy.cpp +++ b/modules/galaxy/rendering/renderablegalaxy.cpp @@ -272,7 +272,7 @@ void RenderableGalaxy::initialize() { GLint colorAttrib = _pointsProgram->attributeLocation("inColor"); glBindBuffer(GL_ARRAY_BUFFER, _positionVbo); - glEnableVertexAttribArray(positionAttrib); + glEnableVertexAttribArray(positionAttrib); glVertexAttribPointer(positionAttrib, 3, GL_FLOAT, GL_FALSE, 0, 0); glBindBuffer(GL_ARRAY_BUFFER, _colorVbo); diff --git a/modules/galaxy/tasks/milkywayconversiontask.cpp b/modules/galaxy/tasks/milkywayconversiontask.cpp index 4002251bb9..6b623b1b92 100644 --- a/modules/galaxy/tasks/milkywayconversiontask.cpp +++ b/modules/galaxy/tasks/milkywayconversiontask.cpp @@ -39,7 +39,7 @@ namespace { const char* KeyInNSlices = "InNSlices"; const char* KeyOutFilename = "OutFilename"; const char* KeyOutDimensions = "OutDimensions"; -} // namespace +} // namespace namespace openspace { diff --git a/modules/globebrowsing/chunk/chunk.cpp b/modules/globebrowsing/chunk/chunk.cpp index 6e10fde6f6..19c0799545 100644 --- a/modules/globebrowsing/chunk/chunk.cpp +++ b/modules/globebrowsing/chunk/chunk.cpp @@ -40,7 +40,7 @@ Chunk::Chunk(const RenderableGlobe& owner, const TileIndex& tileIndex, bool init : _owner(owner) , _tileIndex(tileIndex) , _isVisible(initVisible) - , _surfacePatch(tileIndex) + , _surfacePatch(tileIndex) {} const GeodeticPatch& Chunk::surfacePatch() const { @@ -171,8 +171,8 @@ std::vector Chunk::getBoundingPolyhedronCorners() const { double maxCenterRadius = patchCenterRadius + boundingHeight.max; Geodetic2 halfSize = patch.halfSize(); - // As the patch is curved, the maximum height offsets at the corners must be long - // enough to cover large enough to cover a boundingHeight.max at the center of the + // As the patch is curved, the maximum height offsets at the corners must be long + // enough to cover large enough to cover a boundingHeight.max at the center of the // patch. // Approximating scaleToCoverCenter by assuming the latitude and longitude angles // of "halfSize" are equal to the angles they create from the center of the @@ -189,7 +189,7 @@ std::vector Chunk::getBoundingPolyhedronCorners() const { bool chunkIsNorthOfEquator = patch.isNorthern(); - // The minimum height offset, however, we can simply + // The minimum height offset, however, we can simply double minCornerHeight = boundingHeight.min; std::vector corners(8); diff --git a/modules/globebrowsing/chunk/chunk.h b/modules/globebrowsing/chunk/chunk.h index c3c676adab..fc3af610e5 100644 --- a/modules/globebrowsing/chunk/chunk.h +++ b/modules/globebrowsing/chunk/chunk.h @@ -66,7 +66,7 @@ public: * return Status::WANT_MERGE, if it is larger it will return Status::WANT_SPLIT, * otherwise Status::DO_NOTHING. * - * \returns The Status of the chunk. + * \returns The Status of the chunk. */ Status update(const RenderData& data); diff --git a/modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.cpp b/modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.cpp index c31e1d5818..5760f519c0 100644 --- a/modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.cpp +++ b/modules/globebrowsing/chunk/chunklevelevaluator/projectedareaevaluator.cpp @@ -46,12 +46,12 @@ int ProjectedArea::getDesiredLevel(const Chunk& chunk, const RenderData& data) c glm::dvec3(inverseModelTransform * cameraPositionModelSpace); glm::dvec3 cameraToEllipsoidCenter = -cameraPosition; - Geodetic2 cameraGeodeticPos = ellipsoid.cartesianToGeodetic2(cameraPosition); + Geodetic2 cameraGeodeticPos = ellipsoid.cartesianToGeodetic2(cameraPosition); // Approach: // The projected area of the chunk will be calculated based on a small area that // is close to the camera, and the scaled up to represent the full area. - // The advantage of doing this is that it will better handle the cases where the + // The advantage of doing this is that it will better handle the cases where the // full patch is very curved (e.g. stretches from latitude 0 to 90 deg). const Geodetic2 center = chunk.surfacePatch().center(); @@ -61,11 +61,11 @@ int ProjectedArea::getDesiredLevel(const Chunk& chunk, const RenderData& data) c // | // V // - // oo + // oo // [ ]< // *geodetic space* - // - // closestCorner + // + // closestCorner // +-----------------+ <-- north east corner // | | // | center | @@ -81,7 +81,7 @@ int ProjectedArea::getDesiredLevel(const Chunk& chunk, const RenderData& data) c // | // V // - // oo + // oo // [ ]< // *geodetic space* // @@ -103,7 +103,7 @@ int ProjectedArea::getDesiredLevel(const Chunk& chunk, const RenderData& data) c C = glm::normalize(C); // Camera *cartesian space* - // | +--------+---+ + // | +--------+---+ // V __--'' __--'' / // C-------A--------- + // oo / / / diff --git a/modules/globebrowsing/chunk/chunknode.cpp b/modules/globebrowsing/chunk/chunknode.cpp index bbe9392605..1ef8c7694b 100644 --- a/modules/globebrowsing/chunk/chunknode.cpp +++ b/modules/globebrowsing/chunk/chunknode.cpp @@ -109,7 +109,7 @@ void ChunkNode::reverseBreadthFirst(const std::function& // Loop through nodes in breadths first order Q.push(this); while (Q.size() > 0) { - const ChunkNode* node = Q.front(); + const ChunkNode* node = Q.front(); Q.pop(); // Add node to future stack @@ -126,7 +126,7 @@ void ChunkNode::reverseBreadthFirst(const std::function& } } - // Loop through all nodes in stack, this will be reversed breadth first + // Loop through all nodes in stack, this will be reversed breadth first while (S.size() > 0) { f(*S.top()); S.pop(); diff --git a/modules/globebrowsing/chunk/culling/horizonculler.cpp b/modules/globebrowsing/chunk/culling/horizonculler.cpp index 84edb71c90..4919490c4f 100644 --- a/modules/globebrowsing/chunk/culling/horizonculler.cpp +++ b/modules/globebrowsing/chunk/culling/horizonculler.cpp @@ -79,7 +79,7 @@ bool HorizonCuller::isCullable(const Chunk& chunk, const RenderData& data) { maxHeight, minimumGlobeRadius); } -bool HorizonCuller::isCullable(const glm::dvec3& cameraPosition, +bool HorizonCuller::isCullable(const glm::dvec3& cameraPosition, const glm::dvec3& globePosition, const glm::dvec3& objectPosition, double objectBoundingSphereRadius, diff --git a/modules/globebrowsing/geometry/angle.h b/modules/globebrowsing/geometry/angle.h index 9ad16bfa41..68cb1f4cd7 100644 --- a/modules/globebrowsing/geometry/angle.h +++ b/modules/globebrowsing/geometry/angle.h @@ -96,8 +96,8 @@ public: Angle& normalizeAround(const Angle& center); /** - * Clamps the angle to the interval [min, max]. - * Default arguments are [0, 2pi]. + * Clamps the angle to the interval [min, max]. + * Default arguments are [0, 2pi]. */ Angle& clamp(const Angle& min = ZERO, const Angle& max = FULL); diff --git a/modules/globebrowsing/geometry/angle.inl b/modules/globebrowsing/geometry/angle.inl index 0ef33336cb..d6b763885d 100644 --- a/modules/globebrowsing/geometry/angle.inl +++ b/modules/globebrowsing/geometry/angle.inl @@ -30,7 +30,7 @@ template const T Angle::PI = T(3.14159265358979323846264338327950); template -const T Angle::EPSILON = 1e-10; // Should depend on the typedef /eb +const T Angle::EPSILON = 1e-10; // Should depend on the typedef /eb ////////////////////////////////////////////////////////////////////////////////////////// // STATIC CONSTANTS // diff --git a/modules/globebrowsing/geometry/ellipsoid.cpp b/modules/globebrowsing/geometry/ellipsoid.cpp index 2482b459ed..d679960709 100644 --- a/modules/globebrowsing/geometry/ellipsoid.cpp +++ b/modules/globebrowsing/geometry/ellipsoid.cpp @@ -91,7 +91,7 @@ glm::dvec3 Ellipsoid::geodeticSurfaceNormal(Geodetic2 geodetic2) const { //geodetic2.lon = geodetic2.lon > M_PI ? geodetic2.lon - M_PI * 2 : geodetic2.lon; return glm::dvec3( cosLat * cos(geodetic2.lon), - cosLat * sin(geodetic2.lon), + cosLat * sin(geodetic2.lon), sin(geodetic2.lat)); } diff --git a/modules/globebrowsing/geometry/geodeticpatch.cpp b/modules/globebrowsing/geometry/geodeticpatch.cpp index 3171225df4..3258e96a43 100644 --- a/modules/globebrowsing/geometry/geodeticpatch.cpp +++ b/modules/globebrowsing/geometry/geodeticpatch.cpp @@ -139,7 +139,7 @@ Geodetic2 GeodeticPatch::clamp(const Geodetic2& p) const { // Normalize w.r.t. the center in order for the clamping to done correctly // - // Example: + // Example: // centerLat = 0 deg, halfSize.lat = 10 deg, pointLat = 330 deg // --> Just clamping pointLat would be clamp(330, -10, 10) = 10 // WRONG! // Instead, if we first normalize 330 deg around 0, we get -30 deg @@ -163,11 +163,11 @@ Geodetic2 GeodeticPatch::closestCorner(const Geodetic2& p) const { Ang latDiff = Ang::fromRadians(centerToPoint.lat).normalizeAround(Ang::ZERO); Ang lonDiff = Ang::fromRadians(centerToPoint.lon).normalizeAround(Ang::ZERO); - // If latDiff > 0 - // --> point p is north of the patch center + // If latDiff > 0 + // --> point p is north of the patch center // --> the closest corner to the point must be a northern one // --> set the corner's latitude coordinate to center.lat + halfSize.lat - // else + // else // --> set corner's latidude coordinate to center.lat - halfSize.lat double cornerLat = _center.lat + _halfSize.lat * (latDiff > Ang::ZERO ? 1 : -1); @@ -179,31 +179,31 @@ Geodetic2 GeodeticPatch::closestCorner(const Geodetic2& p) const { Geodetic2 GeodeticPatch::closestPoint(const Geodetic2& p) const { // This method finds the closest point on the patch, to the provided - // point p. As we are deali ng with latitude-longitude patches, distance in this + // point p. As we are deali ng with latitude-longitude patches, distance in this // context refers to great-circle distance. // (https://en.wikipedia.org/wiki/Great-circle_distance) // - // This uses a simple clamping approach to find the closest point on the - // patch. A naive castesian clamp is not sufficient for this purpose, + // This uses a simple clamping approach to find the closest point on the + // patch. A naive castesian clamp is not sufficient for this purpose, // as illustrated with an example below. // Example: (degrees are used for latidude, longitude) // patchCenter = (0,0), patchHalfSize = (45,45), point = (5, 170) // Note, the point and the patch are on opposite sides of the sphere // - // cartesian clamp: + // cartesian clamp: // --> clampedPointLat = clamp(5, -45, 45) = 5 // --> clampedPointLon = clamp(170, -45, 45) = 45 // --> result: (5, 45) - // --> closest point is actually (45, 45) + // --> closest point is actually (45, 45) // --> The error is significant - // - // This method simply adds an extra clamp on the latitude in these cases. In the + // + // This method simply adds an extra clamp on the latitude in these cases. In the // above example, that would be the following: // --> clampedPointLat = clamp(180 - 5, -45, 45) = 45 - // + // // Just doing this actually makes points returned from this methods being the - // true closest point, great-circle distance-wise. + // true closest point, great-circle distance-wise. using Ang = Angle; @@ -213,17 +213,17 @@ Geodetic2 GeodeticPatch::closestPoint(const Geodetic2& p) const { Ang pointLat = Ang::fromRadians(p.lat); Ang pointLon = Ang::fromRadians(p.lon); - // Normalize point with respect to center. This is done because the point + // Normalize point with respect to center. This is done because the point // will later be clamped. See LatLonPatch::clamp(const LatLon&) for explanation pointLat.normalizeAround(centerLat); pointLon.normalizeAround(centerLon); - // Calculate the longitud difference between center and point. We normalize around - // zero because we want the "shortest distance" difference, i.e the difference + // Calculate the longitud difference between center and point. We normalize around + // zero because we want the "shortest distance" difference, i.e the difference // should be in the interval [-180 deg, 180 deg] Ang centerToPointLon = (centerLon - pointLon).normalizeAround(Ang::ZERO); - // Calculate the longitudinal distance to the closest patch edge + // Calculate the longitudinal distance to the closest patch edge Ang longitudeDistanceToClosestPatchEdge = centerToPointLon.abs() - Ang::fromRadians(_halfSize.lon); // If the longitude distance to the closest patch edge is larger than 90 deg diff --git a/modules/globebrowsing/geometry/geodeticpatch.h b/modules/globebrowsing/geometry/geodeticpatch.h index fda307db1f..a67a84dc71 100644 --- a/modules/globebrowsing/geometry/geodeticpatch.h +++ b/modules/globebrowsing/geometry/geodeticpatch.h @@ -48,7 +48,7 @@ public: GeodeticPatch(const TileIndex& tileIndex); void setCenter(const Geodetic2&); - void setHalfSize(const Geodetic2&); + void setHalfSize(const Geodetic2&); /** * Returns the latitude boundary which is closest to the equator diff --git a/modules/globebrowsing/globes/chunkedlodglobe.cpp b/modules/globebrowsing/globes/chunkedlodglobe.cpp index 31dea61166..d21fd18e7d 100644 --- a/modules/globebrowsing/globes/chunkedlodglobe.cpp +++ b/modules/globebrowsing/globes/chunkedlodglobe.cpp @@ -80,7 +80,7 @@ ChunkedLodGlobe::ChunkedLodGlobe(const RenderableGlobe& owner, size_t segmentsPe AABB3(glm::vec3(-1, -1, 0), glm::vec3(1, 1, 1e35))) ); - _chunkEvaluatorByAvailableTiles = + _chunkEvaluatorByAvailableTiles = std::make_unique(); _chunkEvaluatorByProjectedArea = std::make_unique(); diff --git a/modules/globebrowsing/globes/chunkedlodglobe.h b/modules/globebrowsing/globes/chunkedlodglobe.h index 3ccad36387..872659ae9c 100644 --- a/modules/globebrowsing/globes/chunkedlodglobe.h +++ b/modules/globebrowsing/globes/chunkedlodglobe.h @@ -83,7 +83,7 @@ public: * lower than the current level of the Chunkss * TileIndex. If the desired level is higher than that of the * Chunk, it wants to split. If it is lower, it wants to merge with - * its siblings. + * its siblings. */ int getDesiredLevel(const Chunk& chunk, const RenderData& renderData) const; diff --git a/modules/globebrowsing/globes/pointglobe.cpp b/modules/globebrowsing/globes/pointglobe.cpp index 581f0345de..1101a7d103 100644 --- a/modules/globebrowsing/globes/pointglobe.cpp +++ b/modules/globebrowsing/globes/pointglobe.cpp @@ -37,7 +37,7 @@ namespace { static const openspace::properties::Property::PropertyInfo IntensityClampInfo = { "IntensityClamp", "Intensity clamp", - "" + "" }; static const openspace::properties::Property::PropertyInfo LightIntensityInfo = { @@ -138,7 +138,7 @@ void PointGlobe::render(const RenderData& data, RendererTasks&) { // Model transform and view transform needs to be in double precision glm::dmat4 modelTransform = glm::translate(glm::dmat4(1.0), bodyPosition) * // Translation - glm::inverse(rotationTransform) * + glm::inverse(rotationTransform) * scaleTransform; // Scale glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform; //glm::vec3 directionToSun = glm::normalize(glm::vec3(0) - glm::vec3(bodyPosition)); diff --git a/modules/globebrowsing/globes/renderableglobe.cpp b/modules/globebrowsing/globes/renderableglobe.cpp index ecdfb53687..5b50ab4297 100644 --- a/modules/globebrowsing/globes/renderableglobe.cpp +++ b/modules/globebrowsing/globes/renderableglobe.cpp @@ -157,11 +157,11 @@ namespace openspace::globebrowsing { RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) : Renderable(dictionary) , _debugProperties({ - BoolProperty(SaveOrThrowInfo, false), + BoolProperty(SaveOrThrowInfo, false), BoolProperty(ShowChunkEdgeInfo, false), BoolProperty(ShowChunkBoundsInfo, false), BoolProperty(ShowChunkAABBInfo, false), - BoolProperty(HeightResolutionInfo, false), + BoolProperty(HeightResolutionInfo, false), BoolProperty(HeightIntensityInfo, false), BoolProperty(FrustumCullingInfo, true), BoolProperty(HorizonCullingInfo, true), @@ -368,7 +368,7 @@ const std::shared_ptr RenderableGlobe::savedCamera() const { } SurfacePositionHandle RenderableGlobe::calculateSurfacePositionHandle( - const glm::dvec3& targetModelSpace) + const glm::dvec3& targetModelSpace) { glm::dvec3 centerToEllipsoidSurface = _ellipsoid.geodeticSurfaceProjection(targetModelSpace); @@ -396,7 +396,7 @@ SurfacePositionHandle RenderableGlobe::calculateSurfacePositionHandle( }; } -void RenderableGlobe::setSaveCamera(std::shared_ptr camera) { +void RenderableGlobe::setSaveCamera(std::shared_ptr camera) { _savedCamera = camera; } diff --git a/modules/globebrowsing/globes/renderableglobe.h b/modules/globebrowsing/globes/renderableglobe.h index ffbda5040d..2dc6f001ab 100644 --- a/modules/globebrowsing/globes/renderableglobe.h +++ b/modules/globebrowsing/globes/renderableglobe.h @@ -45,7 +45,7 @@ class LayerManager; * algorithm for rendering. * The renderable uses a DistanceSwitch to determine if the renderable - * should be rendered. + * should be rendered. */ class RenderableGlobe : public Renderable { public: @@ -107,7 +107,7 @@ public: void setSaveCamera(std::shared_ptr camera); virtual SurfacePositionHandle calculateSurfacePositionHandle( - const glm::dvec3& targetModelSpace) override; + const glm::dvec3& targetModelSpace) override; private: // Globes. These are renderables inserted in a distance switch so that the heavier diff --git a/modules/globebrowsing/meshes/basicgrid.h b/modules/globebrowsing/meshes/basicgrid.h index efcceff7c1..4edc91bcb5 100644 --- a/modules/globebrowsing/meshes/basicgrid.h +++ b/modules/globebrowsing/meshes/basicgrid.h @@ -45,7 +45,7 @@ public: * \param useNormals determines whether or not to upload any vertex normal data * to the GPU. */ - BasicGrid(unsigned int xSegments, unsigned int ySegments, + BasicGrid(unsigned int xSegments, unsigned int ySegments, TriangleSoup::Positions usePositions, TriangleSoup::TextureCoordinates useTextureCoordinates, TriangleSoup::Normals useNormals); diff --git a/modules/globebrowsing/meshes/grid.h b/modules/globebrowsing/meshes/grid.h index 8c4372e1c6..4465eda9ad 100644 --- a/modules/globebrowsing/meshes/grid.h +++ b/modules/globebrowsing/meshes/grid.h @@ -62,7 +62,7 @@ public: protected: /** - * Should return the indices of vertices for a grid with size xSegments * + * Should return the indices of vertices for a grid with size xSegments * ySegments. Where the number of vertices in each direction is the number * of segments + 1. */ diff --git a/modules/globebrowsing/other/distanceswitch.h b/modules/globebrowsing/other/distanceswitch.h index 45d9a6bd3c..2a3d63271b 100644 --- a/modules/globebrowsing/other/distanceswitch.h +++ b/modules/globebrowsing/other/distanceswitch.h @@ -38,7 +38,7 @@ namespace openspace { namespace openspace::globebrowsing { /** - * Selects a specific Renderable to be used for rendering, based on distance to the + * Selects a specific Renderable to be used for rendering, based on distance to the * camera */ class DistanceSwitch { @@ -49,7 +49,7 @@ public: bool deinitialize(); /** - * Picks the first Renderable with the associated maxDistance greater than the + * Picks the first Renderable with the associated maxDistance greater than the * current distance to the camera */ void render(const RenderData& data, RendererTasks& rendererTask); diff --git a/modules/globebrowsing/other/lruthreadpool.h b/modules/globebrowsing/other/lruthreadpool.h index 99ea554d47..359c74349c 100644 --- a/modules/globebrowsing/other/lruthreadpool.h +++ b/modules/globebrowsing/other/lruthreadpool.h @@ -43,7 +43,7 @@ template class LRUThreadPool; template class LRUThreadPoolWorker { -public: +public: LRUThreadPoolWorker(LRUThreadPool& pool); void operator()(); private: diff --git a/modules/globebrowsing/other/pixelbuffer.h b/modules/globebrowsing/other/pixelbuffer.h index 7cde0ab2ff..4765fbf2eb 100644 --- a/modules/globebrowsing/other/pixelbuffer.h +++ b/modules/globebrowsing/other/pixelbuffer.h @@ -116,7 +116,7 @@ public: void unbind(); /** - * \returns true of the buffer is mapped, otherwise false + * \returns true of the buffer is mapped, otherwise false */ bool isMapped() const; diff --git a/modules/globebrowsing/rendering/chunkrenderer.cpp b/modules/globebrowsing/rendering/chunkrenderer.cpp index 06dce09b32..a35c59ef99 100644 --- a/modules/globebrowsing/rendering/chunkrenderer.cpp +++ b/modules/globebrowsing/rendering/chunkrenderer.cpp @@ -143,7 +143,7 @@ void ChunkRenderer::setCommonUniforms(ghoul::opengl::ProgramObject& programObjec } if (chunk.owner().generalProperties().useAccurateNormals && - !_layerManager->layerGroup(layergroupid::HeightLayers).activeLayers().empty()) + !_layerManager->layerGroup(layergroupid::HeightLayers).activeLayers().empty()) { glm::dvec3 corner00 = chunk.owner().ellipsoid().cartesianSurfacePosition( chunk.surfacePatch().getCorner(Quad::SOUTH_WEST)); diff --git a/modules/globebrowsing/rendering/gpu/gpuchunktile.h b/modules/globebrowsing/rendering/gpu/gpuchunktile.h index e94536ecd7..7d5c1d3c3b 100644 --- a/modules/globebrowsing/rendering/gpu/gpuchunktile.h +++ b/modules/globebrowsing/rendering/gpu/gpuchunktile.h @@ -45,15 +45,15 @@ public: /** * Sets the value of ChunkTile to its corresponding - * GPU struct. OBS! Users must ensure bind has been + * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ void setValue(ghoul::opengl::ProgramObject* programObject, const ChunkTile& chunkTile); - /** - * Binds GLSL variables with identifiers starting with - * nameBase within the provided shader program with this object. + /** + * Binds GLSL variables with identifiers starting with + * nameBase within the provided shader program with this object. * After this method has been called, users may invoke setValue. */ void bind(ghoul::opengl::ProgramObject* programObject, const std::string& nameBase); diff --git a/modules/globebrowsing/rendering/gpu/gpuchunktilepile.h b/modules/globebrowsing/rendering/gpu/gpuchunktilepile.h index be896aa15a..a7e1bf15a2 100644 --- a/modules/globebrowsing/rendering/gpu/gpuchunktilepile.h +++ b/modules/globebrowsing/rendering/gpu/gpuchunktilepile.h @@ -45,18 +45,18 @@ public: /** * Sets the value of ChunkTilePile to its corresponding - * GPU struct. OBS! Users must ensure bind has been + * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ void setValue(ghoul::opengl::ProgramObject* programObject, const ChunkTilePile& chunkTilePile); - /** - * Binds this object with GLSL variables with identifiers starting + /** + * Binds this object with GLSL variables with identifiers starting * with nameBase within the provided shader program. * After this method has been called, users may invoke setValue. */ - void bind(ghoul::opengl::ProgramObject* programObject, const std::string& nameBase, + void bind(ghoul::opengl::ProgramObject* programObject, const std::string& nameBase, int pileSize); /** * Deactivates any TextureUnits assigned by this object. diff --git a/modules/globebrowsing/rendering/gpu/gpuheightlayer.h b/modules/globebrowsing/rendering/gpu/gpuheightlayer.h index c0b25b308f..48d61db381 100644 --- a/modules/globebrowsing/rendering/gpu/gpuheightlayer.h +++ b/modules/globebrowsing/rendering/gpu/gpuheightlayer.h @@ -49,14 +49,14 @@ public: /** * Sets the value of Layer to its corresponding - * GPU struct. OBS! Users must ensure bind has been + * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ virtual void setValue(ghoul::opengl::ProgramObject* programObject, const Layer& layer, const TileIndex& tileIndex, int pileSize) override; - /** - * Binds this object with GLSL variables with identifiers starting + /** + * Binds this object with GLSL variables with identifiers starting * with nameBase within the provided shader program. * After this method has been called, users may invoke setValue. */ diff --git a/modules/globebrowsing/rendering/gpu/gpulayer.h b/modules/globebrowsing/rendering/gpu/gpulayer.h index 6e4f737a9e..7603544dde 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayer.h +++ b/modules/globebrowsing/rendering/gpu/gpulayer.h @@ -48,14 +48,14 @@ public: /** * Sets the value of Layer to its corresponding - * GPU struct. OBS! Users must ensure bind has been + * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ virtual void setValue(ghoul::opengl::ProgramObject* programObject, const Layer& layer, const TileIndex& tileIndex, int pileSize); - /** - * Binds this object with GLSL variables with identifiers starting + /** + * Binds this object with GLSL variables with identifiers starting * with nameBase within the provided shader program. * After this method has been called, users may invoke setValue. */ diff --git a/modules/globebrowsing/rendering/gpu/gpulayergroup.cpp b/modules/globebrowsing/rendering/gpu/gpulayergroup.cpp index f73e2ab2ec..dc55b69019 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayergroup.cpp +++ b/modules/globebrowsing/rendering/gpu/gpulayergroup.cpp @@ -58,7 +58,7 @@ void GPULayerGroup::bind(ghoul::opengl::ProgramObject* programObject, for (size_t i = 0; i < _gpuActiveLayers.size(); ++i) { // should maybe a proper GPULayer factory _gpuActiveLayers[i] = (category == layergroupid::GroupID::HeightLayers) ? - std::make_unique() : + std::make_unique() : std::make_unique(); std::string nameExtension = "[" + std::to_string(i) + "]."; _gpuActiveLayers[i]->bind( diff --git a/modules/globebrowsing/rendering/gpu/gpulayergroup.h b/modules/globebrowsing/rendering/gpu/gpulayergroup.h index d94c9daa32..ff186929be 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayergroup.h +++ b/modules/globebrowsing/rendering/gpu/gpulayergroup.h @@ -55,14 +55,14 @@ public: /** * Sets the value of LayerGroup to its corresponding - * GPU struct. OBS! Users must ensure bind has been + * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ virtual void setValue(ghoul::opengl::ProgramObject* programObject, const LayerGroup& layerGroup, const TileIndex& tileIndex); - /** - * Binds this object with GLSL variables with identifiers starting + /** + * Binds this object with GLSL variables with identifiers starting * with nameBase within the provided shader program. * After this method has been called, users may invoke setValue. */ diff --git a/modules/globebrowsing/rendering/gpu/gpulayermanager.cpp b/modules/globebrowsing/rendering/gpu/gpulayermanager.cpp index 475b744462..f3d0ea2e51 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayermanager.cpp +++ b/modules/globebrowsing/rendering/gpu/gpulayermanager.cpp @@ -29,7 +29,7 @@ namespace openspace::globebrowsing { void GPULayerManager::setValue(ghoul::opengl::ProgramObject* programObject, - const LayerManager& layerManager, + const LayerManager& layerManager, const TileIndex& tileIndex) { auto layerGroups = layerManager.layerGroups(); diff --git a/modules/globebrowsing/rendering/gpu/gpulayermanager.h b/modules/globebrowsing/rendering/gpu/gpulayermanager.h index 8c6f237da7..bc196cc742 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayermanager.h +++ b/modules/globebrowsing/rendering/gpu/gpulayermanager.h @@ -45,14 +45,14 @@ public: /** * Sets the value of LayerGroup to its corresponding - * GPU struct. OBS! Users must ensure bind has been + * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ virtual void setValue(ghoul::opengl::ProgramObject* programObject, const LayerManager& layerManager, const TileIndex& tileIndex); - /** - * Binds this object with GLSL variables with identifiers starting + /** + * Binds this object with GLSL variables with identifiers starting * with nameBase within the provided shader program. * After this method has been called, users may invoke setValue. */ diff --git a/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.h b/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.h index 6b2c1c4f04..ddaafcaa18 100644 --- a/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.h +++ b/modules/globebrowsing/rendering/gpu/gpulayerrendersettings.h @@ -42,14 +42,14 @@ class GPULayerRenderSettings{ public: /** * Sets the value of LayerRenderSettings to its corresponding - * GPU struct. OBS! Users must ensure bind has been + * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ void setValue(ghoul::opengl::ProgramObject* programObject, const LayerRenderSettings& layerSettings); - /** - * Binds this object with GLSL variables with identifiers starting + /** + * Binds this object with GLSL variables with identifiers starting * with nameBase within the provided shader program. * After this method has been called, users may invoke setValue. */ diff --git a/modules/globebrowsing/rendering/gpu/gputiledepthtransform.h b/modules/globebrowsing/rendering/gpu/gputiledepthtransform.h index 79065249c1..9de5a3d776 100644 --- a/modules/globebrowsing/rendering/gpu/gputiledepthtransform.h +++ b/modules/globebrowsing/rendering/gpu/gputiledepthtransform.h @@ -42,15 +42,15 @@ class GPUTileDepthTransform { public: /** * Sets the value of TileDepthTransform to its corresponding - * GPU struct. OBS! Users must ensure bind has been + * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ void setValue(ghoul::opengl::ProgramObject* programObject, const TileDepthTransform& depthTransform); - /** - * Binds GLSL variables with identifiers starting with - * nameBase within the provided shader program with this object. + /** + * Binds GLSL variables with identifiers starting with + * nameBase within the provided shader program with this object. * After this method has been called, users may invoke setValue. */ void bind(ghoul::opengl::ProgramObject* programObject, diff --git a/modules/globebrowsing/rendering/gpu/gputileuvtransform.h b/modules/globebrowsing/rendering/gpu/gputileuvtransform.h index fb52dcaa33..9245742aff 100644 --- a/modules/globebrowsing/rendering/gpu/gputileuvtransform.h +++ b/modules/globebrowsing/rendering/gpu/gputileuvtransform.h @@ -42,15 +42,15 @@ class GPUTileUvTransform { public: /** * Sets the value of TileUvTransform to its corresponding - * GPU struct. OBS! Users must ensure bind has been + * GPU struct. OBS! Users must ensure bind has been * called before setting using this method. */ void setValue(ghoul::opengl::ProgramObject* programObject, const TileUvTransform& uvTransform); - /** - * Binds GLSL variables with identifiers starting with - * nameBase within the provided shader program with this object. + /** + * Binds GLSL variables with identifiers starting with + * nameBase within the provided shader program with this object. * After this method has been called, users may invoke setValue. */ void bind(ghoul::opengl::ProgramObject* programObject, diff --git a/modules/globebrowsing/rendering/layer/layer.cpp b/modules/globebrowsing/rendering/layer/layer.cpp index 7a970cf579..23a27a63f7 100644 --- a/modules/globebrowsing/rendering/layer/layer.cpp +++ b/modules/globebrowsing/rendering/layer/layer.cpp @@ -223,7 +223,7 @@ ChunkTilePile Layer::getChunkTilePile(const TileIndex& tileIndex, int pileSize) if (_tileProvider) { return _tileProvider->getChunkTilePile(tileIndex, pileSize); } - else { + else { ChunkTilePile chunkTilePile; chunkTilePile.resize(pileSize); for (int i = 0; i < pileSize; ++i) { @@ -350,7 +350,7 @@ void Layer::initializeBasedOnType(layergroupid::TypeID typeId, ghoul::Dictionary if (tileProviderInitDict.hasKeyAndValue(keyName)) { std::string name; tileProviderInitDict.getValue(keyName, name); - LDEBUG("Initializing tile provider for layer: '" + name + "'"); + LDEBUG("Initializing tile provider for layer: '" + name + "'"); } _tileProvider = std::shared_ptr( tileprovider::TileProvider::createFromDictionary(typeId, tileProviderInitDict) diff --git a/modules/globebrowsing/tile/pixelregion.cpp b/modules/globebrowsing/tile/pixelregion.cpp index df6d7a83a1..fabd02f3a7 100644 --- a/modules/globebrowsing/tile/pixelregion.cpp +++ b/modules/globebrowsing/tile/pixelregion.cpp @@ -31,7 +31,7 @@ namespace openspace::globebrowsing { PixelRegion::PixelRegion(const PixelCoordinate& pixelStart, const PixelRange& numberOfPixels) : start(pixelStart) - , numPixels(numberOfPixels) + , numPixels(numberOfPixels) {} PixelRegion::PixelRegion(const PixelRegion& o) @@ -91,20 +91,20 @@ void PixelRegion::align(Side side, int pos) { } } -void PixelRegion::alignLeft(int x) { - start.x = x; +void PixelRegion::alignLeft(int x) { + start.x = x; } -void PixelRegion::alignTop(int y) { - start.y = y; +void PixelRegion::alignTop(int y) { + start.y = y; } -void PixelRegion::alignRight(int x) { - start.x = x - numPixels.x; +void PixelRegion::alignRight(int x) { + start.x = x - numPixels.x; } -void PixelRegion::alignBottom(int y) { - start.y = y - numPixels.y; +void PixelRegion::alignBottom(int y) { + start.y = y - numPixels.y; } void PixelRegion::scale(const glm::dvec2& s) { diff --git a/modules/globebrowsing/tile/pixelregion.h b/modules/globebrowsing/tile/pixelregion.h index c597365443..018d67b294 100644 --- a/modules/globebrowsing/tile/pixelregion.h +++ b/modules/globebrowsing/tile/pixelregion.h @@ -58,7 +58,7 @@ struct PixelRegion { void setBottom(int y); /** - * Aligns one the sides of the pixel regino to the specified position. This does + * Aligns one the sides of the pixel regino to the specified position. This does * not change the number of pixels within the region. * * Example: Side = left and pos = 16: diff --git a/modules/globebrowsing/tile/rawtiledatareader/gdalrawtiledatareader.cpp b/modules/globebrowsing/tile/rawtiledatareader/gdalrawtiledatareader.cpp index a53f36092e..66fd37cc96 100644 --- a/modules/globebrowsing/tile/rawtiledatareader/gdalrawtiledatareader.cpp +++ b/modules/globebrowsing/tile/rawtiledatareader/gdalrawtiledatareader.cpp @@ -167,8 +167,8 @@ RawTile::ReadError GdalRawTileDataReader::rasterRead( char* dataDest = dataDestination; // GDAL reads pixels top to bottom, but we want our pixels bottom to top. - // Therefore, we increment the destination pointer to the last line on in the - // buffer, and the we specify in the rasterIO call that we want negative line + // Therefore, we increment the destination pointer to the last line on in the + // buffer, and the we specify in the rasterIO call that we want negative line // spacing. Doing this compensates the flipped Y axis dataDest += (io.write.totalNumBytes - io.write.bytesPerLine); diff --git a/modules/globebrowsing/tile/rawtiledatareader/gdalrawtiledatareader.h b/modules/globebrowsing/tile/rawtiledatareader/gdalrawtiledatareader.h index a4211de38d..78a2cfea5d 100644 --- a/modules/globebrowsing/tile/rawtiledatareader/gdalrawtiledatareader.h +++ b/modules/globebrowsing/tile/rawtiledatareader/gdalrawtiledatareader.h @@ -55,7 +55,7 @@ class GdalRawTileDataReader : public RawTileDataReader { public: /** - * Opens a GDALDataset in readonly mode and calculates meta data required for + * Opens a GDALDataset in readonly mode and calculates meta data required for * reading tile using a TileIndex. * * \param filePath, a path to a specific file GDAL can read @@ -103,7 +103,7 @@ private: /** * Use as a helper function when determining the maximum tile level. This function * returns the negated number of overviews requred to downscale the highest overview - * dataset so that it fits within minimumPixelSize pixels in the x-dimension. + * dataset so that it fits within minimumPixelSize pixels in the x-dimension. */ int calculateTileLevelDifference(int minimumPixelSize) const; diff --git a/modules/globebrowsing/tile/rawtiledatareader/rawtiledatareader.cpp b/modules/globebrowsing/tile/rawtiledatareader/rawtiledatareader.cpp index bf29c170c0..e40233e187 100644 --- a/modules/globebrowsing/tile/rawtiledatareader/rawtiledatareader.cpp +++ b/modules/globebrowsing/tile/rawtiledatareader/rawtiledatareader.cpp @@ -373,15 +373,15 @@ RawTile::ReadError RawTileDataReader::repeatedRasterRead( { RawTile::ReadError worstError = RawTile::ReadError::None; - // NOTE: - // Ascii graphics illustrates the implementation details of this method, for one - // specific case. Even though the illustrated case is specific, readers can + // NOTE: + // Ascii graphics illustrates the implementation details of this method, for one + // specific case. Even though the illustrated case is specific, readers can // hopefully find it useful to get the general idea. // Make a copy of the full IO desription as we will have to modify it IODescription io = fullIO; - // Example: + // Example: // We have an io description that defines a WRITE and a READ region. // In this case the READ region extends outside of the defined io.read.fullRegion, // meaning we will have to perform wrapping @@ -389,12 +389,12 @@ RawTile::ReadError RawTileDataReader::repeatedRasterRead( // io.write.region io.read.region // | | // V V - // +-------+ +-------+ - // | | | |--------+ + // +-------+ +-------+ + // | | | |--------+ // | | | | | // | | | | | // +-------+ +-------+ | - // | | <-- io.read.fullRegion + // | | <-- io.read.fullRegion // | | // +--------------+ @@ -402,27 +402,27 @@ RawTile::ReadError RawTileDataReader::repeatedRasterRead( // Loop through each side: left, top, right, bottom for (int i = 0; i < 4; ++i) { - // Example: + // Example: // We are currently considering the left side of the pixel region PixelRegion::Side side = static_cast(i); IODescription cutoff = io.cut(side, io.read.fullRegion.edge(side)); - // Example: + // Example: // We cut off the left part that was outside the io.read.fullRegion, and we - // now have an additional io description for the cut off region. - // Note that the cut-method used above takes care of the corresponding + // now have an additional io description for the cut off region. + // Note that the cut-method used above takes care of the corresponding // WRITE region for us. // cutoff.write.region cutoff.read.region // | io.write.region | io.read.region // | | | | // V V V V - // +-+-----+ +-+-----+ + // +-+-----+ +-+-----+ // | | | | | |--------+ // | | | | | | | // | | | | | | | // +-+-----+ +-+-----+ | - // | | <-- io.read.fullRegion + // | | <-- io.read.fullRegion // | | // +--------------+ @@ -435,7 +435,7 @@ RawTile::ReadError RawTileDataReader::repeatedRasterRead( // Example: // The cut off region is wrapped to the opposite side of the region, - // i.e. "repeated". Note that we don't want WRITE region to change, + // i.e. "repeated". Note that we don't want WRITE region to change, // we're only wrapping the READ region. // cutoff.write.region io.read.region cutoff.read.region @@ -443,15 +443,15 @@ RawTile::ReadError RawTileDataReader::repeatedRasterRead( // | | V V // V V +-----+ +-+ // +-+-----+ | |------| | - // | | | | | | | + // | | | | | | | // | | | | | | | // | | | +-----+ +-+ - // +-+-----+ | | <-- io.read.fullRegion + // +-+-----+ | | <-- io.read.fullRegion // | | // +--------------+ // Example: - // The cutoff region has been repeated along one of its sides, but + // The cutoff region has been repeated along one of its sides, but // as we can see in this example, it still has a top part outside the // defined gdal region. This is handled through recursion. RawTile::ReadError err = repeatedRasterRead( diff --git a/modules/globebrowsing/tile/rawtiledatareader/tiledatatype.cpp b/modules/globebrowsing/tile/rawtiledatareader/tiledatatype.cpp index 9c3da72259..ff2811e1ab 100644 --- a/modules/globebrowsing/tile/rawtiledatareader/tiledatatype.cpp +++ b/modules/globebrowsing/tile/rawtiledatareader/tiledatatype.cpp @@ -138,7 +138,7 @@ TextureFormat getTextureFormat(int rasterCount, GDALDataType gdalType) { // No representation of 64 bit float? //case GDT_Float64: // format.glFormat = GL_RED; - // break; + // break; default: LERROR("GDAL data type unknown to OpenGL: " << gdalType); } @@ -192,7 +192,7 @@ TextureFormat getTextureFormat(int rasterCount, GDALDataType gdalType) { case GDT_Float32: format.glFormat = GL_RGB32F; break; - // No representation of 64 bit float? + // No representation of 64 bit float? //case GDT_Float64: // format.glFormat = GL_RED; // break; @@ -224,7 +224,7 @@ TextureFormat getTextureFormat(int rasterCount, GDALDataType gdalType) { // No representation of 64 bit float? //case GDT_Float64: // format.glFormat = GL_RED; - // break; + // break; default: LERROR("GDAL data type unknown to OpenGL: " << gdalType); } @@ -264,7 +264,7 @@ TextureFormat getTextureFormatOptimized(int rasterCount, GDALDataType gdalType) // No representation of 64 bit float? //case GDT_Float64: // format.glFormat = GL_RED; - // break; + // break; default: LERROR("GDAL data type unknown to OpenGL: " << gdalType); } @@ -306,7 +306,7 @@ TextureFormat getTextureFormatOptimized(int rasterCount, GDALDataType gdalType) case GDT_UInt16: format.glFormat = GL_RGB16UI; break; - case GDT_Int16: + case GDT_Int16: format.glFormat = GL_RGB16_SNORM; break; case GDT_UInt32: @@ -318,7 +318,7 @@ TextureFormat getTextureFormatOptimized(int rasterCount, GDALDataType gdalType) case GDT_Float32: format.glFormat = GL_RGB32F; break; - // No representation of 64 bit float? + // No representation of 64 bit float? //case GDT_Float64: // format.glFormat = GL_RED; // break; @@ -350,7 +350,7 @@ TextureFormat getTextureFormatOptimized(int rasterCount, GDALDataType gdalType) // No representation of 64 bit float? //case GDT_Float64: // format.glFormat = GL_RED; - // break; + // break; default: LERROR("GDAL data type unknown to OpenGL: " << gdalType); } diff --git a/modules/globebrowsing/tile/tileindex.cpp b/modules/globebrowsing/tile/tileindex.cpp index b3e8e856ec..992e2dce67 100644 --- a/modules/globebrowsing/tile/tileindex.cpp +++ b/modules/globebrowsing/tile/tileindex.cpp @@ -112,7 +112,7 @@ int TileIndex::manhattan(const TileIndex& other) const { } // Creates a hash which can be used as key in hash maps. -// +// // +-------+------------+-------+------------+ // | USAGE | BIT RANGE | #BITS | MAX VALUE | // +-------+------------+-------+------------+ diff --git a/modules/globebrowsing/tile/tileloadjob.h b/modules/globebrowsing/tile/tileloadjob.h index 515ca97472..21c60a56b2 100644 --- a/modules/globebrowsing/tile/tileloadjob.h +++ b/modules/globebrowsing/tile/tileloadjob.h @@ -46,7 +46,7 @@ struct TileLoadJob : public Job { /** * No data is allocated unless specified so by the TileTextureInitData of * rawTileDataReader but it is assumed that pboDataPtr is a mapped pointer to a pixel - * buffer object. + * buffer object. */ TileLoadJob(std::shared_ptr rawTileDataReader, const TileIndex& tileIndex, char* pboDataPtr); diff --git a/modules/globebrowsing/tile/tileprovider/defaulttileprovider.cpp b/modules/globebrowsing/tile/tileprovider/defaulttileprovider.cpp index fb1222f649..3b72e93b68 100644 --- a/modules/globebrowsing/tile/tileprovider/defaulttileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/defaulttileprovider.cpp @@ -70,7 +70,7 @@ namespace { namespace openspace::globebrowsing::tileprovider { -DefaultTileProvider::DefaultTileProvider(const ghoul::Dictionary& dictionary) +DefaultTileProvider::DefaultTileProvider(const ghoul::Dictionary& dictionary) : TileProvider(dictionary) , _filePath(FilePathInfo, "") , _tilePixelSize(TilePixelSizeInfo, 32, 32, 2048) @@ -97,7 +97,7 @@ DefaultTileProvider::DefaultTileProvider(const ghoul::Dictionary& dictionary) int tilePixelSize = 0; if (dictionary.getValue(KeyTilePixelSize, pixelSize)) { LDEBUG("Default pixel size overridden: " << pixelSize); - tilePixelSize = static_cast(pixelSize); + tilePixelSize = static_cast(pixelSize); } _padTiles = true; diff --git a/modules/globebrowsing/tile/tileprovider/defaulttileprovider.h b/modules/globebrowsing/tile/tileprovider/defaulttileprovider.h index 83447d8e8e..9e7a8540a6 100644 --- a/modules/globebrowsing/tile/tileprovider/defaulttileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/defaulttileprovider.h @@ -41,7 +41,7 @@ namespace openspace::globebrowsing { namespace openspace::globebrowsing::tileprovider { /** -* Provides tiles loaded by AsyncTileDataProvider and +* Provides tiles loaded by AsyncTileDataProvider and * caches them in memory using LRU caching */ class DefaultTileProvider : public TileProvider { @@ -52,8 +52,8 @@ public: virtual ~DefaultTileProvider() override; /** - * \returns a Tile with status OK iff it exists in in-memory - * cache. If not, it may enqueue some IO operations on a + * \returns a Tile with status OK iff it exists in in-memory + * cache. If not, it may enqueue some IO operations on a * separate thread. */ virtual Tile getTile(const TileIndex& tileIndex) override; @@ -68,7 +68,7 @@ public: private: /** * Collects all asynchronously downloaded RawTile - * and uses createTile to create Tiles, + * and uses createTile to create Tiles, * which are put in the LRU cache - potentially pushing out outdated * Tiles. */ diff --git a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp index a482fdaa17..858d625e98 100644 --- a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.cpp @@ -61,7 +61,7 @@ const char* TemporalTileProvider::TemporalXMLTags::TIME_RESOLUTION = "OpenSpaceTimeResolution"; const char* TemporalTileProvider::TemporalXMLTags::TIME_FORMAT = "OpenSpaceTimeIdFormat"; -TemporalTileProvider::TemporalTileProvider(const ghoul::Dictionary& dictionary) +TemporalTileProvider::TemporalTileProvider(const ghoul::Dictionary& dictionary) : _initDict(dictionary) , _filePath(FilePathInfo) , _successfulInitialization(false) @@ -99,7 +99,7 @@ TemporalTileProvider::TemporalTileProvider(const ghoul::Dictionary& dictionary) else { LERROR("Unable to read file " + _filePath.value()); _successfulInitialization = false; - } + } } bool TemporalTileProvider::readFilePath() { @@ -210,7 +210,7 @@ std::string TemporalTileProvider::getXMLValue(CPLXMLNode* root, const std::strin TileDepthTransform TemporalTileProvider::depthTransform() { if (_successfulInitialization) { ensureUpdated(); - return _currentTileProvider->depthTransform(); + return _currentTileProvider->depthTransform(); } else { return { 1.0f, 0.0f}; @@ -402,7 +402,7 @@ TimeFormat* TimeIdProviderFactory::getProvider(const std::string& format) { init(); } ghoul_assert( - _timeIdProviderMap.find(format) != _timeIdProviderMap.end(), + _timeIdProviderMap.find(format) != _timeIdProviderMap.end(), "Unsupported Time format: " + format ); return _timeIdProviderMap[format].get(); diff --git a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h index f14289e3bb..e8c37f8d9b 100644 --- a/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/temporaltileprovider.h @@ -50,7 +50,7 @@ namespace openspace::globebrowsing::tileprovider { * Interface for stringifying OpenSpace Time instances. * * Once OpenSpace has a proper Time format class, this should be handled by that instead - * of here. + * of here. */ struct TimeFormat { virtual ~TimeFormat() = default; @@ -110,7 +110,7 @@ struct YYYY_MM_DDThh_mm_ssZ : public TimeFormat { /** * Static factory class for providing different TimeFormats. * A time format stringifier is retrieved by a name of the format. - * See implementation of init() to see what time + * See implementation of init() to see what time * id formats are supported. */ struct TimeIdProviderFactory { @@ -122,7 +122,7 @@ struct TimeIdProviderFactory { * See implementation of init() for supported time formats. * * \param format - name of TimeFormat, eg "YYYY-MM-DDThh:mm:ssZ". - * \returns a concrete TimeFormat used to stringify instances of Time + * \returns a concrete TimeFormat used to stringify instances of Time */ static TimeFormat* getProvider(const std::string& format); @@ -136,7 +136,7 @@ struct TimeIdProviderFactory { }; /** - * Used to quantize time to descrete values. + * Used to quantize time to descrete values. */ struct TimeQuantizer { TimeQuantizer() {} @@ -144,13 +144,13 @@ struct TimeQuantizer { TimeQuantizer(const Time& start, const Time& end, const std::string& resolutionStr); /** - * Takes a time resulition string and parses it into a double + * Takes a time resulition string and parses it into a double * value representing the time resolution as seconds. * * Example: parseTimeResolutionStr("1d"); - * + * * \param resoltutionStr with the format {number}{unit} - * where supported units are: + * where supported units are: * (s)econds, (m)inutes, (h)ours, (d)ays, (y)ears * * \returns the time resolution in seconds @@ -186,12 +186,12 @@ private: * Provide Tiles from web map services that have temporal resolution. * * TemporalTileProviders are instantiated using a ghoul::Dictionary, - * and must define a filepath to a Openspace Temporal dataset description file. + * and must define a filepath to a Openspace Temporal dataset description file. * This is an xml-file that defines the same meta data as the GDAL wms description - * (http://www.gdal.org/frmt_wms.html), but augmented with some - * extra tags describing the temporal properties of the dataset. See + * (http://www.gdal.org/frmt_wms.html), but augmented with some + * extra tags describing the temporal properties of the dataset. See * TemporalTileProvider::TemporalXMLTags - * + * */ class TemporalTileProvider : public TileProvider { public: @@ -218,7 +218,7 @@ public: private: /** - * A placeholder string that must be provided in the WMS template url. This + * A placeholder string that must be provided in the WMS template url. This * placeholder will be replaced by quantized date-time strings during run time * in order to access the datasets for different instances of time. */ @@ -243,8 +243,8 @@ private: static const char* TIME_END; /** - * Tag should contain the time resolution of the dataset. - * The resolution is defined by a number along with a unit specifying how + * Tag should contain the time resolution of the dataset. + * The resolution is defined by a number along with a unit specifying how * often the dataset is updated temporally. Supported units are: * (s)econds, (m)inutes, (h)ours, (d)ays, (y)ears. * @@ -255,7 +255,7 @@ private: /** * Tag should contain a string specifying the date-time format expected by the - * WMS. + * WMS. */ static const char* TIME_FORMAT; }; @@ -275,12 +275,12 @@ private: std::string getGdalDatasetXML(TimeKey key); /** - * Instantiates a new TileProvder for the temporal dataset at the time - * specified. - * + * Instantiates a new TileProvder for the temporal dataset at the time + * specified. + * * This method replaced the URL_TIME_PLACEHOLDER in the template URL * with the provided timekey, the opens a new GDAL dataset with that URL. - * + * * \param timekey time specifying dataset's temporality * \returns newly instantiated TileProvider */ @@ -288,14 +288,14 @@ private: /** * Takes as input a Openspace Temporal dataset description, extracts the temporal - * metadata provided by reading the TemporalXMLTags, removes the - * read tags from the description, and returns a GDAL template GDAL dataset - * description. The template GDAL dataset description has the a + * metadata provided by reading the TemporalXMLTags, removes the + * read tags from the description, and returns a GDAL template GDAL dataset + * description. The template GDAL dataset description has the a * URL_TIME_PLACEHOLDER still in it, which needs to be replaced before * GDAL can open it as a GDALDataset. * * \param xml Openspace Temporal dataset description - * \returns a GDAL template data description. + * \returns a GDAL template data description. */ std::string consumeTemporalMetaData(const std::string &xml); diff --git a/modules/globebrowsing/tile/tileprovider/texttileprovider.h b/modules/globebrowsing/tile/tileprovider/texttileprovider.h index 5382762f98..c7ee2661e5 100644 --- a/modules/globebrowsing/tile/tileprovider/texttileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/texttileprovider.h @@ -40,9 +40,9 @@ namespace ghoul::fontrendering { namespace openspace::globebrowsing::tileprovider { /** - * Enables a simple way of providing tiles with any type of rendered text. - * Internally it handles setting up a FBO for rendering the text, and defines a new - * interface, consisting of only a single method for subclasses to implement: + * Enables a simple way of providing tiles with any type of rendered text. + * Internally it handles setting up a FBO for rendering the text, and defines a new + * interface, consisting of only a single method for subclasses to implement: * renderText(const FontRenderer&, const TileIndex&) const; */ class TextTileProvider : public TileProvider { @@ -62,7 +62,7 @@ public: virtual int maxLevel() override; /** - * Allow overriding of hash function. + * Allow overriding of hash function. * Default is TileIndex::hashKey() * * \param tileIndex tileIndex to hash @@ -71,9 +71,9 @@ public: virtual TileIndex::TileHashKey toHash(const TileIndex& tileIndex) const; /** - * Uses the fontRenderer to render some text onto the tile texture provided in - * backgroundTile(const TileIndex& tileIndex). - * + * Uses the fontRenderer to render some text onto the tile texture provided in + * backgroundTile(const TileIndex& tileIndex). + * * \param fontRenderer used for rendering text onto texture * \param tileIndex associated with the tile to be rendered onto */ diff --git a/modules/globebrowsing/tile/tileprovider/tileprovider.cpp b/modules/globebrowsing/tile/tileprovider/tileprovider.cpp index f67bf3022e..98e54247a5 100644 --- a/modules/globebrowsing/tile/tileprovider/tileprovider.cpp +++ b/modules/globebrowsing/tile/tileprovider/tileprovider.cpp @@ -84,7 +84,7 @@ ChunkTile TileProvider::getChunkTile(TileIndex tileIndex, int parents, int maxPa } maxParents -= parents; - // Step 2. Traverse 0 or more parents up the chunkTree to make sure we're inside + // Step 2. Traverse 0 or more parents up the chunkTree to make sure we're inside // the range of defined data. int maximumLevel = maxLevel(); while (tileIndex.level > maximumLevel){ @@ -95,8 +95,8 @@ ChunkTile TileProvider::getChunkTile(TileIndex tileIndex, int parents, int maxPa return ChunkTile{ Tile::TileUnavailable, uvTransform, TileDepthTransform() }; } - // Step 3. Traverse 0 or more parents up the chunkTree until we find a chunk that - // has a loaded tile ready to use. + // Step 3. Traverse 0 or more parents up the chunkTree until we find a chunk that + // has a loaded tile ready to use. while (tileIndex.level > 1) { Tile tile = getTile(tileIndex); if (tile.status() != Tile::Status::OK) { diff --git a/modules/globebrowsing/tile/tileprovider/tileprovider.h b/modules/globebrowsing/tile/tileprovider/tileprovider.h index 59cb47a10c..1b6550d20c 100644 --- a/modules/globebrowsing/tile/tileprovider/tileprovider.h +++ b/modules/globebrowsing/tile/tileprovider/tileprovider.h @@ -39,14 +39,14 @@ namespace openspace::globebrowsing::tileprovider { /** - * Interface for providing Tiles given a - * TileIndex. + * Interface for providing Tiles given a + * TileIndex. */ class TileProvider : public properties::PropertyOwner { public: /** - * Factory method for instantiating different implementations of - * TileProviders. The provided dictionary must + * Factory method for instantiating different implementations of + * TileProviders. The provided dictionary must * define a key specifying what implementation of TileProvider * to be instantiated. */ @@ -54,15 +54,15 @@ public: layergroupid::TypeID layerTypeID, const ghoul::Dictionary& dictionary); - /** - * Default constructor. + /** + * Default constructor. */ TileProvider(); /** - * Implementations of the TileProvider interface must implement - * a constructor taking a dictionary as input. The provided - * dictionary must define a key specifying what implementation + * Implementations of the TileProvider interface must implement + * a constructor taking a dictionary as input. The provided + * dictionary must define a key specifying what implementation * of TileProvider to be instantiated. */ TileProvider(const ghoul::Dictionary& dictionary); @@ -80,16 +80,16 @@ public: * Method for querying tiles, given a specified TileIndex. * * This method is expected to be invoked multiple times per frame, - * and should therefore return quickly, e.g. not perform heavy I/O + * and should therefore return quickly, e.g. not perform heavy I/O * operations. However, invoking this method may spawn separate threads - * to perform such operations. Therefore, programmers shoud - * note that there is no guarantee that the Tile + * to perform such operations. Therefore, programmers shoud + * note that there is no guarantee that the Tile * status and texture will be consistent over different invocations * of this method. - * - * \param tileIndex specifying a region of a map for which + * + * \param tileIndex specifying a region of a map for which * we want tile data. - * + * * \returns The tile corresponding to the TileIndex by the time * the method was invoked. */ @@ -113,7 +113,7 @@ public: /** * Get the associated depth transform for this TileProvider. - * This is necessary for TileProviders serving height map + * This is necessary for TileProviders serving height map * data, in order to correcly map pixel values to meters. */ virtual TileDepthTransform depthTransform() = 0; @@ -125,8 +125,8 @@ public: virtual void update() = 0; /** - * Provides a uniform way of all TileProviders to reload or - * restore all of its internal state. This is mainly useful + * Provides a uniform way of all TileProviders to reload or + * restore all of its internal state. This is mainly useful * for debugging purposes. */ virtual void reset() = 0; @@ -145,7 +145,7 @@ public: /** * \returns a unique identifier for the TileProvider<\code>. All * TileProviders<\code> have an ID starting at 0 from the first created. - * The maximum number of unique identifiers is UINT_MAX + * The maximum number of unique identifiers is UINT_MAX */ unsigned int uniqueIdentifier() const; diff --git a/modules/imgui/src/gui.cpp b/modules/imgui/src/gui.cpp index 30f8941616..e3bd6d3db6 100644 --- a/modules/imgui/src/gui.cpp +++ b/modules/imgui/src/gui.cpp @@ -233,7 +233,7 @@ void addScreenSpaceRenderableOnline(std::string texturePath) { OsEng.scriptEngine().queueScript(script, openspace::scripting::ScriptEngine::RemoteScripting::Yes); } -} // namespace +} // namespace namespace openspace::gui { @@ -243,7 +243,7 @@ void CaptionText(const char* text) { ImGui::PopFont(); } -GUI::GUI() +GUI::GUI() : GuiComponent("Main") , _globalProperty("Global") , _property( @@ -388,7 +388,7 @@ void GUI::initialize() { _featuredProperties.setHasRegularProperties(true); _virtualProperty.initialize(); _filePath.initialize(); -#ifdef GLOBEBROWSING_USE_GDAL +#ifdef GLOBEBROWSING_USE_GDAL _globeBrowsing.initialize(); #endif // GLOBEBROWSING_USE_GDAL _performance.initialize(); @@ -396,7 +396,7 @@ void GUI::initialize() { _parallel.initialize(); _mission.initialize(); #ifdef OPENSPACE_MODULE_ISWA_ENABLED - _iswa.initialize(); + _iswa.initialize(); #endif // OPENSPACE_MODULE_ISWA_ENABLED } @@ -493,7 +493,7 @@ void GUI::initializeGL() { _globalProperty.initializeGL(); _featuredProperties.initializeGL(); _performance.initializeGL(); - _help.initializeGL(); + _help.initializeGL(); #ifdef GLOBEBROWSING_USE_GDAL _globeBrowsing.initializeGL(); #endif // GLOBEBROWSING_USE_GDAL @@ -644,7 +644,7 @@ bool GUI::keyCallback(Key key, KeyModifier modifier, KeyAction action) { const bool consumeEvent = io.WantCaptureKeyboard; if (consumeEvent) { if (action == KeyAction::Press) { - io.KeysDown[keyIndex] = true; + io.KeysDown[keyIndex] = true; } io.KeyShift = hasShift; io.KeyCtrl = hasCtrl; diff --git a/modules/imgui/src/guipropertycomponent.cpp b/modules/imgui/src/guipropertycomponent.cpp index 05e4dd7145..14f9fbe798 100644 --- a/modules/imgui/src/guipropertycomponent.cpp +++ b/modules/imgui/src/guipropertycomponent.cpp @@ -317,7 +317,7 @@ void GuiPropertyComponent::render() { if (header()) { renderPropertyOwner(pOwner); - } + } }; if (!_currentUseTreeLayout || noGuiGroups) { diff --git a/modules/imgui/src/guispacetimecomponent.cpp b/modules/imgui/src/guispacetimecomponent.cpp index 31266675d8..7ccb55bba3 100644 --- a/modules/imgui/src/guispacetimecomponent.cpp +++ b/modules/imgui/src/guispacetimecomponent.cpp @@ -100,8 +100,8 @@ void GuiSpaceTimeComponent::render() { nodeNames += n->name() + '\0'; } - auto iCurrentFocus = std::find(nodes.begin(), nodes.end(), currentFocus); - if (!nodes.empty()) { + auto iCurrentFocus = std::find(nodes.begin(), nodes.end(), currentFocus); + if (!nodes.empty()) { // Only check if we found the current focus node if we have any nodes at all // only then it would be a real error ghoul_assert(iCurrentFocus != nodes.end(), "Focus node not found"); diff --git a/modules/iswa/rendering/datacygnet.cpp b/modules/iswa/rendering/datacygnet.cpp index 4cd2dff370..dfa24757a1 100644 --- a/modules/iswa/rendering/datacygnet.cpp +++ b/modules/iswa/rendering/datacygnet.cpp @@ -124,10 +124,10 @@ bool DataCygnet::updateTexture(){ if (!_textures[option]) { auto texture = std::make_unique( - values, + values, _textureDimensions, ghoul::opengl::Texture::Format::Red, - GL_RED, + GL_RED, GL_FLOAT, ghoul::opengl::Texture::FilterMode::Linear, ghoul::opengl::Texture::WrappingMode::ClampToEdge @@ -308,7 +308,7 @@ void DataCygnet::setPropertyCallbacks(){ _backgroundValues.setValue(_dataProcessor->filterValues()); }); - _dataOptions.onChange([this](){ + _dataOptions.onChange([this](){ if(_dataOptions.value().size() > MAX_TEXTURES) LWARNING("Too many options chosen, max is " + std::to_string(MAX_TEXTURES)); updateTexture(); @@ -327,7 +327,7 @@ void DataCygnet::subscribeToGroup(){ std::vector values; bool success = dict.getValue >("dataOptions", values); if(success){ - _dataOptions.setValue(values); + _dataOptions.setValue(values); } }); @@ -336,7 +336,7 @@ void DataCygnet::subscribeToGroup(){ glm::vec2 values; bool success = dict.getValue("normValues", values); if(success){ - _normValues.setValue(values); + _normValues.setValue(values); } }); @@ -345,7 +345,7 @@ void DataCygnet::subscribeToGroup(){ glm::vec2 values; bool success = dict.getValue("backgroundValues", values); if(success){ - _backgroundValues.setValue(values); + _backgroundValues.setValue(values); } }); diff --git a/modules/iswa/rendering/datacygnet.h b/modules/iswa/rendering/datacygnet.h index 89f5375607..f75726c802 100644 --- a/modules/iswa/rendering/datacygnet.h +++ b/modules/iswa/rendering/datacygnet.h @@ -51,7 +51,7 @@ protected: /** * loads the transferfunctions specified in tfPath into * _transferFunctions list. - * + * * @param tfPath Path to transfer function file */ void readTransferFunctions(std::string tfPath); @@ -99,7 +99,7 @@ protected: properties::BoolProperty _useHistogram; properties::BoolProperty _autoFilter; - std::shared_ptr _dataProcessor; + std::shared_ptr _dataProcessor; std::string _dataBuffer; glm::size3_t _textureDimensions; diff --git a/modules/iswa/rendering/dataplane.cpp b/modules/iswa/rendering/dataplane.cpp index 550bf44cf3..bc03293756 100644 --- a/modules/iswa/rendering/dataplane.cpp +++ b/modules/iswa/rendering/dataplane.cpp @@ -35,7 +35,7 @@ namespace openspace { DataPlane::DataPlane(const ghoul::Dictionary& dictionary) :DataCygnet(dictionary) -{ +{ _programName = "DataPlaneProgram"; _vsPath = "${MODULE_ISWA}/shaders/dataplane_vs.glsl"; _fsPath = "${MODULE_ISWA}/shaders/dataplane_fs.glsl"; @@ -54,13 +54,13 @@ void DataPlane::initialize() { //If autofiler is on, background values property should be hidden _autoFilter.onChange([this]() { - // If autofiler is selected, use _dataProcessor to set backgroundValues + // If autofiler is selected, use _dataProcessor to set backgroundValues // and unregister backgroundvalues property. if (_autoFilter.value()) { _backgroundValues.setValue(_dataProcessor->filterValues()); _backgroundValues.setVisibility(properties::Property::Visibility::Hidden); //_backgroundValues.setVisible(false); - // else if autofilter is turned off, register backgroundValues + // else if autofilter is turned off, register backgroundValues } else { _backgroundValues.setVisibility(properties::Property::Visibility::All); //_backgroundValues.setVisible(true); diff --git a/modules/iswa/rendering/dataplane.h b/modules/iswa/rendering/dataplane.h index 960d0db7b4..250bbc1748 100644 --- a/modules/iswa/rendering/dataplane.h +++ b/modules/iswa/rendering/dataplane.h @@ -30,7 +30,7 @@ namespace openspace { /** - * DataPlane is a concrete IswaCygnet with data files as its input source. + * DataPlane is a concrete IswaCygnet with data files as its input source. * The class handles creation, destruction and rendering of a plane geometry. * It also specifies what uniforms to use and what GUI properties it needs. */ diff --git a/modules/iswa/rendering/datasphere.cpp b/modules/iswa/rendering/datasphere.cpp index 527e191674..ddf7d98326 100644 --- a/modules/iswa/rendering/datasphere.cpp +++ b/modules/iswa/rendering/datasphere.cpp @@ -67,13 +67,13 @@ void DataSphere::initialize() { _dataProcessor = std::make_shared(); //If autofiler is on, background values property should be hidden _autoFilter.onChange([this]() { - // If autofiler is selected, use _dataProcessor to set backgroundValues + // If autofiler is selected, use _dataProcessor to set backgroundValues // and unregister backgroundvalues property. if (_autoFilter.value()) { _backgroundValues.setValue(_dataProcessor->filterValues()); _backgroundValues.setVisibility(properties::Property::Visibility::Hidden); //_backgroundValues.setVisible(false); - // else if autofilter is turned off, register backgroundValues + // else if autofilter is turned off, register backgroundValues } else { _backgroundValues.setVisibility(properties::Property::Visibility::All); //_backgroundValues.setVisible(true); diff --git a/modules/iswa/rendering/datasphere.h b/modules/iswa/rendering/datasphere.h index dff23ca92e..f635350b48 100644 --- a/modules/iswa/rendering/datasphere.h +++ b/modules/iswa/rendering/datasphere.h @@ -32,7 +32,7 @@ namespace openspace { class PowerScaledSphere; /** - * DataSphere is a concrete IswaCygnet with data files as its input source. + * DataSphere is a concrete IswaCygnet with data files as its input source. * The class handles creation, destruction and rendering of a sphere geometry. * It also specifies what uniforms to use and what GUI properties it needs. */ @@ -57,6 +57,6 @@ protected: float _radius; }; -} // namespace openspace +} // namespace openspace #endif // __OPENSPACE_MODULE_ISWA___DATASPHERE___H__ diff --git a/modules/iswa/rendering/iswabasegroup.cpp b/modules/iswa/rendering/iswabasegroup.cpp index 2201a57f77..efe81edf7e 100644 --- a/modules/iswa/rendering/iswabasegroup.cpp +++ b/modules/iswa/rendering/iswabasegroup.cpp @@ -63,7 +63,7 @@ namespace openspace { IswaBaseGroup::IswaBaseGroup(std::string name, std::string type) : properties::PropertyOwner({ std::move(name) }) - , _enabled(EnabledInfo, true) + , _enabled(EnabledInfo, true) , _alpha(AlphaInfo, 0.9f, 0.f, 1.f) , _delete(DeleteInfo) , _registered(false) @@ -100,8 +100,8 @@ std::shared_ptr IswaBaseGroup::dataProcessor(){ return _dataProcessor; } -std::shared_ptr > IswaBaseGroup::groupEvent(){ - return _groupEvent; +std::shared_ptr > IswaBaseGroup::groupEvent() { + return _groupEvent; }; @@ -119,12 +119,12 @@ void IswaBaseGroup::registerProperties(){ _delete.onChange([this]{ clearGroup(); - }); + }); - _registered = true; + _registered = true; } -void IswaBaseGroup::unregisterProperties(){ +void IswaBaseGroup::unregisterProperties() { _registered = false; } diff --git a/modules/iswa/rendering/iswacygnet.h b/modules/iswa/rendering/iswacygnet.h index b9ecf2c7bb..b7fa75dc35 100644 --- a/modules/iswa/rendering/iswacygnet.h +++ b/modules/iswa/rendering/iswacygnet.h @@ -88,7 +88,7 @@ protected: void initializeTime(); void initializeGroup(); /** - * Creates the shader program. Concrete IswaCygnets must set + * Creates the shader program. Concrete IswaCygnets must set * _vsPath, _fsPath and _programName before this function in called. * @return true if successful creation */ @@ -113,7 +113,7 @@ protected: */ virtual bool updateTextureResource() = 0; /** - * should send a http request to get the resource it needs to create + * should send a http request to get the resource it needs to create * a texture. For Texture cygnets, this should be an image. For DataCygnets, * this should be the data file. * @return true if update was successfull diff --git a/modules/iswa/rendering/iswadatagroup.cpp b/modules/iswa/rendering/iswadatagroup.cpp index 8ff483a794..ed39c58bce 100644 --- a/modules/iswa/rendering/iswadatagroup.cpp +++ b/modules/iswa/rendering/iswadatagroup.cpp @@ -85,7 +85,7 @@ namespace { namespace openspace{ IswaDataGroup::IswaDataGroup(std::string name, std::string type) - : IswaBaseGroup(name, type) + : IswaBaseGroup(name, type) , _useLog(UseLogInfo, false) , _useHistogram(UseHistogramInfo, false) , _autoFilter(AutoFilterInfo, true) @@ -133,13 +133,13 @@ void IswaDataGroup::registerProperties(){ //If autofiler is on, background values property should be hidden _autoFilter.onChange([this](){ LDEBUG("Group " + name() + " published autoFilterChanged"); - // If autofiler is selected, use _dataProcessor to set backgroundValues + // If autofiler is selected, use _dataProcessor to set backgroundValues // and unregister backgroundvalues property. if(_autoFilter.value()){ _backgroundValues.setValue(_dataProcessor->filterValues()); _backgroundValues.setVisibility(properties::Property::Visibility::Hidden); //_backgroundValues.setVisible(false); - // else if autofilter is turned off, register backgroundValues + // else if autofilter is turned off, register backgroundValues } else { _backgroundValues.setVisibility(properties::Property::Visibility::All); //_backgroundValues.setVisible(true); diff --git a/modules/iswa/rendering/kameleonplane.cpp b/modules/iswa/rendering/kameleonplane.cpp index a6807f59f5..12f0ecf14c 100644 --- a/modules/iswa/rendering/kameleonplane.cpp +++ b/modules/iswa/rendering/kameleonplane.cpp @@ -57,7 +57,7 @@ namespace openspace { KameleonPlane::KameleonPlane(const ghoul::Dictionary& dictionary) : DataCygnet(dictionary) - , _fieldlines(FieldLineSeedsInfo) + , _fieldlines(FieldLineSeedsInfo) , _resolution(ResolutionInfo, 100.f, 10.f, 200.f) , _slice(SliceInfo, 0.f, 0.f, 1.f) { @@ -124,13 +124,13 @@ void KameleonPlane::initialize() { //If autofiler is on, background values property should be hidden _autoFilter.onChange([this](){ - // If autofiler is selected, use _dataProcessor to set backgroundValues + // If autofiler is selected, use _dataProcessor to set backgroundValues // and unregister backgroundvalues property. if (_autoFilter) { _backgroundValues.setValue(_dataProcessor->filterValues()); _backgroundValues.setVisibility(properties::Property::Visibility::Hidden); //_backgroundValues.setVisible(false); - // else if autofilter is turned off, register backgroundValues + // else if autofilter is turned off, register backgroundValues } else { _backgroundValues.setVisibility(properties::Property::Visibility::All); //_backgroundValues.setVisible(true); @@ -160,7 +160,7 @@ void KameleonPlane::initialize() { updateTextureResource(); }); - _fieldlines.onChange([this](){ + _fieldlines.onChange([this](){ updateFieldlineSeeds(); }); @@ -354,7 +354,7 @@ void KameleonPlane::subscribeToGroup() { void KameleonPlane::setDimensions() { // the cdf files has an offset of 0.5 in normali resolution. - // with lower resolution the offset increases. + // with lower resolution the offset increases. _data->offset = _origOffset - 0.5f*(100.0f/_resolution.value()); _dimensions = glm::size3_t(_data->scale*((float)_resolution.value()/100.f)); _dimensions[_cut] = 1; diff --git a/modules/iswa/rendering/kameleonplane.h b/modules/iswa/rendering/kameleonplane.h index 544cdb4a6c..8fc3f3874c 100644 --- a/modules/iswa/rendering/kameleonplane.h +++ b/modules/iswa/rendering/kameleonplane.h @@ -31,7 +31,7 @@ namespace openspace { /** - * KameleonPlane is a concrete IswaCygnet with volume data files from + * KameleonPlane is a concrete IswaCygnet with volume data files from * disk as input source. An object of this class will provide a cutplane * through a volume of space weather data. It will also give the option * to create fieldlines around and intersecting the planes. Interaction @@ -53,23 +53,23 @@ private: */ bool createGeometry() override; bool destroyGeometry() override; - bool updateTextureResource() override; + bool updateTextureResource() override; void renderGeometry() const override; void setUniforms() override; std::vector textureData() override; void setDimensions(); /** - * Given a path to the json index of seedpoints file, this + * Given a path to the json index of seedpoints file, this * method reads, parses and adds them as checkbox options * in the _fieldlines SelectionProperty - * + * * @param indexFile Path to json index file */ void readFieldlinePaths(std::string indexFile); /** - * Updates the _fieldlineState map to match the _fieldlines + * Updates the _fieldlineState map to match the _fieldlines * SelectionProperty and creates or removes fieldlines in the scene. */ void updateFieldlineSeeds(); @@ -92,7 +92,7 @@ private: glm::vec3 _origOffset; /** - * _fieldlineState maps the checkbox value of each fieldline seedpoint file to a tuple + * _fieldlineState maps the checkbox value of each fieldline seedpoint file to a tuple * containing information that is needed to either add or remove a fieldline from the scenegraph. * this is the name, path to seedpoints file and a boolean to determine if it is active or inactive. */ diff --git a/modules/iswa/rendering/texturecygnet.cpp b/modules/iswa/rendering/texturecygnet.cpp index 1dc59af620..ea235dd086 100644 --- a/modules/iswa/rendering/texturecygnet.cpp +++ b/modules/iswa/rendering/texturecygnet.cpp @@ -34,17 +34,18 @@ namespace openspace { TextureCygnet::TextureCygnet(const ghoul::Dictionary& dictionary) : IswaCygnet(dictionary) -{ +{ registerProperties(); } TextureCygnet::~TextureCygnet() {} bool TextureCygnet::updateTexture() { - std::unique_ptr texture = ghoul::io::TextureReader::ref().loadTexture( - (void*) _imageFile.buffer, - _imageFile.size, - _imageFile.format); + auto texture = ghoul::io::TextureReader::ref().loadTexture( + (void*) _imageFile.buffer, + _imageFile.size, + _imageFile.format + ); if (texture) { LDEBUG("Loaded texture from image iswa cygnet with id: '" << _data->id << "'"); diff --git a/modules/iswa/rendering/texturecygnet.h b/modules/iswa/rendering/texturecygnet.h index 151cbdb96a..a53b052cd2 100644 --- a/modules/iswa/rendering/texturecygnet.h +++ b/modules/iswa/rendering/texturecygnet.h @@ -32,7 +32,7 @@ namespace openspace { /** * This class exist to abstract away the loading of images * from iSWA and updating of the textures for child geometries. - * The class specifies the minimum interface that child classes + * The class specifies the minimum interface that child classes * needs to implement. */ class TextureCygnet : public IswaCygnet { diff --git a/modules/iswa/rendering/textureplane.h b/modules/iswa/rendering/textureplane.h index 5ebae5c00b..768c20732b 100644 --- a/modules/iswa/rendering/textureplane.h +++ b/modules/iswa/rendering/textureplane.h @@ -31,7 +31,7 @@ namespace openspace { /** * TexturePlane is a "concrete" IswaCygnet with texture as its input source. - * It handles the creation, destruction and rendering of a plane geometry. + * It handles the creation, destruction and rendering of a plane geometry. * It also specifies which shaders to use and the uniforms that it needs. */ class TexturePlane : public TextureCygnet{ diff --git a/modules/iswa/util/dataprocessor.cpp b/modules/iswa/util/dataprocessor.cpp index 1c224c1d7a..98663d863b 100644 --- a/modules/iswa/util/dataprocessor.cpp +++ b/modules/iswa/util/dataprocessor.cpp @@ -97,7 +97,7 @@ float DataProcessor::processDataPoint(float value, int option) { } float DataProcessor::normalizeWithStandardScore(float value, float mean, float sd, - glm::vec2 normalizationValues) + glm::vec2 normalizationValues) { float zScoreMin = normalizationValues.x; //10.0f;//_normValues.x; float zScoreMax = normalizationValues.y; //10.0f;//_normValues.y; @@ -105,25 +105,25 @@ float DataProcessor::normalizeWithStandardScore(float value, float mean, float s // Clamp intresting values standardScore = glm::clamp(standardScore, -zScoreMin, zScoreMax); //return and normalize - return ( standardScore + zScoreMin )/(zScoreMin + zScoreMax ); + return ( standardScore + zScoreMin )/(zScoreMin + zScoreMax ); } float DataProcessor::unnormalizeWithStandardScore(float standardScore, float mean, float sd, glm::vec2 normalizationValues) { float zScoreMin = normalizationValues.x; - float zScoreMax = normalizationValues.y; + float zScoreMax = normalizationValues.y; float value = standardScore*(zScoreMax+zScoreMin)-zScoreMin; - value = value*sd+mean; + value = value*sd+mean; - // std::cout << value << std::endl; + // std::cout << value << std::endl; return value; // float standardScore = ( value - mean ) / sd; // // Clamp intresting values // standardScore = glm::clamp(standardScore, -zScoreMin, zScoreMax); // //return and normalize - // return ( standardScore + zScoreMin )/(zScoreMin + zScoreMax ); + // return ( standardScore + zScoreMin )/(zScoreMin + zScoreMax ); } void DataProcessor::initializeVectors(int numOptions){ @@ -179,7 +179,7 @@ void DataProcessor::calculateFilterValues(std::vector selectedOptions) { _filterValues += glm::vec2(filterMid, filterWidth); } - _filterValues /= numSelected; + _filterValues /= numSelected; } } @@ -230,7 +230,7 @@ void DataProcessor::add(std::vector>& optionValues, //unnormalize histMin, histMax // min = std::min(min, histMin) std::shared_ptr newHist = std::make_shared( - std::min(min, normalizeWithStandardScore(unNormHistMin, mean, _standardDeviation[i], _histNormValues)), + std::min(min, normalizeWithStandardScore(unNormHistMin, mean, _standardDeviation[i], _histNormValues)), std::min(max, normalizeWithStandardScore(unNormHistMax, mean, _standardDeviation[i], _histNormValues)), numBins ); diff --git a/modules/iswa/util/dataprocessor.h b/modules/iswa/util/dataprocessor.h index 923bae21b0..8c3dec76ac 100644 --- a/modules/iswa/util/dataprocessor.h +++ b/modules/iswa/util/dataprocessor.h @@ -66,7 +66,7 @@ protected: glm::vec2 _normValues; glm::vec2 _filterValues; - std::vector _min; + std::vector _min; std::vector _max; std::vector _sum; std::vector _standardDeviation; diff --git a/modules/iswa/util/dataprocessorjson.cpp b/modules/iswa/util/dataprocessorjson.cpp index 8b21e67eda..880b721af8 100644 --- a/modules/iswa/util/dataprocessorjson.cpp +++ b/modules/iswa/util/dataprocessorjson.cpp @@ -100,10 +100,13 @@ void DataProcessorJson::addDataValues(std::string data, properties::SelectionPro } } -std::vector DataProcessorJson::processData(std::string data, properties::SelectionProperty& dataOptions, glm::size3_t& dimensions){ - if(!data.empty()){ +std::vector DataProcessorJson::processData(std::string data, + properties::SelectionProperty& dataOptions, + glm::size3_t& dimensions) +{ + if (!data.empty()) { json j = json::parse(data); - json variables = j["variables"]; + json variables = j["variables"]; std::vector selectedOptions = dataOptions.value(); // int numSelected = selectedOptions.size(); diff --git a/modules/iswa/util/dataprocessorkameleon.cpp b/modules/iswa/util/dataprocessorkameleon.cpp index 6615b33af0..7864999e13 100644 --- a/modules/iswa/util/dataprocessorkameleon.cpp +++ b/modules/iswa/util/dataprocessorkameleon.cpp @@ -52,10 +52,10 @@ std::vector DataProcessorKameleon::readMetadata(std::string path, g std::vector opts = _kw->getVariables(); opts.erase( std::remove_if( - opts.begin(), - opts.end(), + opts.begin(), + opts.end(), [this](std::string opt){ return (opt.size() > 3 || _coordinateVariables.find(opt) != _coordinateVariables.end());} - ), + ), opts.end() ); return opts; @@ -100,7 +100,7 @@ void DataProcessorKameleon::addDataValues(std::string path, properties::Selectio } std::vector DataProcessorKameleon::processData(std::string path, properties::SelectionProperty& dataOptions, glm::size3_t& dimensions, float slice){ _slice = slice; - // _dimensions = dimensions; + // _dimensions = dimensions; return processData(path, dataOptions, dimensions); } diff --git a/modules/iswa/util/dataprocessortext.cpp b/modules/iswa/util/dataprocessortext.cpp index 4e461b77df..11f8f85bfc 100644 --- a/modules/iswa/util/dataprocessortext.cpp +++ b/modules/iswa/util/dataprocessortext.cpp @@ -86,7 +86,7 @@ std::vector DataProcessorText::readMetadata(std::string data, glm:: } void DataProcessorText::addDataValues(std::string data, properties::SelectionProperty& dataOptions){ - int numOptions = dataOptions.options().size(); + int numOptions = dataOptions.options().size(); initializeVectors(numOptions); if(!data.empty()){ @@ -185,13 +185,13 @@ std::vector DataProcessorText::processData(std::string data, properties: // ); // for(int option : selectedOptions){ - // value = values[option]; + // value = values[option]; // //value = values[option+3]; //+3 because options x, y and z in the file // dataOptions[option][numValues] = processDataPoint(value, option); // } // ----------- OLD METHODS ------------------------ -// first = 0; +// first = 0; last = 0; option = -3; lineSize = line.size(); @@ -202,8 +202,12 @@ std::vector DataProcessorText::processData(std::string data, properties: last = line.find_first_of(" \t", first); last = (last > 0)? last : lineSize; - if (option >= 0 && std::find(selectedOptions.begin(), selectedOptions.end(), option) != selectedOptions.end()){ - // boost::spirit::qi::parse(&line[first], &line[last], boost::spirit::qi::float_, value); + auto it = std::find( + selectedOptions.begin(), + selectedOptions.end(), + option + ); + if (option >= 0 && it != selectedOptions.end()) { value = std::stof(line.substr(first, last)); dataOptions[option][numValues] = processDataPoint(value, option); } diff --git a/modules/iswa/util/iswamanager.cpp b/modules/iswa/util/iswamanager.cpp index 7c0f472585..60f58d2f5b 100644 --- a/modules/iswa/util/iswamanager.cpp +++ b/modules/iswa/util/iswamanager.cpp @@ -140,7 +140,7 @@ void IswaManager::addIswaCygnet(int id, std::string type, std::string group) { } // This callback determines what geometry should be used and creates the right cygbet - auto metadataCallback = + auto metadataCallback = [this, metaFuture](const DownloadManager::MemoryFile& file) { //Create a string from downloaded file std::string res; @@ -201,7 +201,7 @@ std::future IswaManager::fetchImageCygnet(int id, d std::to_string(id) + ": " + err ); } - ) ); + ) ); } std::future IswaManager::fetchDataCygnet(int id, double timestamp) { @@ -219,7 +219,7 @@ std::future IswaManager::fetchDataCygnet(int id, do std::to_string(id) + ": " + err ); } - ) ); + ) ); } std::string IswaManager::iswaUrl(int id, double timestamp, std::string type) { @@ -228,15 +228,15 @@ std::string IswaManager::iswaUrl(int id, double timestamp, std::string type) { url = _baseUrl + type+"/" + std::to_string(-id) + "/"; } else { url = "http://iswa3.ccmc.gsfc.nasa.gov/IswaSystemWebApp/iSWACygnetStreamer?window=-1&cygnetId="+ std::to_string(id) +"×tamp="; - } + } - //std::string t = Time::ref().currentTimeUTC(); + //std::string t = Time::ref().currentTimeUTC(); std::string t = SpiceManager::ref().dateFromEphemerisTime(timestamp); std::stringstream ss(t); std::string token; std::getline(ss, token, ' '); - url += token + "-"; + url += token + "-"; std::getline(ss, token, ' '); url += _month[token] + "-"; std::getline(ss, token, 'T'); @@ -347,7 +347,7 @@ std::string IswaManager::jsonPlaneToLuaTable(std::shared_ptr dat std::string table = "{" "Name = '" + data->name +"' , " "Parent = '" + parent + "', " - "Renderable = {" + "Renderable = {" "Type = '" + _type[data->type] + _geom[data->geom] + "', " "Id = " + std::to_string(data->id) + ", " "Frame = '" + frame + "' , " @@ -396,8 +396,8 @@ std::string IswaManager::parseKWToLuaTable(CdfInfo info, std::string cut) { std::string table = "{" "Name = '" +info.name+ "'," - "Parent = '" + parent + "', " - "Renderable = {" + "Parent = '" + parent + "', " + "Renderable = {" "Type = 'KameleonPlane', " "Id = 0 ," "Frame = '" + frame + "' , " @@ -405,7 +405,7 @@ std::string IswaManager::parseKWToLuaTable(CdfInfo info, std::string cut) { "GridMax = " + std::to_string(max) + ", " "SpatialScale = " + std::to_string(spatialScale) + ", " "UpdateTime = 0, " - "kwPath = '" + info.path + "' ," + "kwPath = '" + info.path + "' ," "axisCut = '"+cut+"'," "CoordinateType = '" + coordinateType + "', " "Group = '"+ info.group + "'," @@ -413,7 +413,7 @@ std::string IswaManager::parseKWToLuaTable(CdfInfo info, std::string cut) { "fieldlineSeedsIndexFile = '"+info.fieldlineSeedsIndexFile+"'" "}" "}" - ; + ; return table; } } @@ -452,7 +452,7 @@ std::string IswaManager::jsonSphereToLuaTable(std::shared_ptr da std::string table = "{" "Name = '" + data->name +"' , " "Parent = '" + parent + "', " - "Renderable = {" + "Renderable = {" "Type = '" + _type[data->type] + _geom[data->geom] + "', " "Id = " + std::to_string(data->id) + ", " "Frame = '" + frame + "' , " @@ -648,7 +648,7 @@ void IswaManager::fillCygnetInfo(std::string jsonString) { }; _cygnetInformation[jCygnet["cygnetID"]] = std::make_shared(info); } - } + } } } diff --git a/modules/iswa/util/iswamanager.h b/modules/iswa/util/iswamanager.h index f12876031f..814582e1ab 100644 --- a/modules/iswa/util/iswamanager.h +++ b/modules/iswa/util/iswamanager.h @@ -64,7 +64,7 @@ namespace openspace { class IswaBaseGroup; -class IswaCygnet; +class IswaCygnet; struct CdfInfo { std::string name; diff --git a/modules/iswa/util/iswamanager_lua.inl b/modules/iswa/util/iswamanager_lua.inl index 53a4e7b304..4484d0bd7f 100644 --- a/modules/iswa/util/iswamanager_lua.inl +++ b/modules/iswa/util/iswamanager_lua.inl @@ -71,7 +71,7 @@ int iswa_addScreenSpaceCygnet(lua_State* L) { float id; d.getValue("CygnetId", id); - auto cygnetInformation = IswaManager::ref().cygnetInformation(); + auto cygnetInformation = IswaManager::ref().cygnetInformation(); if (cygnetInformation.find((int)id) == cygnetInformation.end()) { LWARNING("Could not find Cygnet with id = " + std::to_string(id)); return 0; @@ -131,7 +131,7 @@ int iswa_removeScrenSpaceCygnet(lua_State* L) { int id = static_cast(lua_tonumber(L, 1)); - auto cygnetInformation = IswaManager::ref().cygnetInformation(); + auto cygnetInformation = IswaManager::ref().cygnetInformation(); if (cygnetInformation.find(id) == cygnetInformation.end()) { LWARNING("Could not find Cygnet with id = " + std::to_string(id)); return 0; @@ -152,7 +152,7 @@ int iswa_removeGroup(lua_State* L) { std::string name = luaL_checkstring(L, -1); // IswaManager::ref().unregisterGroup(id); - auto groups = IswaManager::ref().groups(); + auto groups = IswaManager::ref().groups(); if (groups.find(name) != groups.end()) { groups[name]->clearGroup(); } @@ -171,7 +171,7 @@ int iswa_addKameleonPlanes(lua_State* L) { std::string group = luaL_checkstring(L, 1); int pos = static_cast(lua_tonumber(L, 2)); IswaManager::ref().addKameleonCdf(group, pos); - // auto cdfInfo = + // auto cdfInfo = return 0; } diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index d7dc43ab0d..b317796e1e 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -172,7 +172,9 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict std::string transferFunctionPath; if (dictionary.getValue(KeyTransferFunction, transferFunctionPath)) { _transferFunctionPath = transferFunctionPath; - _transferFunction = std::make_shared(absPath(transferFunctionPath)); + _transferFunction = std::make_shared( + absPath(transferFunctionPath) + ); } std::string sourcePath; @@ -234,8 +236,14 @@ RenderableKameleonVolume::RenderableKameleonVolume(const ghoul::Dictionary& dict _cache = cache; } - _gridType.addOption(static_cast(volume::VolumeGridType::Cartesian), "Cartesian grid"); - _gridType.addOption(static_cast(volume::VolumeGridType::Spherical), "Spherical grid"); + _gridType.addOption( + static_cast(volume::VolumeGridType::Cartesian), + "Cartesian grid" + ); + _gridType.addOption( + static_cast(volume::VolumeGridType::Spherical), + "Spherical grid" + ); _gridType.setValue(static_cast(volume::VolumeGridType::Cartesian)); std::string gridType; @@ -256,7 +264,11 @@ void RenderableKameleonVolume::initialize() { _volumeTexture->uploadTexture(); _transferFunction->update(); - _raycaster = std::make_unique(_volumeTexture, _transferFunction, _clipPlanes); + _raycaster = std::make_unique( + _volumeTexture, + _transferFunction, + _clipPlanes + ); _raycaster->setStepSize(_stepSize); _gridType.onChange([this] { @@ -409,7 +421,12 @@ void RenderableKameleonVolume::loadCdf(const std::string& path) { } ghoul::Dictionary dict = reader.readMetaData(); - _rawVolume = reader.readFloatVolume(_dimensions, _variable, _lowerDomainBound, _upperDomainBound); + _rawVolume = reader.readFloatVolume( + _dimensions, + _variable, + _lowerDomainBound, + _upperDomainBound + ); updateTextureFromVolume(); } diff --git a/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp b/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp index c61581477b..80714452d0 100644 --- a/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp +++ b/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp @@ -38,7 +38,8 @@ namespace { const char* KeyInput = "Input"; const char* KeyOutput = "Output"; - const char* MainTemplateFilename = "${OPENSPACE_DATA}/web/kameleondocumentation/main.hbs"; + const char* MainTemplateFilename = + "${OPENSPACE_DATA}/web/kameleondocumentation/main.hbs"; const char* HandlebarsFilename = "${OPENSPACE_DATA}/web/common/handlebars-v4.0.5.js"; const char* JsFilename = "${OPENSPACE_DATA}/web/kameleondocumentation/script.js"; const char* BootstrapFilename = "${OPENSPACE_DATA}/web/common/bootstrap.min.css"; @@ -48,7 +49,8 @@ namespace { namespace openspace { namespace kameleonvolume { -KameleonDocumentationTask::KameleonDocumentationTask(const ghoul::Dictionary& dictionary) { +KameleonDocumentationTask::KameleonDocumentationTask(const ghoul::Dictionary& dictionary) +{ openspace::documentation::testSpecificationAndThrow( documentation(), dictionary, @@ -90,8 +92,16 @@ void KameleonDocumentationTask::perform(const Task::ProgressCallback & progressC std::string jsContent; std::back_insert_iterator jsInserter(jsContent); - std::copy(std::istreambuf_iterator{handlebarsInput}, std::istreambuf_iterator(), jsInserter); - std::copy(std::istreambuf_iterator{jsInput}, std::istreambuf_iterator(), jsInserter); + std::copy( + std::istreambuf_iterator{handlebarsInput}, + std::istreambuf_iterator(), + jsInserter + ); + std::copy( + std::istreambuf_iterator{jsInput}, + std::istreambuf_iterator(), + jsInserter + ); std::ifstream bootstrapInput(absPath(BootstrapFilename)); std::ifstream cssInput(absPath(CssFilename)); @@ -99,8 +109,16 @@ void KameleonDocumentationTask::perform(const Task::ProgressCallback & progressC std::string cssContent; std::back_insert_iterator cssInserter(cssContent); - std::copy(std::istreambuf_iterator{bootstrapInput}, std::istreambuf_iterator(), cssInserter); - std::copy(std::istreambuf_iterator{cssInput}, std::istreambuf_iterator(), cssInserter); + std::copy( + std::istreambuf_iterator{bootstrapInput}, + std::istreambuf_iterator(), + cssInserter + ); + std::copy( + std::istreambuf_iterator{cssInput}, + std::istreambuf_iterator(), + cssInserter + ); std::ifstream mainTemplateInput(absPath(MainTemplateFilename)); std::string mainTemplateContent{ std::istreambuf_iterator{mainTemplateInput}, diff --git a/modules/space/rendering/renderableplanet.cpp b/modules/space/rendering/renderableplanet.cpp index cad826fb14..d6c2853d11 100644 --- a/modules/space/rendering/renderableplanet.cpp +++ b/modules/space/rendering/renderableplanet.cpp @@ -279,9 +279,11 @@ RenderablePlanet::RenderablePlanet(const ghoul::Dictionary& dictionary) sourceName, sourceRadius)); } else { - LWARNING("No Radius value expecified for Shadow Source Name " - << sourceName << " from " << name - << " planet.\nDisabling shadows for this planet."); + LWARNING( + "No Radius value expecified for Shadow Source Name " + << sourceName << " from " << name + << " planet.\nDisabling shadows for this planet." + ); disableShadows = true; break; } @@ -342,14 +344,14 @@ void RenderablePlanet::initialize() { "shadowNightProgram", "${MODULE_SPACE}/shaders/shadow_nighttexture_vs.glsl", "${MODULE_SPACE}/shaders/shadow_nighttexture_fs.glsl"); - } + } else if (_programObject == nullptr && _shadowEnabled) { // shadow program _programObject = renderEngine.buildRenderProgram( "shadowProgram", "${MODULE_SPACE}/shaders/shadow_vs.glsl", "${MODULE_SPACE}/shaders/shadow_fs.glsl"); - } + } else if (_programObject == nullptr && _hasNightTexture) { // Night texture program _programObject = renderEngine.buildRenderProgram( @@ -433,7 +435,7 @@ void RenderablePlanet::render(const RenderData& data, RendererTasks&) { _programObject->setUniform("transparency", _alpha); _programObject->setUniform( - "modelViewProjectionTransform", + "modelViewProjectionTransform", data.camera.projectionMatrix() * glm::mat4(modelViewTransform) ); _programObject->setUniform("ModelTransform", glm::mat4(modelTransform)); diff --git a/modules/space/rendering/renderableplanet.h b/modules/space/rendering/renderableplanet.h index 8ead4e4fe8..1dc59d2fc4 100644 --- a/modules/space/rendering/renderableplanet.h +++ b/modules/space/rendering/renderableplanet.h @@ -88,7 +88,7 @@ private: std::unique_ptr _programObject; std::unique_ptr _texture; - std::unique_ptr _nightTexture; + std::unique_ptr _nightTexture; std::unique_ptr _heightMapTexture; properties::FloatProperty _heightExaggeration; diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index 8912cd6129..df3489f73e 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -321,7 +321,7 @@ void RenderableStars::render(const RenderData& data, RendererTasks&) { // @Check overwriting the scaling from the camera; error as parsec->meter conversion // is done twice? ---abock - glm::vec2 scaling = glm::vec2(1, -19); + glm::vec2 scaling = glm::vec2(1, -19); glm::mat4 modelMatrix = glm::mat4(1.0); glm::mat4 viewMatrix = data.camera.viewMatrix(); diff --git a/modules/space/translation/keplertranslation.cpp b/modules/space/translation/keplertranslation.cpp index b2aa8bb9d3..309f597d06 100644 --- a/modules/space/translation/keplertranslation.cpp +++ b/modules/space/translation/keplertranslation.cpp @@ -220,7 +220,7 @@ KeplerTranslation::KeplerTranslation() addProperty(_period); } -KeplerTranslation::KeplerTranslation(const ghoul::Dictionary& dictionary) +KeplerTranslation::KeplerTranslation(const ghoul::Dictionary& dictionary) : KeplerTranslation() { documentation::testSpecificationAndThrow( diff --git a/modules/space/translation/tletranslation.h b/modules/space/translation/tletranslation.h index bdcc737cf8..fae1fab8fc 100644 --- a/modules/space/translation/tletranslation.h +++ b/modules/space/translation/tletranslation.h @@ -63,7 +63,7 @@ private: /** * Reads the provided TLE file and calles the KeplerTranslation::setKeplerElments * method with the correct values. If \p filename is a valid TLE file but contains - * disallowed values (see KeplerTranslation::setKeplerElements), a + * disallowed values (see KeplerTranslation::setKeplerElements), a * KeplerTranslation::RangeError is thrown. * \param filename The path to the file that contains the TLE file. * \param lineNum The line number in the file where the set of 3 TLE lines starts diff --git a/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp b/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp index 51d4014f91..45aa195974 100644 --- a/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp +++ b/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp @@ -196,7 +196,7 @@ void RenderableCrawlingLine::render(const RenderData& data, RendererTasks&) { data.camera.projectionMatrix() * glm::mat4(data.camera.combinedViewMatrix() * modelTransform - ) + ) ; //glm::dmat4 modelViewTransform = data.camera.combinedViewMatrix() * modelTransform; @@ -283,7 +283,7 @@ void RenderableCrawlingLine::update(const UpdateData& data) { glBindBuffer(GL_ARRAY_BUFFER, _vbo); glBufferSubData( - GL_ARRAY_BUFFER, + GL_ARRAY_BUFFER, 0, 2 * sizeof(VBOData), vboData diff --git a/modules/spacecraftinstruments/rendering/renderablefov.cpp b/modules/spacecraftinstruments/rendering/renderablefov.cpp index 2612b023fb..233b09549e 100644 --- a/modules/spacecraftinstruments/rendering/renderablefov.cpp +++ b/modules/spacecraftinstruments/rendering/renderablefov.cpp @@ -428,7 +428,7 @@ bool RenderableFov::isReady() const { // Orthogonal projection next to planets surface glm::dvec3 RenderableFov::orthogonalProjection(const glm::dvec3& vecFov, double time, - const std::string& target) const + const std::string& target) const { glm::dvec3 vecToTarget = SpiceManager::ref().targetPosition( target, @@ -714,13 +714,13 @@ void RenderableFov::computeIntercepts(const UpdateData& data, const std::string& const double t2 = 0.5 + bisect(half, jBound, intercepts); // - // The target is sticking out somewhere between i and j, so we + // The target is sticking out somewhere between i and j, so we // have three regions here: // The first (0,t1) and second (t2,1) are not intersecting // The third between (t1,t2) is intersecting // - // i p1 p2 j - // ***** + // i p1 p2 j + // ***** // x-------* *-------x // 0 t1 t2 1 @@ -806,7 +806,7 @@ void RenderableFov::computeIntercepts(const UpdateData& data, const std::string& // SpiceManager::ref().surfaceIntercept( // target, // _instrument.spacecraft, - // _instrument.name, + // _instrument.name, // bodyfixed, // _instrument.aberrationCorrection, // data.time, @@ -825,7 +825,7 @@ void RenderableFov::computeIntercepts(const UpdateData& data, const std::string& // bool intercepted = res.interceptFound; // if (intercepted) { - // // find the two outer most points of intersection + // // find the two outer most points of intersection // glm::dvec3 root1 = bisection(half, current, data.time, target); // glm::dvec3 root2 = bisection(half, next, data.time, target); @@ -1022,7 +1022,7 @@ void RenderableFov::computeIntercepts(const UpdateData& data, const std::string& if (interceptTag[i] == false) { // If point is non-interceptive, project it. insertPoint( _fovPlane, - glm::vec4(orthogonalProjection(current, data.time, target), 0.0), + glm::vec4(orthogonalProjection(current, data.time, target), 0.0), tmp ); _rebuild = true; @@ -1064,7 +1064,7 @@ void RenderableFov::computeIntercepts(const UpdateData& data, const std::string& bool intercepted = res.interceptFound; if (intercepted) { - // find the two outer most points of intersection + // find the two outer most points of intersection glm::dvec3 root1 = bisection(half, current, data.time, target); glm::dvec3 root2 = bisection(half, next, data.time, target); @@ -1122,7 +1122,7 @@ void RenderableFov::computeIntercepts(const UpdateData& data, const std::string& for (int j = 1; j <= InterpolationSteps; ++j) { float t = (static_cast(j) / InterpolationSteps); interpolated = interpolate(mid, next, t); - glm::dvec3 ivec = + glm::dvec3 ivec = (j > 1) ? checkForIntercept(interpolated, data.time, target) : orthogonalProjection(interpolated, data.time, target); @@ -1353,7 +1353,7 @@ void RenderableFov::updateGPU() { // ); //} //else { - // // new points - memory change + // // new points - memory change // glBindVertexArray(_orthogonalPlane.vao); // glBindBuffer(GL_ARRAY_BUFFER, _orthogonalPlane.vbo); // glBufferData( diff --git a/modules/spacecraftinstruments/rendering/renderablefov.h b/modules/spacecraftinstruments/rendering/renderablefov.h index 02bf625b42..b9c4fbae7e 100644 --- a/modules/spacecraftinstruments/rendering/renderablefov.h +++ b/modules/spacecraftinstruments/rendering/renderablefov.h @@ -116,7 +116,7 @@ private: float _interpolationTime; struct RenderInformation { - // Differentiating different vertex types + // Differentiating different vertex types using VertexColorType = int32_t; // This needs to be synced with the fov_vs.glsl shader static const VertexColorType VertexColorTypeDefaultStart = 0; diff --git a/modules/spacecraftinstruments/rendering/renderablemodelprojection.h b/modules/spacecraftinstruments/rendering/renderablemodelprojection.h index feb97b823b..e487c35b97 100644 --- a/modules/spacecraftinstruments/rendering/renderablemodelprojection.h +++ b/modules/spacecraftinstruments/rendering/renderablemodelprojection.h @@ -43,7 +43,7 @@ namespace ghoul::opengl { namespace openspace { -namespace documentation { struct Documentation; } +namespace documentation { struct Documentation; } struct RenderData; struct UpdateData; diff --git a/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp b/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp index 5f85e63803..4e75eab50a 100644 --- a/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp @@ -221,8 +221,8 @@ void RenderablePlaneProjection::updatePlane(const Image& img, double currentTime glm::dvec3 boresight; std::string target = _defaultTarget; - // Turned on if the plane should be attached to the closest target, - // rather than the target specified in img + // Turned on if the plane should be attached to the closest target, + // rather than the target specified in img //if (!_moving) { // target = findClosestTarget(currentTime); //} @@ -290,7 +290,7 @@ void RenderablePlaneProjection::updatePlane(const Image& img, double currentTime ); if (thisNode && newParent) { thisNode->setParent(*newParent); - } + } } const GLfloat vertex_data[] = { diff --git a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp index f0b1b6219c..9f1bc301e2 100644 --- a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp @@ -184,7 +184,7 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary& std::string texturePath = ""; success = dict.getValue(ColorTextureInfo.identifier, texturePath); if (success) { - _colorTexturePath = absPath(texturePath); + _colorTexturePath = absPath(texturePath); } std::string heightMapPath = ""; @@ -241,7 +241,7 @@ void RenderablePlanetProjection::initialize() { _geometry->initialize(this); //completeSuccess &= auxiliaryRendertarget(); - // SCREEN-QUAD + // SCREEN-QUAD const GLfloat size = 1.f; const GLfloat w = 1.f; const GLfloat vertex_data[] = { @@ -308,7 +308,7 @@ void RenderablePlanetProjection::imageProjectGPU( _fboProgramObject->setUniform("_scaling" , _camScaling); _fboProgramObject->setUniform("boresight" , _boresight); - if (_geometry->hasProperty("Radius")){ + if (_geometry->hasProperty("Radius")) { ghoul::any r = _geometry->property("Radius")->get(); if (glm::vec3* radius = ghoul::any_cast(&r)){ _fboProgramObject->setUniform("_radius", radius); @@ -339,7 +339,7 @@ void RenderablePlanetProjection::attitudeParameters(double time) { ); _transform = glm::mat4(1); - //90 deg rotation w.r.t spice req. + //90 deg rotation w.r.t spice req. glm::mat4 rot = glm::rotate( _transform, static_cast(M_PI_2), @@ -376,7 +376,7 @@ void RenderablePlanetProjection::attitudeParameters(double time) { ); psc position = PowerScaledCoordinate::CreatePowerScaledCoordinate(p.x, p.y, p.z); - //change to KM and add psc camera scaling. + //change to KM and add psc camera scaling. position[3] += (3 + _camScaling[1]); //position[3] += 3; glm::vec3 cpos = position.vec3(); diff --git a/modules/spacecraftinstruments/util/hongkangparser.cpp b/modules/spacecraftinstruments/util/hongkangparser.cpp index f2297f734b..a38a2e03f4 100644 --- a/modules/spacecraftinstruments/util/hongkangparser.cpp +++ b/modules/spacecraftinstruments/util/hongkangparser.cpp @@ -41,7 +41,7 @@ namespace { namespace openspace { -HongKangParser::HongKangParser(std::string name, std::string fileName, +HongKangParser::HongKangParser(std::string name, std::string fileName, std::string spacecraft, ghoul::Dictionary translationDictionary, std::vector potentialTargets) @@ -84,7 +84,7 @@ HongKangParser::HongKangParser(std::string name, std::string fileName, } void HongKangParser::findPlaybookSpecifiedTarget(std::string line, std::string& target) { - //remembto add this lua later... + //remembto add this lua later... std::transform( line.begin(), line.end(), @@ -100,14 +100,14 @@ void HongKangParser::findPlaybookSpecifiedTarget(std::string line, std::string& break; } else { - // not found - we set void until we have more info. + // not found - we set void until we have more info. target = "VOID"; } } } bool HongKangParser::create() { - //check input for errors. + //check input for errors. bool hasObserver = SpiceManager::ref().hasNaifId(_spacecraft); if (!hasObserver) { throw ghoul::RuntimeError( @@ -160,7 +160,7 @@ bool HongKangParser::create() { while (!file.eof()) { std::getline(file, line); - std::string event = line.substr(0, line.find_first_of(" ")); + std::string event = line.substr(0, line.find_first_of(" ")); auto it = _fileTranslation.find(event); bool foundEvent = (it != _fileTranslation.end()); @@ -169,7 +169,7 @@ bool HongKangParser::create() { double time = getETfromMet(met); if (foundEvent){ - //store the time, this is used for getNextCaptureTime() + //store the time, this is used for getNextCaptureTime() _captureProgression.push_back(time); if (it->second->getDecoderType() == "CAMERA") { @@ -215,10 +215,10 @@ bool HongKangParser::create() { // store actual image in map. All targets get _only_ their // corresp. subset. _subsetMap[image.target]._subset.push_back(image); - // compute and store the range for each subset + // compute and store the range for each subset _subsetMap[image.target]._range.include(time); } - if (it->second->getDecoderType() == "SCANNER") { // SCANNER START + if (it->second->getDecoderType() == "SCANNER") { // SCANNER START scan_start = time; InstrumentDecoder* scanner = static_cast( @@ -292,8 +292,8 @@ bool HongKangParser::create() { return true; } -bool HongKangParser::augmentWithSpice(Image& image, std::string spacecraft, - std::vector, +bool HongKangParser::augmentWithSpice(Image& image, std::string spacecraft, + std::vector, std::vector potentialTargets) { image.target = "VOID"; @@ -338,8 +338,6 @@ double HongKangParser::getETfromMet(double met) { const double referenceET = SpiceManager::ref().ephemerisTimeFromDate("2015-07-14T11:50:00.00"); - //_metRef += 3; // MET reference time is off by 3 sec? - const double diff = std::abs(met - _metRef); if (met > _metRef) { return referenceET + diff; diff --git a/modules/spacecraftinstruments/util/hongkangparser.h b/modules/spacecraftinstruments/util/hongkangparser.h index 8f774ae84b..3e348bc14d 100644 --- a/modules/spacecraftinstruments/util/hongkangparser.h +++ b/modules/spacecraftinstruments/util/hongkangparser.h @@ -43,7 +43,7 @@ private: double getETfromMet(std::string timestr); double getETfromMet(double met); - bool augmentWithSpice(Image& image, std::string spacecraft, + bool augmentWithSpice(Image& image, std::string spacecraft, std::vector payload, std::vector potentialTargets); std::string _defaultCaptureImage; diff --git a/modules/spacecraftinstruments/util/imagesequencer.cpp b/modules/spacecraftinstruments/util/imagesequencer.cpp index 3dc284197c..9561a17c66 100644 --- a/modules/spacecraftinstruments/util/imagesequencer.cpp +++ b/modules/spacecraftinstruments/util/imagesequencer.cpp @@ -159,7 +159,7 @@ std::pair> ImageSequencer::getIncidentTargetLis // move the iterator to the first element of the range std::advance(it, -(range + 1)); - // now extract incident range + // now extract incident range for (int i = 0; i < 2 * range + 1; i++){ incidentTargets.first = it->first; incidentTargets.second.push_back(it->second); @@ -220,7 +220,7 @@ std::map ImageSequencer::getActiveInstruments() { for (const auto& key : _fileTranslation) { // for each spice-instrument for (const auto& instrumentID : key.second->getTranslation()) { - // check if the spice-instrument is active + // check if the spice-instrument is active if (instrumentActive(instrumentID)) { // go over switching map for (const auto& instrument : _switchingMap) { @@ -240,11 +240,11 @@ std::map ImageSequencer::getActiveInstruments() { bool ImageSequencer::instrumentActive(std::string instrumentID) { for (const auto& i : _instrumentTimes) { //check if this instrument is in range - if (i.second.includes(_currentTime)) { + if (i.second.includes(_currentTime)) { //if so, then get the corresponding spiceID - std::vector spiceIDs = _fileTranslation[i.first]->getTranslation(); + std::vector ids = _fileTranslation[i.first]->getTranslation(); //check which specific subinstrument is firing - for (const auto& s : spiceIDs) { + for (const auto& s : ids) { if (s == instrumentID) { return true; } @@ -259,11 +259,13 @@ float ImageSequencer::instrumentActiveTime(const std::string& instrumentID) cons //check if this instrument is in range if (i.second.includes(_currentTime)){ //if so, then get the corresponding spiceID - std::vector spiceIDs = _fileTranslation.at(i.first)->getTranslation(); + std::vector ids = _fileTranslation.at(i.first)->getTranslation(); //check which specific subinstrument is firing - for (auto s : spiceIDs){ + for (auto s : ids){ if (s == instrumentID) { - return static_cast((_currentTime - i.second.start) / (i.second.end - i.second.start)); + return static_cast( + (_currentTime - i.second.start) / (i.second.end - i.second.start) + ); } } } @@ -271,14 +273,16 @@ float ImageSequencer::instrumentActiveTime(const std::string& instrumentID) cons return -1.f; } -bool ImageSequencer::getImagePaths(std::vector& captures, +bool ImageSequencer::getImagePaths(std::vector& captures, std::string projectee, std::string instrumentRequest){ - // check if this instance is either in range or - // a valid candidate to recieve data - if (!instrumentActive(instrumentRequest) && !OsEng.timeManager().time().timeJumped()) return false; - + // check if this instance is either in range or + // a valid candidate to recieve data + if (!instrumentActive(instrumentRequest) && !OsEng.timeManager().time().timeJumped()) + { + return false; + } //if (!Time::ref().timeJumped() && projectee == getCurrentTarget().second) if (_subsetMap[projectee]._range.includes(_currentTime) || @@ -286,14 +290,14 @@ bool ImageSequencer::getImagePaths(std::vector& captures, auto compareTime = [](const Image &a, const Image &b)->bool{ return a.timeRange.start < b.timeRange.start; - }; + }; // for readability we store the iterators - auto begin = _subsetMap[projectee]._subset.begin(); + auto begin = _subsetMap[projectee]._subset.begin(); auto end = _subsetMap[projectee]._subset.end(); // create temporary storage std::vector captureTimes; - // what to look for + // what to look for Image findPrevious, findCurrent; findPrevious.timeRange.start = _previousTime; findCurrent.timeRange.start = _currentTime; @@ -302,18 +306,21 @@ bool ImageSequencer::getImagePaths(std::vector& captures, auto curr = std::lower_bound(begin, end, findCurrent , compareTime); auto prev = std::lower_bound(begin, end, findPrevious, compareTime); - if (curr != begin && curr != end && prev != begin && prev != end && prev < curr){ - if (curr->timeRange.start >= prev->timeRange.start){ - std::copy_if(prev, curr, back_inserter(captureTimes), + if (curr != begin && curr != end && prev != begin && prev != end && prev < curr) + { + if (curr->timeRange.start >= prev->timeRange.start) { + std::copy_if(prev, curr, back_inserter(captureTimes), [instrumentRequest](const Image& i) { - bool correctInstrument = i.activeInstruments[0] == instrumentRequest; - return correctInstrument; - }); + return i.activeInstruments[0] == instrumentRequest; + } + ); //std::reverse(captureTimes.begin(), captureTimes.end()); captures = captureTimes; - if (!captures.empty()) - _latestImages[captures.back().activeInstruments.front()] = captures.back(); + if (!captures.empty()) { + _latestImages[captures.back().activeInstruments.front()] = + captures.back(); + } std::vector toDelete; for (auto it = captures.begin(); it != captures.end(); ++it) { @@ -321,13 +328,17 @@ bool ImageSequencer::getImagePaths(std::vector& captures, double beforeDist = std::numeric_limits::max(); if (it != captures.begin()) { auto before = std::prev(it); - beforeDist = std::abs(before->timeRange.start - it->timeRange.start); + beforeDist = std::abs( + before->timeRange.start - it->timeRange.start + ); } double nextDist = std::numeric_limits::max(); if (it != captures.end() - 1) { auto next = std::next(it); - nextDist = std::abs(next->timeRange.start - it->timeRange.start); + nextDist = std::abs( + next->timeRange.start - it->timeRange.start + ); } if (beforeDist < 1.0 || nextDist < 1.0) { @@ -371,7 +382,9 @@ void ImageSequencer::sortData() { std::sort( _instrumentTimes.begin(), _instrumentTimes.end(), - [](const std::pair& a, const std::pair& b) { + [](const std::pair& a, + const std::pair& b) + { return a.second.start < b.second.start; } ); @@ -380,12 +393,15 @@ void ImageSequencer::sortData() { void ImageSequencer::runSequenceParser(SequenceParser* parser){ bool parserComplete = parser->create(); if (parserComplete){ - // get new data - std::map>& translations = parser->getTranslation(); // in1 - std::map imageData = parser->getSubsetMap(); // in2 - std::vector> instrumentTimes = parser->getInstrumentTimes(); //in3 - std::vector> targetTimes = parser->getTargetTimes(); //in4 - std::vector captureProgression = parser->getCaptureProgression(); //in5 + // get new data + std::map>& translations = + parser->getTranslation(); + std::map imageData = parser->getSubsetMap(); + std::vector> instrumentTimes = + parser->getInstrumentTimes(); + std::vector> targetTimes = + parser->getTargetTimes(); + std::vector captureProgression = parser->getCaptureProgression(); // check for sanity if (imageData.empty() || instrumentTimes.empty() || captureProgression.empty()) { @@ -404,18 +420,20 @@ void ImageSequencer::runSequenceParser(SequenceParser* parser){ _subsetMap.insert(it); } else { std::string key = it.first; - std::vector &source = it.second._subset; // prediction + std::vector &source = it.second._subset; // prediction std::vector &destination = _subsetMap[key]._subset; // imagery // simple search function - double min = 10; + double min = 10; auto findMin = [&](std::vector &vector)->double{ - for (int i = 1; i < static_cast(vector.size()); i++){ - double e = std::abs(vector[i].timeRange.start - vector[i - 1].timeRange.start); - if (e < min){ + for (int i = 1; i < static_cast(vector.size()); ++i) { + double e = std::abs( + vector[i].timeRange.start - vector[i - 1].timeRange.start + ); + if (e < min) { min = e; } - } + } return min; }; @@ -426,42 +444,63 @@ void ImageSequencer::runSequenceParser(SequenceParser* parser){ // set epsilon as 1% smaller than min epsilon -= min * 0.01; - // IFF images have same time as mission planned capture, erase that event from - // 'predicted event file' (mission-playbook) - for (size_t i = 0; i < source.size(); i++) { - for (size_t j = 0; j < destination.size(); j++) { - double diff = std::abs(source[i].timeRange.start - destination[j].timeRange.start); - if (diff < epsilon){ + // IFF images have same time as mission planned capture, erase that event + // from 'predicted event file' (mission-playbook) + for (size_t i = 0; i < source.size(); ++i) { + for (size_t j = 0; j < destination.size(); ++j) { + double diff = std::abs( + source[i].timeRange.start - destination[j].timeRange.start + ); + if (diff < epsilon) { source.erase(source.begin() + i); } } } - // pad image data with predictions (ie - where no actual images, add placeholder) - _subsetMap[key]._subset.insert(_subsetMap[key]._subset.end(), source.begin(), source.end()); + // pad image data with predictions (ie - where no actual images, + // add placeholder) + _subsetMap[key]._subset.insert( + _subsetMap[key]._subset.end(), + source.begin(), + source.end() + ); } } - _instrumentTimes.insert(_instrumentTimes.end(), instrumentTimes.begin(), instrumentTimes.end()); - _targetTimes.insert(_targetTimes.end(), targetTimes.begin(), targetTimes.end()); - _captureProgression.insert(_captureProgression.end(), captureProgression.begin(), captureProgression.end()); + _instrumentTimes.insert( + _instrumentTimes.end(), + instrumentTimes.begin(), + instrumentTimes.end() + ); + _targetTimes.insert( + _targetTimes.end(), + targetTimes.begin(), + targetTimes.end() + ); + _captureProgression.insert( + _captureProgression.end(), + captureProgression.begin(), + captureProgression.end() + ); // sorting of data _not_ optional sortData(); - // extract payload from _fileTranslation - for (auto& t : _fileTranslation){ + // extract payload from _fileTranslation + for (auto& t : _fileTranslation) { if (t.second->getDecoderType() == "CAMERA" || - t.second->getDecoderType() == "SCANNER"){ + t.second->getDecoderType() == "SCANNER") + { std::vector spiceIDs = t.second->getTranslation(); - for (auto id : spiceIDs){ + for (auto id : spiceIDs) { _switchingMap[id] = false; } } } _hasData = true; } - else + else { LERROR("One or more sequence loads failed; please check mod files"); + } } } // namespace openspace diff --git a/modules/spacecraftinstruments/util/imagesequencer.h b/modules/spacecraftinstruments/util/imagesequencer.h index 77920691d2..dfcb6f149e 100644 --- a/modules/spacecraftinstruments/util/imagesequencer.h +++ b/modules/spacecraftinstruments/util/imagesequencer.h @@ -39,13 +39,13 @@ class SequenceParser; /** * The ImageSequencer singleton main function is to manage the timekeeping and -* distribution of 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 +* distribution of 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 private members. +* 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 * \see ImageSequencer::runSequenceParser(SequenceParser* parser) * std::map @@ -78,17 +78,17 @@ public: /** * Updates sequencer with current time. This is used internally for keeping - * track of both current simulation time and the time of the previously rendered frame. - */ + * track of both current simulation time and the time of the previously rendered frame. + */ void updateSequencer(const Time& time); /** - * Runs parser and recieves the datastructures filled by it. + * Runs parser and recieves the datastructures filled by it. * \see SequenceParser */ void runSequenceParser(SequenceParser* parser); /** - * Retrieves the next upcoming target in time. + * Retrieves the next upcoming target in time. */ std::pair getNextTarget(); @@ -103,32 +103,32 @@ public: std::pair> getIncidentTargetList(int range = 2); /** - * Retrieves the next upcoming time of image capture. + * Retrieves the next upcoming time of image capture. */ double getNextCaptureTime(); /** - * Retrieves the time interval length between the current time and an upcoming capture. + * Retrieves the time interval length between the current time and an upcoming capture. */ double getIntervalLength(); /* * Returns a map with key instrument names whose value indicate whether - * an instrument is active or not. + * an instrument is active or not. */ std::map getActiveInstruments(); /* * Retrieves the relevant data from a specific subset based on the what instance * makes the request. If an instance is not registered in the class then the singleton - * returns false and no projections will occur. + * returns false and no projections will occur. */ bool getImagePaths(std::vector& captures, std::string projectee, std::string instrumentRequest); /* - * returns true if instrumentID is within a capture range. + * returns true if instrumentID is within a capture range. */ bool instrumentActive(std::string instrumentID); @@ -143,9 +143,9 @@ private: void sortData(); /* - * _fileTranslation handles any types of ambiguities between the data and - * spice/openspace -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 + * _fileTranslation handles any types of ambiguities between the data and + * spice/openspace -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 a modfile. * \see Decoder * \see (projection mod files) @@ -153,8 +153,8 @@ private: std::map> _fileTranslation; /* - * This is the main container of image data. The key is the target name, - * the value is a subset of images. + * This is the main container of image data. The key is the target name, + * the value is a subset of images. * \see SequenceParser */ std::map _subsetMap; @@ -163,24 +163,24 @@ private: * In order for the simulation to know when to turn on/off any instrument within * all instruments in the spacecraft payload, the key is the data-file given * instrument name. - */ + */ std::map _switchingMap; /* - * This datastructure holds the specific times when the spacecraft switches from - * observing one inertial body to the next. This happens a lot in such missions - * and the coupling of target with specific time is usually therefore not 1:1. + * This datastructure holds the specific times when the spacecraft switches from + * observing one inertial body to the next. This happens a lot in such missions + * and the coupling of target with specific time is usually therefore not 1:1. */ std::vector> _targetTimes; /* * Holds the time ranges of each instruments on and off periods. An instrument - * rendering class may ask the ImageSequencer whether or not it + * rendering class may ask the ImageSequencer whether or not it */ std::vector> _instrumentTimes; /* - * Each consecutive images capture time, for easier traversal. + * Each consecutive images capture time, for easier traversal. */ std::vector _captureProgression; @@ -196,7 +196,7 @@ private: std::string _defaultCaptureImage; std::map _latestImages; - // if no data, no run + // if no data, no run bool _hasData; }; diff --git a/modules/spacecraftinstruments/util/instrumenttimesparser.cpp b/modules/spacecraftinstruments/util/instrumenttimesparser.cpp index 703626887f..4490b915e7 100644 --- a/modules/spacecraftinstruments/util/instrumenttimesparser.cpp +++ b/modules/spacecraftinstruments/util/instrumenttimesparser.cpp @@ -114,7 +114,7 @@ bool InstrumentTimesParser::create() { continue; } - // Read file into string + // Read file into string std::ifstream inFile(filepath); std::string line; std::smatch matches; diff --git a/modules/spacecraftinstruments/util/labelparser.cpp b/modules/spacecraftinstruments/util/labelparser.cpp index f5bdcd1446..1a9750ce61 100644 --- a/modules/spacecraftinstruments/util/labelparser.cpp +++ b/modules/spacecraftinstruments/util/labelparser.cpp @@ -170,7 +170,7 @@ bool LabelParser::create() { if (position != std::string::npos){ ghoul::filesystem::File currentFile(path); std::string extension = currentFile.fileExtension(); - if (extension == "lbl" || extension == "LBL"){ // discovered header file + if (extension == "lbl" || extension == "LBL") { // discovered header file std::ifstream file(currentFile.path()); if (!file.good()){ @@ -224,13 +224,8 @@ bool LabelParser::create() { } if (read == "DETECTOR_TYPE"){ _detectorType = decode(line); - count++; + count++; } - // if (_badDecoding){ - // LERROR("Please examine file: '" << currentFile.path() << "'"); - // return false; - // } - if (read == "START_TIME"){ std::string start = line.substr(line.find("=") + 1); @@ -266,7 +261,9 @@ bool LabelParser::create() { ), stop.end() ); - stopTime = SpiceManager::ref().ephemerisTimeFromDate(stop); + stopTime = SpiceManager::ref().ephemerisTimeFromDate( + stop + ); count++; } else{ diff --git a/modules/spacecraftinstruments/util/labelparser.h b/modules/spacecraftinstruments/util/labelparser.h index 5728e23d87..9ed0723caa 100644 --- a/modules/spacecraftinstruments/util/labelparser.h +++ b/modules/spacecraftinstruments/util/labelparser.h @@ -52,9 +52,9 @@ private: std::string decode(std::string line); std::string encode(std::string line); - bool augmentWithSpice(Image& image, - std::string spacecraft, - std::vector payload, + bool augmentWithSpice(Image& image, + std::string spacecraft, + std::vector payload, std::vector potentialTargets); std::string _name; diff --git a/modules/spacecraftinstruments/util/projectioncomponent.cpp b/modules/spacecraftinstruments/util/projectioncomponent.cpp index fbed52475f..3f894ff910 100644 --- a/modules/spacecraftinstruments/util/projectioncomponent.cpp +++ b/modules/spacecraftinstruments/util/projectioncomponent.cpp @@ -465,7 +465,7 @@ void ProjectionComponent::imageProjectBegin() { // Generate the new textures generateProjectionLayerTexture(_textureSize); - if (_shadowing.isEnabled) { + if (_shadowing.isEnabled) { generateDepthTexture(_textureSize); } diff --git a/modules/spacecraftinstruments/util/projectioncomponent.h b/modules/spacecraftinstruments/util/projectioncomponent.h index d7332a887a..cc1a2d614f 100644 --- a/modules/spacecraftinstruments/util/projectioncomponent.h +++ b/modules/spacecraftinstruments/util/projectioncomponent.h @@ -74,7 +74,7 @@ public: glm::mat4 computeProjectorMatrix( const glm::vec3 loc, glm::dvec3 aim, const glm::vec3 up, const glm::dmat3& instrumentMatrix, - float fieldOfViewY, + float fieldOfViewY, float aspectRatio, float nearPlane, float farPlane, diff --git a/modules/touch/include/touchinteraction.h b/modules/touch/include/touchinteraction.h index 25f832102e..6d3fee3a82 100644 --- a/modules/touch/include/touchinteraction.h +++ b/modules/touch/include/touchinteraction.h @@ -72,7 +72,7 @@ public: std::vector selectedPoints; std::vector screenPoints; int nDOF; - glm::dvec2(*castToNDC)(glm::dvec3, Camera&, SceneGraphNode*); + glm::dvec2(*castToNDC)(const glm::dvec3&, Camera&, SceneGraphNode*); double(*distToMinimize)(double* par, int x, void* fdata, LMstat* lmstat); Camera* camera; SceneGraphNode* node; @@ -86,12 +86,12 @@ public: * 3 Continues if GUI isn't on * 4 If the node in focus is large enough and all contact points have selected it, * calls directControl() function for direct-manipulation - * 5 Updates std::vector _selected (only if LMA successfully + * 5 Updates std::vector _selected (only if LMA successfully * converged, avoids interaction to snap on LMA fails) - * 6 If directControl() wasn't called this frame, interpret the incoming + * 6 If directControl() wasn't called this frame, interpret the incoming * list and decide what type of interaction this frame should do * 7 Compute the new total velocities after interaction - * 8 Evaluate if directControl should be called next frame- true if all contact points + * 8 Evaluate if directControl should be called next frame- true if all contact points * select the same node and said node is larger than _nodeRadiusThreshold */ void updateStateFromInput(const std::vector& list, @@ -100,10 +100,10 @@ public: // Calculates the new camera state with velocities and time since last frame void step(double dt); - // Used to save LMA data for one frame if the user chose to + // Used to save LMA data for one frame if the user chose to void unitTest(); - // Called each frame we have no new input, used to reset data + // Called each frame we have no new input, used to reset data void resetAfterInput(); // Sets _tap to true, called if tap occured current frame (called from touchmodule) @@ -125,7 +125,7 @@ private: bool guiMode(const std::vector& list); /* Function that calculates the new camera state such that it minimizes the L2 error - * in screenspace + * in screenspace * between contact points and surface coordinates projected to clip space using LMA */ void directControl(const std::vector& list); @@ -136,7 +136,7 @@ private: */ void findSelectedNode(const std::vector& list); - /* Returns an int (ROT = 0, PINCH, PAN, ROLL, PICK) for what interaction to be used, + /* Returns an int (ROT = 0, PINCH, PAN, ROLL, PICK) for what interaction to be used, * depending on what input was gotten */ int interpretInteraction(const std::vector& list, diff --git a/modules/touch/src/touchinteraction.cpp b/modules/touch/src/touchinteraction.cpp index 53f0f36496..8a66aac409 100644 --- a/modules/touch/src/touchinteraction.cpp +++ b/modules/touch/src/touchinteraction.cpp @@ -67,6 +67,121 @@ namespace { const char* _loggerCat = "TouchInteraction"; + + static const openspace::properties::Property::PropertyInfo OriginInfo = { + "Origin", + "Origin", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo UnitTestInfo = { + "UnitTest", + "Take a unit test saving the LM data into file", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo EventsInfo = { + "TouchEvents", + "True if we have a touch event", + "", + openspace::properties::Property::Visibility::Hidden + }; + + static const openspace::properties::Property::PropertyInfo SetDefaultInfo = { + "SetDefault", + "Reset all properties to default", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo MaxTapTimeInfo = { + "MaxTapTime", + "Max tap delay (in ms) for double tap", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo DecelatesPerSecondInfo = { + "DeceleratesPerSecond", + "Number of times velocity is decelerated per second", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo TouchScreenSizeInfo = { + "TouchScreenSize", + "Touch Screen size in inches", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo TapZoomFactorInfo = { + "TapZoomFactor", + "Scaling distance travelled on tap", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo DirectManipulationInfo = { + "DirectManipulationRadius", + "Radius a planet has to have to activate direct-manipulation", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo RollThresholdInfo = { + "RollThreshold", + "Threshold for min angle for roll interpret", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo OrbitSpinningThreshold = { + "OrbitThreshold", + "Threshold to activate orbit spinning in direct-manipulation", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo SpinningSensitivityInfo = { + "SpinningSensitivity", + "Sensitivity of spinning in direct-manipulation", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo InputSensitivityInfo = { + "InputSensitivity", + "Threshold for interpreting input as still", + "" + }; + + static const openspace::properties::Property::PropertyInfo StationaryCentroidInfo = { + "CentroidStationary", + "Threshold for stationary centroid", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo PanDeltaDistanceInfo = { + "PanDeltaDistance", + "Delta distance between fingers allowed for interpreting pan interaction", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo SlerpTimeInfo = { + "SlerpTime", + "Time to slerp in seconds to new orientation with new node picking", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo GuiButtonSizeInfo = { + "GuiButtonSize", + "GUI button size in pixels", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo FrictionInfo = { + "Friction", + "Friction for different interactions (orbit, zoom, roll, pan)", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo PickingRadiusInfo = { + "PickingRadiusMinimum", + "Minimum radius for picking in NDC coordinates", + "" // @TODO Missing documentation + }; } // namespace using namespace TUIO; @@ -75,113 +190,42 @@ namespace openspace { TouchInteraction::TouchInteraction() : properties::PropertyOwner({ "TouchInteraction" }) - , _origin({ "Origin", "Origin", "" }) // @TODO Missing documentation - , _unitTest( - { "Click to take a unit test", "Take a unit test saving the LM data into file", "" }, // @TODO Missing documentation - false - ) - , _touchActive( - { "TouchEvents", "True if we have a touch event", "", properties::Property::Visibility::Hidden }, // @TODO Missing documentation - false - ) - , _reset( - { "Default Values", "Reset all properties to default", "" }, // @TODO Missing documentation - false - ) - , _maxTapTime( - { "Max Tap Time", "Max tap delay (in ms) for double tap", "" }, // @TODO Missing documentation - 300, - 10, - 1000 - ) - , _deceleratesPerSecond( - { "Decelerates per second", "Number of times velocity is decelerated per second", "" }, // @TODO Missing documentation - 240, - 60, - 300 - ) - , _touchScreenSize( - { "TouchScreenSize", "Touch Screen size in inches", "" }, // @TODO Missing documentation - 55.0f, - 5.5f, - 150.0f - ) - , _tapZoomFactor( - { "Tap zoom factor", "Scaling distance travelled on tap", "" }, // @TODO Missing documentation - 0.2f, - 0.f, - 0.5f - ) - , _nodeRadiusThreshold( - { "Activate direct-manipulation", "Radius a planet has to have to activate direct-manipulation", "" }, // @TODO Missing documentation - 0.2f, - 0.0f, - 1.0f - ) - , _rollAngleThreshold( - { "Interpret roll", "Threshold for min angle for roll interpret", "" }, // @TODO Missing documentation - 0.025f, - 0.f, - 0.05f - ) - , _orbitSpeedThreshold( - { "Activate orbit spinning", "Threshold to activate orbit spinning in direct-manipulation", "" }, // @TODO Missing documentation - 0.005f, - 0.f, - 0.01f - ) - , _spinSensitivity( - { "Sensitivity of spinning", "Sensitivity of spinning in direct-manipulation", "" }, // @TODO Missing documentation - 1.f, - 0.f, - 2.f - ) - , _inputStillThreshold( - { "Input still", "Threshold for interpreting input as still", "" }, // @TODO Missing documentation - 0.0005f, - 0.f, - 0.001f - ) - , _centroidStillThreshold( - { "Centroid stationary", "Threshold for stationary centroid", "" }, // @TODO Missing documentation - 0.0018f, - 0.f, - 0.01f - ) // used to void wrongly interpreted roll interactions - , _interpretPan( - { "Pan delta distance", "Delta distance between fingers allowed for interpreting pan interaction", "" }, // @TODO Missing documentation - 0.015f, - 0.f, - 0.1f - ) - , _slerpTime( - { "Time to slerp", "Time to slerp in seconds to new orientation with new node picking", "" }, // @TODO Missing documentation - 3.f, - 0.f, - 5.f - ) + , _origin(OriginInfo) + , _unitTest(UnitTestInfo, false) + , _touchActive(EventsInfo, false) + , _reset(SetDefaultInfo, false) + , _maxTapTime(MaxTapTimeInfo, 300, 10, 1000) + , _deceleratesPerSecond(DecelatesPerSecondInfo, 240, 60, 300) + , _touchScreenSize(TouchScreenSizeInfo, 55.0f, 5.5f, 150.0f) + , _tapZoomFactor(TapZoomFactorInfo, 0.2f, 0.f, 0.5f) + , _nodeRadiusThreshold(DirectManipulationInfo, 0.2f, 0.0f, 1.0f) + , _rollAngleThreshold(RollThresholdInfo, 0.025f, 0.f, 0.05f) + , _orbitSpeedThreshold(OrbitSpinningThreshold, 0.005f, 0.f, 0.01f) + , _spinSensitivity(SpinningSensitivityInfo, 1.f, 0.f, 2.f) + , _inputStillThreshold(InputSensitivityInfo, 0.0005f, 0.f, 0.001f) + // used to void wrongly interpreted roll interactions + , _centroidStillThreshold(StationaryCentroidInfo, 0.0018f, 0.f, 0.01f) + , _interpretPan(PanDeltaDistanceInfo, 0.015f, 0.f, 0.1f) + , _slerpTime(SlerpTimeInfo, 3.f, 0.f, 5.f) , _guiButton( - { "GUI Button", "GUI button size in pixels", "" }, // @TODO Missing documentation + GuiButtonSizeInfo, glm::ivec2(32, 64), glm::ivec2(8, 16), glm::ivec2(128, 256) ) , _friction( - { "Friction", "Friction for different interactions (orbit, zoom, roll, pan)", "" }, // @TODO Missing documentation + FrictionInfo, glm::vec4(0.01f, 0.025f, 0.02f, 0.02f), glm::vec4(0.f), glm::vec4(0.2f) ) - , _pickingRadiusMinimum( - { "Picking Radius", "Minimum radius for picking in NDC coordinates", "" }, - 0.1f, - 0.f, - 1.f - ) + , _pickingRadiusMinimum(PickingRadiusInfo, 0.1f, 0.f, 1.f) , _vel{ glm::dvec2(0.0), 0.0, 0.0, glm::dvec2(0.0) } , _sensitivity{ glm::dvec2(0.08, 0.045), 4.0, 2.75, glm::dvec2(0.08, 0.045) } , _centroid(glm::dvec3(0.0)) - , _projectionScaleFactor(1.000004) // calculated with two vectors with known diff in length, then projDiffLength/diffLength. + // calculated with two vectors with known diff in length, then + // projDiffLength/diffLength. + , _projectionScaleFactor(1.000004) , _currentRadius(1.0) , _slerpdT(1000) , _numOfTests(0) @@ -214,7 +258,9 @@ TouchInteraction::TouchInteraction() _origin.onChange([this]() { SceneGraphNode* node = sceneGraphNode(_origin.value()); if (!node) { - LWARNING("Could not find a node in scenegraph called '" << _origin.value() << "'"); + LWARNING( + "Could not find a node in scenegraph called '" << _origin.value() << "'" + ); return; } setFocusNode(node); @@ -227,7 +273,9 @@ TouchInteraction::TouchInteraction() } // Called each frame if there is any input -void TouchInteraction::updateStateFromInput(const std::vector& list, std::vector& lastProcessed) { +void TouchInteraction::updateStateFromInput(const std::vector& list, + std::vector& lastProcessed) +{ if (_tap) { // check for doubletap if (_time.getSessionTime().getTotalMilliseconds() < _maxTapTime) { _doubleTap = true; @@ -247,8 +295,9 @@ void TouchInteraction::updateStateFromInput(const std::vector& list, computeVelocities(list, lastProcessed); } - // evaluates if current frame is in directTouchMode (will if so be used next frame) - _directTouchMode = (_currentRadius > _nodeRadiusThreshold && _selected.size() == list.size()); + // evaluates if current frame is in directTouchMode (will be used next frame) + _directTouchMode = + (_currentRadius > _nodeRadiusThreshold && _selected.size() == list.size()); } } @@ -256,18 +305,27 @@ void TouchInteraction::updateStateFromInput(const std::vector& list, bool TouchInteraction::guiMode(const std::vector& list) { WindowWrapper& wrapper = OsEng.windowWrapper(); glm::ivec2 res = wrapper.currentWindowSize(); - glm::dvec2 pos = glm::vec2(list.at(0).getScreenX(res.x), list.at(0).getScreenY(res.y)); // mouse pixel position + glm::dvec2 pos = glm::vec2( + list.at(0).getScreenX(res.x), + list.at(0).getScreenY(res.y) + ); ImGUIModule& module = *(OsEng.moduleEngine().module()); _guiON = module.gui.isEnabled(); - if (_tap && list.size() == 1 && std::abs(pos.x) < _guiButton.value().x && std::abs(pos.y) < _guiButton.value().y) { // pressed invisible button + if (_tap && list.size() == 1 && + std::abs(pos.x) < _guiButton.value().x && std::abs(pos.y) < _guiButton.value().y) + { + // pressed invisible button _guiON = !_guiON; module.gui.setEnabled(_guiON); std::string mode = (_guiON) ? "" : "de"; - LINFO("GUI mode is " << mode << "activated. Inside box by: (" << - static_cast(100 * (pos.x / _guiButton.value().x)) << "%, " << static_cast(100 * (pos.y / _guiButton.value().y)) << "%)\n"); + LINFO( + "GUI mode is " << mode << "activated. Inside box by: (" << + static_cast(100 * (pos.x / _guiButton.value().x)) << "%, " << + static_cast(100 * (pos.y / _guiButton.value().y)) << "%)\n" + ); } else if (_guiON) { module.touchInput = { _guiON, pos, 1 }; // emulate touch input as a mouse @@ -283,12 +341,16 @@ void TouchInteraction::directControl(const std::vector& list) { _vel.roll = 0.0; _vel.pan = glm::dvec2(0.0, 0.0); - // Returns the screen point s(xi,par) dependant the transform M(par) and object point xi + // Returns the screen point s(xi,par) dependent the transform M(par) and object + // point xi auto distToMinimize = [](double* par, int x, void* fdata, LMstat* lmstat) { FunctionData* ptr = reinterpret_cast(fdata); - // Apply transform to camera and find the new screen point of the updated camera state - double q[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; // { vec2 globalRot, zoom, roll, vec2 localRot } + // Apply transform to camera and find the new screen point of the updated camera + // state + + // { vec2 globalRot, zoom, roll, vec2 localRot } + double q[6] = { 0.0, 0.0, 0.0, 0.0, 0.0, 0.0 }; for (int i = 0; i < ptr->nDOF; ++i) { q[i] = par[i]; } @@ -303,11 +365,13 @@ void TouchInteraction::directControl(const std::vector& list) { dvec3 lookUp = ptr->camera->lookUpVectorWorldSpace(); dvec3 camDirection = ptr->camera->viewDirectionWorldSpace(); - // Make a representation of the rotation quaternion with local and global rotations + // Make a representation of the rotation quaternion with local and global + // rotations dmat4 lookAtMat = lookAt( dvec3(0, 0, 0), directionToCenter, - normalize(camDirection + lookUp)); // To avoid problem with lookup in up direction + // To avoid problem with lookup in up direction + normalize(camDirection + lookUp)); dquat globalCamRot = normalize(quat_cast(inverse(lookAtMat))); dquat localCamRot = inverse(globalCamRot) * ptr->camera->rotationQuaternion(); @@ -324,13 +388,16 @@ void TouchInteraction::directControl(const std::vector& list) { dvec3 eulerAngles(q[1], q[0], 0); dquat rotationDiffCamSpace = dquat(eulerAngles); - dquat rotationDiffWorldSpace = globalCamRot * rotationDiffCamSpace * inverse(globalCamRot); - dvec3 rotationDiffVec3 = centerToCamera * rotationDiffWorldSpace - centerToCamera; + dquat rotationDiffWorldSpace = + globalCamRot * rotationDiffCamSpace * inverse(globalCamRot); + dvec3 rotationDiffVec3 = + centerToCamera * rotationDiffWorldSpace - centerToCamera; camPos += rotationDiffVec3; dvec3 centerToCamera = camPos - centerPos; directionToCenter = normalize(-centerToCamera); - dvec3 lookUpWhenFacingCenter = globalCamRot * dvec3(ptr->camera->lookUpVectorCameraSpace()); + dvec3 lookUpWhenFacingCenter = + globalCamRot * dvec3(ptr->camera->lookUpVectorCameraSpace()); dmat4 lookAtMat = lookAt( dvec3(0, 0, 0), directionToCenter, @@ -345,8 +412,13 @@ void TouchInteraction::directControl(const std::vector& list) { cam.setPositionVec3(camPos); cam.setRotation(globalCamRot * localCamRot); - // we now have a new position and orientation of camera, project surfacePoint to the new screen to get distance to minimize - glm::dvec2 newScreenPoint = ptr->castToNDC(ptr->selectedPoints.at(x), cam, ptr->node); + // we now have a new position and orientation of camera, project surfacePoint to + // the new screen to get distance to minimize + glm::dvec2 newScreenPoint = ptr->castToNDC( + ptr->selectedPoints.at(x), + cam, + ptr->node + ); lmstat->pos.push_back(newScreenPoint); return glm::length(ptr->screenPoints.at(x) - newScreenPoint); }; @@ -354,7 +426,8 @@ void TouchInteraction::directControl(const std::vector& list) { auto gradient = [](double* g, double* par, int x, void* fdata, LMstat* lmstat) { FunctionData* ptr = reinterpret_cast(fdata); double h, lastG, f1, f0 = ptr->distToMinimize(par, x, fdata, lmstat); - double scale = log10(ptr->node->boundingSphere()); // scale value to find minimum step size h, dependant on planet size + // scale value to find minimum step size h, dependant on planet size + double scale = log10(ptr->node->boundingSphere()); std::vector dPar(ptr->nDOF, 0.0); dPar.assign(par, par + ptr->nDOF); @@ -366,7 +439,7 @@ void TouchInteraction::directControl(const std::vector& list) { f1 = ptr->distToMinimize(dPar.data(), x, fdata, lmstat); dPar.at(i) = par[i]; // Iterative process to find the minimum step h that gives a good gradient - for (int j = 0; j < 100; ++j) { + for (int j = 0; j < 100; ++j) { if ((f1 - f0) != 0 && lastG == 0) { // found minimum step size h // scale up to get a good initial guess value h *= scale * scale * scale; @@ -374,7 +447,8 @@ void TouchInteraction::directControl(const std::vector& list) { // clamp min step size to a fraction of the incoming parameter if (i == 2) { double epsilon = 1e-3; - h = std::max(std::max(std::abs(dPar.at(i)), epsilon) * 0.001, h); // make sure incoming parameter is larger than 0 + // make sure incoming parameter is larger than 0 + h = std::max(std::max(std::abs(dPar.at(i)), epsilon) * 0.001, h); } else if (ptr->nDOF == 2) { h = std::max(std::abs(dPar.at(i)) * 0.001, h); @@ -399,30 +473,36 @@ void TouchInteraction::directControl(const std::vector& list) { } g[i] = (f1 - f0) / h; } - if (ptr->nDOF == 2) { // normalize on 1 finger case to allow for horizontal/vertical movement + if (ptr->nDOF == 2) { + // normalize on 1 finger case to allow for horizontal/vertical movement for (int i = 0; i < 2; ++i) { g[i] = g[i]/std::abs(g[i]); } } else if (ptr->nDOF == 6) { - for (int i = 0; i < ptr->nDOF; ++i) { // lock to only pan and zoom on 3 finger case, no roll/orbit + for (int i = 0; i < ptr->nDOF; ++i) { + // lock to only pan and zoom on 3 finger case, no roll/orbit g[i] = (i == 2) ? g[i] : g[i] / std::abs(g[i]); } } }; - // project back a 3D point in model view to clip space [-1,1] coordinates on the view plane - auto castToNDC = [](glm::dvec3 vec, Camera& camera, SceneGraphNode* node) { - glm::dvec3 posInCamSpace = glm::inverse(camera.rotationQuaternion()) - * ((node->rotationMatrix() * vec) + (node->worldPosition() - camera.positionVec3()) ); + // project back a 3D point in model view to clip space [-1,1] coordinates on the view + // plane + auto castToNDC = [](const glm::dvec3& vec, Camera& camera, SceneGraphNode* node) { + glm::dvec3 posInCamSpace = glm::inverse(camera.rotationQuaternion()) * + (node->rotationMatrix() * vec + + (node->worldPosition() - camera.positionVec3())); glm::dvec4 clipspace = camera.projectionMatrix() * glm::dvec4(posInCamSpace, 1.0); return (glm::dvec2(clipspace) / clipspace.w); }; - int nFingers = std::min(static_cast(list.size()), 3); // only send in first three fingers (to make it easier for LMA to converge on 3+ finger case with only zoom/pan) + // only send in first three fingers (to make it easier for LMA to converge on 3+ + // finger case with only zoom/pan) + int nFingers = std::min(static_cast(list.size()), 3); int nDOF = std::min(nFingers * 2, 6); - std::vector par(nDOF, 0.0); + std::vector par(nDOF, 0.0); par.at(0) = _lastVel.orbit.x; // use _lastVel for orbit par.at(1) = _lastVel.orbit.y; @@ -433,16 +513,43 @@ void TouchInteraction::directControl(const std::vector& list) { const SelectedBody& sb = _selected.at(i); selectedPoints.push_back(sb.coordinates); - std::vector::const_iterator c = std::find_if(list.begin(), list.end(), [&sb](const TuioCursor& c) { return c.getSessionID() == sb.id; }); - screenPoints.push_back(glm::dvec2(2 * (c->getX() - 0.5), -2 * (c->getY() - 0.5))); // normalized -1 to 1 coordinates on screen + std::vector::const_iterator c = std::find_if( + list.begin(), + list.end(), + [&sb](const TuioCursor& c) { return c.getSessionID() == sb.id; } + ); + // normalized -1 to 1 coordinates on screen + screenPoints.push_back( + glm::dvec2(2 * (c->getX() - 0.5), -2 * (c->getY() - 0.5)) + ); } - FunctionData fData = { selectedPoints, screenPoints, nDOF, castToNDC, distToMinimize, _camera, _selected.at(0).node, _lmstat, _currentRadius }; + FunctionData fData = { + selectedPoints, + screenPoints, + nDOF, + castToNDC, + distToMinimize, + _camera, + _selected.at(0).node, + _lmstat, + _currentRadius + }; void* dataPtr = reinterpret_cast(&fData); // finds best transform values for the new camera state and stores them in par - _lmSuccess = levmarq(nDOF, par.data(), nFingers, NULL, distToMinimize, gradient, dataPtr, &_lmstat); + _lmSuccess = levmarq( + nDOF, + par.data(), + nFingers, + nullptr, + distToMinimize, + gradient, + dataPtr, + &_lmstat + ); - if (_lmSuccess && !_unitTest) { // if good values were found set new camera state + if (_lmSuccess && !_unitTest) { + // if good values were found set new camera state _vel.orbit = glm::dvec2(par.at(0), par.at(1)); if (nDOF > 2) { _vel.zoom = par.at(2); @@ -461,18 +568,27 @@ void TouchInteraction::directControl(const std::vector& list) { _vel.roll = 0.0; _vel.pan = glm::dvec2(0.0, 0.0); } - else { // prevents touch to infinitely be active (due to windows bridge case where event doesnt get consumed sometimes when LMA fails to converge) - OsEng.moduleEngine().module()->touchInput = { 1, glm::dvec2(0.0, 0.0), 1 }; + else { + // prevents touch to infinitely be active (due to windows bridge case where event + // doesnt get consumed sometimes when LMA fails to converge) + OsEng.moduleEngine().module()->touchInput = { + 1, + glm::dvec2(0.0, 0.0), 1 + }; resetAfterInput(); } } -// Traces the touch input into the scene and finds the surface coordinates of touched planets (if occuring) +// Traces the touch input into the scene and finds the surface coordinates of touched +// planets (if occuring) void TouchInteraction::findSelectedNode(const std::vector& list) { //trim list to only contain visible nodes that make sense - std::string selectables[30] = { "Sun", "Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", "Neptune", "Pluto", - "Moon", "Titan", "Rhea", "Mimas", "Iapetus", "Enceladus", "Dione", "Io", "Ganymede", "Europa", - "Callisto", "NewHorizons", "Styx", "Nix", "Kerberos", "Hydra", "Charon", "Tethys", "OsirisRex", "Bennu" }; + std::string selectables[30] = { + "Sun", "Mercury", "Venus", "Earth", "Mars", "Jupiter", "Saturn", "Uranus", + "Neptune", "Pluto", "Moon", "Titan", "Rhea", "Mimas", "Iapetus", "Enceladus", + "Dione", "Io", "Ganymede", "Europa", "Callisto", "NewHorizons", "Styx", "Nix", + "Kerberos", "Hydra", "Charon", "Tethys", "OsirisRex", "Bennu" + }; std::vector selectableNodes; for (SceneGraphNode* node : OsEng.renderEngine().scene()->allSceneGraphNodes()) for (std::string name : selectables) @@ -494,8 +610,10 @@ void TouchInteraction::findSelectedNode(const std::vector& list) { for (const TuioCursor& c : list) { double xCo = 2 * (c.getX() - 0.5); double yCo = -2 * (c.getY() - 0.5); // normalized -1 to 1 coordinates on screen - glm::dvec3 cursorInWorldSpace = camToWorldSpace * - glm::dvec3(glm::inverse(_camera->projectionMatrix()) * glm::dvec4(xCo, yCo, -1.0, 1.0)); // vec3(projectionmatrix * clipspace), divide with w? + // vec3(projectionmatrix * clipspace), divide with w? + glm::dvec3 cursorInWorldSpace = camToWorldSpace * + glm::dvec3(glm::inverse(_camera->projectionMatrix()) * + glm::dvec4(xCo, yCo, -1.0, 1.0)); glm::dvec3 raytrace = glm::normalize(cursorInWorldSpace); int id = c.getSessionID(); @@ -503,22 +621,34 @@ void TouchInteraction::findSelectedNode(const std::vector& list) { for (SceneGraphNode* node : selectableNodes) { double boundingSphere = node->boundingSphere(); glm::dvec3 camToSelectable = node->worldPosition() - camPos; - double dist = length(glm::cross(cursorInWorldSpace, camToSelectable)) / glm::length(cursorInWorldSpace) - boundingSphere; + double dist = length(glm::cross(cursorInWorldSpace, camToSelectable)) / + glm::length(cursorInWorldSpace) - boundingSphere; if (dist <= 0.0) { - // finds intersection closest point between boundingsphere and line in world coordinates, assumes line direction is normalized + // finds intersection closest point between boundingsphere and line in + // world coordinates, assumes line direction is normalized double d = glm::dot(raytrace, camToSelectable); - double root = boundingSphere * boundingSphere - glm::dot(camToSelectable, camToSelectable) + d * d; + double root = boundingSphere * boundingSphere - + glm::dot(camToSelectable, camToSelectable) + d * d; if (root > 0) { // two intersection points (take the closest one) d -= sqrt(root); } glm::dvec3 intersectionPoint = camPos + d * raytrace; - glm::dvec3 pointInModelView = glm::inverse(node->rotationMatrix()) * (intersectionPoint - node->worldPosition()); + glm::dvec3 pointInModelView = glm::inverse(node->rotationMatrix()) * + (intersectionPoint - node->worldPosition()); // Add id, node and surface coordinates to the selected list - std::vector::iterator oldNode = std::find_if(newSelected.begin(), newSelected.end(), [id](SelectedBody s) { return s.id == id; }); + std::vector::iterator oldNode = std::find_if( + newSelected.begin(), + newSelected.end(), + [id](SelectedBody s) { return s.id == id; } + ); if (oldNode != newSelected.end()) { - double oldNodeDist = glm::length(oldNode->node->worldPosition() - camPos); - if (glm::length(camToSelectable) < oldNodeDist) { // new node is closer, remove added node and add the new one instead + double oldNodeDist = glm::length( + oldNode->node->worldPosition() - camPos + ); + if (glm::length(camToSelectable) < oldNodeDist) { + // new node is closer, remove added node and add the new one + // instead newSelected.pop_back(); newSelected.push_back({ id, node, pointInModelView }); } @@ -529,7 +659,9 @@ void TouchInteraction::findSelectedNode(const std::vector& list) { } // Compute locations in view space to perform the picking - glm::dvec4 clip = glm::dmat4(_camera->projectionMatrix()) * _camera->combinedViewMatrix() * glm::vec4(node->worldPosition(), 1.0); + glm::dvec4 clip = glm::dmat4(_camera->projectionMatrix()) * + _camera->combinedViewMatrix() * + glm::vec4(node->worldPosition(), 1.0); glm::dvec2 ndc = clip / clip.w; // If the object is not in the screen, we dont want to consider it at all @@ -537,17 +669,17 @@ void TouchInteraction::findSelectedNode(const std::vector& list) { glm::dvec2 cursor = { xCo, yCo }; double ndcDist = glm::length(ndc - cursor); - // We either want to select the object if it's bounding sphere as been touched - // (checked by the first part of this loop above) or if the touch point is - // within a minimum distance of the center + // We either want to select the object if it's bounding sphere as been + // touched (checked by the first part of this loop above) or if the touch + // point is within a minimum distance of the center if (dist <= 0.0 || (ndcDist <= _pickingRadiusMinimum)) { - // If the user touched the planet directly, this is definitely the one they are - // interested in => minimum distance + // If the user touched the planet directly, this is definitely the one + // they are interested in => minimum distance if (dist <= 0.0) { LINFOC(node->name(), "Picking candidate based on direct touch"); pickingInfo.push_back({ - node, + node, -std::numeric_limits::max(), -std::numeric_limits::max() }); @@ -589,29 +721,48 @@ void TouchInteraction::findSelectedNode(const std::vector& list) { } // Interprets the input gesture to a specific interaction -int TouchInteraction::interpretInteraction(const std::vector& list, const std::vector& lastProcessed) { +int TouchInteraction::interpretInteraction(const std::vector& list, + const std::vector& lastProcessed) +{ glm::dvec3 lastCentroid = _centroid; - _centroid.x = std::accumulate(list.begin(), list.end(), 0.0, [](double x, const TuioCursor& c) { return x + c.getX(); }) / list.size(); - _centroid.y = std::accumulate(list.begin(), list.end(), 0.0, [](double y, const TuioCursor& c) { return y + c.getY(); }) / list.size(); + _centroid.x = std::accumulate( + list.begin(), + list.end(), + 0.0, + [](double x, const TuioCursor& c) { return x + c.getX(); } + ) / list.size(); + _centroid.y = std::accumulate( + list.begin(), + list.end(), + 0.0, + [](double y, const TuioCursor& c) { return y + c.getY(); } + ) / list.size(); // see if the distance between fingers changed - used in pan interpretation double dist = 0; double lastDist = 0; TuioCursor cursor = list.at(0); for (const TuioCursor& c : list) { - dist += glm::length(glm::dvec2(c.getX(), c.getY()) - glm::dvec2(cursor.getX(), cursor.getY())); + dist += glm::length( + glm::dvec2(c.getX(), c.getY()) - glm::dvec2(cursor.getX(), cursor.getY()) + ); cursor = c; } TuioPoint point = lastProcessed.at(0).second; for (const Point& p : lastProcessed) { - lastDist += glm::length(glm::dvec2(p.second.getX(), p.second.getY()) - glm::dvec2(point.getX(), point.getY())); + lastDist += glm::length(glm::dvec2(p.second.getX(), p.second.getY()) - + glm::dvec2(point.getX(), point.getY())); point = p.second; } // find the slowest moving finger - used in roll interpretation double minDiff = 1000; int id = 0; for (const TuioCursor& c : list) { - TuioPoint point = std::find_if(lastProcessed.begin(), lastProcessed.end(), [&c](const Point& p) { return p.first == c.getSessionID(); })->second; + TuioPoint point = std::find_if( + lastProcessed.begin(), + lastProcessed.end(), + [&c](const Point& p) { return p.first == c.getSessionID(); } + )->second; double diff = c.getX() - point.getX() + c.getY() - point.getY(); if (!c.isMoving()) { diff = minDiff = 0.0; @@ -623,22 +774,36 @@ int TouchInteraction::interpretInteraction(const std::vector& list, } } // find if all fingers angles are high - used in roll interpretation - double rollOn = std::accumulate(list.begin(), list.end(), 0.0, [&](double diff, const TuioCursor& c) { - TuioPoint point = std::find_if(lastProcessed.begin(), lastProcessed.end(), [&c](const Point& p) { return p.first == c.getSessionID(); })->second; - double res = 0.0; - float lastAngle = point.getAngle(_centroid.x, _centroid.y); - float currentAngle = c.getAngle(_centroid.x, _centroid.y); - if (lastAngle > currentAngle + 1.5 * M_PI) - res = currentAngle + (2 * M_PI - lastAngle); - else if (currentAngle > lastAngle + 1.5 * M_PI) - res = (2 * M_PI - currentAngle) + lastAngle; - else - res = currentAngle - lastAngle; - if (std::abs(res) < _rollAngleThreshold) - return 1000.0; - else - return (diff + res); - }); + double rollOn = std::accumulate( + list.begin(), + list.end(), + 0.0, + [&](double diff, const TuioCursor& c) { + TuioPoint point = std::find_if( + lastProcessed.begin(), + lastProcessed.end(), + [&c](const Point& p) { return p.first == c.getSessionID(); } + )->second; + double res = 0.0; + float lastAngle = point.getAngle(_centroid.x, _centroid.y); + float currentAngle = c.getAngle(_centroid.x, _centroid.y); + if (lastAngle > currentAngle + 1.5 * M_PI) { + res = currentAngle + (2 * M_PI - lastAngle); + } + else if (currentAngle > lastAngle + 1.5 * M_PI) { + res = (2 * M_PI - currentAngle) + lastAngle; + } + else { + res = currentAngle - lastAngle; + } + if (std::abs(res) < _rollAngleThreshold) { + return 1000.0; + } + else { + return (diff + res); + } + } + ); if (_doubleTap) { return PICK; @@ -647,12 +812,19 @@ int TouchInteraction::interpretInteraction(const std::vector& list, return ROT; } else { + float avgDistance = std::abs(dist - lastDist) / list.at(0).getMotionSpeed(); // if average distance between 3 fingers are constant we have panning - if (std::abs(dist - lastDist) / list.at(0).getMotionSpeed() < _interpretPan && list.size() == 3) { + if (avgDistance < _interpretPan && list.size() == 3) { return PAN; } - // we have roll if one finger is still, or the total roll angles around the centroid is over _rollAngleThreshold (_centroidStillThreshold is used to void misinterpretations) - else if (std::abs(minDiff) < _inputStillThreshold || (std::abs(rollOn) < 100.0 && glm::distance(_centroid, lastCentroid) / list.size() < _centroidStillThreshold)) { + // we have roll if one finger is still, or the total roll angles around the + // centroid is over _rollAngleThreshold (_centroidStillThreshold is used to void + // misinterpretations) + else if (std::abs(minDiff) < _inputStillThreshold || + (std::abs(rollOn) < 100.0 && + glm::distance(_centroid, lastCentroid) / list.size() + < _centroidStillThreshold)) + { return ROLL; } else { @@ -661,81 +833,128 @@ int TouchInteraction::interpretInteraction(const std::vector& list, } } -// Calculate how much interpreted interaction should change the camera state (based on _vel) -void TouchInteraction::computeVelocities(const std::vector& list, const std::vector& lastProcessed) { +// Calculate how much interpreted interaction (_vel) should change the camera state +void TouchInteraction::computeVelocities(const std::vector& list, + const std::vector& lastProcessed) +{ TuioCursor cursor = list.at(0); int action = interpretInteraction(list, lastProcessed); switch (action) { case ROT: { // add rotation velocity - _vel.orbit += glm::dvec2(cursor.getXSpeed() * _sensitivity.orbit.x, cursor.getYSpeed() * _sensitivity.orbit.y); + _vel.orbit += glm::dvec2(cursor.getXSpeed() * + _sensitivity.orbit.x, cursor.getYSpeed() * + _sensitivity.orbit.y); break; } - case PINCH: { // add zooming velocity - dependant on distance difference between contact points this/last frame - double distance = std::accumulate(list.begin(), list.end(), 0.0, [&](double d, const TuioCursor& c) { - return d + c.getDistance(_centroid.x, _centroid.y); - }) / list.size(); - double lastDistance = std::accumulate(lastProcessed.begin(), lastProcessed.end(), 0.0f, [&](float d, const Point& p) { - return d + p.second.getDistance(_centroid.x, _centroid.y); - }) / lastProcessed.size(); + case PINCH: { + // add zooming velocity - dependant on distance difference between contact + // points this/last frame + double distance = std::accumulate( + list.begin(), + list.end(), + 0.0, + [&](double d, const TuioCursor& c) { + return d + c.getDistance(_centroid.x, _centroid.y); + } + ) / list.size(); + double lastDistance = std::accumulate( + lastProcessed.begin(), + lastProcessed.end(), + 0.0f, + [&](float d, const Point& p) { + return d + p.second.getDistance(_centroid.x, _centroid.y); + } + ) / lastProcessed.size(); - double zoomFactor = (distance - lastDistance) * (glm::distance(_camera->positionVec3(), _camera->focusPositionVec3()) - _focusNode->boundingSphere()); - _vel.zoom += zoomFactor * _sensitivity.zoom * std::max(_touchScreenSize.value() * 0.1, 1.0); + double zoomFactor = (distance - lastDistance) * + (glm::distance(_camera->positionVec3(), _camera->focusPositionVec3()) - + _focusNode->boundingSphere()); + _vel.zoom += zoomFactor * _sensitivity.zoom * + std::max(_touchScreenSize.value() * 0.1, 1.0); break; } - case ROLL: { // add global roll rotation velocity - double rollFactor = std::accumulate(list.begin(), list.end(), 0.0, [&](double diff, const TuioCursor& c) { - TuioPoint point = std::find_if(lastProcessed.begin(), lastProcessed.end(), [&c](const Point& p) { return p.first == c.getSessionID(); })->second; - double res = diff; - double lastAngle = point.getAngle(_centroid.x, _centroid.y); - double currentAngle = c.getAngle(_centroid.x, _centroid.y); - // if's used to set angles 359 + 1 = 0 and 0 - 1 = 359 - if (lastAngle > currentAngle + 1.5 * M_PI) - res += currentAngle + (2 * M_PI - lastAngle); - else if (currentAngle > lastAngle + 1.5 * M_PI) - res += (2 * M_PI - currentAngle) + lastAngle; - else - res += currentAngle - lastAngle; - return res; - }) / list.size(); + case ROLL: { + // add global roll rotation velocity + double rollFactor = std::accumulate( + list.begin(), + list.end(), + 0.0, + [&](double diff, const TuioCursor& c) { + TuioPoint point = std::find_if( + lastProcessed.begin(), + lastProcessed.end(), + [&c](const Point& p) { return p.first == c.getSessionID(); } + )->second; + double res = diff; + double lastAngle = point.getAngle(_centroid.x, _centroid.y); + double currentAngle = c.getAngle(_centroid.x, _centroid.y); + // if's used to set angles 359 + 1 = 0 and 0 - 1 = 359 + if (lastAngle > currentAngle + 1.5 * M_PI) { + res += currentAngle + (2 * M_PI - lastAngle); + } + else if (currentAngle > lastAngle + 1.5 * M_PI) { + res += (2 * M_PI - currentAngle) + lastAngle; + } + else { + res += currentAngle - lastAngle; + } + return res; + } + ) / list.size(); _vel.roll += -rollFactor * _sensitivity.roll; break; } - case PAN: { // add local rotation velocity - _vel.pan += glm::dvec2(cursor.getXSpeed() * _sensitivity.pan.x, cursor.getYSpeed() * _sensitivity.pan.y); + case PAN: { + // add local rotation velocity + _vel.pan += glm::dvec2(cursor.getXSpeed() * + _sensitivity.pan.x, cursor.getYSpeed() * _sensitivity.pan.y); break; } - case PICK: { // pick something in the scene as focus node + case PICK: { + // pick something in the scene as focus node if (_pickingSelected) { setFocusNode(_pickingSelected); - OsEng.navigationHandler().setFocusNode(_focusNode); // cant do setFocusNode() since TouchInteraction is not subclass of InteractionMode + // cant do setFocusNode() since TouchInteraction is not subclass of + // InteractionMode + OsEng.navigationHandler().setFocusNode(_focusNode); // rotate camera to look at new focus, using slerp quat - glm::dvec3 camToFocus = _focusNode->worldPosition() - _camera->positionVec3(); - glm::dvec3 camForward = glm::normalize(_camera->viewDirectionWorldSpace()); - double angle = glm::angle(camForward, camToFocus); - glm::dvec3 axis = glm::normalize(glm::cross(camForward, camToFocus)); - _toSlerp.x = axis.x * sin(angle / 2.0); + glm::dvec3 camToFocus = _focusNode->worldPosition() - + _camera->positionVec3(); + glm::dvec3 forward = glm::normalize(_camera->viewDirectionWorldSpace()); + double angle = glm::angle(forward, camToFocus); + glm::dvec3 axis = glm::normalize(glm::cross(forward, camToFocus)); + _toSlerp.x = axis.x * sin(angle / 2.0); _toSlerp.y = axis.y * sin(angle / 2.0); _toSlerp.z = axis.z * sin(angle / 2.0); _toSlerp.w = cos(angle / 2.0); _slerpdT = 0.0; } - else { // zooms in to current if PICK interpret happened but only space was selected - double dist = glm::distance(_camera->positionVec3(), _camera->focusPositionVec3()) - _focusNode->boundingSphere(); - _vel.zoom = (_sensitivity.zoom * std::max(_touchScreenSize.value() * 0.1, 1.0)) * _tapZoomFactor * dist; + else { + // zooms in to current if PICK interpret happened but only space was + // selected + double dist = glm::distance( + _camera->positionVec3(), _camera->focusPositionVec3() + ) - _focusNode->boundingSphere(); + _vel.zoom = _sensitivity.zoom * + std::max(_touchScreenSize.value() * 0.1, 1.0) * + _tapZoomFactor * dist; } break; } } } -// Main update call, calculates the new orientation and position for the camera depending on _vel and dt. Called every frame +// Main update call, calculates the new orientation and position for the camera depending +// on _vel and dt. Called every frame void TouchInteraction::step(double dt) { using namespace glm; - setFocusNode(OsEng.navigationHandler().focusNode()); // since functions cant be called directly (TouchInteraction not a subclass of InteractionMode) + // since functions cant be called directly (TouchInteraction not a subclass of + // InteractionMode) + setFocusNode(OsEng.navigationHandler().focusNode()); if (_focusNode && _camera) { // Create variables from current state dvec3 camPos = _camera->positionVec3(); @@ -746,25 +965,31 @@ void TouchInteraction::step(double dt) { dvec3 lookUp = _camera->lookUpVectorWorldSpace(); dvec3 camDirection = _camera->viewDirectionWorldSpace(); - // Make a representation of the rotation quaternion with local and global rotations + // Make a representation of the rotation quaternion with local and global + // rotations + // To avoid problem with lookup in up direction dmat4 lookAtMat = lookAt( dvec3(0, 0, 0), directionToCenter, - normalize(camDirection + lookUp)); // To avoid problem with lookup in up direction + normalize(camDirection + lookUp) + ); dquat globalCamRot = normalize(quat_cast(inverse(lookAtMat))); dquat localCamRot = inverse(globalCamRot) * _camera->rotationQuaternion(); double boundingSphere = _focusNode->boundingSphere(); dvec3 centerToBoundingSphere; double distance = std::max(length(centerToCamera) - boundingSphere, 0.0); - _currentRadius = boundingSphere / std::max(distance * _projectionScaleFactor, 1.0); + _currentRadius = boundingSphere / + std::max(distance * _projectionScaleFactor, 1.0); - { // Roll - dquat camRollRot = angleAxis(_vel.roll*dt, dvec3(0.0, 0.0, 1.0)); + { + // Roll + dquat camRollRot = angleAxis(_vel.roll * dt, dvec3(0.0, 0.0, 1.0)); localCamRot = localCamRot * camRollRot; } - { // Panning (local rotation) - dvec3 eulerAngles(_vel.pan.y*dt, _vel.pan.x*dt, 0); + { + // Panning (local rotation) + dvec3 eulerAngles(_vel.pan.y * dt, _vel.pan.x * dt, 0); dquat rotationDiff = dquat(eulerAngles); localCamRot = localCamRot * rotationDiff; @@ -774,17 +999,21 @@ void TouchInteraction::step(double dt) { localCamRot = slerp(localCamRot, _toSlerp, _slerpdT / _slerpTime); } } - { // Orbit (global rotation) + { + // Orbit (global rotation) dvec3 eulerAngles(_vel.orbit.y*dt, _vel.orbit.x*dt, 0); dquat rotationDiffCamSpace = dquat(eulerAngles); - dquat rotationDiffWorldSpace = globalCamRot * rotationDiffCamSpace * inverse(globalCamRot); - dvec3 rotationDiffVec3 = centerToCamera * rotationDiffWorldSpace - centerToCamera; + dquat rotationDiffWorldSpace = globalCamRot * rotationDiffCamSpace * + inverse(globalCamRot); + dvec3 rotationDiffVec3 = centerToCamera * rotationDiffWorldSpace - + centerToCamera; camPos += rotationDiffVec3; dvec3 centerToCamera = camPos - centerPos; directionToCenter = normalize(-centerToCamera); - dvec3 lookUpWhenFacingCenter = globalCamRot * dvec3(_camera->lookUpVectorCameraSpace()); + dvec3 lookUpWhenFacingCenter = globalCamRot * + dvec3(_camera->lookUpVectorCameraSpace()); dmat4 lookAtMat = lookAt( dvec3(0, 0, 0), directionToCenter, @@ -796,7 +1025,10 @@ void TouchInteraction::step(double dt) { dvec3 centerToCamera = camPos - centerPos; double distToSurface = length(centerToCamera - centerToBoundingSphere); - if (length(_vel.zoom*dt) < distToSurface && length(centerToCamera + directionToCenter*_vel.zoom*dt) > length(centerToBoundingSphere)) { + if (length(_vel.zoom * dt) < distToSurface && + length(centerToCamera + directionToCenter*_vel.zoom * dt) > + length(centerToBoundingSphere)) + { camPos += directionToCenter * _vel.zoom * dt; } else { @@ -856,21 +1088,25 @@ void TouchInteraction::unitTest() { } } -/* Decelerate velocities, called a set number of times per second to dereference it from frame time -* Example: -* Assume: frequency = 0.01, dt = 0.05 (200 fps), _timeSlack = 0.0001 -* times = floor((0.05 + 0.0001) / 0.01) = 5 -* _timeSlack = 0.0501 % 0.01 = 0.01 -*/ +// Decelerate velocities, called a set number of times per second to dereference it from +// frame time +// Example: +// Assume: frequency = 0.01, dt = 0.05 (200 fps), _timeSlack = 0.0001 +// times = floor((0.05 + 0.0001) / 0.01) = 5 +// _timeSlack = 0.0501 % 0.01 = 0.01 + void TouchInteraction::decelerate(double dt) { double frequency = 1.0 / _deceleratesPerSecond; - // Number of times velocities should decelerate, depending on chosen frequency and time slack over from last frame + // Number of times velocities should decelerate, depending on chosen frequency and + // time slack over from last frame int times = (dt + _timeSlack) / frequency; // Save the new time slack for the next frame _timeSlack = fmod((dt + _timeSlack), frequency); // Decelerate zoom velocity quicker if we're close enough to use direct-manipulation - if (!_directTouchMode && _currentRadius > _nodeRadiusThreshold && _vel.zoom > _focusNode->boundingSphere()) { + if (!_directTouchMode && _currentRadius > _nodeRadiusThreshold && + _vel.zoom > _focusNode->boundingSphere()) + { _vel.zoom *= std::pow(1 - 2 * _friction.value().y, times); } _vel.orbit *= std::pow(1 - _friction.value().x, times); @@ -883,7 +1119,8 @@ void TouchInteraction::decelerate(double dt) { void TouchInteraction::resetAfterInput() { if (_directTouchMode && _selected.size() > 0 && _lmSuccess) { double spinDelta = _spinSensitivity / OsEng.windowWrapper().averageDeltaTime(); - if (glm::length(_lastVel.orbit) > _orbitSpeedThreshold) { // allow node to start "spinning" after direct-manipulation finger is let go off + if (glm::length(_lastVel.orbit) > _orbitSpeedThreshold) { + // allow node to start "spinning" after direct-manipulation finger is let go _vel.orbit = _lastVel.orbit * spinDelta; } } diff --git a/modules/touch/src/touchmarker.cpp b/modules/touch/src/touchmarker.cpp index d4cfe8afa4..d71404b413 100644 --- a/modules/touch/src/touchmarker.cpp +++ b/modules/touch/src/touchmarker.cpp @@ -34,18 +34,46 @@ namespace { const std::string _loggerCat = "TouchMarker"; const int MAX_FINGERS = 20; + + static const openspace::properties::Property::PropertyInfo VisibilityInfo = { + "Visibility", + "Toggle visibility of markers", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo RadiusInfo = { + "Size", + "Marker radius", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo TransparencyInfo = { + "Transparency", + "Marker transparency", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo ThicknessInfo = { + "Thickness", + "Marker thickness", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo ColorInfo = { + "MarkerColor", "Marker color", "" // @TODO Missing documentation + }; } // namespace namespace openspace { TouchMarker::TouchMarker() : properties::PropertyOwner({ "TouchMarker" }) - , _visible({ "TouchMarkers visible", "Toggle visibility of markers", "" }, true) // @TODO Missing documentation - , _radiusSize({ "Marker size", "Marker radius", "" }, 30.f, 0.f, 100.f) // @TODO Missing documentation - , _transparency({ "Transparency of marker", "Marker transparency", "" }, 0.8f, 0.f, 1.f) // @TODO Missing documentation - , _thickness({ "Thickness of marker", "Marker thickness", "" }, 2.f, 0.f, 4.f) // @TODO Missing documentation + , _visible(VisibilityInfo, true) + , _radiusSize(RadiusInfo, 30.f, 0.f, 100.f) + , _transparency(TransparencyInfo, 0.8f, 0.f, 1.f) + , _thickness(ThicknessInfo, 2.f, 0.f, 4.f ) , _color( - { "MarkerColor", "Marker color", "" }, // @TODO Missing documentation + ColorInfo, glm::vec3(204.f / 255.f, 51.f / 255.f, 51.f / 255.f), glm::vec3(0.f), glm::vec3(1.f) diff --git a/modules/touch/src/tuioear.cpp b/modules/touch/src/tuioear.cpp index a9e2e128ae..6841926a20 100644 --- a/modules/touch/src/tuioear.cpp +++ b/modules/touch/src/tuioear.cpp @@ -44,7 +44,8 @@ void TuioEar::removeTuioObject(TuioObject*) { } void TuioEar::addTuioCursor(TuioCursor* tcur) { _mx.lock(); _tap = false; - // find same id in _list if it exists in _removeList (new input with same ID as a previously stored) + // find same id in _list if it exists in _removeList (new input with same ID as a + // previously stored) int i = tcur->getSessionID(); std::vector::iterator foundID = std::find_if( _removeList.begin(), @@ -93,7 +94,10 @@ void TuioEar::removeTuioCursor(TuioCursor* tcur) { } dist /= tcur->getPath().size(); - double heldTime = tcur->getPath().back().getTuioTime().getTotalMilliseconds() - tcur->getPath().front().getTuioTime().getTotalMilliseconds(); + double heldTime = + tcur->getPath().back().getTuioTime().getTotalMilliseconds() - + tcur->getPath().front().getTuioTime().getTotalMilliseconds(); + if (heldTime < 180 && dist < 0.0004 && _list.size() == 1 && _removeList.size() == 1) { _tapCo = TuioCursor(*tcur); _tap = true; diff --git a/modules/touch/touchmodule.cpp b/modules/touch/touchmodule.cpp index 8da5114914..eb7505c81f 100644 --- a/modules/touch/touchmodule.cpp +++ b/modules/touch/touchmodule.cpp @@ -46,7 +46,8 @@ bool TouchModule::hasNewInput() { // Get new input from listener listOfContactPoints = ear.getInput(); ear.clearInput(); - touch.touchActive(!listOfContactPoints.empty()); // Set touch property to active (to void mouse input, mainly for mtdev bridges) + // Set touch property to active (to void mouse input, mainly for mtdev bridges) + touch.touchActive(!listOfContactPoints.empty()); // Erase old input id's that no longer exists lastProcessed.erase( @@ -73,14 +74,25 @@ bool TouchModule::hasNewInput() { } // Return true if we got new input - if (listOfContactPoints.size() == lastProcessed.size() && !listOfContactPoints.empty()) { + if (listOfContactPoints.size() == lastProcessed.size() && + !listOfContactPoints.empty()) + { bool newInput = true; - // go through list and check if the last registrered time is newer than the one in lastProcessed (last frame) - std::for_each(lastProcessed.begin(), lastProcessed.end(), [this, &newInput](Point& p) { - std::vector::iterator cursor = std::find_if(listOfContactPoints.begin(), listOfContactPoints.end(), - [&p](const TuioCursor& c) { return c.getSessionID() == p.first; }); + // go through list and check if the last registrered time is newer than the one in + // lastProcessed (last frame) + std::for_each( + lastProcessed.begin(), + lastProcessed.end(), + [this, &newInput](Point& p) { + std::vector::iterator cursor = std::find_if( + listOfContactPoints.begin(), + listOfContactPoints.end(), + [&p](const TuioCursor& c) { return c.getSessionID() == p.first; } + ); double now = cursor->getPath().back().getTuioTime().getTotalMilliseconds(); - if (!cursor->isMoving()) { // if current cursor isn't moving, we want to interpret that as new input for interaction purposes + if (!cursor->isMoving()) { + // if current cursor isn't moving, we want to interpret that as new input + // for interaction purposes newInput = true; } else if (p.second.getTuioTime().getTotalMilliseconds() == now) { @@ -134,16 +146,20 @@ TouchModule::TouchModule() for (const TuioCursor& c : listOfContactPoints) { lastProcessed.emplace_back(c.getSessionID(), c.getPath().back()); } - touch.unitTest(); // used to save data from solver, only calculated for one frame when user chooses in GUI - touch.step(OsEng.windowWrapper().deltaTime()); // calculate the new camera state for this frame + // used to save data from solver, only calculated for one frame when user chooses + // in GUI + touch.unitTest(); + // calculate the new camera state for this frame + touch.step(OsEng.windowWrapper().deltaTime()); } ); OsEng.registerModuleCallback( OpenSpaceEngine::CallbackOption::Render, [&]() { - markers.render(listOfContactPoints); // render markers, customizable through the GUI - } + // render markers, customizable through the GUI + markers.render(listOfContactPoints); + } ); } diff --git a/modules/toyvolume/rendering/renderabletoyvolume.cpp b/modules/toyvolume/rendering/renderabletoyvolume.cpp index b196bf5932..070cf4be64 100644 --- a/modules/toyvolume/rendering/renderabletoyvolume.cpp +++ b/modules/toyvolume/rendering/renderabletoyvolume.cpp @@ -33,16 +33,54 @@ #include #include +namespace { + static const openspace::properties::Property::PropertyInfo ScalingInfo = { + "Scaling", + "Scaling", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo ScalingExponentInfo = { + "ScalingExponent", + "Scaling Exponent", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo StepSizeInfo = { + "StepSize", + "Step Size", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo TranslationInfo = { + "Translation", + "Translation", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo RotationInfo = { + "Rotation", + "Euler rotation", + "" // @TODO Missing documentation + }; + + static const openspace::properties::Property::PropertyInfo ColorInfo = { + "Color", + "Color", + "" // @TODO Missing documentation + }; +} // namespace + namespace openspace { RenderableToyVolume::RenderableToyVolume(const ghoul::Dictionary& dictionary) : Renderable(dictionary) - , _scaling({ "Scaling", "Scaling", "" }, glm::vec3(1.f, 1.f, 1.f), glm::vec3(0.f), glm::vec3(10.f)) // @TODO Missing documentation - , _scalingExponent({ "ScalingExponent", "Scaling Exponent", "" }, 1, -10, 20) - , _stepSize({ "StepSize", "Step Size", "" }, 0.02f, 0.01f, 1.f) // @TODO Missing documentation - , _translation({ "Translation", "Translation", "" }, glm::vec3(0.f, 0.f, 0.f), glm::vec3(0.f), glm::vec3(10.f)) // @TODO Missing documentation - , _rotation({ "Rotation", "Euler rotation", "" }, glm::vec3(0.f, 0.f, 0.f), glm::vec3(0), glm::vec3(6.28f)) // @TODO Missing documentation - , _color({ "Color", "Color", "" }, glm::vec4(1.f, 0.f, 0.f, 0.1f), glm::vec4(0.f), glm::vec4(1.f)) // @TODO Missing documentation + , _scaling(ScalingInfo, glm::vec3(1.f, 1.f, 1.f), glm::vec3(0.f), glm::vec3(10.f)) + , _scalingExponent(ScalingExponentInfo, 1, -10, 20) + , _stepSize(StepSizeInfo, 0.02f, 0.01f, 1.f ) + , _translation(TranslationInfo, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(10.f)) + , _rotation(RotationInfo, glm::vec3(0.f, 0.f, 0.f), glm::vec3(0), glm::vec3(6.28f)) + , _color(ColorInfo, glm::vec4(1.f, 0.f, 0.f, 0.1f), glm::vec4(0.f), glm::vec4(1.f)) { float stepSize, scalingExponent; glm::vec3 scaling, translation, rotation; @@ -108,12 +146,20 @@ bool RenderableToyVolume::isReady() const { void RenderableToyVolume::update(const UpdateData& data) { if (_raycaster) { - glm::mat4 transform = glm::translate(glm::mat4(1.0), static_cast(_translation) * std::pow(10.0f, static_cast(_scalingExponent))); + glm::mat4 transform = glm::translate( + glm::mat4(1.0), + static_cast(_translation) * + std::pow(10.0f, static_cast(_scalingExponent)) + ); glm::vec3 eulerRotation = static_cast(_rotation); transform = glm::rotate(transform, eulerRotation.x, glm::vec3(1, 0, 0)); transform = glm::rotate(transform, eulerRotation.y, glm::vec3(0, 1, 0)); transform = glm::rotate(transform, eulerRotation.z, glm::vec3(0, 0, 1)); - transform = glm::scale(transform, static_cast(_scaling) * std::pow(10.0f, static_cast(_scalingExponent))); + transform = glm::scale( + transform, + static_cast(_scaling) * + std::pow(10.0f, static_cast(_scalingExponent)) + ); _raycaster->setColor(_color); _raycaster->setStepSize(_stepSize); diff --git a/modules/toyvolume/rendering/toyvolumeraycaster.cpp b/modules/toyvolume/rendering/toyvolumeraycaster.cpp index 9031ca6943..04406014e3 100644 --- a/modules/toyvolume/rendering/toyvolumeraycaster.cpp +++ b/modules/toyvolume/rendering/toyvolumeraycaster.cpp @@ -54,7 +54,9 @@ void ToyVolumeRaycaster::initialize() { void ToyVolumeRaycaster::deinitialize() { } -void ToyVolumeRaycaster::renderEntryPoints(const RenderData& data, ghoul::opengl::ProgramObject& program) { +void ToyVolumeRaycaster::renderEntryPoints(const RenderData& data, + ghoul::opengl::ProgramObject& program) +{ program.setUniform("modelTransform", _modelTransform); program.setUniform("viewProjection", data.camera.viewProjectionMatrix()); Renderable::setPscUniforms(program, data.camera, data.position); @@ -67,7 +69,9 @@ void ToyVolumeRaycaster::renderEntryPoints(const RenderData& data, ghoul::opengl _boundingBox.render(); } -void ToyVolumeRaycaster::renderExitPoints(const RenderData& data, ghoul::opengl::ProgramObject& program) { +void ToyVolumeRaycaster::renderExitPoints(const RenderData& data, + ghoul::opengl::ProgramObject& program) +{ // Uniforms program.setUniform("modelTransform", _modelTransform); program.setUniform("viewProjection", data.camera.viewProjectionMatrix()); @@ -84,7 +88,9 @@ void ToyVolumeRaycaster::renderExitPoints(const RenderData& data, ghoul::opengl: glCullFace(GL_BACK); } -void ToyVolumeRaycaster::preRaycast(const RaycastData& data, ghoul::opengl::ProgramObject& program) { +void ToyVolumeRaycaster::preRaycast(const RaycastData& data, + ghoul::opengl::ProgramObject& program) +{ std::string colorUniformName = "color" + std::to_string(data.id); std::string timeUniformName = "time" + std::to_string(data.id); std::string stepSizeUniformName = "maxStepSize" + std::to_string(data.id); diff --git a/modules/toyvolume/rendering/toyvolumeraycaster.h b/modules/toyvolume/rendering/toyvolumeraycaster.h index a433952c96..ac5eaa3569 100644 --- a/modules/toyvolume/rendering/toyvolumeraycaster.h +++ b/modules/toyvolume/rendering/toyvolumeraycaster.h @@ -75,4 +75,4 @@ private: } // openspace -#endif // __OPENSPACE_MODULE_TOYVOLUME___TOYVOLUMERAYCASTER___H__ +#endif // __OPENSPACE_MODULE_TOYVOLUME___TOYVOLUMERAYCASTER___H__ diff --git a/modules/volume/rawvolumewriter.h b/modules/volume/rawvolumewriter.h index 5fc5ff4d3a..20baf35b68 100644 --- a/modules/volume/rawvolumewriter.h +++ b/modules/volume/rawvolumewriter.h @@ -36,7 +36,7 @@ template class RawVolumeWriter { public: RawVolumeWriter(std::string path, size_t bufferSize = 1024); - void setPath(const std::string& path); + void setPath(const std::string& path); glm::uvec3 dimensions() const; void setDimensions(const glm::uvec3& dimensions); void write(const std::function& fn, @@ -53,7 +53,7 @@ private: }; } // namespace volume -} // namespace openspace +} // namespace openspace #include "rawvolumewriter.inl" diff --git a/modules/volume/rawvolumewriter.inl b/modules/volume/rawvolumewriter.inl index 3f999295df..0e443e39ad 100644 --- a/modules/volume/rawvolumewriter.inl +++ b/modules/volume/rawvolumewriter.inl @@ -85,7 +85,7 @@ void RawVolumeWriter::write(const std::function +template void RawVolumeWriter::write(const RawVolume& volume) { setDimensions(volume.dimensions()); diff --git a/modules/volume/rendering/basicvolumeraycaster.h b/modules/volume/rendering/basicvolumeraycaster.h index 9182ffc8b8..4ff6580d49 100644 --- a/modules/volume/rendering/basicvolumeraycaster.h +++ b/modules/volume/rendering/basicvolumeraycaster.h @@ -56,7 +56,7 @@ class BasicVolumeRaycaster : public VolumeRaycaster { public: BasicVolumeRaycaster( std::shared_ptr texture, - std::shared_ptr transferFunction, + std::shared_ptr transferFunction, std::shared_ptr clipPlanes); virtual ~BasicVolumeRaycaster(); void initialize(); @@ -111,4 +111,4 @@ private: } // namespace openspace -#endif // __OPENSPACE_MODULE_VOLUME___BASICVOLUMERAYCASTER___H__ +#endif // __OPENSPACE_MODULE_VOLUME___BASICVOLUMERAYCASTER___H__ diff --git a/modules/volume/rendering/volumeclipplanes.cpp b/modules/volume/rendering/volumeclipplanes.cpp index 83219e4e87..b34fcc4c1b 100644 --- a/modules/volume/rendering/volumeclipplanes.cpp +++ b/modules/volume/rendering/volumeclipplanes.cpp @@ -33,7 +33,7 @@ namespace volume { VolumeClipPlanes::VolumeClipPlanes(const ghoul::Dictionary& dictionary) : properties::PropertyOwner({ "" }) // @TODO Missing name // @TODO Missing documentation - , _nClipPlanes({ "nClipPlanes", "Number of clip planes", "" }, 0, 0, 10) + , _nClipPlanes({ "nClipPlanes", "Number of clip planes", "" }, 0, 0, 10) { std::vector keys = dictionary.keys(); for (const std::string& key : keys) { diff --git a/modules/volume/volumeutils.cpp b/modules/volume/volumeutils.cpp index 287726e027..f6431ca69f 100644 --- a/modules/volume/volumeutils.cpp +++ b/modules/volume/volumeutils.cpp @@ -30,7 +30,7 @@ size_t coordsToIndex(const glm::uvec3& coords, const glm::uvec3& dims) { size_t w = dims.x; size_t h = dims.y; // size_t d = dims.z; -// +// // size_t x = coords.x; // size_t y = coords.y; // size_t z = coords.z; diff --git a/src/documentation/documentation.cpp b/src/documentation/documentation.cpp index 8d8b7afff4..941b50d5b5 100644 --- a/src/documentation/documentation.cpp +++ b/src/documentation/documentation.cpp @@ -65,7 +65,7 @@ struct WarningCompare { // so we have to include one ourselves namespace std { std::string to_string(std::string value) { - return value; + return value; } std::string to_string(openspace::documentation::TestResult::Offense::Reason reason) { diff --git a/src/documentation/documentationgenerator.cpp b/src/documentation/documentationgenerator.cpp index 7526fddf37..ba0fca7354 100644 --- a/src/documentation/documentationgenerator.cpp +++ b/src/documentation/documentationgenerator.cpp @@ -136,7 +136,7 @@ void DocumentationGenerator::writeDocumentation(const std::string& filename) { << "\t" << "" << '\n' << "\t" << "" << '\n' << "\t\t" << "" << _name << "" << '\n' << "\t" << "" << '\n' diff --git a/src/documentation/verifier.cpp b/src/documentation/verifier.cpp index 8d4b302e87..43c69580e4 100644 --- a/src/documentation/verifier.cpp +++ b/src/documentation/verifier.cpp @@ -300,7 +300,7 @@ AndVerifier::AndVerifier(Verifier* l, Verifier* r) } TestResult AndVerifier::operator()(const ghoul::Dictionary& dict, - const std::string& key) const + const std::string& key) const { TestResult resLhs = lhs->operator()(dict, key); TestResult resRhs = rhs->operator()(dict, key); diff --git a/src/engine/downloadmanager.cpp b/src/engine/downloadmanager.cpp index 21e67c259c..019878987d 100644 --- a/src/engine/downloadmanager.cpp +++ b/src/engine/downloadmanager.cpp @@ -426,7 +426,7 @@ void DownloadManager::getFileExtension(const std::string& url, if (CURLE_OK == res) { char* ct; // ask for the content-type - res = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct); + res = curl_easy_getinfo(curl, CURLINFO_CONTENT_TYPE, &ct); if ((res == CURLE_OK) && ct && finishedCallback) { finishedCallback(std::string(ct)); } diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 406f8c7750..876ae47594 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -832,7 +832,7 @@ void OpenSpaceEngine::configureLogging() { ConfigurationManager::KeyLogging + '.' + ConfigurationManager::PartLogLevel; const std::string KeyLogImmediateFlush = ConfigurationManager::KeyLogging + '.' + ConfigurationManager::PartImmediateFlush; - const std::string KeyLogs = + const std::string KeyLogs = ConfigurationManager::KeyLogging + '.' + ConfigurationManager::PartLogs; if (configurationManager().hasKeyAndValue(KeyLogLevel)) { @@ -1009,7 +1009,7 @@ void OpenSpaceEngine::initializeGL() { // The ordering of the KeyCheckOpenGLState and KeyLogEachOpenGLCall are important as // the callback mask in glbinding is stateful for each context, and since - // KeyLogEachOpenGLCall is more specific, we want it to be able to overwrite the + // KeyLogEachOpenGLCall is more specific, we want it to be able to overwrite the // state from KeyCheckOpenGLState if (_configurationManager->hasKey(ConfigurationManager::KeyCheckOpenGLState)) { const bool val = _configurationManager->value( diff --git a/src/engine/syncengine.cpp b/src/engine/syncengine.cpp index 684669b5f9..1337e5ef2d 100644 --- a/src/engine/syncengine.cpp +++ b/src/engine/syncengine.cpp @@ -32,7 +32,7 @@ namespace openspace { -SyncEngine::SyncEngine(unsigned int syncBufferSize) +SyncEngine::SyncEngine(unsigned int syncBufferSize) : _syncBuffer(syncBufferSize) { ghoul_assert(syncBufferSize > 0, "syncBufferSize must be bigger than 0"); diff --git a/src/engine/wrapper/sgctwindowwrapper.cpp b/src/engine/wrapper/sgctwindowwrapper.cpp index 4940e12b33..6754293148 100644 --- a/src/engine/wrapper/sgctwindowwrapper.cpp +++ b/src/engine/wrapper/sgctwindowwrapper.cpp @@ -171,7 +171,7 @@ glm::vec2 SGCTWindowWrapper::dpiScaling() const { int SGCTWindowWrapper::currentNumberOfAaSamples() const { return sgct::Engine::instance()->getCurrentWindowPtr()->getNumberOfAASamples(); -} +} bool SGCTWindowWrapper::isRegularRendering() const { sgct::SGCTWindow* w = sgct::Engine::instance()->getCurrentWindowPtr(); diff --git a/src/interaction/navigationhandler.cpp b/src/interaction/navigationhandler.cpp index 4746f84296..08c4373dac 100644 --- a/src/interaction/navigationhandler.cpp +++ b/src/interaction/navigationhandler.cpp @@ -149,7 +149,7 @@ void NavigationHandler::updateCamera(double deltaTime) { } else { _orbitalNavigator->updateMouseStatesFromInput(*_inputState, deltaTime); - _orbitalNavigator->updateCameraStateFromMouseStates(*_camera, deltaTime); + _orbitalNavigator->updateCameraStateFromMouseStates(*_camera, deltaTime); } _camera->setFocusPositionVec3(focusNode()->worldPosition()); } diff --git a/src/interaction/orbitalnavigator.cpp b/src/interaction/orbitalnavigator.cpp index a7f67fe980..0478eceb6f 100644 --- a/src/interaction/orbitalnavigator.cpp +++ b/src/interaction/orbitalnavigator.cpp @@ -88,7 +88,7 @@ namespace { namespace openspace::interaction { -OrbitalNavigator::Friction::Friction() +OrbitalNavigator::Friction::Friction() : properties::PropertyOwner({ "Friction" }) , roll(RollFrictionInfo, true) , rotational(RotationalFrictionInfo, true) @@ -108,7 +108,7 @@ OrbitalNavigator::OrbitalNavigator() , _sensitivity(SensitivityInfo, 20.0f, 1.0f, 50.f) , _mouseStates(_sensitivity * pow(10.0, -4), 1 / (_friction.friction + 0.0000001)) { - auto smoothStep = + auto smoothStep = [](double t) { double res = 3.0 * t*t - 2.0 * t*t*t; return glm::clamp(res, 0.0, 1.0); @@ -261,7 +261,7 @@ void OrbitalNavigator::updateCameraStateFromMouseStates(Camera& camera, double d ); // Update the camera state - camera.setPositionVec3(camPos); + camera.setPositionVec3(camPos); camera.setRotation(camRot.globalRotation * camRot.localRotation); } } @@ -504,7 +504,7 @@ glm::dvec3 OrbitalNavigator::translateVertically( glm::dquat OrbitalNavigator::rotateHorizontally( double deltaTime, const glm::dquat& globalCameraRotation, - const glm::dvec3& /*cameraPosition*/, + const glm::dvec3& /*cameraPosition*/, const SurfacePositionHandle& positionHandle) const { glm::dmat4 modelTransform = _focusNode->modelTransform(); diff --git a/src/mission/mission.cpp b/src/mission/mission.cpp index 88297f165a..1445f9a3e7 100644 --- a/src/mission/mission.cpp +++ b/src/mission/mission.cpp @@ -125,8 +125,8 @@ MissionPhase::MissionPhase(const ghoul::Dictionary& dict) { _timeRange.include(overallTimeRange); } else { - // Its OK to not specify an overall time range, the time range for the - // subphases will simply be used. + // Its OK to not specify an overall time range, the time range for the + // subphases will simply be used. _timeRange.include(timeRangeSubPhases); } } diff --git a/src/network/networkengine.cpp b/src/network/networkengine.cpp index 0a0be411f2..edea7cc398 100644 --- a/src/network/networkengine.cpp +++ b/src/network/networkengine.cpp @@ -49,7 +49,7 @@ namespace { namespace openspace { -NetworkEngine::NetworkEngine() +NetworkEngine::NetworkEngine() // -1 is okay as we assign one identifier in this ctor : _lastAssignedIdentifier(MessageIdentifier(-1)) , _shouldPublishStatusMessage(true) @@ -217,7 +217,7 @@ void NetworkEngine::sendInitialInformation() { std::vector payload = m.body; payload.insert(payload.begin(), identifier.data.begin(), identifier.data.end()); OsEng.windowWrapper().sendMessageToExternalControl(payload); - LINFO("Sent initial message: (s=" << m.body.size() << ")" << + LINFO("Sent initial message: (s=" << m.body.size() << ")" << "[i=" << identifier.value << "]" ); diff --git a/src/network/parallelconnection.cpp b/src/network/parallelconnection.cpp index 2860fdf55e..550c3abfef 100644 --- a/src/network/parallelconnection.cpp +++ b/src/network/parallelconnection.cpp @@ -628,7 +628,7 @@ double ParallelConnection::timeTolerance() const { void ParallelConnection::dataMessageReceived(const std::vector& messageContent) { // The type of data message received - uint32_t type = *(reinterpret_cast(messageContent.data())); + uint32_t type = *(reinterpret_cast(messageContent.data())); std::vector buffer( messageContent.begin() + sizeof(uint32_t), messageContent.end() diff --git a/src/properties/matrix/dmat2property.cpp b/src/properties/matrix/dmat2property.cpp index 9dd7bf0e53..009afe1de4 100644 --- a/src/properties/matrix/dmat2property.cpp +++ b/src/properties/matrix/dmat2property.cpp @@ -126,7 +126,7 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat2Property, glm::dmat2x2, glm::dmat2x2(0), numeric_limits::max() ), glm::dmat2x2( - 0.01, 0.01, + 0.01, 0.01, 0.01, 0.01 ), DEFAULT_FROM_LUA_LAMBDA(glm::dmat2x2), diff --git a/src/properties/matrix/dmat2x3property.cpp b/src/properties/matrix/dmat2x3property.cpp index 1cfecabde0..8178e25617 100644 --- a/src/properties/matrix/dmat2x3property.cpp +++ b/src/properties/matrix/dmat2x3property.cpp @@ -130,7 +130,7 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat2x3Property, glm::dmat2x3, glm::dmat2x3(0) numeric_limits::max() ), glm::dmat2x3( - 0.01, 0.01, 0.01, + 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 ), DEFAULT_FROM_LUA_LAMBDA(glm::dmat2x3), diff --git a/src/properties/matrix/dmat2x4property.cpp b/src/properties/matrix/dmat2x4property.cpp index 6277315574..9706a1929c 100644 --- a/src/properties/matrix/dmat2x4property.cpp +++ b/src/properties/matrix/dmat2x4property.cpp @@ -134,7 +134,7 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat2x4Property, glm::dmat2x4, glm::dmat2x4(0) numeric_limits::max() ), glm::dmat2x4( - 0.01, 0.01, 0.01, 0.01, + 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 ), DEFAULT_FROM_LUA_LAMBDA(glm::dmat2x4), diff --git a/src/properties/matrix/dmat3property.cpp b/src/properties/matrix/dmat3property.cpp index e00d73ea6d..acdb6af091 100644 --- a/src/properties/matrix/dmat3property.cpp +++ b/src/properties/matrix/dmat3property.cpp @@ -136,8 +136,8 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat3Property, glm::dmat3x3, glm::dmat3x3(0), numeric_limits::max() ), glm::dmat3x3( - 0.01, 0.01, 0.01, - 0.01, 0.01, 0.01, + 0.01, 0.01, 0.01, + 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 ), DEFAULT_FROM_LUA_LAMBDA(glm::dmat3x3), diff --git a/src/properties/matrix/dmat3x2property.cpp b/src/properties/matrix/dmat3x2property.cpp index 29bcf67716..8ee35db37f 100644 --- a/src/properties/matrix/dmat3x2property.cpp +++ b/src/properties/matrix/dmat3x2property.cpp @@ -130,7 +130,7 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat3x2Property, glm::dmat3x2, glm::dmat3x2(0) numeric_limits::max() ), glm::dmat3x2( - 0.01, 0.01, 0.01, + 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 ), DEFAULT_FROM_LUA_LAMBDA(glm::dmat3x2), diff --git a/src/properties/matrix/dmat3x4property.cpp b/src/properties/matrix/dmat3x4property.cpp index 1fc0b7b2d2..d0523030e5 100644 --- a/src/properties/matrix/dmat3x4property.cpp +++ b/src/properties/matrix/dmat3x4property.cpp @@ -142,8 +142,8 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat3x4Property, glm::dmat3x4, glm::dmat3x4(0) numeric_limits::max() ), glm::dmat3x4( - 0.01, 0.01, 0.01, 0.01, - 0.01, 0.01, 0.01, 0.01, + 0.01, 0.01, 0.01, 0.01, + 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 ), DEFAULT_FROM_LUA_LAMBDA(glm::dmat3x4), diff --git a/src/properties/matrix/dmat4property.cpp b/src/properties/matrix/dmat4property.cpp index 2a0c829c13..283549e309 100644 --- a/src/properties/matrix/dmat4property.cpp +++ b/src/properties/matrix/dmat4property.cpp @@ -150,9 +150,9 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat4Property, glm::dmat4x4, glm::dmat4x4(0), numeric_limits::max() ), glm::dmat4x4( - 0.01, 0.01, 0.01, 0.01, - 0.01, 0.01, 0.01, 0.01, - 0.01, 0.01, 0.01, 0.01, + 0.01, 0.01, 0.01, 0.01, + 0.01, 0.01, 0.01, 0.01, + 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 ), DEFAULT_FROM_LUA_LAMBDA(glm::dmat4x4), diff --git a/src/properties/matrix/dmat4x2property.cpp b/src/properties/matrix/dmat4x2property.cpp index 2301a25424..3a38fd9cf6 100644 --- a/src/properties/matrix/dmat4x2property.cpp +++ b/src/properties/matrix/dmat4x2property.cpp @@ -134,7 +134,7 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat4x2Property, glm::dmat4x2, glm::dmat4x2(0) numeric_limits::max() ), glm::dmat4x2( - 0.01, 0.01, 0.01, 0.01, + 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 ), DEFAULT_FROM_LUA_LAMBDA(glm::dmat4x2), diff --git a/src/properties/matrix/dmat4x3property.cpp b/src/properties/matrix/dmat4x3property.cpp index 5d88da9057..7edc09ecdb 100644 --- a/src/properties/matrix/dmat4x3property.cpp +++ b/src/properties/matrix/dmat4x3property.cpp @@ -142,8 +142,8 @@ REGISTER_NUMERICALPROPERTY_SOURCE(DMat4x3Property, glm::dmat4x3, glm::dmat4x3(0) numeric_limits::max() ), glm::dmat4x3( - 0.01, 0.01, 0.01, 0.01, - 0.01, 0.01, 0.01, 0.01, + 0.01, 0.01, 0.01, 0.01, + 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01, 0.01 ), DEFAULT_FROM_LUA_LAMBDA(glm::dmat4x3), diff --git a/src/properties/matrix/mat3x4property.cpp b/src/properties/matrix/mat3x4property.cpp index d74e4eef22..3412134a3c 100644 --- a/src/properties/matrix/mat3x4property.cpp +++ b/src/properties/matrix/mat3x4property.cpp @@ -142,8 +142,8 @@ REGISTER_NUMERICALPROPERTY_SOURCE(Mat3x4Property, glm::mat3x4, glm::mat3x4(0), numeric_limits::max() ), glm::mat3x4( - 0.01f, 0.01f, 0.01f, 0.01f, - 0.01f, 0.01f, 0.01f, 0.01f, + 0.01f, 0.01f, 0.01f, 0.01f, + 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f ), DEFAULT_FROM_LUA_LAMBDA(glm::mat3x4), diff --git a/src/properties/matrix/mat4property.cpp b/src/properties/matrix/mat4property.cpp index 2fc8200cc8..e0afddd0ea 100644 --- a/src/properties/matrix/mat4property.cpp +++ b/src/properties/matrix/mat4property.cpp @@ -150,9 +150,9 @@ REGISTER_NUMERICALPROPERTY_SOURCE(Mat4Property, glm::mat4x4, glm::mat4x4(0), numeric_limits::max() ), glm::mat4x4( - 0.01f, 0.01f, 0.01f, 0.01f, - 0.01f, 0.01f, 0.01f, 0.01f, - 0.01f, 0.01f, 0.01f, 0.01f, + 0.01f, 0.01f, 0.01f, 0.01f, + 0.01f, 0.01f, 0.01f, 0.01f, + 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f ), DEFAULT_FROM_LUA_LAMBDA(glm::mat4x4), diff --git a/src/properties/matrix/mat4x2property.cpp b/src/properties/matrix/mat4x2property.cpp index b3d8aaf043..7bc809a0ef 100644 --- a/src/properties/matrix/mat4x2property.cpp +++ b/src/properties/matrix/mat4x2property.cpp @@ -134,7 +134,7 @@ REGISTER_NUMERICALPROPERTY_SOURCE(Mat4x2Property, glm::mat4x2, glm::mat4x2(0), numeric_limits::max() ), glm::mat4x2( - 0.01f, 0.01f, 0.01f, 0.01f, + 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f ), DEFAULT_FROM_LUA_LAMBDA(glm::mat4x2), diff --git a/src/properties/matrix/mat4x3property.cpp b/src/properties/matrix/mat4x3property.cpp index 5ca0e28437..22dcac9bd4 100644 --- a/src/properties/matrix/mat4x3property.cpp +++ b/src/properties/matrix/mat4x3property.cpp @@ -142,8 +142,8 @@ REGISTER_NUMERICALPROPERTY_SOURCE(Mat4x3Property, glm::mat4x3, glm::mat4x3(0), numeric_limits::max() ), glm::mat4x3( - 0.01f, 0.01f, 0.01f, 0.01f, - 0.01f, 0.01f, 0.01f, 0.01f, + 0.01f, 0.01f, 0.01f, 0.01f, + 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f, 0.01f ), DEFAULT_FROM_LUA_LAMBDA(glm::mat4x3), diff --git a/src/properties/property.cpp b/src/properties/property.cpp index 2f6e41a51b..1454467423 100644 --- a/src/properties/property.cpp +++ b/src/properties/property.cpp @@ -223,7 +223,7 @@ std::string Property::generateBaseDescription() const { std::string(TypeKey) + " = \"" + className() + "\", " + IdentifierKey + " = \"" + fullyQualifiedIdentifier() + "\", " + NameKey + " = \"" + guiName() + "\", " + - generateMetaDataDescription() + ", " + + generateMetaDataDescription() + ", " + generateAdditionalDescription(); } diff --git a/src/rendering/abufferrenderer.cpp b/src/rendering/abufferrenderer.cpp index 82f2393c4d..ee7bc8a4fb 100644 --- a/src/rendering/abufferrenderer.cpp +++ b/src/rendering/abufferrenderer.cpp @@ -74,10 +74,10 @@ void ABufferRenderer::initialize() { const GLfloat vertex_data[] = { // x y s t -size, -size, 0.0f, 1.0f, - size, size, 0.0f, 1.0f, - -size, size, 0.0f, 1.0f, - -size, -size, 0.0f, 1.0f, - size, -size, 0.0f, 1.0f, + size, size, 0.0f, 1.0f, + -size, size, 0.0f, 1.0f, + -size, -size, 0.0f, 1.0f, + size, -size, 0.0f, 1.0f, size, size, 0.0f, 1.0f, }; @@ -237,7 +237,7 @@ void ABufferRenderer::update() { void ABufferRenderer::render(float blackoutFactor, bool doPerformanceMeasurements) { PerfMeasure("ABufferRenderer::render"); - if (!_scene || !_camera) { + if (!_scene || !_camera) { return; } diff --git a/src/rendering/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp index 97c2616bc1..211f970b48 100644 --- a/src/rendering/framebufferrenderer.cpp +++ b/src/rendering/framebufferrenderer.cpp @@ -405,7 +405,7 @@ void FramebufferRenderer::render(float blackoutFactor, bool doPerformanceMeasure glBindFramebuffer(GL_FRAMEBUFFER, _exitFramebuffer); glClear(GL_COLOR_BUFFER_BIT | GL_DEPTH_BUFFER_BIT); - ghoul::opengl::ProgramObject* exitProgram = _exitPrograms[raycaster].get(); + ghoul::opengl::ProgramObject* exitProgram = _exitPrograms[raycaster].get(); if (exitProgram) { exitProgram->activate(); raycaster->renderExitPoints(raycasterTask.renderData, *exitProgram); diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 73a7a6365b..b7660d1f8e 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include #ifdef OPENSPACE_MODULE_SPACECRAFTINSTRUMENTS_ENABLED #include @@ -80,7 +80,7 @@ namespace { const char* _loggerCat = "RenderEngine"; - const char* KeyRenderingMethod = "RenderingMethod"; + const char* KeyRenderingMethod = "RenderingMethod"; const std::chrono::seconds ScreenLogTimeToLive(15); const char* DefaultRenderingMethod = "ABuffer"; const char* RenderFsPath = "${SHADERS}/render.frag"; @@ -375,7 +375,7 @@ void RenderEngine::initialize() { void RenderEngine::initializeGL() { LTRACE("RenderEngine::initializeGL(begin)"); - // TODO: Fix the power scaled coordinates in such a way that these + // TODO: Fix the power scaled coordinates in such a way that these // values can be set to more realistic values // set the close clip plane and the far clip plane to extreme values while in diff --git a/src/rendering/screenspacerenderable.cpp b/src/rendering/screenspacerenderable.cpp index 1fcd91818e..f62ab66629 100644 --- a/src/rendering/screenspacerenderable.cpp +++ b/src/rendering/screenspacerenderable.cpp @@ -294,7 +294,7 @@ ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary } _delete.onChange([this](){ - std::string script = + std::string script = "openspace.unregisterScreenSpaceRenderable('" + name() + "');"; OsEng.scriptEngine().queueScript( script, @@ -454,7 +454,7 @@ glm::mat4 ScreenSpaceRenderable::scaleMatrix() { _scale * scalingRatioY * textureRatio, 1.f ) - ); + ); } glm::mat4 ScreenSpaceRenderable::rotationMatrix() { diff --git a/src/scene/rotation.cpp b/src/scene/rotation.cpp index f25f5b2189..f1209576f6 100644 --- a/src/scene/rotation.cpp +++ b/src/scene/rotation.cpp @@ -66,7 +66,7 @@ std::unique_ptr Rotation::createFromDictionary(const ghoul::Dictionary return result; } -Rotation::Rotation() +Rotation::Rotation() : properties::PropertyOwner({ "Rotation" }) {} diff --git a/src/scene/scene_doc.inl b/src/scene/scene_doc.inl index 7e12ff7475..dfc66f0537 100644 --- a/src/scene/scene_doc.inl +++ b/src/scene/scene_doc.inl @@ -78,7 +78,7 @@ documentation::Documentation Scene::Documentation() { { "Modules", new TableVerifier({ - { + { "*", new StringVerifier, Optional::No, diff --git a/src/scene/scene_lua.inl b/src/scene/scene_lua.inl index 6912630ec2..4d1110ed85 100644 --- a/src/scene/scene_lua.inl +++ b/src/scene/scene_lua.inl @@ -180,7 +180,7 @@ int property_setValueSingle(lua_State* L) { for (properties::Property* prop : allProperties()) { std::string propFullId = prop->fullyQualifiedIdentifier(); //Look for a match in the uri with the group name (first term) removed - int propMatchLength = + int propMatchLength = static_cast(propFullId.length()) - static_cast(pathRemainderToMatch.length()); diff --git a/src/scripting/scriptengine_lua.inl b/src/scripting/scriptengine_lua.inl index 887bfac211..883f6774a2 100644 --- a/src/scripting/scriptengine_lua.inl +++ b/src/scripting/scriptengine_lua.inl @@ -201,7 +201,7 @@ int absolutePath(lua_State* L) { path = FileSys.convertPathSeparator(path, '/'); lua_pushstring(L, path.c_str()); return 1; -} +} /** * \ingroup LuaScripts @@ -262,7 +262,7 @@ int directoryExists(lua_State* L) { /** * \ingroup LuaScripts * walkDirectory(string, bool, bool): - * Walks a directory and returns the contents of the directory as absolute paths. The + * Walks a directory and returns the contents of the directory as absolute paths. The * first argument is the path of the directory that should be walked, the second argument * determines if the walk is recursive and will continue in contained directories. The * default value for this parameter is "false". The third argument determines whether the @@ -303,8 +303,8 @@ int walkDirectoryFolder(lua_State* L) { /** * \ingroup LuaScripts * directoryForPath(string): - * This function extracts the directory part of the passed path. For example, if the - * parameter is 'C:\\OpenSpace\\foobar\\foo.txt', this function returns + * This function extracts the directory part of the passed path. For example, if the + * parameter is 'C:\\OpenSpace\\foobar\\foo.txt', this function returns * 'C:\\OpenSpace\\foobar'." */ int directoryForPath(lua_State* L) { diff --git a/src/scripting/scriptscheduler.cpp b/src/scripting/scriptscheduler.cpp index f78b82d032..6b3caa26d6 100644 --- a/src/scripting/scriptscheduler.cpp +++ b/src/scripting/scriptscheduler.cpp @@ -244,13 +244,13 @@ ScriptScheduler::progressTo(double newTime) } double ScriptScheduler::currentTime() const { - return _currentTime; + return _currentTime; } std::vector ScriptScheduler::allScripts() const { std::vector result; for (size_t i = 0; i < _timings.size(); ++i) { - ScheduledScript script; + ScheduledScript script; script.time = _timings[i]; script.forwardScript = _forwardScripts[i]; script.backwardScript = _backwardScripts[i]; diff --git a/src/util/openspacemodule.cpp b/src/util/openspacemodule.cpp index 4d91e4a52d..2a5b036666 100644 --- a/src/util/openspacemodule.cpp +++ b/src/util/openspacemodule.cpp @@ -40,7 +40,7 @@ namespace { namespace openspace { -OpenSpaceModule::OpenSpaceModule(std::string name) +OpenSpaceModule::OpenSpaceModule(std::string name) : properties::PropertyOwner({ std::move(name) }) {} diff --git a/src/util/progressbar.cpp b/src/util/progressbar.cpp index 3d9b78d76b..14ec9f879c 100644 --- a/src/util/progressbar.cpp +++ b/src/util/progressbar.cpp @@ -32,7 +32,7 @@ ProgressBar::ProgressBar(int end, int width, std::ostream& stream) : _width(width) , _previous(-1) , _end(end) - , _stream(stream) + , _stream(stream) { print(0); } diff --git a/src/util/spicemanager.cpp b/src/util/spicemanager.cpp index 3978bc4090..ae27937026 100644 --- a/src/util/spicemanager.cpp +++ b/src/util/spicemanager.cpp @@ -175,7 +175,7 @@ SpiceManager::TerminatorType SpiceManager::terminatorTypeFromString( const strin return Mapping.at(type); } -SpiceManager::SpiceManager() +SpiceManager::SpiceManager() : _useExceptions(UseException::Yes) { // Set the SPICE library to not exit the program if an error occurs @@ -447,7 +447,7 @@ void SpiceManager::getValue(const std::string& body, const std::string& value, } void SpiceManager::getValue(const std::string& body, const std::string& value, - std::vector& v) const + std::vector& v) const { ghoul_assert(!v.empty(), "Array for values has to be preallocaed"); @@ -864,10 +864,10 @@ SpiceManager::TerminatorEllipseResult SpiceManager::terminatorEllipse( res.terminatorPoints.resize(numberOfTerminatorPoints); edterm_c(toString(terminatorType), - lightSource.c_str(), - target.c_str(), - ephemerisTime, - frame.c_str(), + lightSource.c_str(), + target.c_str(), + ephemerisTime, + frame.c_str(), aberrationCorrection, observer.c_str(), numberOfTerminatorPoints, diff --git a/src/util/time.cpp b/src/util/time.cpp index 422f1a038e..5bbbeb5ffd 100644 --- a/src/util/time.cpp +++ b/src/util/time.cpp @@ -97,7 +97,7 @@ double Time::deltaTime() const { } void Time::setPause(bool pause) { - _timePaused = pause; + _timePaused = pause; } bool Time::togglePause() { diff --git a/src/util/timerange.cpp b/src/util/timerange.cpp index c50db091f2..f5fb0c0eee 100644 --- a/src/util/timerange.cpp +++ b/src/util/timerange.cpp @@ -82,7 +82,7 @@ bool TimeRange::initializeFromDictionary(const ghoul::Dictionary& dict, TimeRang success &= dict.getValue(KeyStart, startTimeStr); success &= dict.getValue(KeyEnd, endTimeStr); if (success) { - // Parse to date. + // Parse to date. // @TODO converting string to time stamp should not rely on Spice timeRange.start = SpiceManager::ref().ephemerisTimeFromDate(startTimeStr); timeRange.end = SpiceManager::ref().ephemerisTimeFromDate(endTimeStr); @@ -118,7 +118,7 @@ double TimeRange::duration() const { } bool TimeRange::isDefined() const { - return start <= end; + return start <= end; } bool TimeRange::isEmpty() const { diff --git a/src/util/transformationmanager.cpp b/src/util/transformationmanager.cpp index 71cb0b04e3..45223c770a 100644 --- a/src/util/transformationmanager.cpp +++ b/src/util/transformationmanager.cpp @@ -75,7 +75,7 @@ glm::dmat3 TransformationManager::kameleonTransformationMatrix( ); #else return glm::dmat3(0.0); -#endif +#endif } glm::dmat3 TransformationManager::frameTransformationMatrix( diff --git a/support/coding/check_style_guide.py b/support/coding/check_style_guide.py index 048bf311c4..95a3d7e13c 100644 --- a/support/coding/check_style_guide.py +++ b/support/coding/check_style_guide.py @@ -308,6 +308,19 @@ def check_line_length(lines): +def check_empty_character_at_end(lines): + # Disable this check in non-strict mode + if not is_strict_mode: + return '' + + index = [i + 1 for i, s in enumerate(lines) if len(s) > 1 and s[-2] == ' '] + if len(index) > 0: + return index + else: + return '' + + + previousSymbols = {} def check_header_file(file, component): with open(file, 'r+', encoding="utf8") as f: @@ -392,10 +405,13 @@ def check_header_file(file, component): if line_length: print(file, '\t', 'Line length exceeded: ', line_length) + empty_character_at_end = check_empty_character_at_end(lines) + if empty_character_at_end: + print(file, '\t', 'Empty character at end: ', empty_character_at_end) def check_inline_file(file, component): - with open(file, 'r+') as f: + with open(file, 'r+', encoding="utf8") as f: lines = f.readlines() copyright = check_copyright(lines) @@ -434,10 +450,14 @@ def check_inline_file(file, component): if line_length: print(file, '\t', 'Line length exceeded: ', line_length) + empty_character_at_end = check_empty_character_at_end(lines) + if empty_character_at_end: + print(file, '\t', 'Empty character at end: ', empty_character_at_end) + def check_source_file(file, component): - with open(file, 'r+') as f: + with open(file, 'r+', encoding="utf8") as f: lines = f.readlines() header = check_glm_header(lines, file) @@ -469,6 +489,10 @@ def check_source_file(file, component): if line_length: print(file, '\t', 'Line length exceeded: ', line_length) + empty_character_at_end = check_empty_character_at_end(lines) + if empty_character_at_end: + print(file, '\t', 'Empty character at end: ', empty_character_at_end) + def check_files(positiveList, negativeList, component, check_function):