From 60e3ed2170ad993f0b86450874eb89ecaa18d9e0 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Sat, 28 Nov 2020 22:31:06 +0100 Subject: [PATCH] General pass for coding style --- apps/OpenSpace/ext/sgct | 2 +- apps/OpenSpace/main.cpp | 8 +- ext/ghoul | 2 +- .../openspace/interaction/sessionrecording.h | 4 +- .../tasks/convertrecfileversiontask.h | 2 +- .../interaction/tasks/convertrecformattask.h | 4 +- include/openspace/rendering/helper.h | 3 +- include/openspace/scene/assetloader.h | 2 +- include/openspace/scene/profile.h | 2 +- include/openspace/util/timemanager.h | 3 +- .../rendering/renderableatmosphere.cpp | 9 +- .../rendering/grids/renderableboxgrid.cpp | 9 +- .../base/rendering/grids/renderablegrid.cpp | 7 +- modules/base/rendering/grids/renderablegrid.h | 2 +- .../rendering/grids/renderableradialgrid.cpp | 28 ++-- .../grids/renderablesphericalgrid.cpp | 4 +- modules/base/rendering/modelgeometry.cpp | 1 - modules/base/rendering/renderablemodel.cpp | 4 +- modules/base/rendering/renderablemodel.h | 4 +- modules/base/rendering/renderablesphere.cpp | 8 +- modules/base/rendering/renderabletrail.cpp | 16 ++- modules/base/rotation/staticrotation.cpp | 4 +- .../rendering/renderabledumeshes.cpp | 2 +- .../rendering/renderableplanescloud.cpp | 2 +- modules/exoplanets/exoplanetshelper.h | 6 +- modules/exoplanets/exoplanetsmodule.cpp | 8 +- modules/exoplanets/exoplanetsmodule_lua.inl | 64 ++++----- .../tasks/exoplanetsdatapreparationtask.cpp | 8 +- .../src/globelabelscomponent.cpp | 2 +- modules/globebrowsing/src/layergroupid.h | 9 +- modules/globebrowsing/src/renderableglobe.cpp | 3 +- modules/globebrowsing/src/renderableglobe.h | 3 +- modules/server/src/topics/timetopic.cpp | 2 +- .../rendering/renderableorbitalkepler.cpp | 14 +- modules/space/rendering/renderablerings.cpp | 4 +- .../space/tasks/generatedebrisvolumetask.cpp | 123 +++++++++++++----- .../space/translation/horizonstranslation.cpp | 4 +- .../rendering/renderablefov.cpp | 74 +++++------ modules/touch/src/win32_touch.cpp | 20 +-- modules/volume/envelope.cpp | 3 +- src/engine/configuration_doc.inl | 2 +- src/engine/globals.cpp | 69 +++++----- src/engine/openspaceengine.cpp | 2 +- src/interaction/orbitalnavigator.cpp | 6 +- src/interaction/sessionrecording.cpp | 24 ++-- .../tasks/convertrecformattask.cpp | 3 +- src/properties/propertyowner.cpp | 7 +- src/rendering/framebufferrenderer.cpp | 27 ++-- src/rendering/renderengine.cpp | 2 +- src/scene/assetloader.cpp | 3 +- src/scene/lightsource.cpp | 2 +- src/scene/profile.cpp | 5 +- src/scene/profile_lua.inl | 2 +- src/scene/scale.cpp | 4 +- src/scene/scenelicensewriter.cpp | 2 +- src/util/time_lua.inl | 16 +-- 56 files changed, 377 insertions(+), 278 deletions(-) diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index 6c351ebf2e..dc7d75681b 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit 6c351ebf2e7a1106982502f4050363f31ac3d0a3 +Subproject commit dc7d75681b1fe5259c7adf7502d99679a01270a8 diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index ec1d62ec3f..d074fc737a 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -582,10 +582,10 @@ void mainPostDrawFunc() { } if (w.right.initialized) { - const GLuint texId = window.frameBufferTexture(Window::TextureIndex::RightEye); - glBindTexture(GL_TEXTURE_2D, texId); + const GLuint tId = window.frameBufferTexture(Window::TextureIndex::RightEye); + glBindTexture(GL_TEXTURE_2D, tId); w.right.handle->SendTexture( - texId, + tId, GL_TEXTURE_2D, window.framebufferResolution().x, window.framebufferResolution().y @@ -1205,7 +1205,7 @@ int main(int argc, char** argv) { arguments.insert(arguments.begin() + 2, absPath(windowConfiguration)); // Need to set this before the creation of the sgct::Engine - + Log::instance().setLogToConsole(false); Log::instance().setShowTime(false); Log::instance().setShowLogLevel(false); diff --git a/ext/ghoul b/ext/ghoul index ae10aa2307..d08973205c 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit ae10aa23075d1f78407e9895a8ec2e91337e958d +Subproject commit d08973205c88a2c759d86a679db0d5536df7ee71 diff --git a/include/openspace/interaction/sessionrecording.h b/include/openspace/interaction/sessionrecording.h index ba66e18f69..0ab16c63d2 100644 --- a/include/openspace/interaction/sessionrecording.h +++ b/include/openspace/interaction/sessionrecording.h @@ -593,8 +593,8 @@ protected: DataMode mode, int lineNum, std::ofstream& outFile); virtual bool convertCamera(std::stringstream& inStream, DataMode mode, int lineNum, std::string& inputLine, std::ofstream& outFile, unsigned char* buff); - virtual bool convertTimeChange(std::stringstream& inStream, DataMode mode, int lineNum, - std::string& inputLine, std::ofstream& outFile, unsigned char* buff); + virtual bool convertTimeChange(std::stringstream& inStream, DataMode mode, + int lineNum, std::string& inputLine, std::ofstream& outFile, unsigned char* buff); virtual bool convertScript(std::stringstream& inStream, DataMode mode, int lineNum, std::string& inputLine, std::ofstream& outFile, unsigned char* buff); DataMode readModeFromHeader(std::string filename); diff --git a/include/openspace/interaction/tasks/convertrecfileversiontask.h b/include/openspace/interaction/tasks/convertrecfileversiontask.h index 66125ee5bc..98a5a51da6 100644 --- a/include/openspace/interaction/tasks/convertrecfileversiontask.h +++ b/include/openspace/interaction/tasks/convertrecfileversiontask.h @@ -54,4 +54,4 @@ private: } // namespace openspace::interaction -#endif //__OPENSPACE_CORE___CONVERTRECFILEVERSIONTASK___H__ +#endif // __OPENSPACE_CORE___CONVERTRECFILEVERSIONTASK___H__ diff --git a/include/openspace/interaction/tasks/convertrecformattask.h b/include/openspace/interaction/tasks/convertrecformattask.h index a221109b2a..17df5c5c4e 100644 --- a/include/openspace/interaction/tasks/convertrecformattask.h +++ b/include/openspace/interaction/tasks/convertrecformattask.h @@ -32,8 +32,6 @@ #include - - namespace openspace::interaction { class ConvertRecFormatTask : public Task { @@ -67,4 +65,4 @@ private: } // namespace openspace::interaction -#endif //__OPENSPACE_CORE___CONVERTRECFORMATTASK___H__ +#endif // __OPENSPACE_CORE___CONVERTRECFORMATTASK___H__ diff --git a/include/openspace/rendering/helper.h b/include/openspace/rendering/helper.h index a26eb9aab6..a776dfb25d 100644 --- a/include/openspace/rendering/helper.h +++ b/include/openspace/rendering/helper.h @@ -105,7 +105,8 @@ VertexXYZ convertToXYZ(const Vertex& v); std::vector convert(std::vector v); -std::vector createRing(int nSegments, float radius, glm::vec4 colors = glm::vec4(1.f)); +std::vector createRing(int nSegments, float radius, + glm::vec4 colors = glm::vec4(1.f)); } // namespace openspace::rendering::helper diff --git a/include/openspace/scene/assetloader.h b/include/openspace/scene/assetloader.h index 644acf671d..5d0b72c007 100644 --- a/include/openspace/scene/assetloader.h +++ b/include/openspace/scene/assetloader.h @@ -215,7 +215,7 @@ private: _onDependencyInitializationFunctionRefs; std::unordered_map>> _onDependencyDeinitializationFunctionRefs; - + int _assetsTableRef = 0; }; diff --git a/include/openspace/scene/profile.h b/include/openspace/scene/profile.h index ab8de80916..cb539cbe35 100644 --- a/include/openspace/scene/profile.h +++ b/include/openspace/scene/profile.h @@ -127,7 +127,7 @@ public: * and all of the property & asset changes that were made since startup. */ void saveCurrentSettingsToProfile(const properties::PropertyOwner& rootOwner, - std::string currentTime, + std::string currentTime, interaction::NavigationHandler::NavigationState navState); /// If the value passed to this function is 'true', the addAsset and removeAsset diff --git a/include/openspace/util/timemanager.h b/include/openspace/util/timemanager.h index 2297e29a18..658b5f08a3 100644 --- a/include/openspace/util/timemanager.h +++ b/include/openspace/util/timemanager.h @@ -160,7 +160,8 @@ private: std::vector> _timeChangeCallbacks; std::vector> _deltaTimeChangeCallbacks; - std::vector> _deltaTimeStepsChangeCallbacks; + std::vector> + _deltaTimeStepsChangeCallbacks; std::vector> _timeJumpCallbacks; std::vector> _timelineChangeCallbacks; diff --git a/modules/atmosphere/rendering/renderableatmosphere.cpp b/modules/atmosphere/rendering/renderableatmosphere.cpp index 62582209a1..776c38032a 100644 --- a/modules/atmosphere/rendering/renderableatmosphere.cpp +++ b/modules/atmosphere/rendering/renderableatmosphere.cpp @@ -384,13 +384,14 @@ RenderableAtmosphere::RenderableAtmosphere(const ghoul::Dictionary& dictionary) "Atmosphere Effects. Disabling atmosphere effects for this planet." ); } - + if (atmosphereDictionary.hasKey(SunIntensityInfo.identifier)) { _sunRadianceIntensity = atmosphereDictionary.value(SunIntensityInfo.identifier); } - - if (atmosphereDictionary.hasKey(MieScatteringExtinctionPropCoeffInfo.identifier)) { + + if (atmosphereDictionary.hasKey(MieScatteringExtinctionPropCoeffInfo.identifier)) + { _mieScattExtPropCoefProp = atmosphereDictionary.value( MieScatteringExtinctionPropCoeffInfo.identifier ); @@ -621,7 +622,7 @@ RenderableAtmosphere::RenderableAtmosphere(const ghoul::Dictionary& dictionary) _mieScatteringCoeffZP.onChange(updateAtmosphere); addProperty(_mieScatteringCoeffZP); - _mieScatteringExtinctionPropCoefficientP = + _mieScatteringExtinctionPropCoefficientP = _mieScattExtPropCoefProp != 1.f ? _mieScattExtPropCoefProp : _mieScatteringCoeff.x / _mieExtinctionCoeff.x; diff --git a/modules/base/rendering/grids/renderableboxgrid.cpp b/modules/base/rendering/grids/renderableboxgrid.cpp index c05f583011..e56c997d0a 100644 --- a/modules/base/rendering/grids/renderableboxgrid.cpp +++ b/modules/base/rendering/grids/renderableboxgrid.cpp @@ -272,14 +272,7 @@ void RenderableBoxGrid::update(const UpdateData&) { GL_STATIC_DRAW ); - glVertexAttribPointer( - 0, - 3, - GL_FLOAT, - GL_FALSE, - sizeof(Vertex), - nullptr - ); + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(Vertex), nullptr); glBindVertexArray(0); diff --git a/modules/base/rendering/grids/renderablegrid.cpp b/modules/base/rendering/grids/renderablegrid.cpp index e8b8857103..9e55e4a216 100644 --- a/modules/base/rendering/grids/renderablegrid.cpp +++ b/modules/base/rendering/grids/renderablegrid.cpp @@ -81,7 +81,8 @@ documentation::Documentation RenderableGrid::Documentation() { }, { SegmentsInfo.identifier, - new DoubleVector2Verifier, // @TODO (emmbr 2020-07-07): should be Int, but specification test fails... + // @TODO (emmbr 2020-07-07): should be Int, but specification test fails.. + new DoubleVector2Verifier, Optional::Yes, SegmentsInfo.description }, @@ -230,13 +231,13 @@ void RenderableGrid::update(const UpdateData&) { const glm::vec2 halfSize = _size.value() / 2.f; const glm::uvec2 nSegments = _segments.value(); - const glm::vec2 step = _size.value() / static_cast(nSegments); + const glm::vec2 step = _size.value() / static_cast(nSegments); const int nLines = (2 * nSegments.x * nSegments.y) + nSegments.x + nSegments.y; const int nVertices = 2 * nLines; _varray.resize(nVertices); // OBS! Could be optimized further by removing duplicate vertices - + int nr = 0; for (unsigned int i = 0; i < nSegments.x; ++i) { for (unsigned int j = 0; j < nSegments.y; ++j) { diff --git a/modules/base/rendering/grids/renderablegrid.h b/modules/base/rendering/grids/renderablegrid.h index 79d43df723..39c3c2d751 100644 --- a/modules/base/rendering/grids/renderablegrid.h +++ b/modules/base/rendering/grids/renderablegrid.h @@ -35,7 +35,7 @@ #include #include -namespace ghoul::opengl { class ProgramObject; } +namespace ghoul::opengl { class ProgramObject; } namespace openspace::documentation { struct Documentation; } namespace openspace { diff --git a/modules/base/rendering/grids/renderableradialgrid.cpp b/modules/base/rendering/grids/renderableradialgrid.cpp index 0b61d9fc56..73c0f5ed25 100644 --- a/modules/base/rendering/grids/renderableradialgrid.cpp +++ b/modules/base/rendering/grids/renderableradialgrid.cpp @@ -131,8 +131,8 @@ RenderableRadialGrid::RenderableRadialGrid(const ghoul::Dictionary& dictionary) : Renderable(dictionary) , _gridColor(GridColorInfo, glm::vec3(0.5f), glm::vec3(0.f), glm::vec3(1.f)) , _gridSegments( - GridSegmentsInfo, - glm::ivec2(1, 1), + GridSegmentsInfo, + glm::ivec2(1, 1), glm::ivec2(1), glm::ivec2(200) ) @@ -258,7 +258,7 @@ void RenderableRadialGrid::render(const RenderData& data, RendererTasks&) { "MVPTransform", glm::dmat4(data.camera.projectionMatrix()) * modelViewTransform ); - + _gridProgram->setUniform("gridColor", _gridColor); float adjustedLineWidth = 1.f; @@ -272,7 +272,7 @@ void RenderableRadialGrid::render(const RenderData& data, RendererTasks&) { glEnablei(GL_BLEND, 0); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_LINE_SMOOTH); - + for (GeometryData& c : _circles) { c.render(); } @@ -337,9 +337,9 @@ void RenderableRadialGrid::update(const UpdateData&) { rendering::helper::createRing(nLines, _minRadius); for (int i = 0; i < nLines; ++i) { - const rendering::helper::VertexXYZ vOut = + const rendering::helper::VertexXYZ vOut = rendering::helper::convertToXYZ(outerVertices[i]); - + const rendering::helper::VertexXYZ vIn = rendering::helper::convertToXYZ(innerVertices[i]); @@ -352,7 +352,7 @@ void RenderableRadialGrid::update(const UpdateData&) { _gridIsDirty = false; } -RenderableRadialGrid::GeometryData::GeometryData(GLenum renderMode) +RenderableRadialGrid::GeometryData::GeometryData(GLenum renderMode) : mode(renderMode) { glGenVertexArrays(1, &vao); @@ -375,8 +375,8 @@ RenderableRadialGrid::GeometryData::GeometryData(GeometryData&& other) noexcept other.vbo = 0; } -RenderableRadialGrid::GeometryData& -RenderableRadialGrid::GeometryData::operator=(GeometryData&& other) noexcept +RenderableRadialGrid::GeometryData& +RenderableRadialGrid::GeometryData::operator=(GeometryData&& other) noexcept { if (this != &other) { vao = other.vao; @@ -409,11 +409,11 @@ void RenderableRadialGrid::GeometryData::update() { ); glVertexAttribPointer( - 0, - 3, - GL_FLOAT, - GL_FALSE, - sizeof(rendering::helper::VertexXYZ), + 0, + 3, + GL_FLOAT, + GL_FALSE, + sizeof(rendering::helper::VertexXYZ), nullptr ); } diff --git a/modules/base/rendering/grids/renderablesphericalgrid.cpp b/modules/base/rendering/grids/renderablesphericalgrid.cpp index 76e2467944..95af20718b 100644 --- a/modules/base/rendering/grids/renderablesphericalgrid.cpp +++ b/modules/base/rendering/grids/renderablesphericalgrid.cpp @@ -201,7 +201,7 @@ void RenderableSphericalGrid::render(const RenderData& data, RendererTasks&){ "MVPTransform", glm::dmat4(data.camera.projectionMatrix()) * modelViewTransform ); - + _gridProgram->setUniform("gridColor", _gridColor); float adjustedLineWidth = 1.f; @@ -215,7 +215,7 @@ void RenderableSphericalGrid::render(const RenderData& data, RendererTasks&){ glEnablei(GL_BLEND, 0); glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); glEnable(GL_LINE_SMOOTH); - + glBindVertexArray(_vaoID); glBindBuffer(GL_ELEMENT_ARRAY_BUFFER, _iBufferID); glDrawElements(_mode, _isize, GL_UNSIGNED_INT, nullptr); diff --git a/modules/base/rendering/modelgeometry.cpp b/modules/base/rendering/modelgeometry.cpp index f6a2e8424f..fa0b673bdb 100644 --- a/modules/base/rendering/modelgeometry.cpp +++ b/modules/base/rendering/modelgeometry.cpp @@ -82,7 +82,6 @@ documentation:: Documentation ModelGeometry::Documentation() { }; } -// Create with ghoul::mm_unique_ptr ghoul::mm_unique_ptr ModelGeometry::createFromDictionary( const ghoul::Dictionary& dictionary) { diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index 39c920ded5..3fb0bc90f6 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -62,8 +62,8 @@ namespace { constexpr const std::array UniformNames = { "opacity", "nLightSources", "lightDirectionsViewSpace", "lightIntensities", - "modelViewTransform", "normalTransform", "projectionTransform", - "performShading", "texture1", "ambientIntensity", "diffuseIntensity", + "modelViewTransform", "normalTransform", "projectionTransform", + "performShading", "texture1", "ambientIntensity", "diffuseIntensity", "specularIntensity", "opacityBlending" }; diff --git a/modules/base/rendering/renderablemodel.h b/modules/base/rendering/renderablemodel.h index 23beb352cc..b89cbcf944 100644 --- a/modules/base/rendering/renderablemodel.h +++ b/modules/base/rendering/renderablemodel.h @@ -86,8 +86,8 @@ private: ghoul::opengl::ProgramObject* _program = nullptr; UniformCache(opacity, nLightSources, lightDirectionsViewSpace, lightIntensities, - modelViewTransform, normalTransform, projectionTransform, - performShading, texture, ambientIntensity, diffuseIntensity, + modelViewTransform, normalTransform, projectionTransform, + performShading, texture, ambientIntensity, diffuseIntensity, specularIntensity, opacityBlending) _uniformCache; std::vector> _lightSources; diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp index f097a5a806..c88294d8f5 100644 --- a/modules/base/rendering/renderablesphere.cpp +++ b/modules/base/rendering/renderablesphere.cpp @@ -370,7 +370,9 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) { const float startLogFadeDistance = glm::log(_size * _fadeInThreshold); const float stopLogFadeDistance = startLogFadeDistance + 1.f; - if (logDistCamera > startLogFadeDistance && logDistCamera < stopLogFadeDistance) { + if (logDistCamera > startLogFadeDistance && logDistCamera < + stopLogFadeDistance) + { const float fadeFactor = glm::clamp( (logDistCamera - startLogFadeDistance) / (stopLogFadeDistance - startLogFadeDistance), @@ -391,7 +393,9 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) { const float startLogFadeDistance = glm::log(_size * _fadeOutThreshold); const float stopLogFadeDistance = startLogFadeDistance + 1.f; - if (logDistCamera > startLogFadeDistance && logDistCamera < stopLogFadeDistance) { + if (logDistCamera > startLogFadeDistance && logDistCamera < + stopLogFadeDistance) + { const float fadeFactor = glm::clamp( (logDistCamera - startLogFadeDistance) / (stopLogFadeDistance - startLogFadeDistance), diff --git a/modules/base/rendering/renderabletrail.cpp b/modules/base/rendering/renderabletrail.cpp index 9c96849da0..c46038e569 100644 --- a/modules/base/rendering/renderabletrail.cpp +++ b/modules/base/rendering/renderabletrail.cpp @@ -71,11 +71,17 @@ namespace { }; // Fragile! Keep in sync with documentation - const std::map RenderBinModeConversion = { + const std::map RenderBinConversion = { { "Background", openspace::Renderable::RenderBin::Background }, { "Opaque", openspace::Renderable::RenderBin::Opaque }, - { "PreDeferredTransparent", openspace::Renderable::RenderBin::PreDeferredTransparent}, - { "PostDeferredTransparent", openspace::Renderable::RenderBin::PostDeferredTransparent} + { + "PreDeferredTransparent", + openspace::Renderable::RenderBin::PreDeferredTransparent + }, + { + "PostDeferredTransparent", + openspace::Renderable::RenderBin::PostDeferredTransparent + } }; static const openspace::properties::PropertyOwner::PropertyOwnerInfo @@ -274,7 +280,7 @@ RenderableTrail::RenderableTrail(const ghoul::Dictionary& dictionary) addPropertySubOwner(_appearance); if (dictionary.hasKeyAndValue(RenderBinModeInfo.identifier)) { - openspace::Renderable::RenderBin cfgRenderBin = RenderBinModeConversion.at( + openspace::Renderable::RenderBin cfgRenderBin = RenderBinConversion.at( dictionary.value(RenderBinModeInfo.identifier) ); setRenderBin(cfgRenderBin); @@ -327,7 +333,7 @@ bool RenderableTrail::isReady() const { void RenderableTrail::internalRender(bool renderLines, bool renderPoints, const RenderData& data, - const glm::dmat4& modelTransform, + const glm::dmat4& modelTransform, RenderInformation& info, int nVertices, int offset) { ZoneScoped diff --git a/modules/base/rotation/staticrotation.cpp b/modules/base/rotation/staticrotation.cpp index 9cdba21e3a..8c995246b1 100644 --- a/modules/base/rotation/staticrotation.cpp +++ b/modules/base/rotation/staticrotation.cpp @@ -94,9 +94,9 @@ StaticRotation::StaticRotation() ) { addProperty(_eulerRotation); - _eulerRotation.onChange([this]() { + _eulerRotation.onChange([this]() { _matrixIsDirty = true; - requireUpdate(); + requireUpdate(); }); } diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.cpp b/modules/digitaluniverse/rendering/renderabledumeshes.cpp index afff95f42d..01094ae093 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.cpp +++ b/modules/digitaluniverse/rendering/renderabledumeshes.cpp @@ -485,7 +485,7 @@ void RenderableDUMeshes::renderLabels(const RenderData& data, labelInfo.scale = pow(10.f, _textSize); labelInfo.enableDepth = true; labelInfo.enableFalseDepth = false; - + glm::vec4 textColor = glm::vec4(glm::vec3(_textColor), _textOpacity); for (const std::pair& pair : _labelData) { diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.cpp b/modules/digitaluniverse/rendering/renderableplanescloud.cpp index 2b7bb6e7f6..a1d80e4503 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.cpp +++ b/modules/digitaluniverse/rendering/renderableplanescloud.cpp @@ -628,7 +628,7 @@ void RenderablePlanesCloud::renderLabels(const RenderData& data, } glm::vec4 textColor = glm::vec4( - glm::vec3(_textColor), + glm::vec3(_textColor), _textOpacity * fadeInVariable ); diff --git a/modules/exoplanets/exoplanetshelper.h b/modules/exoplanets/exoplanetshelper.h index 29e6b5a7ac..476cd781bd 100644 --- a/modules/exoplanets/exoplanetshelper.h +++ b/modules/exoplanets/exoplanetshelper.h @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_EXOPLANETS___EXOPLANET_HELPER___H__ -#define __OPENSPACE_MODULE_EXOPLANETS___EXOPLANET_HELPER___H__ +#ifndef __OPENSPACE_MODULE_EXOPLANETS___EXOPLANETSHELPER___H__ +#define __OPENSPACE_MODULE_EXOPLANETS___EXOPLANETSHELPER___H__ #include #include @@ -91,4 +91,4 @@ void sanitizeNameString(std::string& s); } // namespace openspace::exoplanets -#endif // __OPENSPACE_MODULE_EXOPLANETS___EXOPLANETSMODULE___H__ +#endif // __OPENSPACE_MODULE_EXOPLANETS___EXOPLANETSHELPER___H__ diff --git a/modules/exoplanets/exoplanetsmodule.cpp b/modules/exoplanets/exoplanetsmodule.cpp index 3a9305d206..201e82a857 100644 --- a/modules/exoplanets/exoplanetsmodule.cpp +++ b/modules/exoplanets/exoplanetsmodule.cpp @@ -54,14 +54,14 @@ scripting::LuaLibrary ExoplanetsModule::luaLibrary() const { {}, "string or list of strings", "Add one or multiple exoplanet systems to the scene, as specified by the " - "input. An input string should be the name of the system host star." + "input. An input string should be the name of the system host star" }, { "removeExoplanetSystem", &exoplanets::luascriptfunctions::removeExoplanetSystem, {}, "string", - "Removes the nodes of the specified exoplanet system from the scene graph." + "Removes the nodes of the specified exoplanet system from the scene graph" }, { "listAvailableExoplanetSystems", @@ -69,14 +69,14 @@ scripting::LuaLibrary ExoplanetsModule::luaLibrary() const { {}, "", "Prints a list with the names of all exoplanet systems that can be added to " - "the scene graph to the OpenSpace Log. " + "the scene graph to the OpenSpace Log" }, { "getListOfExoplanets", &exoplanets::luascriptfunctions::getListOfExoplanets, {}, "", - "Gets a list with the names of all exoplanet systems, that can be used by a GUI." + "Gets a list with the names of all exoplanet systems" } }; diff --git a/modules/exoplanets/exoplanetsmodule_lua.inl b/modules/exoplanets/exoplanetsmodule_lua.inl index 50206be659..5f40a768c1 100644 --- a/modules/exoplanets/exoplanetsmodule_lua.inl +++ b/modules/exoplanets/exoplanetsmodule_lua.inl @@ -1,26 +1,26 @@ /***************************************************************************************** -* * -* OpenSpace * -* * -* Copyright (c) 2014-2020 * -* * -* Permission is hereby granted, free of charge, to any person obtaining a copy of this * -* software and associated documentation files (the "Software"), to deal in the Software * -* without restriction, including without limitation the rights to use, copy, modify, * -* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * -* permit persons to whom the Software is furnished to do so, subject to the following * -* conditions: * -* * -* The above copyright notice and this permission notice shall be included in all copies * -* or substantial portions of the Software. * -* * -* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * -* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * -* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * -* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * -* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * -* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * -****************************************************************************************/ + * * + * OpenSpace * + * * + * Copyright (c) 2014-2020 * + * * + * Permission is hereby granted, free of charge, to any person obtaining a copy of this * + * software and associated documentation files (the "Software"), to deal in the Software * + * without restriction, including without limitation the rights to use, copy, modify, * + * merge, publish, distribute, sublicense, and/or sell copies of the Software, and to * + * permit persons to whom the Software is furnished to do so, subject to the following * + * conditions: * + * * + * The above copyright notice and this permission notice shall be included in all copies * + * or substantial portions of the Software. * + * * + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, * + * INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A * + * PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT * + * HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF * + * CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE * + * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * + ****************************************************************************************/ #include #include @@ -51,7 +51,8 @@ constexpr const char* ExoplanetsDataPath = "${SYNC}/http/exoplanets_data/1/exoplanets_data.bin"; constexpr const char* StarTextureFile = "${SYNC}/http/exoplanets_textures/1/sun.jpg"; -constexpr const char* NoDataTextureFile = "${SYNC}/http/exoplanets_textures/1/grid-32.png"; +constexpr const char* NoDataTextureFile = + "${SYNC}/http/exoplanets_textures/1/grid-32.png"; constexpr const char* DiscTextureFile = "${SYNC}/http/exoplanets_textures/1/disc_texture.png"; @@ -122,7 +123,7 @@ void createExoplanetSystem(std::string_view starName) { if (!hasSufficientData(p)) { LERROR(fmt::format( - "Insufficient data available for visualizion of exoplanet system: '{}'", + "Insufficient data available for exoplanet system: '{}'", starName )); return; @@ -174,16 +175,18 @@ void createExoplanetSystem(std::string_view starName) { "}," "{" "Identifier = 'StarTexture'," - "FilePath = " + fmt::format("openspace.absPath('{}')", StarTextureFile) + "," + "FilePath = " + + fmt::format("openspace.absPath('{}')", StarTextureFile) + "," "BlendMode = 'Color'," "Enabled = true" "}"; } else { - colorLayers = + colorLayers = "{" "Identifier = 'NoDataStarTexture'," - "FilePath = " + fmt::format("openspace.absPath('{}')", NoDataTextureFile) + "," + "FilePath = " + + fmt::format("openspace.absPath('{}')", NoDataTextureFile) + "," "BlendMode = 'Color'," "Enabled = true" "}"; @@ -194,7 +197,7 @@ void createExoplanetSystem(std::string_view starName) { "Radii = " + std::to_string(radiusInMeter) + "," "SegmentsPerPatch = 64," "PerformShading = false," - "Layers = {" + "Layers = {" "ColorLayers = { " + colorLayers + "}" "}" "},"; @@ -259,7 +262,8 @@ void createExoplanetSystem(std::string_view starName) { float planetRadius; std::string enabled; - const float astronomicalUnit = static_cast(distanceconstants::AstronomicalUnit); + const float astronomicalUnit = + static_cast(distanceconstants::AstronomicalUnit); const float solarRadius = static_cast(distanceconstants::SolarRadius); const float jupiterRadius = static_cast(distanceconstants::JupiterRadius); @@ -285,7 +289,7 @@ void createExoplanetSystem(std::string_view starName) { const std::string planetKeplerTranslation = "{" "Type = 'KeplerTranslation'," - "Eccentricity = " + std::to_string(planet.ecc) + "," + "Eccentricity = " + std::to_string(planet.ecc) + "," "SemiMajorAxis = " + std::to_string(semiMajorAxisInKm) + "," "Inclination = " + std::to_string(planet.i) + "," "AscendingNode = " + std::to_string(planet.bigOmega) + "," diff --git a/modules/exoplanets/tasks/exoplanetsdatapreparationtask.cpp b/modules/exoplanets/tasks/exoplanetsdatapreparationtask.cpp index 8b66c057b7..c1bb2ff2d6 100644 --- a/modules/exoplanets/tasks/exoplanetsdatapreparationtask.cpp +++ b/modules/exoplanets/tasks/exoplanetsdatapreparationtask.cpp @@ -48,7 +48,9 @@ namespace { namespace openspace::exoplanets { -ExoplanetsDataPreparationTask::ExoplanetsDataPreparationTask(const ghoul::Dictionary& dictionary) { +ExoplanetsDataPreparationTask::ExoplanetsDataPreparationTask( + const ghoul::Dictionary& dictionary) +{ openspace::documentation::testSpecificationAndThrow( documentation(), dictionary, @@ -71,7 +73,9 @@ std::string ExoplanetsDataPreparationTask::description() { ); } -void ExoplanetsDataPreparationTask::perform(const Task::ProgressCallback& progressCallback) { +void ExoplanetsDataPreparationTask::perform( + const Task::ProgressCallback& progressCallback) +{ std::ifstream inputDataFile(_inputDataPath); if (!inputDataFile.good()) { LERROR(fmt::format("Failed to open input file '{}'", _inputDataPath)); diff --git a/modules/globebrowsing/src/globelabelscomponent.cpp b/modules/globebrowsing/src/globelabelscomponent.cpp index 2eb2e0f97e..045b98cbb5 100644 --- a/modules/globebrowsing/src/globelabelscomponent.cpp +++ b/modules/globebrowsing/src/globelabelscomponent.cpp @@ -692,7 +692,7 @@ void GlobeLabelsComponent::renderLabels(const RenderData& data, float fadeInVariable ) { glm::vec4 textColor = glm::vec4( - glm::vec3(_labelsColor), + glm::vec3(_labelsColor), _labelsOpacity * fadeInVariable ); diff --git a/modules/globebrowsing/src/layergroupid.h b/modules/globebrowsing/src/layergroupid.h index e2c28e503b..d86ffb9247 100644 --- a/modules/globebrowsing/src/layergroupid.h +++ b/modules/globebrowsing/src/layergroupid.h @@ -140,7 +140,8 @@ constexpr openspace::globebrowsing::layergroupid::GroupID from_string( std::string_view string) { for (int i = 0; i < openspace::globebrowsing::layergroupid::NUM_LAYER_GROUPS; ++i) { - if (string == openspace::globebrowsing::layergroupid::LAYER_GROUP_IDENTIFIERS[i]) { + if (string == openspace::globebrowsing::layergroupid::LAYER_GROUP_IDENTIFIERS[i]) + { return static_cast(i); } } @@ -151,9 +152,11 @@ template <> constexpr openspace::globebrowsing::layergroupid::AdjustmentTypeID from_string( std::string_view string) { - for (int i = 0; i < openspace::globebrowsing::layergroupid::NUM_ADJUSTMENT_TYPES; ++i) { + for (int i = 0; i < openspace::globebrowsing::layergroupid::NUM_ADJUSTMENT_TYPES; ++i) + { if (string == openspace::globebrowsing::layergroupid::ADJUSTMENT_TYPE_NAMES[i]) { - return static_cast(i); + return + static_cast(i); } } return openspace::globebrowsing::layergroupid::AdjustmentTypeID::None; diff --git a/modules/globebrowsing/src/renderableglobe.cpp b/modules/globebrowsing/src/renderableglobe.cpp index 0c774885df..d3c47d8bb2 100644 --- a/modules/globebrowsing/src/renderableglobe.cpp +++ b/modules/globebrowsing/src/renderableglobe.cpp @@ -273,7 +273,8 @@ const Chunk& findChunkNode(const Chunk& node, const Geodetic2& location) { #if defined(__APPLE__) || (defined(__linux__) && defined(__clang__)) using ChunkTileVector = std::vector>; #else -using ChunkTileVector = std::pmr::vector>; +using ChunkTileVector = + std::pmr::vector>; #endif ChunkTileVector tilesAndSettingsUnsorted(const LayerGroup& layerGroup, diff --git a/modules/globebrowsing/src/renderableglobe.h b/modules/globebrowsing/src/renderableglobe.h index f632d38e59..188ec97b5c 100644 --- a/modules/globebrowsing/src/renderableglobe.h +++ b/modules/globebrowsing/src/renderableglobe.h @@ -222,7 +222,8 @@ private: void debugRenderChunk(const Chunk& chunk, const glm::dmat4& mvp, bool renderBounds, bool renderAABB) const; - bool isCullableByFrustum(const Chunk& chunk, const RenderData& renderData, const glm::dmat4& mvp) const; + bool isCullableByFrustum(const Chunk& chunk, const RenderData& renderData, + const glm::dmat4& mvp) const; bool isCullableByHorizon(const Chunk& chunk, const RenderData& renderData, const BoundingHeights& heights) const; diff --git a/modules/server/src/topics/timetopic.cpp b/modules/server/src/topics/timetopic.cpp index 57d61adb9b..a4b8ba0f75 100644 --- a/modules/server/src/topics/timetopic.cpp +++ b/modules/server/src/topics/timetopic.cpp @@ -170,7 +170,7 @@ void TimeTopic::sendDeltaTimeSteps() { const std::vector& steps = global::timeManager->deltaTimeSteps(); json deltaTimeStepsJson = { - { "deltaTimeSteps", steps } + { "deltaTimeSteps", steps } }; const json nextPrevJson = getNextPrevDeltaTimeStepJson(); diff --git a/modules/space/rendering/renderableorbitalkepler.cpp b/modules/space/rendering/renderableorbitalkepler.cpp index 0afe86fc94..8b438ead27 100644 --- a/modules/space/rendering/renderableorbitalkepler.cpp +++ b/modules/space/rendering/renderableorbitalkepler.cpp @@ -51,11 +51,17 @@ namespace { constexpr const char* KeyLineNum = "LineNumber"; // Fragile! Keep in sync with documentation - const std::map RenderBinModeConversion = { + const std::map RenderBinConversion = { { "Background", openspace::Renderable::RenderBin::Background }, { "Opaque", openspace::Renderable::RenderBin::Opaque }, - { "PreDeferredTransparent", openspace::Renderable::RenderBin::PreDeferredTransparent}, - { "PostDeferredTransparent", openspace::Renderable::RenderBin::PostDeferredTransparent} + { + "PreDeferredTransparent", + openspace::Renderable::RenderBin::PreDeferredTransparent + }, + { + "PostDeferredTransparent", + openspace::Renderable::RenderBin::PostDeferredTransparent + } }; constexpr const std::array LeapYears = { @@ -416,7 +422,7 @@ RenderableOrbitalKepler::RenderableOrbitalKepler(const ghoul::Dictionary& dict) _sizeRenderCallbackHandle = _sizeRender.onChange(_updateRenderSizeSelect); if (dict.hasKeyAndValue(RenderBinModeInfo.identifier)) { - openspace::Renderable::RenderBin cfgRenderBin = RenderBinModeConversion.at( + openspace::Renderable::RenderBin cfgRenderBin = RenderBinConversion.at( dict.value(RenderBinModeInfo.identifier) ); setRenderBin(cfgRenderBin); diff --git a/modules/space/rendering/renderablerings.cpp b/modules/space/rendering/renderablerings.cpp index 4e882de4a0..ac786e9b82 100644 --- a/modules/space/rendering/renderablerings.cpp +++ b/modules/space/rendering/renderablerings.cpp @@ -39,8 +39,8 @@ namespace { constexpr const std::array UniformNames = { - "modelViewProjectionTransform", "textureOffset", "colorFilterValue", "_nightFactor", - "sunPosition", "texture1" + "modelViewProjectionTransform", "textureOffset", "colorFilterValue", + "_nightFactor", "sunPosition", "texture1" }; constexpr openspace::properties::Property::PropertyInfo TextureInfo = { diff --git a/modules/space/tasks/generatedebrisvolumetask.cpp b/modules/space/tasks/generatedebrisvolumetask.cpp index 3946f9ccc2..aea20f3c61 100644 --- a/modules/space/tasks/generatedebrisvolumetask.cpp +++ b/modules/space/tasks/generatedebrisvolumetask.cpp @@ -483,7 +483,9 @@ float getMaxApogee(std::vector inData){ return static_cast(maxApogee*1000); // * 1000 for meters } -int getIndexFromPosition(glm::dvec3 position, glm::uvec3 dim, float maxApogee, std::string gridType){ +int getIndexFromPosition(glm::dvec3 position, glm::uvec3 dim, float maxApogee, + std::string gridType) +{ // epsilon is to make sure that for example if newPosition.x/maxApogee = 1, // then the index for that dimension will not exceed the range of the grid. float epsilon = static_cast(0.000000001); @@ -492,12 +494,15 @@ int getIndexFromPosition(glm::dvec3 position, glm::uvec3 dim, float maxApogee, s ,position.y + maxApogee ,position.z + maxApogee); - glm::uvec3 coordinateIndex = glm::uvec3(static_cast(newPosition.x * dim.x / (2 * (maxApogee + epsilon))) - ,static_cast(newPosition.y * dim.y / (2 * (maxApogee + epsilon))) - ,static_cast(newPosition.z * dim.z / (2 * (maxApogee + epsilon)))); + glm::uvec3 coordinateIndex = glm::uvec3( + static_cast(newPosition.x * dim.x / (2 * (maxApogee + epsilon))), + static_cast(newPosition.y * dim.y / (2 * (maxApogee + epsilon))), + static_cast(newPosition.z * dim.z / (2 * (maxApogee + epsilon))) + ); - return coordinateIndex.z * (dim.x * dim.y) + coordinateIndex.y * dim.x + coordinateIndex.x; + return coordinateIndex.z * (dim.x * dim.y) + + coordinateIndex.y * dim.x + coordinateIndex.x; } else if(gridType == "Spherical"){ @@ -508,16 +513,13 @@ int getIndexFromPosition(glm::dvec3 position, glm::uvec3 dim, float maxApogee, s position.z = 0; } - glm::uvec3 coordinateIndex = glm::uvec3(static_cast(position.x * dim.x / (maxApogee)) - ,static_cast(position.y * dim.y / (3.14159265358979323846264338327950288)) - ,static_cast(position.z * dim.z / (2*3.14159265358979323846264338327950288))); + glm::uvec3 coordinateIndex = glm::uvec3( + static_cast(position.x * dim.x / (maxApogee)), + static_cast(position.y * dim.y / glm::pi()), + static_cast(position.z * dim.z / glm::two_pi())); - - // LINFO(fmt::format("index coords: {} ", coordinateIndex)); - // LINFO(fmt::format("index dim: {} ", dim)); - // LINFO(fmt::format("index va: {} ", coordinateIndex.y * (dim.x * dim.y) + coordinateIndex.z * dim.x + coordinateIndex.x)); - - return coordinateIndex.z * (dim.x * dim.y) + coordinateIndex.y * dim.x + coordinateIndex.x; + return coordinateIndex.z * (dim.x * dim.y) + + coordinateIndex.y * dim.x + coordinateIndex.x; } return -1; @@ -541,9 +543,12 @@ double getVoxelVolume(int index, RawVolume& raw, glm::uvec3 dim, float ma } -double* mapDensityToVoxels(double* densityArray, std::vector positions, glm::uvec3 dim, float maxApogee, std::string gridType, RawVolume& raw) { +double* mapDensityToVoxels(double* densityArray, std::vector positions, + glm::uvec3 dim, float maxApogee, std::string gridType, + RawVolume& raw) +{ - for(const glm::dvec3& position : positions) { + for (const glm::dvec3& position : positions) { //LINFO(fmt::format("pos: {} ", position)); int index = getIndexFromPosition(position, dim, maxApogee, gridType); //LINFO(fmt::format("index: {} ", index)); @@ -551,7 +556,8 @@ double* mapDensityToVoxels(double* densityArray, std::vector positio ++densityArray[index]; } else if(gridType == "Spherical"){ - double voxelVolume = getVoxelVolume(index, raw, dim, maxApogee); //something like this + // something like this + double voxelVolume = getVoxelVolume(index, raw, dim, maxApogee); densityArray[index] += 1/voxelVolume; } } @@ -569,9 +575,11 @@ GenerateDebrisVolumeTask::GenerateDebrisVolumeTask(const ghoul::Dictionary& dict _rawVolumeOutputPath = absPath(dictionary.value(KeyRawVolumeOutput)); _dictionaryOutputPath = absPath(dictionary.value(KeyDictionaryOutput)); - _dimensions = dictionary.value(KeyDimensions); // must not be for some reason. + // must not be for some reason. + _dimensions = dictionary.value(KeyDimensions); _startTime = dictionary.value(KeyStartTime); - _timeStep = dictionary.value(KeyTimeStep); // Todo: send KeyTimeStep in as a int or float correctly. + // Todo: send KeyTimeStep in as a int or float correctly. + _timeStep = dictionary.value(KeyTimeStep); _endTime = dictionary.value(KeyEndTime); // since _inputPath is past from task, // there will have to be either one task per dataset, @@ -605,12 +613,35 @@ void GenerateDebrisVolumeTask::perform(const Task::ProgressCallback& progressCal // std::vectorTLEDataVector3 = readTLEFile(_inputPath3); // std::vectorTLEDataVector4 = readTLEFile(_inputPath4); - // _TLEDataVector.reserve( TLEDataVector.size() + TLEDataVector1.size() + TLEDataVector2.size() + TLEDataVector3.size() + TLEDataVector4.size()); - // _TLEDataVector.insert(_TLEDataVector.end(), TLEDataVector.begin(), TLEDataVector.end()); - // _TLEDataVector.insert(_TLEDataVector.end(), TLEDataVector1.begin(), TLEDataVector1.end()); - // _TLEDataVector.insert(_TLEDataVector.end(), TLEDataVector2.begin(), TLEDataVector2.end()); - // _TLEDataVector.insert(_TLEDataVector.end(), TLEDataVector3.begin(), TLEDataVector3.end()); - // _TLEDataVector.insert(_TLEDataVector.end(), TLEDataVector4.begin(), TLEDataVector4.end()); + // _TLEDataVector.reserve( + // TLEDataVector.size() + TLEDataVector1.size() + TLEDataVector2.size() + + // TLEDataVector3.size() + TLEDataVector4.size() + // ); + // _TLEDataVector.insert( + // _TLEDataVector.end(), + // TLEDataVector.begin(), + // TLEDataVector.end() + // ); + //_TLEDataVector.insert( + // _TLEDataVector.end(), + // TLEDataVector1.begin(), + // TLEDataVector1.end() + //); + //_TLEDataVector.insert( + // _TLEDataVector.end(), + // TLEDataVector2.begin(), + // TLEDataVector2.end() + //); + //_TLEDataVector.insert( + // _TLEDataVector.end(), + // TLEDataVector3.begin(), + // TLEDataVector3.end() + //); + //_TLEDataVector.insert( + // _TLEDataVector.end(), + // TLEDataVector4.begin(), + // TLEDataVector4.end() + //); // ----- or ----- if only one // _TLEDataVector = readTLEFile(_inputPath); @@ -651,16 +682,31 @@ void GenerateDebrisVolumeTask::perform(const Task::ProgressCallback& progressCal float minVal = std::numeric_limits::max(); float maxVal = std::numeric_limits::min(); // 2. - for(int i=0 ; i<=numberOfIterations ; ++i) { - - std::vector startPositionBuffer = getPositionBuffer(_TLEDataVector, startTimeInSeconds+(i*timeStep), _gridType); //+(i*timeStep) + for (int i=0 ; i<=numberOfIterations ; ++i) { + std::vector startPositionBuffer = getPositionBuffer( + _TLEDataVector, + startTimeInSeconds + (i * timeStep), + _gridType + ); //+(i*timeStep) //LINFO(fmt::format("pos: {} ", startPositionBuffer[4])); double *densityArrayp = new double[size](); - //densityArrayp = mapDensityToVoxels(densityArrayp, generatedPositions, _dimensions, maxApogee); + //densityArrayp = mapDensityToVoxels( + // densityArrayp, + // generatedPositions, + // _dimensions, + // maxApogee + //); volume::RawVolume rawVolume(_dimensions); - densityArrayp = mapDensityToVoxels(densityArrayp, startPositionBuffer, _dimensions, _maxApogee, _gridType, rawVolume); + densityArrayp = mapDensityToVoxels( + densityArrayp, + startPositionBuffer, + _dimensions, + _maxApogee, + _gridType, + rawVolume + ); /*std::vector testBuffer; testBuffer.push_back(glm::dvec3(0,0,0)); testBuffer.push_back(glm::dvec3(1,1.5,1.5)); @@ -669,14 +715,20 @@ void GenerateDebrisVolumeTask::perform(const Task::ProgressCallback& progressCal //testBuffer.push_back(glm::dvec3(10000,1000000000,1000000000)); - densityArrayp = mapDensityToVoxels(densityArrayp, testBuffer, _dimensions, _maxApogee, _gridType); + densityArrayp = mapDensityToVoxels( + densityArrayp, + testBuffer, + _dimensions, + _maxApogee, + _gridType + ); */ // create object rawVolume //glm::vec3 domainSize = _upperDomainBound - _lowerDomainBound; - // TODO: Create a forEachSatallite and set(cell, value) to combine mapDensityToVoxel - // and forEachVoxel for less time complexity. + // TODO: Create a forEachSatallite and set(cell, value) to combine + // mapDensityToVoxel and forEachVoxel for less time complexity. rawVolume.forEachVoxel([&](glm::uvec3 cell, float) { // glm::vec3 coord = _lowerDomainBound + // glm::vec3(cell) / glm::vec3(_dimensions) * domainSize; @@ -708,7 +760,10 @@ void GenerateDebrisVolumeTask::perform(const Task::ProgressCallback& progressCal ghoul::filesystem::File file(rawOutputName); const std::string directory = file.directoryName(); if (!FileSys.directoryExists(directory)) { - FileSys.createDirectory(directory, ghoul::filesystem::FileSystem::Recursive::Yes); + FileSys.createDirectory( + directory, + ghoul::filesystem::FileSystem::Recursive::Yes + ); } volume::RawVolumeWriter writer(rawOutputName); diff --git a/modules/space/translation/horizonstranslation.cpp b/modules/space/translation/horizonstranslation.cpp index b931afd0e3..7a794e1e74 100644 --- a/modules/space/translation/horizonstranslation.cpp +++ b/modules/space/translation/horizonstranslation.cpp @@ -141,7 +141,9 @@ void HorizonsTranslation::loadData() { bool hasCachedFile = FileSys.fileExists(cachedFile); if (hasCachedFile) { - LINFO(fmt::format("Cached file '{}' used for Horizon file '{}'", cachedFile, file)); + LINFO(fmt::format( + "Cached file '{}' used for Horizon file '{}'", cachedFile, file + )); bool success = loadCachedFile(cachedFile); if (success) { diff --git a/modules/spacecraftinstruments/rendering/renderablefov.cpp b/modules/spacecraftinstruments/rendering/renderablefov.cpp index a8ea7682e0..be75dca698 100644 --- a/modules/spacecraftinstruments/rendering/renderablefov.cpp +++ b/modules/spacecraftinstruments/rendering/renderablefov.cpp @@ -256,46 +256,46 @@ RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary) , _drawSolid(DrawSolidInfo, false) , _standOffDistance(StandoffDistanceInfo, 0.9999, 0.99, 1.0, 0.000001) , _colors({ - { - DefaultStartColorInfo, - glm::vec3(0.4f), - glm::vec3(0.f), - glm::vec3(1.f) - }, - { - DefaultEndColorInfo, - glm::vec3(0.85f), - glm::vec3(0.f), - glm::vec3(1.f) - }, - { - ActiveColorInfo, - glm::vec3(0.f, 1.f, 0.f), - glm::vec3(0.f), - glm::vec3(1.f) - }, - { - TargetInFovInfo, - glm::vec3(0.f, 0.5f, 0.7f), - glm::vec3(0.f), - glm::vec3(1.f) - }, - { - IntersectionStartInfo, - glm::vec3(1.f, 0.89f, 0.f), + { + DefaultStartColorInfo, + glm::vec3(0.4f), glm::vec3(0.f), - glm::vec3(1.f) - }, - { - IntersectionEndInfo, - glm::vec3(1.f, 0.29f, 0.f), - glm::vec3(0.f), glm::vec3(1.f) }, - { - SquareColorInfo, - glm::vec3(0.85f), - glm::vec3(0.f), + { + DefaultEndColorInfo, + glm::vec3(0.85f), + glm::vec3(0.f), + glm::vec3(1.f) + }, + { + ActiveColorInfo, + glm::vec3(0.f, 1.f, 0.f), + glm::vec3(0.f), + glm::vec3(1.f) + }, + { + TargetInFovInfo, + glm::vec3(0.f, 0.5f, 0.7f), + glm::vec3(0.f), + glm::vec3(1.f) + }, + { + IntersectionStartInfo, + glm::vec3(1.f, 0.89f, 0.f), + glm::vec3(0.f), + glm::vec3(1.f) + }, + { + IntersectionEndInfo, + glm::vec3(1.f, 0.29f, 0.f), + glm::vec3(0.f), + glm::vec3(1.f) + }, + { + SquareColorInfo, + glm::vec3(0.85f), + glm::vec3(0.f), glm::vec3(1.f) } }) diff --git a/modules/touch/src/win32_touch.cpp b/modules/touch/src/win32_touch.cpp index bfd8b73aa9..f0de96acad 100644 --- a/modules/touch/src/win32_touch.cpp +++ b/modules/touch/src/win32_touch.cpp @@ -235,9 +235,9 @@ Win32TouchHook::Win32TouchHook(void* nativeWindow) { // This mouse hook prevents injected mouse events (touch-to-mouse), // since we cannot catch it in our messageloop. // Since this is attached to windows global thread, this will block lowlevel mouse - // access to all running applications if we stall in this thread. - // Debug breakpoints typically freeze our application, in which case we simply don't - // create this if a debugger is attached. + // access to all running applications if we stall in this thread. + // Debug breakpoints typically freeze our application, in which case we simply + // don't create this if a debugger is attached. if (!IsDebuggerPresent()) { gMouseHookThread = new std::thread([](){ gMouseHook = SetWindowsHookExW( @@ -246,7 +246,7 @@ Win32TouchHook::Win32TouchHook(void* nativeWindow) { GetModuleHandleW(NULL), 0 //<- Global thread id (low-level mouse is global only) ); - if (!gMouseHook) { + if (!gMouseHook) { LINFO("Could not setup mousehook!"); } @@ -278,12 +278,12 @@ Win32TouchHook::~Win32TouchHook() { } } -// Low-level mouse hook is "needed" if we want to stop mousecursor from moving -// when we get a touch-input on our window. -// A negative effect is that this function is for global threads, meaning our -// application will cause Windows to stall the mouse cursor when this -// function can't be scheduled (i.e. when debugger hits a breakpoint). -// This is not yet fail-proof...might be a race-condition on message pumping? +// Low-level mouse hook is "needed" if we want to stop mousecursor from moving when we get +// a touch-input on our window. +// A negative effect is that this function is for global threads, meaning our application +// will cause Windows to stall the mouse cursor when this function can't be scheduled +// (i.e. when debugger hits a breakpoint). This is not yet fail-proof...might be a +// race-condition on message pumping? // - Seems to move the cursor when we get two fingers as input.. // - If we ourselves would pump windows for events, we can handle this. LRESULT CALLBACK LowLevelMouseProc(int nCode, WPARAM wParam, LPARAM lParam) { diff --git a/modules/volume/envelope.cpp b/modules/volume/envelope.cpp index 21f5cfdad3..a3539dc83d 100644 --- a/modules/volume/envelope.cpp +++ b/modules/volume/envelope.cpp @@ -123,7 +123,8 @@ glm::vec4 Envelope::valueAtPosition(float pos) const { beforeIter->color * (std::fabs(pos - afterIter->position.first) / dist) + afterIter->color * (std::fabs(pos - beforeIter->position.first) / dist) ), - beforeIter->position.second * (std::fabs(pos - afterIter->position.first) / dist) + + beforeIter->position.second * + (std::fabs(pos - afterIter->position.first) / dist) + afterIter->position.second * (std::fabs(pos - beforeIter->position.first) / dist) }; diff --git a/src/engine/configuration_doc.inl b/src/engine/configuration_doc.inl index 0e92ca2427..8790848033 100644 --- a/src/engine/configuration_doc.inl +++ b/src/engine/configuration_doc.inl @@ -41,7 +41,7 @@ documentation::Documentation Configuration::Documentation = { }, { KeySgctConfigNameInitialized, - new StringAnnotationVerifier("The type of SGCT auto-gen function (if called)"), + new StringAnnotationVerifier("The type of SGCT autogen function (if called)"), Optional::Yes, "The SGCT configuration can be defined from an .xml file, or auto-generated " "by an sgct.config.* lua function. If a lua function is used to generate the " diff --git a/src/engine/globals.cpp b/src/engine/globals.cpp index 156f8f7465..1a008a11ca 100644 --- a/src/engine/globals.cpp +++ b/src/engine/globals.cpp @@ -53,6 +53,7 @@ #include #include #include +#include #include #include #include @@ -106,127 +107,129 @@ void create() { std::byte* currentPos = DataStorage.data(); fontManager = new (currentPos) ghoul::fontrendering::FontManager({ 1536, 1536, 1 }); - assert(fontManager); + ghoul_assert(fontManager, "No fontManager"); currentPos += sizeof(ghoul::fontrendering::FontManager); dashboard = new (currentPos) Dashboard; - assert(dashboard); + ghoul_assert(dashboard, "No dashboard"); currentPos += sizeof(Dashboard); deferredcasterManager = new (currentPos) DeferredcasterManager; - assert(deferredcasterManager); + ghoul_assert(deferredcasterManager, "No deferredcasterManager"); currentPos += sizeof(DeferredcasterManager); downloadManager = new (currentPos) DownloadManager; - assert(downloadManager); + ghoul_assert(downloadManager, "No downloadManager"); currentPos += sizeof(DownloadManager); luaConsole = new (currentPos) LuaConsole; - assert(luaConsole); + ghoul_assert(luaConsole, "No luaConsole"); currentPos += sizeof(LuaConsole); memoryManager = new (currentPos) MemoryManager; - assert(memoryManager); + ghoul_assert(memoryManager, "No memoryManager"); currentPos += sizeof(MemoryManager); missionManager = new (currentPos) MissionManager; - assert(missionManager); + ghoul_assert(missionManager, "No missionManager"); currentPos += sizeof(MissionManager); moduleEngine = new (currentPos) ModuleEngine; - assert(moduleEngine); + ghoul_assert(moduleEngine, "No moduleEngine"); currentPos += sizeof(ModuleEngine); openSpaceEngine = new (currentPos) OpenSpaceEngine; - assert(openSpaceEngine); + ghoul_assert(openSpaceEngine, "No openSpaceEngine"); currentPos += sizeof(OpenSpaceEngine); parallelPeer = new (currentPos) ParallelPeer; - assert(parallelPeer); + ghoul_assert(parallelPeer, "No parallelPeer"); currentPos += sizeof(ParallelPeer); raycasterManager = new (currentPos) RaycasterManager; - assert(raycasterManager); + ghoul_assert(raycasterManager, "No raycasterManager"); currentPos += sizeof(RaycasterManager); renderEngine = new (currentPos) RenderEngine; - assert(renderEngine); + ghoul_assert(renderEngine, "No renderEngine"); currentPos += sizeof(RenderEngine); - screenSpaceRenderables = new (currentPos) std::vector>; - assert(screenSpaceRenderables); + screenSpaceRenderables = + new (currentPos) std::vector>; + ghoul_assert(screenSpaceRenderables, "No screenSpaceRenderables"); currentPos += sizeof(std::vector>); syncEngine = new (currentPos) SyncEngine(4096); - assert(syncEngine); + ghoul_assert(syncEngine, "No syncEngine"); currentPos += sizeof(SyncEngine); timeManager = new (currentPos) TimeManager; - assert(timeManager); + ghoul_assert(timeManager, "No timeManager"); currentPos += sizeof(TimeManager); versionChecker = new (currentPos) VersionChecker; - assert(versionChecker); + ghoul_assert(versionChecker, "No versionChecker"); currentPos += sizeof(VersionChecker); virtualPropertyManager = new (currentPos) VirtualPropertyManager; - assert(virtualPropertyManager); + ghoul_assert(virtualPropertyManager, "No virtualPropertyManager"); currentPos += sizeof(VirtualPropertyManager); windowDelegate = new (currentPos) WindowDelegate; - assert(windowDelegate); + ghoul_assert(windowDelegate, "No windowDelegate"); currentPos += sizeof(WindowDelegate); configuration = new (currentPos) configuration::Configuration; - assert(configuration); + ghoul_assert(configuration, "No configuration"); currentPos += sizeof(configuration::Configuration); interactionMonitor = new (currentPos) interaction::InteractionMonitor; - assert(interactionMonitor); + ghoul_assert(interactionMonitor, "No interactionMonitor"); currentPos += sizeof(interaction::InteractionMonitor); joystickInputStates = new (currentPos) interaction::JoystickInputStates; - assert(joystickInputStates); + ghoul_assert(joystickInputStates, "No joystickInputStates"); currentPos += sizeof(interaction::JoystickInputStates); websocketInputStates = new (currentPos) interaction::WebsocketInputStates; - assert(websocketInputStates); + ghoul_assert(websocketInputStates, "No websocketInputStates"); currentPos += sizeof(interaction::WebsocketInputStates); keybindingManager = new (currentPos) interaction::KeybindingManager; - assert(keybindingManager); + ghoul_assert(keybindingManager, "No keybindingManager"); currentPos += sizeof(interaction::KeybindingManager); navigationHandler = new (currentPos) interaction::NavigationHandler; - assert(navigationHandler); + ghoul_assert(navigationHandler, "No navigationHandler"); currentPos += sizeof(interaction::NavigationHandler); sessionRecording = new (currentPos) interaction::SessionRecording(true); - assert(sessionRecording); + ghoul_assert(sessionRecording, "No sessionRecording"); currentPos += sizeof(interaction::SessionRecording); shortcutManager = new (currentPos) interaction::ShortcutManager; - assert(shortcutManager); + ghoul_assert(shortcutManager, "No shortcutManager"); currentPos += sizeof(interaction::ShortcutManager); rootPropertyOwner = new (currentPos) properties::PropertyOwner({ "" }); - assert(rootPropertyOwner); + ghoul_assert(rootPropertyOwner, "No rootPropertyOwner"); currentPos += sizeof(properties::PropertyOwner); - screenSpaceRootPropertyOwner = new (currentPos) properties::PropertyOwner({ "ScreenSpace" }); - assert(screenSpaceRootPropertyOwner); + screenSpaceRootPropertyOwner = + new (currentPos) properties::PropertyOwner({ "ScreenSpace" }); + ghoul_assert(screenSpaceRootPropertyOwner, "No screenSpaceRootPropertyOwner"); currentPos += sizeof(properties::PropertyOwner); scriptEngine = new (currentPos) scripting::ScriptEngine; - assert(scriptEngine); + ghoul_assert(scriptEngine, "No scriptEngine"); currentPos += sizeof(scripting::ScriptEngine); scriptScheduler = new (currentPos) scripting::ScriptScheduler; - assert(scriptScheduler); + ghoul_assert(scriptScheduler, "No scriptScheduler"); currentPos += sizeof(scripting::ScriptScheduler); profile = new (currentPos) Profile; - assert(profile); + ghoul_assert(profile, "No profile"); currentPos += sizeof(Profile); } diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index edb6de88f3..cedd6501b7 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -1017,7 +1017,7 @@ void OpenSpaceEngine::writeSceneDocumentation() { &properties::PropertyOwner::generateJson, global::rootPropertyOwner ); - + std::future scene = std::async( &properties::PropertyOwner::generateJson, _scene.get() diff --git a/src/interaction/orbitalnavigator.cpp b/src/interaction/orbitalnavigator.cpp index 47ab0f642f..06c54aecae 100644 --- a/src/interaction/orbitalnavigator.cpp +++ b/src/interaction/orbitalnavigator.cpp @@ -256,7 +256,7 @@ OrbitalNavigator::OrbitalNavigator() , _flightDestinationDistance(FlightDestinationDistInfo, 2e8f, 0.0f, 1e10f) , _flightDestinationFactor(FlightDestinationFactorInfo, 1E-4, 1E-6, 0.5) , _applyLinearFlight(ApplyLinearFlightInfo, false) - , _velocitySensitivity(VelocityZoomControlInfo, 3.5f, 0.001f, 20.f) + , _velocitySensitivity(VelocityZoomControlInfo, 3.5f, 0.001f, 20.f) , _mouseSensitivity(MouseSensitivityInfo, 15.f, 1.f, 50.f) , _joystickSensitivity(JoystickSensitivityInfo, 10.f, 1.0f, 50.f) , _websocketSensitivity(WebsocketSensitivityInfo, 5.f, 1.0f, 50.f) @@ -476,7 +476,9 @@ void OrbitalNavigator::updateCameraStateFromStates(double deltaTime) { // Fly towards the flight destination distance. When getting closer than // arrivalThreshold terminate the flight - if (std::fabs(distFromCameraToFocus - _flightDestinationDistance) > arrivalThreshold) { + if (std::fabs(distFromCameraToFocus - _flightDestinationDistance) > + arrivalThreshold) + { pose.position = moveCameraAlongVector( pose.position, distFromCameraToFocus, diff --git a/src/interaction/sessionrecording.cpp b/src/interaction/sessionrecording.cpp index 1468bf2d85..4e5b9d8a93 100644 --- a/src/interaction/sessionrecording.cpp +++ b/src/interaction/sessionrecording.cpp @@ -976,7 +976,8 @@ bool SessionRecording::readSingleKeyframeCamera(datamessagestructures::CameraKey void SessionRecording::saveSingleKeyframeCamera(datamessagestructures::CameraKeyframe& kf, Timestamps& times, DataMode mode, - std::ofstream& file, unsigned char* buffer) + std::ofstream& file, + unsigned char* buffer) { if (mode == DataMode::Binary) { saveCameraKeyframeBinary(times, kf, buffer, file); @@ -1068,9 +1069,9 @@ bool SessionRecording::playbackTimeChange() { return success; } -bool SessionRecording::convertTimeChange(std::stringstream& inStream, DataMode mode, int lineNum, - std::string& inputLine, std::ofstream& outFile, - unsigned char* buffer) +bool SessionRecording::convertTimeChange(std::stringstream& inStream, DataMode mode, + int lineNum, std::string& inputLine, + std::ofstream& outFile, unsigned char* buffer) { Timestamps times; datamessagestructures::TimeKeyframe kf; @@ -1210,9 +1211,9 @@ bool SessionRecording::playbackScript() { return success; } -bool SessionRecording::convertScript(std::stringstream& inStream, DataMode mode, int lineNum, - std::string& inputLine, std::ofstream& outFile, - unsigned char* buffer) +bool SessionRecording::convertScript(std::stringstream& inStream, DataMode mode, + int lineNum, std::string& inputLine, + std::ofstream& outFile, unsigned char* buffer) { Timestamps times; datamessagestructures::ScriptMessage kf; @@ -1252,7 +1253,8 @@ bool SessionRecording::readSingleKeyframeScript(datamessagestructures::ScriptMes void SessionRecording::saveSingleKeyframeScript(datamessagestructures::ScriptMessage& kf, Timestamps& times, DataMode mode, - std::ofstream& file, unsigned char* buffer) + std::ofstream& file, + unsigned char* buffer) { if (mode == DataMode::Binary) { saveScriptKeyframeBinary(times, kf, buffer, file); @@ -1300,8 +1302,7 @@ bool SessionRecording::readScriptKeyframeBinary(Timestamps& times, bool SessionRecording::readScriptKeyframeAscii(Timestamps& times, datamessagestructures::ScriptMessage& kf, - std::string currentParsingLine, - int lineN) + std::string currentParsingLine, int lineN) { std::string entryType; std::istringstream iss(currentParsingLine); @@ -1366,8 +1367,7 @@ bool SessionRecording::addKeyframe(double timestamp, bool SessionRecording::addKeyframeToTimeline(RecordedType type, size_t indexIntoTypeKeyframes, - double timestamp, - int lineNum) + double timestamp, int lineNum) { try { _timeline.push_back({ diff --git a/src/interaction/tasks/convertrecformattask.cpp b/src/interaction/tasks/convertrecformattask.cpp index 57281fc1c3..9132449df0 100644 --- a/src/interaction/tasks/convertrecformattask.cpp +++ b/src/interaction/tasks/convertrecformattask.cpp @@ -117,7 +117,8 @@ void ConvertRecFormatTask::convert() { ); return; } - else if (!SessionRecording::hasFileExtension(_outFilePath, expectedFileExtension_out)) { + else if (!SessionRecording::hasFileExtension(_outFilePath, expectedFileExtension_out)) + { _outFilePath += expectedFileExtension_out; } diff --git a/src/properties/propertyowner.cpp b/src/properties/propertyowner.cpp index 4fedbd95d2..0b0be17ca6 100644 --- a/src/properties/propertyowner.cpp +++ b/src/properties/propertyowner.cpp @@ -121,9 +121,12 @@ namespace { buf.push_back(','); constexpr const char propertyOwnersText[] = "\"propertyOwners\": ["; - //constexpr const std::array propertyOwnersText = { "\"propertyOwners\": [" }; //json << "\"propertyOwners\": ["; - buf.insert(buf.end(), std::begin(propertyOwnersText), std::end(propertyOwnersText) - 1); + buf.insert( + buf.end(), + std::begin(propertyOwnersText), + std::end(propertyOwnersText) - 1 + ); auto propertyOwners = owner->propertySubOwners(); for (properties::PropertyOwner* o : propertyOwners) { createJson(o, buf); diff --git a/src/rendering/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp index 028fd63fc7..48aa47acfe 100644 --- a/src/rendering/framebufferrenderer.cpp +++ b/src/rendering/framebufferrenderer.cpp @@ -176,27 +176,27 @@ void FramebufferRenderer::initialize() { glGenTextures(1, &_gBuffers.positionTexture); glGenTextures(1, &_gBuffers.normalTexture); glGenFramebuffers(1, &_gBuffers.framebuffer); - + // PingPong Buffers // The first pingpong buffer shares the color texture with the renderbuffer: _pingPongBuffers.colorTexture[0] = _gBuffers.colorTexture; glGenTextures(1, &_pingPongBuffers.colorTexture[1]); glGenFramebuffers(1, &_pingPongBuffers.framebuffer); - + // Exit framebuffer glGenTextures(1, &_exitColorTexture); - glGenTextures(1, &_exitDepthTexture); + glGenTextures(1, &_exitDepthTexture); glGenFramebuffers(1, &_exitFramebuffer); // HDR / Filtering Buffers glGenFramebuffers(1, &_hdrBuffers.hdrFilteringFramebuffer); glGenTextures(1, &_hdrBuffers.hdrFilteringTexture); - + // FXAA Buffers glGenFramebuffers(1, &_fxaaBuffers.fxaaFramebuffer); glGenTextures(1, &_fxaaBuffers.fxaaTexture); - + // DownscaleVolumeRendering glGenFramebuffers(1, &_downscaleVolumeRendering.framebuffer); glGenTextures(1, &_downscaleVolumeRendering.colorTexture); @@ -318,7 +318,12 @@ void FramebufferRenderer::initialize() { 0 ); if (glbinding::Binding::ObjectLabel.isResolved()) { - glObjectLabel(GL_FRAMEBUFFER, _hdrBuffers.hdrFilteringFramebuffer, -1, "HDR filtering"); + glObjectLabel( + GL_FRAMEBUFFER, + _hdrBuffers.hdrFilteringFramebuffer, + -1, + "HDR filtering" + ); } status = glCheckFramebufferStatus(GL_FRAMEBUFFER); @@ -1134,8 +1139,8 @@ void FramebufferRenderer::updateFXAA() { void FramebufferRenderer::updateDownscaledVolume() { ZoneScoped - - _downscaledVolumeProgram = ghoul::opengl::ProgramObject::Build( + + _downscaledVolumeProgram = ghoul::opengl::ProgramObject::Build( "Write Downscaled Volume Program", absPath("${SHADERS}/framebuffer/mergeDownscaledVolume.vert"), absPath("${SHADERS}/framebuffer/mergeDownscaledVolume.frag") @@ -1225,7 +1230,7 @@ void FramebufferRenderer::render(Scene* scene, Camera* camera, float blackoutFac performDeferredTasks(tasks.deferredcasterTasks); } - + glDrawBuffers(1, &ColorAttachmentArray[_pingPongIndex]); glEnablei(GL_BLEND, 0); @@ -1283,7 +1288,7 @@ void FramebufferRenderer::performRaycasterTasks(const std::vector for (const RaycasterTask& raycasterTask : tasks) { TracyGpuZone("Raycaster") - + VolumeRaycaster* raycaster = raycasterTask.raycaster; glBindFramebuffer(GL_FRAMEBUFFER, _exitFramebuffer); @@ -1418,7 +1423,7 @@ void FramebufferRenderer::performDeferredTasks( for (const DeferredcasterTask& deferredcasterTask : tasks) { TracyGpuZone("Deferredcaster") - + Deferredcaster* deferredcaster = deferredcasterTask.deferredcaster; ghoul::opengl::ProgramObject* deferredcastProgram = nullptr; diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index c784d1fda3..afc0022b02 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -1314,7 +1314,7 @@ void RenderEngine::renderCameraInformation() { global::navigationHandler->orbitalNavigator(); using FR = ghoul::fontrendering::FontRenderer; - + _cameraButtonLocations.rotation = { fontResolution().x - rotationBox.x - XSeparation, fontResolution().y - penPosY, diff --git a/src/scene/assetloader.cpp b/src/scene/assetloader.cpp index 06804dbf08..ee8d509ef9 100644 --- a/src/scene/assetloader.cpp +++ b/src/scene/assetloader.cpp @@ -306,7 +306,8 @@ bool AssetLoader::loadAsset(Asset* asset) { metaDict.getValue(MetaInformationURL, meta.url); metaDict.getValue(MetaInformationLicense, meta.license); if (metaDict.hasKey(MetaInformationIdentifiers)) { - ghoul::Dictionary iddict = metaDict.value(MetaInformationIdentifiers); + ghoul::Dictionary iddict = + metaDict.value(MetaInformationIdentifiers); for (int i = 1; i <= iddict.size(); ++i) { std::string key = std::to_string(i); std::string identifier = iddict.value(key); diff --git a/src/scene/lightsource.cpp b/src/scene/lightsource.cpp index be63cf1a30..221a3ac107 100644 --- a/src/scene/lightsource.cpp +++ b/src/scene/lightsource.cpp @@ -92,7 +92,7 @@ std::unique_ptr LightSource::createFromDictionary( auto factory = FactoryManager::ref().factory(); LightSource* source = factory->create(timeFrameType, dictionary); - + const std::string identifier = dictionary.value(KeyIdentifier); source->setIdentifier(identifier); diff --git a/src/scene/profile.cpp b/src/scene/profile.cpp index 5f8b389c45..b612cc8612 100644 --- a/src/scene/profile.cpp +++ b/src/scene/profile.cpp @@ -792,7 +792,7 @@ std::string Profile::convertToScene() const { ); if (camera.up.has_value()) { result += fmt::format( - "Up = {{ {}, {}, {} }}, ", + "Up = {{ {}, {}, {} }}, ", camera.up->x, camera.up->y, camera.up->z ); } @@ -809,7 +809,8 @@ std::string Profile::convertToScene() const { if (camera.altitude.has_value()) { return fmt::format( "openspace.globebrowsing.goToGeo([[{}]], {}, {}, {});\n", - camera.anchor, camera.latitude, camera.longitude, *camera.altitude + camera.anchor, + camera.latitude, camera.longitude, *camera.altitude ); } else { diff --git a/src/scene/profile_lua.inl b/src/scene/profile_lua.inl index a009f1d07d..d1ec908e7d 100644 --- a/src/scene/profile_lua.inl +++ b/src/scene/profile_lua.inl @@ -105,7 +105,7 @@ int saveSettingsToProfile(lua_State* L) { if (FileSys.fileExists(absFilename) && !overwrite) { return luaL_error( - L, + L, fmt::format( "Unable to save profile '{}'. File of same name already exists", absFilename diff --git a/src/scene/scale.cpp b/src/scene/scale.cpp index 3035a22884..1cec27f683 100644 --- a/src/scene/scale.cpp +++ b/src/scene/scale.cpp @@ -60,7 +60,9 @@ documentation::Documentation Scale::Documentation() { }; } -ghoul::mm_unique_ptr Scale::createFromDictionary(const ghoul::Dictionary& dictionary) { +ghoul::mm_unique_ptr Scale::createFromDictionary( + const ghoul::Dictionary& dictionary) +{ documentation::testSpecificationAndThrow(Documentation(), dictionary, "Scale"); std::string scaleType = dictionary.value(KeyType); diff --git a/src/scene/scenelicensewriter.cpp b/src/scene/scenelicensewriter.cpp index 42dd91f544..628e86d487 100644 --- a/src/scene/scenelicensewriter.cpp +++ b/src/scene/scenelicensewriter.cpp @@ -65,7 +65,7 @@ std::string SceneLicenseWriter::generateJson() const { int metaCount = 0; for (const Asset* asset : assets) { std::optional meta = asset->metaInformation(); - + if (!meta.has_value()) { continue; } diff --git a/src/util/time_lua.inl b/src/util/time_lua.inl index fe5cc9fadd..b5e0f47b81 100644 --- a/src/util/time_lua.inl +++ b/src/util/time_lua.inl @@ -108,7 +108,7 @@ int time_setDeltaTimeSteps(lua_State* L) { /** * \ingroup LuaScripts * setNextDeltaTimeStep(): -* Immediately set the simulation speed to the first delta time step in the list that is +* Immediately set the simulation speed to the first delta time step in the list that is * larger than the current choice of simulation speed, if any. */ int time_setNextDeltaTimeStep(lua_State* L) { @@ -147,12 +147,12 @@ int time_setPreviousDeltaTimeStep(lua_State* L) { */ int time_interpolateNextDeltaTimeStep(lua_State* L) { ghoul::lua::checkArgumentsAndThrow( - L, - { 0, 1 }, + L, + { 0, 1 }, "lua::time_interpolateNextDeltaTimeStep" ); - double interpolationDuration = + double interpolationDuration = global::timeManager->defaultDeltaTimeInterpolationDuration(); const int nArguments = lua_gettop(L); @@ -181,19 +181,19 @@ int time_interpolateNextDeltaTimeStep(lua_State* L) { /** * \ingroup LuaScripts * interpolatePreviousDeltaTimeStep([interpolationDuration]): -* Interpolate the simulation speed to the previous delta time step in the list. If an +* Interpolate the simulation speed to the previous delta time step in the list. If an * input value is given, the interpolation is done over the specified number of seconds. * If interpolationDuration is not provided, the interpolation time will be based on the * `defaultDeltaTimeInterpolationDuration` property of the TimeManager. */ int time_interpolatePreviousDeltaTimeStep(lua_State* L) { ghoul::lua::checkArgumentsAndThrow( - L, - { 0, 1 }, + L, + { 0, 1 }, "lua::time_interpolatePreviousDeltaTimeStep" ); - double interpolationDuration = + double interpolationDuration = global::timeManager->defaultDeltaTimeInterpolationDuration(); const int nArguments = lua_gettop(L);