diff --git a/CMakeLists.txt b/CMakeLists.txt index 33aed7363d..dfa175515d 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -50,7 +50,7 @@ message(STATUS "CMake version: ${CMAKE_VERSION}") # Bail out if the user tries to generate a 32 bit project. if (NOT ${CMAKE_SIZEOF_VOID_P} EQUAL 8) message(FATAL_ERROR "OpenSpace can only be generated for 64 bit architectures.") -endif() +endif () ########################################################################################## # Cleanup project # @@ -63,7 +63,7 @@ if (NOT EXISTS ${OPENSPACE_EXT_DIR}/ghoul/CMakeLists.txt) "git submodule update --init --recursive \n" "to download the missing dependencies." ) -endif() +endif () set_property(GLOBAL PROPERTY USE_FOLDERS On) set_property(GLOBAL PROPERTY PREDEFINED_TARGETS_FOLDER CMake) @@ -106,7 +106,7 @@ if (NOT OPENSPACE_GIT_STATUS_RETURN EQUAL 0) set(OPENSPACE_GIT_STATUS "uncommitted changes") else() set(OPENSPACE_GIT_STATUS "") -endif() +endif () option(OPENSPACE_WARNINGS_AS_ERRORS "Treat warnings as errors" OFF) @@ -122,11 +122,11 @@ if (MSVC) if (OPENSPACE_OPTIMIZATION_ENABLE_AVX AND OPENSPACE_OPTIMIZATION_ENABLE_AVX512) message(FATAL_ERROR "Cannot enable AVX and AVX512 instructions simultaneously") - endif() + endif () if (OPENSPACE_OPTIMIZATION_ENABLE_AVX2 AND OPENSPACE_OPTIMIZATION_ENABLE_AVX512) message(FATAL_ERROR "Cannot enable AVX2 and AVX512 instructions simultaneously") - endif() + endif () set(GHOUL_OPTIMIZATION_ENABLE_AVX ${OPENSPACE_OPTIMIZATION_ENABLE_AVX} CACHE BOOL "" FORCE) set(GHOUL_OPTIMIZATION_ENABLE_AVX2 ${OPENSPACE_OPTIMIZATION_ENABLE_AVX2} CACHE BOOL "" FORCE) @@ -151,7 +151,7 @@ if (APPLE) target_link_libraries(openspace-core ${CARBON_LIBRARY} ${COREFOUNDATION_LIBRARY} ${COCOA_LIBRARY} ${APP_SERVICES_LIBRARY}) end_dependency() -endif() +endif () # Ghoul add_subdirectory(${OPENSPACE_EXT_DIR}/ghoul) @@ -183,7 +183,7 @@ else () target_link_libraries(openspace-core ${CURL_LIBRARIES}) target_compile_definitions(openspace-core PUBLIC "OPENSPACE_CURL_ENABLED") endif () -endif() +endif () end_dependency() # Qt diff --git a/apps/OpenSpace/CMakeLists.txt b/apps/OpenSpace/CMakeLists.txt index c3aa3e373c..267eb2c182 100644 --- a/apps/OpenSpace/CMakeLists.txt +++ b/apps/OpenSpace/CMakeLists.txt @@ -61,7 +61,7 @@ if (OPENSPACE_OPENVR_SUPPORT) ) endif () end_header("Dependency: OpenVR") -endif() +endif () ##### # Spout @@ -80,7 +80,7 @@ if (APPLE) set(MACOSX_BUNDLE_ICON_FILE openspace.icns) set(CMAKE_OSX_DEPLOYMENT_TARGET "10.14" CACHE STRING "Minimum OS X deployment version" FORCE) set(CMAKE_XCODE_ATTRIBUTE_OTHER_CODE_SIGN_FLAGS "--deep" CACHE STRING "Other Code Signing Flags" FORCE) -endif() +endif () create_new_application(OpenSpace ${SGCT_OPENVR_FILES} diff --git a/ext/ghoul b/ext/ghoul index dae112a3a0..0461bf1f44 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit dae112a3a05eebe880db3b39456bc8c4542c8261 +Subproject commit 0461bf1f44b58e04fb21d929b0f385e1120da7b4 diff --git a/include/openspace/interaction/sessionrecording.inl b/include/openspace/interaction/sessionrecording.inl index 5c8ce2c9ac..386357c9c5 100644 --- a/include/openspace/interaction/sessionrecording.inl +++ b/include/openspace/interaction/sessionrecording.inl @@ -33,9 +33,11 @@ T nextKeyframeObj(unsigned int index, const std::vector& keyframeContainer, finishedCallback(); } return keyframeContainer.back(); - } else if (index < keyframeContainer.size()) { + } + else if (index < keyframeContainer.size()) { return keyframeContainer[index]; - } else { + } + else { return keyframeContainer.back(); } } @@ -44,9 +46,11 @@ template T prevKeyframeObj(unsigned int index, const std::vector& keyframeContainer) { if (index >= keyframeContainer.size()) { return keyframeContainer.back(); - } else if (index > 0) { + } + else if (index > 0) { return keyframeContainer[index - 1]; - } else { + } + else { return keyframeContainer.front(); } } diff --git a/modules/atmosphere/shaders/atmosphere_common.glsl b/modules/atmosphere/shaders/atmosphere_common.glsl index 07887b12a9..c806dfab8e 100644 --- a/modules/atmosphere/shaders/atmosphere_common.glsl +++ b/modules/atmosphere/shaders/atmosphere_common.glsl @@ -125,7 +125,8 @@ vec3 analyticTransmittance(const float r, const float mu, const float d) { return exp(-betaRayleigh * opticalDepth(HR, r, mu, d) - betaOzoneExtinction * (0.0000006) * opticalDepth(HO, r, mu, d) - betaMieExtinction * opticalDepth(HM, r, mu, d)); - } else { + } + else { return exp(-betaRayleigh * opticalDepth(HR, r, mu, d) - betaMieExtinction * opticalDepth(HM, r, mu, d)); } @@ -315,7 +316,8 @@ vec3 transmittance(const float r, const float mu, const float d) { if (mu > 0.0f) { return min(transmittanceLUT(r, mu) / transmittanceLUT(ri, mui), 1.0f); - } else { + } + else { return min(transmittanceLUT(ri, -mui) / transmittanceLUT(r, -mu), 1.0f); } diff --git a/modules/atmosphere/shaders/atmosphere_deferred_fs.glsl b/modules/atmosphere/shaders/atmosphere_deferred_fs.glsl index 54a356dcc4..e9c3fdb17a 100644 --- a/modules/atmosphere/shaders/atmosphere_deferred_fs.glsl +++ b/modules/atmosphere/shaders/atmosphere_deferred_fs.glsl @@ -128,14 +128,16 @@ vec4 calcShadow(const ShadowRenderingStruct shadowInfoArray[numberOfShadows], co if (ground) { if (hardShadows) { return vec4(0.2, 0.2, 0.2, 1.0); - } else { + } + else { return butterworthFunc(length_d, r_u_pi, 4.0); } } else { if (hardShadows) { return vec4(0.5, 0.5, 0.5, 1.0); - } else { + } + else { return vec4(vec3(length_d/r_p_pi), 1.0); } } @@ -143,7 +145,8 @@ vec4 calcShadow(const ShadowRenderingStruct shadowInfoArray[numberOfShadows], co else if ( length_d < r_p_pi ) {// penumbra if (hardShadows) { return vec4(0.5, 0.5, 0.5, 1.0); - } else { + } + else { return vec4(vec3(length_d/r_p_pi), 1.0); } } @@ -212,7 +215,8 @@ bool dAtmosphereIntersection(const dvec3 planetPosition, const dRay ray, const d inside = false; offset = s - q; maxLength = s + q; - } else { + } + else { inside = true; offset = 0.0; maxLength = s + q; @@ -332,7 +336,8 @@ vec3 inscatterRadiance(inout vec3 x, inout float t, inout float irradianceFactor // We set the irradianceFactor to 1.0 so the reflected irradiance will be considered // when calculating the reflected light on the ground. irradianceFactor = 1.0; - } else { + } + else { attenuation = analyticTransmittance(r, mu, t); //attenuation = transmittance(r, mu, t); groundHit = false; @@ -412,7 +417,8 @@ vec3 inscatterRadiance(inout vec3 x, inout float t, inout float irradianceFactor if (groundHit) { return finalScatteringRadiance; - } else { + } + else { //return ((r-Rg) * invRtMinusRg)*spaceColor.rgb + finalScatteringRadiance; return spaceColor.rgb + finalScatteringRadiance; // return attenuation * spaceColor.rgb + @@ -476,7 +482,8 @@ vec3 groundColor(const vec3 x, const float t, const vec3 v, const vec3 s, const vec3 RLStar = (muSun * transmittanceL0 + irradianceReflected) * sunIntensity / M_PI; if (dotNS < 0.05f) { groundRadiance = groundReflectance.rgb * mix(30.0f, 1.0f, smoothstep(-1.0f, 0.05f, dotNS)) * RLStar; - } else { + } + else { groundRadiance = groundReflectance.rgb * RLStar; } @@ -618,7 +625,8 @@ void main() { if (pixelDepth < offset) { // ATM Occluded - Something in fron of ATM. atmosphereFinalColor += color; - } else { + } + else { // Following paper nomenclature double t = offset; vec3 attenuation; @@ -658,7 +666,8 @@ void main() { groundColorV = groundColor(x, tF, v, s, r, mu, attenuation, color, normal.xyz, irradianceFactor, normal.a, sunIntensityGround); - } else { + } + else { // In order to get better performance, we are not tracing // multiple rays per pixel when the ray doesn't intersect // the ground. diff --git a/modules/atmosphere/shaders/deltaJ_calc_fs.glsl b/modules/atmosphere/shaders/deltaJ_calc_fs.glsl index 088267c6f0..d39e6e2e15 100644 --- a/modules/atmosphere/shaders/deltaJ_calc_fs.glsl +++ b/modules/atmosphere/shaders/deltaJ_calc_fs.glsl @@ -173,7 +173,8 @@ void inscatter(float r, float mu, float muSun, float nu, inout vec3 radianceJ) { // Initial InScattering including the phase functions radianceJ1 += singleRay * phaseRaySW + singleMie * phaseMieSW; - } else { + } + else { // On line 9 of the algorithm, the texture table deltaSR is updated, so when we are not in the first // iteraction, we are getting the updated result of deltaSR (not the single inscattered light but the // accumulated (higher order) inscattered light. diff --git a/modules/atmosphere/shaders/inScattering_calc_fs.glsl b/modules/atmosphere/shaders/inScattering_calc_fs.glsl index fc8adbda28..6201fc1acb 100644 --- a/modules/atmosphere/shaders/inScattering_calc_fs.glsl +++ b/modules/atmosphere/shaders/inScattering_calc_fs.glsl @@ -68,7 +68,8 @@ void integrand(const float r, const float mu, const float muSun, const float nu, if (ozoneLayerEnabled) { S_R = (exp(-(ri - Rg) / HO) + exp( -(ri - Rg) / HR )) * transmittanceY; S_M = exp( -(ri - Rg) / HM ) * transmittanceY; - } else { + } + else { S_R = exp( -(ri - Rg) / HR ) * transmittanceY; S_M = exp( -(ri - Rg) / HM ) * transmittanceY; } diff --git a/modules/atmosphere/shaders/irradiance_sup_calc_fs.glsl b/modules/atmosphere/shaders/irradiance_sup_calc_fs.glsl index 72e2f58a04..07ba931806 100644 --- a/modules/atmosphere/shaders/irradiance_sup_calc_fs.glsl +++ b/modules/atmosphere/shaders/irradiance_sup_calc_fs.glsl @@ -78,7 +78,8 @@ void main(void) { vec3 singleMie = texture4D(deltaSMTexture, r, w.z, muSun, nu).rgb; // w.z is the cosine(theta) = mu for vec(w) and also vec(w) dot vec(n(xo)) irradianceE += (singleRay * phaseRay + singleMie * phaseMie) * w.z * dw; - } else { + } + else { // On line 10 of the algorithm, the texture table deltaE is updated, so when we are not in the first // iteraction, we are getting the updated result of deltaE (not the single irradiance light but the // accumulated (higher order) irradiance light. diff --git a/modules/atmosphere/shaders/transmittance_calc_fs.glsl b/modules/atmosphere/shaders/transmittance_calc_fs.glsl index 479a729b00..3413b91e41 100644 --- a/modules/atmosphere/shaders/transmittance_calc_fs.glsl +++ b/modules/atmosphere/shaders/transmittance_calc_fs.glsl @@ -82,7 +82,8 @@ void main(void) { opDepth = betaOzoneExtinction * (0.0000006) * opticalDepth(r, muSun, HO) + betaMieExtinction * opticalDepth(r, muSun, HM) + betaRayleigh * opticalDepth(r, muSun, HR); - } else { + } + else { opDepth = betaMieExtinction * opticalDepth(r, muSun, HM) + betaRayleigh * opticalDepth(r, muSun, HR); } diff --git a/modules/base/rendering/renderableplaneimagelocal.cpp b/modules/base/rendering/renderableplaneimagelocal.cpp index a83340ca9f..5c106c21ed 100644 --- a/modules/base/rendering/renderableplaneimagelocal.cpp +++ b/modules/base/rendering/renderableplaneimagelocal.cpp @@ -102,7 +102,8 @@ RenderablePlaneImageLocal::RenderablePlaneImageLocal(const ghoul::Dictionary& di ); if (renderType == "Background") { setRenderBin(Renderable::RenderBin::Background); - } else if (renderType == "Opaque") { + } + else if (renderType == "Opaque") { setRenderBin(Renderable::RenderBin::Opaque); } else if (renderType == "Transparent") { diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp index f512eefe8e..37939db68a 100644 --- a/modules/base/rendering/renderablesphere.cpp +++ b/modules/base/rendering/renderablesphere.cpp @@ -424,7 +424,8 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) { if (orientation == Orientation::Inside) { glCullFace(GL_FRONT); - } else if (orientation == Orientation::Both) { + } + else if (orientation == Orientation::Both) { glDisable(GL_CULL_FACE); } @@ -455,7 +456,8 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) { if (orientation == Orientation::Inside) { glCullFace(GL_BACK); - } else if (orientation == Orientation::Both) { + } + else if (orientation == Orientation::Both) { glEnable(GL_CULL_FACE); } } diff --git a/modules/base/rotation/staticrotation.cpp b/modules/base/rotation/staticrotation.cpp index 26333b4902..c5ca228c74 100644 --- a/modules/base/rotation/staticrotation.cpp +++ b/modules/base/rotation/staticrotation.cpp @@ -109,13 +109,15 @@ StaticRotation::StaticRotation(const ghoul::Dictionary& dictionary) : StaticRota dictionary.value(RotationInfo.identifier) ); _matrixIsDirty = true; - } else if (dictionary.hasKeyAndValue(RotationInfo.identifier)) { + } + else if (dictionary.hasKeyAndValue(RotationInfo.identifier)) { glm::dvec4 data = dictionary.value(RotationInfo.identifier); _eulerRotation = rotationMatrixToEulerAngles( glm::mat3_cast(glm::dquat(data.w, data.x, data.y, data.z)) ); _matrixIsDirty = true; - } else if (dictionary.hasKeyAndValue(RotationInfo.identifier)) { + } + else if (dictionary.hasKeyAndValue(RotationInfo.identifier)) { _eulerRotation = rotationMatrixToEulerAngles( dictionary.value(RotationInfo.identifier) ); diff --git a/modules/base/shaders/renderabletrail_fs.glsl b/modules/base/shaders/renderabletrail_fs.glsl index a5d9ce25d1..86aae007f2 100644 --- a/modules/base/shaders/renderabletrail_fs.glsl +++ b/modules/base/shaders/renderabletrail_fs.glsl @@ -67,7 +67,8 @@ Fragment getFragment() { if (distanceCenter > dLW) { frag.color.a = 0.0; - } else { + } + else { frag.color.a *= pow(float((dLW - distanceCenter) / dLW), blendFactor); } diff --git a/modules/base/timeframe/timeframeinterval.cpp b/modules/base/timeframe/timeframeinterval.cpp index 84d6dc28bf..53d8ebc1b9 100644 --- a/modules/base/timeframe/timeframeinterval.cpp +++ b/modules/base/timeframe/timeframeinterval.cpp @@ -133,7 +133,8 @@ TimeFrameInterval::TimeFrameInterval(const ghoul::Dictionary& dictionary) dictionary.value(StartInfo.identifier) ); _hasStart = true; - } else if (dictionary.hasValue(StartInfo.identifier)) { + } + else if (dictionary.hasValue(StartInfo.identifier)) { _start = dictionary.value(StartInfo.identifier); _hasStart = true; } diff --git a/modules/cefwebgui/cefwebguimodule.cpp b/modules/cefwebgui/cefwebguimodule.cpp index 478b5847b5..2d5b7c520d 100644 --- a/modules/cefwebgui/cefwebguimodule.cpp +++ b/modules/cefwebgui/cefwebguimodule.cpp @@ -121,7 +121,8 @@ void CefWebGuiModule::startOrStopGui() { _instance->setZoom(_guiScale); webBrowserModule->addBrowser(_instance.get()); - } else if (_instance) { + } + else if (_instance) { _instance->close(true); webBrowserModule->removeBrowser(_instance.get()); webBrowserModule->detachEventHandler(); @@ -176,7 +177,8 @@ void CefWebGuiModule::internalInitialize(const ghoul::Dictionary& configuration) if (_visible && _instance) { webBrowserModule->attachEventHandler(_instance.get()); - } else { + } + else { webBrowserModule->detachEventHandler(); } }); diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp index e7df8224e0..688d518611 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp @@ -465,7 +465,8 @@ RenderableBillboardsCloud::RenderableBillboardsCloud(const ghoul::Dictionary& di if (o == "Camera View Direction") { _renderOption = RenderOptionViewDirection; - } else if (o == "Camera Position Normal") { + } + else if (o == "Camera Position Normal") { _renderOption = RenderOptionPositionNormal; } } diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.cpp b/modules/digitaluniverse/rendering/renderabledumeshes.cpp index 8a1d259747..bdc7b80436 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.cpp +++ b/modules/digitaluniverse/rendering/renderabledumeshes.cpp @@ -713,7 +713,8 @@ bool RenderableDUMeshes::readSpeckFile() { //file.seekg(position); //break; continue; - } else { + } + else { //if (line.substr(0, 4) == "mesh") { // mesh lines are structured as follows: diff --git a/modules/digitaluniverse/shaders/billboard_gs.glsl b/modules/digitaluniverse/shaders/billboard_gs.glsl index 23e4f88912..2ee4ea61cd 100644 --- a/modules/digitaluniverse/shaders/billboard_gs.glsl +++ b/modules/digitaluniverse/shaders/billboard_gs.glsl @@ -78,15 +78,20 @@ void main() { // Must be the same as the enum in RenderableBillboardsCloud.h if (pos.w == 1.f) { unit = 1E3; - } else if (pos.w == 2.f) { + } + else if (pos.w == 2.f) { unit = PARSEC; - } else if (pos.w == 3.f) { + } + else if (pos.w == 3.f) { unit = 1E3 * PARSEC; - } else if (pos.w == 4.f) { + } + else if (pos.w == 4.f) { unit = 1E6 * PARSEC; - } else if (pos.w == 5.f) { + } + else if (pos.w == 5.f) { unit = 1E9 * PARSEC; - } else if (pos.w == 6.f) { + } + else if (pos.w == 6.f) { // Convertion factor from Parsecs to GigalightYears unit = 306391534.73091 * PARSEC; } @@ -105,7 +110,8 @@ void main() { if (renderOption == 0) { scaledRight = scaleMultiply * right * 0.5f; scaledUp = scaleMultiply * up * 0.5f; - } else if (renderOption == 1) { + } + else if (renderOption == 1) { vec3 normal = vec3(normalize(cameraPosition - dpos.xyz)); vec3 newRight = normalize(cross(cameraLookUp, normal)); vec3 newUp = cross(normal, newRight); @@ -148,7 +154,8 @@ void main() { scaledRight *= correctionScale; scaledUp *= correctionScale; - } else { + } + else { // linear alpha decay if (sizes.x < 2.0f * minBillboardSize) { float maxVar = 2.0f * minBillboardSize; diff --git a/modules/digitaluniverse/shaders/points_fs.glsl b/modules/digitaluniverse/shaders/points_fs.glsl index 35bf38a6db..ff55cd58d8 100644 --- a/modules/digitaluniverse/shaders/points_fs.glsl +++ b/modules/digitaluniverse/shaders/points_fs.glsl @@ -41,7 +41,8 @@ Fragment getFragment() { if (hasColorMap) { frag.color = vec4(colorMap.xyz, alphaValue); - } else { + } + else { frag.color = vec4(color, alphaValue); } diff --git a/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp b/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp index c560fca43e..003ec69e3c 100644 --- a/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp +++ b/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp @@ -1157,12 +1157,14 @@ void RenderableFieldlinesSequence::update(const UpdateData& data) { if (_loadingStatesDynamically) { _mustLoadNewStateFromDisk = true; - } else { + } + else { _needsUpdate = true; _activeStateIndex = _activeTriggerTimeIndex; } } // else {we're still in same state as previous frame (no changes needed)} - } else { + } + else { // Not in interval => set everything to false _activeTriggerTimeIndex = -1; _mustLoadNewStateFromDisk = false; @@ -1221,7 +1223,8 @@ void RenderableFieldlinesSequence::updateActiveTriggerTimeIndex(double currentTi else { _activeTriggerTimeIndex = 0; } - } else { + } + else { _activeTriggerTimeIndex = static_cast(_nStates) - 1; } } diff --git a/modules/fieldlinessequence/shaders/fieldlinessequence_vs.glsl b/modules/fieldlinessequence/shaders/fieldlinessequence_vs.glsl index 6b0405fd9f..400b69a0c5 100644 --- a/modules/fieldlinessequence/shaders/fieldlinessequence_vs.glsl +++ b/modules/fieldlinessequence/shaders/fieldlinessequence_vs.glsl @@ -107,7 +107,8 @@ void main() { if (isParticle) { vs_color = flowColor; - } else { + } + else { vs_color = lineColor; } @@ -115,7 +116,8 @@ void main() { vec4 quantityColor = getTransferFunctionColor(); vs_color = vec4(quantityColor.xyz, vs_color.a * quantityColor.a); } - } else { + } + else { vs_color = vec4(0); } diff --git a/modules/fieldlinessequence/util/commons.cpp b/modules/fieldlinessequence/util/commons.cpp index b3aef7b491..9602b52b9b 100644 --- a/modules/fieldlinessequence/util/commons.cpp +++ b/modules/fieldlinessequence/util/commons.cpp @@ -29,9 +29,11 @@ namespace openspace::fls { Model stringToModel(const std::string& s) { if (s == "batsrus") { return Model::Batsrus; - } else if (s == "enlil") { + } + else if (s == "enlil") { return Model::Enlil; - } else if (s == "pfss") { + } + else if (s == "pfss") { return Model::Pfss; } return Model::Invalid; diff --git a/modules/fieldlinessequence/util/kameleonfieldlinehelper.cpp b/modules/fieldlinessequence/util/kameleonfieldlinehelper.cpp index 63b0f6f85d..76daab2b7a 100644 --- a/modules/fieldlinessequence/util/kameleonfieldlinehelper.cpp +++ b/modules/fieldlinessequence/util/kameleonfieldlinehelper.cpp @@ -236,7 +236,8 @@ void addExtraQuantities(ccmc::Kameleon* kameleon, val = interpolator->interpolate("p", p.x, p.y, p.z); val *= ToKelvin; val /= interpolator->interpolate("rho", p.x, p.y, p.z); - } else { + } + else { val = interpolator->interpolate(extraScalarVars[i], p.x, p.y, p.z); // When measuring density in ENLIL CCMC multiply by the radius^2 @@ -265,7 +266,8 @@ void addExtraQuantities(ccmc::Kameleon* kameleon, // the magnetic field vector! val = glm::dot(glm::vec3(x,y,z), normMagnetic); - } else { + } + else { val = std::sqrt(x*x + y*y + z*z); } state.appendToExtra(i + nXtraScalars, val); @@ -315,7 +317,8 @@ void prepareStateAndKameleonForExtras(ccmc::Kameleon* kameleon, )); extraScalarVars.erase(extraScalarVars.begin() + i); --i; - } else { + } + else { extraQuantityNames.push_back(str); } } @@ -359,11 +362,13 @@ void prepareStateAndKameleonForExtras(ccmc::Kameleon* kameleon, extraMagVars.begin() + i + 3 ); i -= 3; - } else { + } + else { extraQuantityNames.push_back(std::move(name)); } } - } else { + } + else { // WRONG NUMBER OF MAGNITUDE VARIABLES.. REMOVE ALL! extraMagVars.clear(); LWARNING(fmt::format( diff --git a/modules/gaia/shaders/gaia_billboard_ge.glsl b/modules/gaia/shaders/gaia_billboard_ge.glsl index 6ff847259d..3296ae1fa2 100644 --- a/modules/gaia/shaders/gaia_billboard_ge.glsl +++ b/modules/gaia/shaders/gaia_billboard_ge.glsl @@ -100,15 +100,15 @@ void main() { // Discard geometry if star has no position (but wasn't a nullArray). // Or if observed distance is above threshold set by cutOffThreshold. // By discarding in gs instead of fs we save computations for when nothing is visible. - if( length(position) < EPS || distThreshold <= 0){ + if (length(position) < EPS || distThreshold <= 0) { return; } vec4 centerWorldPos = vs_gPosition[0]; - dvec3 cameraNormal = normalize(cameraPos - dvec3(centerWorldPos.xyz)); + dvec3 cameraNormal = normalize(cameraPos - dvec3(centerWorldPos.xyz)); dvec3 newRight = normalize(cross(cameraLookUp, cameraNormal)); - dvec3 newUp = cross(cameraNormal, newRight); + dvec3 newUp = cross(cameraNormal, newRight); vec4 wCameraRight = vec4(newRight, 0.0); vec4 wCameraUp = vec4(newUp, 0.0); diff --git a/modules/gaia/shaders/gaia_point_ge.glsl b/modules/gaia/shaders/gaia_point_ge.glsl index e8eeecb2aa..b36e18f5bb 100644 --- a/modules/gaia/shaders/gaia_point_ge.glsl +++ b/modules/gaia/shaders/gaia_point_ge.glsl @@ -61,14 +61,14 @@ void main() { // Discard geometry if star has no position (but wasn't a nullArray). // Or if observed distance is above threshold set by cutOffThreshold. // By discarding in gs instead of fs we save computations for when nothing is visible. - if( length(position) < EPS || distThreshold <= 0){ + if (length(position) < EPS || distThreshold <= 0) { return; } //gl_PointSize = 1.0; gl_Position = position; gl_Position.z = 0.0; - ge_gPosition = viewPosition; + ge_gPosition = viewPosition; EmitVertex(); diff --git a/modules/gaia/shaders/gaia_ssbo_vs.glsl b/modules/gaia/shaders/gaia_ssbo_vs.glsl index 08aee91a65..ecd6f1b064 100644 --- a/modules/gaia/shaders/gaia_ssbo_vs.glsl +++ b/modules/gaia/shaders/gaia_ssbo_vs.glsl @@ -179,7 +179,8 @@ void main() { if ( length(in_position) > EPS ){ vs_gPosition = vec4(model * objectPosition); gl_Position = vec4(projection * viewPosition); - } else { + } + else { vs_gPosition = vec4(0.0); gl_Position = vec4(0.0); } diff --git a/modules/gaia/shaders/gaia_tonemapping_point_fs.glsl b/modules/gaia/shaders/gaia_tonemapping_point_fs.glsl index 6b91cc0ef0..f2da517b0b 100644 --- a/modules/gaia/shaders/gaia_tonemapping_point_fs.glsl +++ b/modules/gaia/shaders/gaia_tonemapping_point_fs.glsl @@ -82,7 +82,8 @@ Fragment getFragment() { //vec2 screenOrigo = vec2(-left, -bottom) / vec2(right - left, top - bottom); //if (abs(screenOrigo.x - uv.x) > 0.0005 && abs(screenOrigo.y - uv.y) > 0.0005) { // origoFrag.color = vec4(0.0); - //} else { + //} + //else { // origoFrag.color = vec4(1.0); //} //return origoFrag; diff --git a/modules/gaia/shaders/gaia_vbo_vs.glsl b/modules/gaia/shaders/gaia_vbo_vs.glsl index a87aacf2d1..f5a635c3d2 100644 --- a/modules/gaia/shaders/gaia_vbo_vs.glsl +++ b/modules/gaia/shaders/gaia_vbo_vs.glsl @@ -112,7 +112,8 @@ void main() { if ( length(in_position) > EPS ){ vs_gPosition = vec4(model * objectPosition); gl_Position = vec4(projection * viewPosition); - } else { + } + else { vs_gPosition = vec4(0.0); gl_Position = vec4(0.0); } diff --git a/modules/galaxy/shaders/raycasterbounds_fs.glsl b/modules/galaxy/shaders/raycasterbounds_fs.glsl index 993bc884e1..2ff99f2c5a 100644 --- a/modules/galaxy/shaders/raycasterbounds_fs.glsl +++ b/modules/galaxy/shaders/raycasterbounds_fs.glsl @@ -32,10 +32,10 @@ Fragment getFragment() { Fragment frag; //Early ray termination on black parts of the data /*vec3 normalizedPos = (modelPosition*2.0)-1.0; - if(abs(modelPosition.x) > 0.9 || abs(modelPosition.y) > 0.9){ + if (abs(modelPosition.x) > 0.9 || abs(modelPosition.y) > 0.9) { frag.color = vec4(0.0, 0.0, 0.0, 1.0); } - else{*/ + else {*/ vec3 pos = modelPosition + 0.5; //vec3 posClamp = clamp(pos, vec3(0.0), vec3(1.0)); frag.color = vec4(pos, 1.0); diff --git a/modules/globebrowsing/shaders/blending.hglsl b/modules/globebrowsing/shaders/blending.hglsl index 2157a1314c..166ec948d1 100644 --- a/modules/globebrowsing/shaders/blending.hglsl +++ b/modules/globebrowsing/shaders/blending.hglsl @@ -78,9 +78,11 @@ vec3 rgb2hsl(in vec3 c) { float h = 0.0; if (r == cMax) { h = (g - b) / cDelta; - } else if (g == cMax) { + } + else if (g == cMax) { h = 2.0 + (b - r) / cDelta; - } else { + } + else { h = 4.0 + (r - g) / cDelta; } diff --git a/modules/globebrowsing/src/lrucache.inl b/modules/globebrowsing/src/lrucache.inl index 2d3dd0b140..2e67893a80 100644 --- a/modules/globebrowsing/src/lrucache.inl +++ b/modules/globebrowsing/src/lrucache.inl @@ -69,7 +69,8 @@ bool LRUCache::touch(const KeyType& key) { _itemMap.emplace(key, _itemList.begin()); return true; - } else { + } + else { return false; } } diff --git a/modules/globebrowsing/src/renderableglobe.cpp b/modules/globebrowsing/src/renderableglobe.cpp index 257ebd550f..d205fc4a5a 100644 --- a/modules/globebrowsing/src/renderableglobe.cpp +++ b/modules/globebrowsing/src/renderableglobe.cpp @@ -330,7 +330,7 @@ BoundingHeights boundingHeightsForChunk(const Chunk& chunk, const LayerManager& } lastHadMissingData = tileMetaData.hasMissingData[HeightChannel]; } - else if(chunkTile.tile.status == Tile::Status::Unavailable) { + else if (chunkTile.tile.status == Tile::Status::Unavailable) { boundingHeights.tileOK = false; } diff --git a/modules/imgui/src/guiassetcomponent.cpp b/modules/imgui/src/guiassetcomponent.cpp index bff854cdd3..34fb9d629a 100644 --- a/modules/imgui/src/guiassetcomponent.cpp +++ b/modules/imgui/src/guiassetcomponent.cpp @@ -112,7 +112,8 @@ void GuiAssetComponent::renderTree(const Asset& asset, const std::string& relati if (requested.empty() && required.empty() && resourceSyncs.empty()) { ImGui::Text("%s", assetText.c_str()); - } else if (ImGui::TreeNode(assetPath.c_str(), "%s", assetText.c_str())) { + } + else if (ImGui::TreeNode(assetPath.c_str(), "%s", assetText.c_str())) { for (const std::shared_ptr& child : required) { renderTree(*child, assetDirectory); } diff --git a/modules/imgui/src/guiiswacomponent.cpp b/modules/imgui/src/guiiswacomponent.cpp index 0b0824ca11..468968de69 100644 --- a/modules/imgui/src/guiiswacomponent.cpp +++ b/modules/imgui/src/guiiswacomponent.cpp @@ -87,7 +87,8 @@ void GuiIswaComponent::render() { script, scripting::ScriptEngine::RemoteScripting::Yes ); - } else { + } + else { global::scriptEngine.queueScript( "openspace.iswa.removeGroup('GMData');", scripting::ScriptEngine::RemoteScripting::Yes @@ -106,7 +107,8 @@ void GuiIswaComponent::render() { script, scripting::ScriptEngine::RemoteScripting::Yes ); - } else { + } + else { global::scriptEngine.queueScript( "openspace.iswa.removeGroup('GMImage');", scripting::ScriptEngine::RemoteScripting::Yes @@ -114,13 +116,14 @@ void GuiIswaComponent::render() { } } - if(_ionData != oldIonDataValue) { - if(_ionData) { + if (_ionData != oldIonDataValue) { + if (_ionData) { global::scriptEngine.queueScript( "openspace.iswa.addCygnet(-10, 'Data', 'Ionosphere');", scripting::ScriptEngine::RemoteScripting::Yes ); - } else { + } + else { global::scriptEngine.queueScript( "openspace.iswa.removeGroup('Ionosphere');", scripting::ScriptEngine::RemoteScripting::Yes @@ -202,7 +205,8 @@ void GuiIswaComponent::render() { "openspace.iswa.addScreenSpaceCygnet({CygnetId=" + idStr + "});", scripting::ScriptEngine::RemoteScripting::Yes ); - } else { + } + else { global::scriptEngine.queueScript( "openspace.iswa.removeScreenSpaceCygnet(" + idStr + ");", scripting::ScriptEngine::RemoteScripting::Yes diff --git a/modules/imgui/src/guiparallelcomponent.cpp b/modules/imgui/src/guiparallelcomponent.cpp index b108911774..60527364bc 100644 --- a/modules/imgui/src/guiparallelcomponent.cpp +++ b/modules/imgui/src/guiparallelcomponent.cpp @@ -146,7 +146,8 @@ void GuiParallelComponent::renderHost() { const size_t nClients = nConnections - 1; if (nClients == 1) { connectionInfo = "Hosting session with 1 client"; - } else { + } + else { connectionInfo = "Hosting session with " + std::to_string(nClients) + " clients"; } diff --git a/modules/iswa/rendering/datacygnet.cpp b/modules/iswa/rendering/datacygnet.cpp index 6b556a073a..35e17aae52 100644 --- a/modules/iswa/rendering/datacygnet.cpp +++ b/modules/iswa/rendering/datacygnet.cpp @@ -140,7 +140,8 @@ bool DataCygnet::updateTexture() { texture->setFilter(Texture::FilterMode::LinearMipMap); _textures[option] = std::move(texture); } - } else { + } + else { _textures[option]->setPixelData(values); _textures[option]->uploadTexture(); } @@ -227,7 +228,8 @@ void DataCygnet::setTextureUniforms() { tfUnits[0].activate(); _transferFunctions[0].bind(); _shader->setUniform("transferFunctions[0]", tfUnits[0]); - } else { + } + else { for (int option : selectedOptions) { if (static_cast(_transferFunctions.size()) >= option) { tfUnits[j].activate(); @@ -284,7 +286,8 @@ void DataCygnet::fillOptions(const std::string& source) { g->registerOptions(_dataOptions.options()); _dataOptions.setValue(g->dataOptionsValue()); - } else { + } + else { _dataOptions.setValue(std::vector(1, 0)); } } diff --git a/modules/iswa/rendering/dataplane.cpp b/modules/iswa/rendering/dataplane.cpp index 4e51556b0d..a4dcc8ce83 100644 --- a/modules/iswa/rendering/dataplane.cpp +++ b/modules/iswa/rendering/dataplane.cpp @@ -49,7 +49,8 @@ void DataPlane::initializeGL() { if (_group) { _dataProcessor = _group->dataProcessor(); subscribeToGroup(); - } else { + } + else { _dataProcessor = std::make_shared(); //If autofiler is on, background values property should be hidden @@ -60,7 +61,8 @@ void DataPlane::initializeGL() { _backgroundValues = _dataProcessor->filterValues(); _backgroundValues.setVisibility(properties::Property::Visibility::Hidden); // else if autofilter is turned off, register backgroundValues - } else { + } + else { _backgroundValues.setVisibility(properties::Property::Visibility::All); } }); @@ -148,7 +150,7 @@ std::vector DataPlane::textureData(){ return std::vector(); } - if(!_dataOptions.options().size()) { // load options for value selection + if (!_dataOptions.options().size()) { // load options for value selection fillOptions(_dataBuffer); _dataProcessor->addDataValues(_dataBuffer, _dataOptions); diff --git a/modules/iswa/rendering/datasphere.cpp b/modules/iswa/rendering/datasphere.cpp index 868ee0de16..318b9d8a19 100644 --- a/modules/iswa/rendering/datasphere.cpp +++ b/modules/iswa/rendering/datasphere.cpp @@ -60,7 +60,8 @@ void DataSphere::initializeGL() { if (_group) { _dataProcessor = _group->dataProcessor(); subscribeToGroup(); - } else { + } + else { _dataProcessor = std::make_shared(); //If autofiler is on, background values property should be hidden _autoFilter.onChange([this]() { @@ -71,7 +72,8 @@ void DataSphere::initializeGL() { _backgroundValues.setVisibility(properties::Property::Visibility::Hidden); //_backgroundValues.setVisible(false); // else if autofilter is turned off, register backgroundValues - } else { + } + else { _backgroundValues.setVisibility(properties::Property::Visibility::All); //_backgroundValues.setVisible(true); } diff --git a/modules/iswa/rendering/iswacygnet.cpp b/modules/iswa/rendering/iswacygnet.cpp index e4d0b91906..2482037464 100644 --- a/modules/iswa/rendering/iswacygnet.cpp +++ b/modules/iswa/rendering/iswacygnet.cpp @@ -110,7 +110,8 @@ void IswaCygnet::initializeGL() { if (!_data.groupName.empty()) { initializeGroup(); - } else { + } + else { _delete.onChange([this]() { deinitialize(); global::scriptEngine.queueScript( diff --git a/modules/iswa/rendering/iswadatagroup.cpp b/modules/iswa/rendering/iswadatagroup.cpp index 89f563871a..33a6275dab 100644 --- a/modules/iswa/rendering/iswadatagroup.cpp +++ b/modules/iswa/rendering/iswadatagroup.cpp @@ -134,7 +134,8 @@ void IswaDataGroup::registerProperties() { _backgroundValues.setVisibility(properties::Property::Visibility::Hidden); //_backgroundValues.setVisible(false); // else if autofilter is turned off, register backgroundValues - } else { + } + else { _backgroundValues.setVisibility(properties::Property::Visibility::All); //_backgroundValues.setVisible(true); } @@ -194,9 +195,11 @@ void IswaDataGroup::registerOptions( void IswaDataGroup::createDataProcessor() { if (_type == typeid(DataPlane).name()) { _dataProcessor = std::make_shared(); - }else if (_type == typeid(DataSphere).name()) { + } + else if (_type == typeid(DataSphere).name()) { _dataProcessor = std::make_shared(); - }else if (_type == typeid(KameleonPlane).name()) { + } + else if (_type == typeid(KameleonPlane).name()) { _dataProcessor = std::make_shared(); } } diff --git a/modules/iswa/rendering/iswakameleongroup.cpp b/modules/iswa/rendering/iswakameleongroup.cpp index ffff28ada9..df227ff0b5 100644 --- a/modules/iswa/rendering/iswakameleongroup.cpp +++ b/modules/iswa/rendering/iswakameleongroup.cpp @@ -155,7 +155,8 @@ void IswaKameleonGroup::updateFieldlineSeeds() { ); std::get<2>(seedPath.second) = false; // if this option was turned on - } else if (it != options.end() && !std::get<2>(seedPath.second)) { + } + else if (it != options.end() && !std::get<2>(seedPath.second)) { LDEBUG("Created fieldlines: " + std::get<0>(seedPath.second)); IswaManager::ref().createFieldline( diff --git a/modules/iswa/rendering/kameleonplane.cpp b/modules/iswa/rendering/kameleonplane.cpp index 18ee019d18..bfc889e835 100644 --- a/modules/iswa/rendering/kameleonplane.cpp +++ b/modules/iswa/rendering/kameleonplane.cpp @@ -131,7 +131,8 @@ void KameleonPlane::initializeGL() { if (_group) { _dataProcessor = _group->dataProcessor(); subscribeToGroup(); - } else { + } + else { _dataProcessor = std::make_shared(); //If autofiler is on, background values property should be hidden @@ -143,7 +144,8 @@ void KameleonPlane::initializeGL() { _backgroundValues.setVisibility(properties::Property::Visibility::Hidden); //_backgroundValues.setVisible(false); // else if autofilter is turned off, register backgroundValues - } else { + } + else { _backgroundValues.setVisibility(properties::Property::Visibility::All); //_backgroundValues.setVisible(true); } @@ -286,7 +288,8 @@ void KameleonPlane::updateFieldlineSeeds() { ); std::get<2>(seedPath.second) = false; // if this option was turned on - } else if (it != selectedOptions.end() && !std::get<2>(seedPath.second)) { + } + else if (it != selectedOptions.end() && !std::get<2>(seedPath.second)) { SceneGraphNode* n = global::renderEngine.scene()->sceneGraphNode( std::get<0>(seedPath.second) ); @@ -377,9 +380,11 @@ void KameleonPlane::setDimensions() { if (_cut == Cut::X) { _textureDimensions = glm::size3_t(_dimensions.y, _dimensions.z, 1); - } else if (_cut == Cut::Y) { + } + else if (_cut == Cut::Y) { _textureDimensions = glm::size3_t(_dimensions.x, _dimensions.z, 1); - } else { + } + else { _textureDimensions = glm::size3_t(_dimensions.x, _dimensions.y, 1); } } diff --git a/modules/iswa/rendering/texturecygnet.cpp b/modules/iswa/rendering/texturecygnet.cpp index 7d9823bcd4..7f21ffb29d 100644 --- a/modules/iswa/rendering/texturecygnet.cpp +++ b/modules/iswa/rendering/texturecygnet.cpp @@ -94,10 +94,12 @@ bool TextureCygnet::updateTextureResource() { if (imageFile.corrupted) { delete[] imageFile.buffer; return false; - } else { + } + else { _imageFile = imageFile; } - } else { + } + else { return false; } diff --git a/modules/iswa/shaders/dataplane_fs.glsl b/modules/iswa/shaders/dataplane_fs.glsl index 893fb2e313..9e53abf9cb 100644 --- a/modules/iswa/shaders/dataplane_fs.glsl +++ b/modules/iswa/shaders/dataplane_fs.glsl @@ -62,7 +62,8 @@ Fragment getFragment() { else { diffuse = texture(transferFunctions[0], vec2(v, 0.0)); } - } else { + } + else { float v = 0.0; for (int i = 0; i < numTextures; i++) { v = texture(textures[i], vs_st).r; diff --git a/modules/iswa/util/dataprocessor.cpp b/modules/iswa/util/dataprocessor.cpp index 7c8e82603b..0bda04e042 100644 --- a/modules/iswa/util/dataprocessor.cpp +++ b/modules/iswa/util/dataprocessor.cpp @@ -72,7 +72,8 @@ float DataProcessor::processDataPoint(float value, int option) { return histogram.equalize( normalizeWithStandardScore(value, mean, sd, _histNormValues) ) / 512.f; - } else { + } + else { return normalizeWithStandardScore(value, mean, sd, _normValues); } } @@ -153,7 +154,8 @@ void DataProcessor::calculateFilterValues(const std::vector& selectedOption standardDeviation, _normValues) ); - } else { + } + else { Histogram hist = _histograms[option]->equalize(); filterMid = hist.highestBinValue(true); filterWidth = 1.f / 512.f; diff --git a/modules/iswa/util/iswamanager.cpp b/modules/iswa/util/iswamanager.cpp index 0be92828ef..5046bb85a9 100644 --- a/modules/iswa/util/iswamanager.cpp +++ b/modules/iswa/util/iswamanager.cpp @@ -147,7 +147,8 @@ IswaManager& IswaManager::ref() { void IswaManager::addIswaCygnet(int id, const std::string& type, std::string group) { if (id > 0) { createScreenSpace(id); - } else if (id < 0) { + } + else if (id < 0) { // create metadata object and assign group and id MetadataFuture metaFuture; metaFuture.id = id; @@ -156,9 +157,11 @@ void IswaManager::addIswaCygnet(int id, const std::string& type, std::string gro // Assign type of cygnet Texture/Data if (type == _type[CygnetType::Texture]) { metaFuture.type = CygnetType::Texture; - } else if (type == _type[CygnetType::Data]) { + } + else if (type == _type[CygnetType::Data]) { metaFuture.type = CygnetType::Data; - } else { + } + else { LERROR("\""+ type + "\" is not a valid type"); return; } @@ -178,7 +181,8 @@ void IswaManager::addIswaCygnet(int id, const std::string& type, std::string gro if (j["Coordinate Type"].is_null()) { metaFuture.geom = CygnetGeometry::Sphere; createSphere(metaFuture); - } else if (j["Coordinate Type"] == "Cartesian") { + } + else if (j["Coordinate Type"] == "Cartesian") { metaFuture.geom = CygnetGeometry::Plane; createPlane(metaFuture); } @@ -258,7 +262,8 @@ std::string IswaManager::iswaUrl(int id, double timestamp, const std::string& ty std::string url; if (id < 0) { url = _baseUrl + type + "/" + std::to_string(-id) + "/"; - } else { + } + else { url = "http://iswa3.ccmc.gsfc.nasa.gov/IswaSystemWebApp/iSWACygnetStreamer?" "window=-1&cygnetId="+ std::to_string(id) +"×tamp="; } @@ -292,18 +297,21 @@ void IswaManager::registerGroup(std::string groupName, std::string type) { std::move(groupName), std::move(type) ); - } else if (kameleonGroup) { + } + else if (kameleonGroup) { _groups[groupName] = std::make_shared( std::move(groupName), std::move(type) ); - } else { + } + else { _groups[groupName] = std::make_shared( std::move(groupName), std::move(type) ); } - } else if (!_groups[groupName]->isType(type)) { + } + else if (!_groups[groupName]->isType(type)) { LWARNING("Can't add cygnet to groups with diffent type"); } } @@ -425,7 +433,8 @@ std::string IswaManager::parseKWToLuaTable(const CdfInfo& info, const std::strin spatialScale.w = 6; coordinateType = "Cartesian"; - } else { + } + else { spatialScale = glm::vec4(1.f); spatialScale.w = 1; //-log10(1.0f/max.x); coordinateType = "Polar"; @@ -514,7 +523,8 @@ void IswaManager::createPlane(MetadataFuture& data) { std::string type; if (data.type == CygnetType::Data) { type = typeid(DataPlane).name(); - } else { + } + else { type = typeid(TexturePlane).name(); } @@ -523,7 +533,8 @@ void IswaManager::createPlane(MetadataFuture& data) { auto it = _groups.find(data.group); if (it == _groups.end() || (*it).second->isType(type)) { name = data.group + "_" + name; - } else { + } + else { data.group = ""; } } @@ -549,14 +560,15 @@ void IswaManager::createSphere(MetadataFuture& data) { // check if this sphere already exist std::string name = _type[data.type] + _geom[data.geom] + std::to_string(data.id); - if(!data.group.empty()){ + if (!data.group.empty()){ std::string type = typeid(DataSphere).name(); registerGroup(data.group, type); auto it = _groups.find(data.group); if (it == _groups.end() || (*it).second->isType(type)) { name = data.group + "_" + name; - } else { + } + else { data.group = ""; } } @@ -589,7 +601,8 @@ void IswaManager::createKameleonPlane(CdfInfo info, std::string cut) { auto it = _groups.find(info.group); if (it == _groups.end() || (*it).second->isType(type)) { info.name = info.group + "_" + info.name; - } else { + } + else { info.group = ""; } } @@ -609,7 +622,8 @@ void IswaManager::createKameleonPlane(CdfInfo info, std::string cut) { scripting::ScriptEngine::RemoteScripting::Yes ); } - } else { + } + else { LWARNING( absPath(info.path) + " is not a cdf file or can't be found."); } } @@ -648,7 +662,8 @@ void IswaManager::createFieldline(std::string name, std::string cdfPath, scripting::ScriptEngine::RemoteScripting::Yes ); } - } else { + } + else { LWARNING( cdfPath + " is not a cdf file or can't be found."); } } @@ -728,7 +743,8 @@ void IswaManager::addCdfFiles(std::string cdfpath) { jsonFile.close(); } - } else { + } + else { LWARNING(cdfpath + " is not a cdf file or can't be found."); } } diff --git a/modules/iswa/util/iswamanager_lua.inl b/modules/iswa/util/iswamanager_lua.inl index fc93fd30db..b2f609ad3c 100644 --- a/modules/iswa/util/iswamanager_lua.inl +++ b/modules/iswa/util/iswamanager_lua.inl @@ -88,7 +88,8 @@ int iswa_addScreenSpaceCygnet(lua_State* L) { if (global::renderEngine.screenSpaceRenderable(name)) { LERROR("A cygnet with the name \"" + name +"\" already exist"); return 0; - } else { + } + else { d.setValue("Name", name); d.setValue("Type", "ScreenSpaceCygnet"); d.setValue("UpdateInterval", static_cast(updateInterval)); @@ -108,14 +109,17 @@ int iswa_addScreenSpaceCygnet(lua_State* L) { // std::string type = "x"; // std::string group = ""; -// if(nArguments > 0) +// if (nArguments > 0) { // kwPath = luaL_checkstring(L, 1); +// } -// if(nArguments > 1) +// if (nArguments > 1) { // type = luaL_checkstring(L, 2); +// } -// if(nArguments > 2) +// if (nArguments > 2) { // group = luaL_checkstring(L, 3); +// } // IswaManager::ref().createKameleonPlane(kwPath, type, group); // return 0; diff --git a/modules/kameleon/src/kameleonhelper.cpp b/modules/kameleon/src/kameleonhelper.cpp index 67d7983af2..53bbf3f08a 100644 --- a/modules/kameleon/src/kameleonhelper.cpp +++ b/modules/kameleon/src/kameleonhelper.cpp @@ -81,7 +81,8 @@ double getTime(ccmc::Kameleon* kameleon) { if (kameleon->doesAttributeExist("start_time")){ seqStartStr = kameleon->getGlobalAttribute("start_time").getAttributeString(); - } else if (kameleon->doesAttributeExist("tim_rundate_cal")) { + } + else if (kameleon->doesAttributeExist("tim_rundate_cal")) { seqStartStr = kameleon->getGlobalAttribute("tim_rundate_cal").getAttributeString(); const size_t N_CHARS = seqStartStr.length(); @@ -111,13 +112,16 @@ double getTime(ccmc::Kameleon* kameleon) { break; } } - } else if (kameleon->doesAttributeExist("tim_obsdate_cal")) { + } + else if (kameleon->doesAttributeExist("tim_obsdate_cal")) { seqStartStr = kameleon->getGlobalAttribute("tim_obsdate_cal").getAttributeString(); - } else if (kameleon->doesAttributeExist("tim_crstart_cal")) { + } + else if (kameleon->doesAttributeExist("tim_crstart_cal")) { seqStartStr = kameleon->getGlobalAttribute("tim_crstart_cal").getAttributeString(); - } else { + } + else { LWARNING( "No starting time attribute could be found in the .cdf file. Starting " "time is set to 01.JAN.2000 12:00." @@ -133,7 +137,8 @@ double getTime(ccmc::Kameleon* kameleon) { seqStartDbl = Time::convertTime( seqStartStr.substr(0, seqStartStr.length() - 2) ); - } else { + } + else { LWARNING("No starting time attribute could be found in the .cdf file." "Starting time is set to 01.JAN.2000 12:00."); seqStartDbl = 0.0; @@ -144,10 +149,12 @@ double getTime(ccmc::Kameleon* kameleon) { if (kameleon->doesAttributeExist("elapsed_time_in_seconds")) { ccmc::Attribute att = kameleon->getGlobalAttribute("elapsed_time_in_seconds"); stateStartOffset = static_cast(att.getAttributeFloat()); - } else if (kameleon->doesAttributeExist("time_physical_time")) { + } + else if (kameleon->doesAttributeExist("time_physical_time")) { ccmc::Attribute att = kameleon->getGlobalAttribute("time_physical_time"); stateStartOffset = static_cast(att.getAttributeFloat()); - } else { + } + else { stateStartOffset = 0.0; LWARNING("No time offset attribute could be found in the .cdf file." "The current state starts the same time as the sequence!"); diff --git a/modules/kameleon/src/kameleonwrapper.cpp b/modules/kameleon/src/kameleonwrapper.cpp index c3fdbbdc05..6f725b1c2b 100644 --- a/modules/kameleon/src/kameleonwrapper.cpp +++ b/modules/kameleon/src/kameleonwrapper.cpp @@ -248,7 +248,8 @@ float* KameleonWrapper::uniformSampledValues(const std::string& var, LWARNING("Warning: There might be a gap in the data"); } // Leave values at zero if outside domain - } else { // if inside + } + else { // if inside // ENLIL CDF specific hacks! // Convert from meters to AU for interpolator const double localRPh = rPh / ccmc::constants::AU_in_meters; @@ -268,8 +269,8 @@ float* KameleonWrapper::uniformSampledValues(const std::string& var, doubleData[index] = value; histogram[mapToHistogram(value)]++; - - } else { + } + else { // Assume cartesian for fallback purpose const double stepX = (_max.x - _min.x) / (static_cast(outDimensions.x)); @@ -408,7 +409,9 @@ float* KameleonWrapper::uniformSliceValues(const std::string& var, LWARNING("Warning: There might be a gap in the data"); } // Leave values at zero if outside domain - } else { // if inside + } + else { + // if inside // ENLIL CDF specific hacks! // Convert from meters to AU for interpolator const double localRPh = rPh / ccmc::constants::AU_in_meters; @@ -426,7 +429,8 @@ float* KameleonWrapper::uniformSliceValues(const std::string& var, ); } - } else { + } + else { const double xPos = _min.x + stepX * xi; const double yPos = _min.y + stepY * yi; const double zPos = _min.z + stepZ * zi; @@ -443,7 +447,8 @@ float* KameleonWrapper::uniformSliceValues(const std::string& var, if (value != missingValue) { doubleData[index] = value; data[index] = static_cast(value); - } else { + } + else { doubleData[index] = 0; } } @@ -513,7 +518,8 @@ float* KameleonWrapper::uniformSampledVectorValues(const std::string& xVar, data[index + 2] = (zVal - varZMin) / (varZMax - varZMin); // B // GL_RGB refuses to work. Workaround doing a GL_RGBA hardcoded alpha data[index + 3] = 1.f; - } else { + } + else { LERROR( "Only cartesian grid supported for " "uniformSampledVectorValues (for now)" @@ -579,7 +585,8 @@ KameleonWrapper::Fieldlines KameleonWrapper::classifiedFieldLines(const std::str fieldLines.push_back(line); } - } else { + } + else { LERROR("Fieldlines are only supported for BATSRUS model"); } @@ -637,7 +644,8 @@ KameleonWrapper::Fieldlines KameleonWrapper::fieldLines(const std::string& xVar, fieldLines.push_back(line); } - } else { + } + else { LERROR("Fieldlines are only supported for BATSRUS model"); } @@ -989,17 +997,23 @@ KameleonWrapper::Model KameleonWrapper::modelType() const { _kameleon->getGlobalAttribute("model_name").getAttributeString(); if (modelName == "open_ggcm" || modelName == "ucla_ggcm") { return Model::OpenGGCM; - } else if (modelName == "batsrus") { + } + else if (modelName == "batsrus") { return Model::BATSRUS; - } else if (modelName == "enlil") { + } + else if (modelName == "enlil") { return Model::ENLIL; - } else if (modelName == "mas") { + } + else if (modelName == "mas") { return Model::MAS; - } else if (modelName == "ADAPT3D") { + } + else if (modelName == "ADAPT3D") { return Model::Adapt3D; - } else if (modelName == "swmf") { + } + else if (modelName == "swmf") { return Model::SWMF; - } else if (modelName == "LFM") { + } + else if (modelName == "LFM") { return Model::LFM; } } @@ -1012,17 +1026,20 @@ glm::vec4 KameleonWrapper::classifyFieldline(FieldlineEnd fEnd, FieldlineEnd bEn { // closed return glm::vec4(1.f, 0.f, 0.f, 1.f); - } else if ((fEnd == FieldlineEnd::FAROUT && bEnd == FieldlineEnd::NORTH) || - (bEnd == FieldlineEnd::FAROUT && fEnd == FieldlineEnd::NORTH)) + } + else if ((fEnd == FieldlineEnd::FAROUT && bEnd == FieldlineEnd::NORTH) || + (bEnd == FieldlineEnd::FAROUT && fEnd == FieldlineEnd::NORTH)) { // north return glm::vec4(1.f, 1.f, 0.f, 1.f); - } else if ((fEnd == FieldlineEnd::FAROUT && bEnd == FieldlineEnd::SOUTH) || - (bEnd == FieldlineEnd::FAROUT && fEnd == FieldlineEnd::SOUTH)) + } + else if ((fEnd == FieldlineEnd::FAROUT && bEnd == FieldlineEnd::SOUTH) || + (bEnd == FieldlineEnd::FAROUT && fEnd == FieldlineEnd::SOUTH)) { // south return glm::vec4(0.f, 1.f, 0.f, 1.f); - } else if (fEnd == FieldlineEnd::FAROUT && bEnd == FieldlineEnd::FAROUT) { + } + else if (fEnd == FieldlineEnd::FAROUT && bEnd == FieldlineEnd::FAROUT) { // solar wind return glm::vec4(0.f, 0.f, 1.f, 1.f); } diff --git a/modules/kameleonvolume/kameleonvolumereader.cpp b/modules/kameleonvolume/kameleonvolumereader.cpp index bd692888ef..0df6caca5d 100644 --- a/modules/kameleonvolume/kameleonvolumereader.cpp +++ b/modules/kameleonvolume/kameleonvolumereader.cpp @@ -222,7 +222,8 @@ std::string KameleonVolumeReader::simulationStart() const { std::string startTime; if (_kameleon.model->doesAttributeExist("start_time")) { startTime = globalAttribute(*_kameleon.model, "start_time"); - } else if (_kameleon.model->doesAttributeExist("tim_rundate_cal")) { + } + else if (_kameleon.model->doesAttributeExist("tim_rundate_cal")) { startTime = globalAttribute(*_kameleon.model, "tim_rundate_cal"); size_t numChars = startTime.length(); if (numChars < 19) { @@ -247,9 +248,11 @@ std::string KameleonVolumeReader::simulationStart() const { break; } } - } else if (_kameleon.model->doesAttributeExist("tim_obsdate_cal")) { + } + else if (_kameleon.model->doesAttributeExist("tim_obsdate_cal")) { startTime = globalAttribute(*_kameleon.model, "tim_obsdate_cal"); - } else if (_kameleon.model->doesAttributeExist("tim_crstart_cal")) { + } + else if (_kameleon.model->doesAttributeExist("tim_crstart_cal")) { startTime = globalAttribute(*_kameleon.model, "tim_crstart_cal"); } @@ -263,7 +266,8 @@ std::string KameleonVolumeReader::simulationStart() const { float KameleonVolumeReader::elapsedTime() const { if (_kameleon.model->doesAttributeExist("elapsed_time_in_seconds")) { return globalAttribute(*_kameleon.model, "elapsed_time_in_seconds"); - } else if (_kameleon.model->doesAttributeExist("time_physical_time")) { + } + else if (_kameleon.model->doesAttributeExist("time_physical_time")) { return globalAttribute(*_kameleon.model, "time_physical_time"); } return 0.f; diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index e221255fd1..7daeed8749 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -329,7 +329,8 @@ void RenderableKameleonVolume::load() { ); if (FileSys.fileExists(cachePath)) { loadRaw(cachePath); - } else { + } + else { loadFromPath(_sourcePath); storeRaw(cachePath); } @@ -351,7 +352,8 @@ void RenderableKameleonVolume::loadFromPath(const std::string& path) { ); if (extension == "cdf") { loadCdf(path); - } else { + } + else { loadRaw(path); } } diff --git a/modules/multiresvolume/rendering/brickselection.cpp b/modules/multiresvolume/rendering/brickselection.cpp index 3a6c844635..fa37a64ec7 100644 --- a/modules/multiresvolume/rendering/brickselection.cpp +++ b/modules/multiresvolume/rendering/brickselection.cpp @@ -70,7 +70,8 @@ BrickSelection BrickSelection::splitTemporally(bool t, unsigned int childBrickIn if (t) { child.lowT = centerT(); child.highT = highT; - } else { + } + else { child.lowT = lowT; child.highT = centerT(); } diff --git a/modules/multiresvolume/rendering/errorhistogrammanager.cpp b/modules/multiresvolume/rendering/errorhistogrammanager.cpp index 7fbef2d659..726ea4b21c 100644 --- a/modules/multiresvolume/rendering/errorhistogrammanager.cpp +++ b/modules/multiresvolume/rendering/errorhistogrammanager.cpp @@ -117,7 +117,8 @@ bool ErrorHistogramManager::buildFromLeaf(unsigned int bstOffset, _histograms[innerNodeIndex] = Histogram(_minBin, _maxBin, _numBins); ancestorVoxels = readValues(ancestorBrickIndex); _voxelCache[innerNodeIndex] = ancestorVoxels; - } else { + } + else { ancestorVoxels = it->second; } @@ -289,7 +290,8 @@ const Histogram* ErrorHistogramManager::histogram(unsigned int brickIndex) const const unsigned int innerNodeIndex = brickToInnerNodeIndex(brickIndex); if (innerNodeIndex < _numInnerNodes) { return &(_histograms[innerNodeIndex]); - } else { + } + else { return nullptr; } } diff --git a/modules/multiresvolume/rendering/histogrammanager.cpp b/modules/multiresvolume/rendering/histogrammanager.cpp index 83711cafd2..d0ad4a8ed7 100644 --- a/modules/multiresvolume/rendering/histogrammanager.cpp +++ b/modules/multiresvolume/rendering/histogrammanager.cpp @@ -64,7 +64,8 @@ bool HistogramManager::buildHistogram(TSP* tsp, unsigned int brickIndex) { for (size_t v = 0; v < numVoxels; ++v) { histogram.add(voxelValues[v], 1.0); } - } else { + } + else { // Has children std::vector children; @@ -89,7 +90,8 @@ bool HistogramManager::buildHistogram(TSP* tsp, unsigned int brickIndex) { // If node has both BST and Octree children, only add BST ones histogram.add(_histograms[childIndex]); } - } else { + } + else { return false; } } diff --git a/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp b/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp index 5a9f7ca421..39f53d52c1 100644 --- a/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp +++ b/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp @@ -129,12 +129,14 @@ bool LocalErrorHistogramManager::buildFromOctreeChild(unsigned int bstOffset, if (isOctreeLeaf) { childValues = readValues(childIndex); - } else { + } + else { const unsigned int childInnerNodeIndex = brickToInnerNodeIndex(childIndex); auto it = _voxelCache.find(childInnerNodeIndex); if (it != _voxelCache.end()) { childValues = it->second; - } else { + } + else { LERROR(fmt::format( "Child {} visited without cache, {}, {}", childIndex, @@ -149,11 +151,13 @@ bool LocalErrorHistogramManager::buildFromOctreeChild(unsigned int bstOffset, if (octreeChildIndex == 0) { parentValues = readValues(parentIndex); _voxelCache[parentInnerNodeIndex] = parentValues; - } else { + } + else { auto it = _voxelCache.find(parentInnerNodeIndex); if (it != _voxelCache.end()) { parentValues = it->second; - } else { + } + else { LERROR(fmt::format("Parent {} visited without cache", parentIndex)); return false; } @@ -231,12 +235,14 @@ bool LocalErrorHistogramManager::buildFromBstChild(unsigned int bstOffset, if (isBstLeaf) { childValues = readValues(childIndex); - } else { + } + else { unsigned int childInnerNodeIndex = brickToInnerNodeIndex(childIndex); auto it = _voxelCache.find(childInnerNodeIndex); if (it != _voxelCache.end()) { childValues = it->second; - } else { + } + else { LERROR(fmt::format("Child {} visited without cache", childIndex)); return false; } @@ -246,11 +252,13 @@ bool LocalErrorHistogramManager::buildFromBstChild(unsigned int bstOffset, if (bstChildIndex == 1) { parentValues = readValues(parentIndex); _voxelCache[parentInnerNodeIndex] = parentValues; - } else { + } + else { auto it = _voxelCache.find(parentInnerNodeIndex); if (it != _voxelCache.end()) { parentValues = it->second; - } else { + } + else { LERROR(fmt::format("Parent {} visited without cache", parentIndex)); return false; } @@ -433,7 +441,8 @@ const Histogram* LocalErrorHistogramManager::spatialHistogram( const unsigned int innerNodeIndex = brickToInnerNodeIndex(brickIndex); if (innerNodeIndex < _numInnerNodes) { return &(_spatialHistograms[innerNodeIndex]); - } else { + } + else { return nullptr; } } @@ -444,7 +453,8 @@ const Histogram* LocalErrorHistogramManager::temporalHistogram( const unsigned int innerNodeIndex = brickToInnerNodeIndex(brickIndex); if (innerNodeIndex < _numInnerNodes) { return &(_temporalHistograms[innerNodeIndex]); - } else { + } + else { return nullptr; } } diff --git a/modules/multiresvolume/rendering/localtfbrickselector.cpp b/modules/multiresvolume/rendering/localtfbrickselector.cpp index 837ddf1928..37d2cd70e4 100644 --- a/modules/multiresvolume/rendering/localtfbrickselector.cpp +++ b/modules/multiresvolume/rendering/localtfbrickselector.cpp @@ -82,7 +82,8 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) if (splitType != BrickSelection::SplitType::None) { priorityQueue.push_back(brickSelection); - } else { + } + else { leafSelections.push_back(brickSelection); } @@ -135,10 +136,12 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) priorityQueue.end(), compareSplitPoints ); - } else { + } + else { leafSelections.push_back(childSelection); } - } else if (bs.splitType == BrickSelection::SplitType::Spatial) { + } + else if (bs.splitType == BrickSelection::SplitType::Spatial) { nBricksInMemory += 7; // Remove one and add eight. const unsigned int firstChild = _tsp->firstOctreeChild(brickIndex); @@ -156,7 +159,8 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) } if (bs.splitPoints > -1) { temporalSplitQueue.push_back(bs); - } else { + } + else { deadEnds.push_back(bs); } break; @@ -187,7 +191,8 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) priorityQueue.end(), compareSplitPoints ); - } else { + } + else { leafSelections.push_back(childSelection); } } @@ -210,7 +215,8 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) temporalSplitQueue.end(), compareSplitPoints ); - } else { + } + else { deadEnds.push_back(bs); } } @@ -241,7 +247,8 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) if (pickRightTimeChild) { childBrickIndex = _tsp->bstRight(brickIndex); - } else { + } + else { childBrickIndex = _tsp->bstLeft(brickIndex); } @@ -260,7 +267,8 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) temporalSplitQueue.end(), compareSplitPoints ); - } else { + } + else { BrickSelection childSelection = bs.splitTemporally( pickRightTimeChild, childBrickIndex, @@ -270,7 +278,8 @@ void LocalTfBrickSelector::selectBricks(int timestep, std::vector& bricks) deadEnds.push_back(childSelection); } } - } else { + } + else { // Write selected inner nodes to brickSelection vector for (const BrickSelection& bs : priorityQueue) { writeSelection(bs, bricks); @@ -316,10 +325,12 @@ float LocalTfBrickSelector::splitPoints(unsigned int brickIndex, if (spatialPoints > 0 && spatialPoints > temporalPoints) { splitPoints = spatialPoints; splitType = BrickSelection::SplitType::Spatial; - } else if (temporalPoints > 0) { + } + else if (temporalPoints > 0) { splitPoints = temporalPoints; splitType = BrickSelection::SplitType::Temporal; - } else { + } + else { splitPoints = -1; splitType = BrickSelection::SplitType::None; } @@ -354,7 +365,8 @@ bool LocalTfBrickSelector::calculateBrickErrors() { for (unsigned int brickIndex = 0; brickIndex < nHistograms; brickIndex++) { if (_tsp->isOctreeLeaf(brickIndex)) { _brickErrors[brickIndex].spatial = 0.0; - } else { + } + else { const Histogram* histogram = _histogramManager->spatialHistogram( brickIndex ); @@ -371,7 +383,8 @@ bool LocalTfBrickSelector::calculateBrickErrors() { if (_tsp->isBstLeaf(brickIndex)) { _brickErrors[brickIndex].temporal = 0.0; - } else { + } + else { const Histogram* histogram = _histogramManager->temporalHistogram( brickIndex ); diff --git a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp index e07c447b6a..02cfcaaf74 100644 --- a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp +++ b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp @@ -221,7 +221,8 @@ RenderableMultiresVolume::RenderableMultiresVolume(const ghoul::Dictionary& dict _startTime = SpiceManager::ref().ephemerisTimeFromDate(startTimeString); _endTime = SpiceManager::ref().ephemerisTimeFromDate(endTimeString); _loop = false; - } else { + } + else { _loop = true; LWARNING("Node does not provide time information. Viewing one image / frame"); } @@ -268,9 +269,11 @@ RenderableMultiresVolume::RenderableMultiresVolume(const ghoul::Dictionary& dict std::string selectorName = _selectorName; if (selectorName == "simple") { _selector = Selector::SIMPLE; - } else if (selectorName == "local") { + } + else if (selectorName == "local") { _selector = Selector::LOCAL; - } else { + } + else { _selector = Selector::TF; } @@ -280,11 +283,14 @@ RenderableMultiresVolume::RenderableMultiresVolume(const ghoul::Dictionary& dict std::string newSelectorName = _selectorName; if (newSelectorName == "simple") { s = Selector::SIMPLE; - } else if (newSelectorName == "local") { + } + else if (newSelectorName == "local") { s = Selector::LOCAL; - } else if (newSelectorName == "tf") { + } + else if (newSelectorName == "tf") { s = Selector::TF; - } else { + } + else { return; } setSelectorType(s); @@ -474,13 +480,15 @@ bool RenderableMultiresVolume::initializeSelector() { fmt::format("Loading histograms from cache: {}", cacheFilename) ); success &= _errorHistogramManager->loadFromFile(cacheFilename); - } else if (_errorHistogramsPath != "") { + } + else if (_errorHistogramsPath != "") { // Read histograms from scene data. LINFO(fmt::format( "Loading histograms from scene data: {}", _errorHistogramsPath )); success &= _errorHistogramManager->loadFromFile(_errorHistogramsPath); - } else { + } + else { // Build histograms from tsp file. LWARNING(fmt::format("Failed to open {}", cacheFilename)); success &= _errorHistogramManager->buildHistograms(nHistograms); @@ -510,7 +518,8 @@ bool RenderableMultiresVolume::initializeSelector() { cacheFile.close(); LINFO(fmt::format("Loading histograms from {}", cacheFilename)); success &= _histogramManager->loadFromFile(cacheFilename); - } else { + } + else { // Build histograms from tsp file. LWARNING(fmt::format("Failed to open '{}'", cacheFilename)); success &= _histogramManager->buildHistograms( @@ -541,7 +550,8 @@ bool RenderableMultiresVolume::initializeSelector() { cacheFile.close(); LINFO(fmt::format("Loading histograms from {}", cacheFilename)); success &= _localErrorHistogramManager->loadFromFile(cacheFilename); - } else { + } + else { // Build histograms from tsp file. LWARNING(fmt::format("Failed to open {}", cacheFilename)); success &= _localErrorHistogramManager->buildHistograms(nHistograms); diff --git a/modules/multiresvolume/rendering/shenbrickselector.cpp b/modules/multiresvolume/rendering/shenbrickselector.cpp index d10de2ef22..c05553a661 100644 --- a/modules/multiresvolume/rendering/shenbrickselector.cpp +++ b/modules/multiresvolume/rendering/shenbrickselector.cpp @@ -74,7 +74,8 @@ void ShenBrickSelector::traverseBST(int timestep, unsigned int brickIndex, if (timestep <= timeSpanCenter) { bstChild = _tsp->bstLeft(brickIndex); timeSpanEnd = timeSpanCenter; - } else { + } + else { bstChild = _tsp->bstRight(brickIndex); timeSpanStart = timeSpanCenter; } @@ -97,11 +98,14 @@ void ShenBrickSelector::selectBricks(int timestep, unsigned int brickIndex, if (_tsp->temporalError(brickIndex) <= _temporalTolerance) { if (_tsp->isOctreeLeaf(bstRootBrickIndex)) { selectCover(coveredBricks, brickIndex, bricks); - } else if (_tsp->spatialError(brickIndex) <= _spatialTolerance) { + } + else if (_tsp->spatialError(brickIndex) <= _spatialTolerance) { selectCover(coveredBricks, brickIndex, bricks); - } else if (_tsp->isBstLeaf(brickIndex)) { + } + else if (_tsp->isBstLeaf(brickIndex)) { traverseOT(timestep, bstRootBrickIndex, coveredBricks, bricks); - } else { + } + else { traverseBST( timestep, brickIndex, @@ -112,13 +116,16 @@ void ShenBrickSelector::selectBricks(int timestep, unsigned int brickIndex, bricks ); } - } else if (_tsp->isBstLeaf(brickIndex)) { + } + else if (_tsp->isBstLeaf(brickIndex)) { if (_tsp->isOctreeLeaf(bstRootBrickIndex)) { selectCover(coveredBricks, brickIndex, bricks); - } else { + } + else { traverseOT(timestep, bstRootBrickIndex, coveredBricks, bricks); } - } else { + } + else { traverseBST( timestep, brickIndex, diff --git a/modules/multiresvolume/rendering/simpletfbrickselector.cpp b/modules/multiresvolume/rendering/simpletfbrickselector.cpp index d69f557a36..78d99e7796 100644 --- a/modules/multiresvolume/rendering/simpletfbrickselector.cpp +++ b/modules/multiresvolume/rendering/simpletfbrickselector.cpp @@ -83,7 +83,8 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector& bricks) if (splitType != BrickSelection::SplitType::None) { priorityQueue.push_back(brickSelection); - } else { + } + else { leafSelections.push_back(brickSelection); } @@ -137,10 +138,12 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector& bricks) priorityQueue.end(), compareSplitPoints ); - } else { + } + else { leafSelections.push_back(childSelection); } - } else if (bs.splitType == BrickSelection::SplitType::Spatial) { + } + else if (bs.splitType == BrickSelection::SplitType::Spatial) { nBricksInMemory += 7; // Remove one and add eight. unsigned int firstChild = _tsp->firstOctreeChild(brickIndex); @@ -158,7 +161,8 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector& bricks) } if (bs.splitPoints > -1) { temporalSplitQueue.push_back(bs); - } else { + } + else { deadEnds.push_back(bs); } break; @@ -186,7 +190,8 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector& bricks) priorityQueue.end(), compareSplitPoints ); - } else { + } + else { leafSelections.push_back(childSelection); } } @@ -208,7 +213,8 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector& bricks) temporalSplitQueue.end(), compareSplitPoints ); - } else { + } + else { deadEnds.push_back(bs); } } @@ -256,7 +262,8 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector& bricks) temporalSplitQueue.end(), compareSplitPoints ); - } else { + } + else { BrickSelection childSelection = bs.splitTemporally( pickRightTimeChild, childBrickIndex, @@ -265,7 +272,8 @@ void SimpleTfBrickSelector::selectBricks(int timestep, std::vector& bricks) deadEnds.push_back(childSelection); } } - } else { + } + else { // Write selected inner nodes to brickSelection vector for (const BrickSelection& bs : priorityQueue) { writeSelection(bs, bricks); @@ -309,10 +317,12 @@ float SimpleTfBrickSelector::splitPoints(unsigned int brickIndex, if (spatialPoints > 0 && spatialPoints > temporalPoints) { splitPoints = spatialPoints; splitType = BrickSelection::SplitType::Spatial; - } else if (temporalPoints > 0) { + } + else if (temporalPoints > 0) { splitPoints = temporalPoints; splitType = BrickSelection::SplitType::Temporal; - } else { + } + else { splitPoints = -1; splitType = BrickSelection::SplitType::None; } diff --git a/modules/multiresvolume/rendering/tfbrickselector.cpp b/modules/multiresvolume/rendering/tfbrickselector.cpp index 810c792b92..75036f1a09 100644 --- a/modules/multiresvolume/rendering/tfbrickselector.cpp +++ b/modules/multiresvolume/rendering/tfbrickselector.cpp @@ -84,7 +84,8 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { if (splitType != BrickSelection::SplitType::None) { priorityQueue.push_back(brickSelection); - } else { + } + else { leafSelections.push_back(brickSelection); } @@ -126,7 +127,8 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { if (pickRightTimeChild) { childBrickIndex = _tsp->bstRight(brickIndex); - } else { + } + else { childBrickIndex = _tsp->bstLeft(brickIndex); } @@ -145,10 +147,12 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { priorityQueue.end(), compareSplitPoints ); - } else { + } + else { leafSelections.push_back(childSelection); } - } else if (bs.splitType == BrickSelection::SplitType::Spatial) { + } + else if (bs.splitType == BrickSelection::SplitType::Spatial) { nBricksInMemory += 7; // Remove one and add eight. unsigned int firstChild = _tsp->firstOctreeChild(brickIndex); @@ -167,7 +171,8 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { } if (bs.splitPoints > -1) { temporalSplitQueue.push_back(bs); - } else { + } + else { deadEnds.push_back(bs); } break; @@ -196,7 +201,8 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { priorityQueue.end(), compareSplitPoints ); - } else { + } + else { leafSelections.push_back(childSelection); } } @@ -224,7 +230,8 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { temporalSplitQueue.end(), compareSplitPoints ); - } else { + } + else { deadEnds.push_back(bs); } } @@ -273,7 +280,8 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { temporalSplitQueue.end(), compareSplitPoints ); - } else { + } + else { BrickSelection childSelection = bs.splitTemporally( pickRightTimeChild, childBrickIndex, @@ -283,7 +291,8 @@ void TfBrickSelector::selectBricks(int timestep, std::vector& bricks) { deadEnds.push_back(childSelection); } } - } else { + } + else { // Write selected inner nodes to brickSelection vector //std::cout << "priority queue: " << priorityQueue.size() << std::endl; for (const BrickSelection& bs : priorityQueue) { @@ -357,10 +366,12 @@ float TfBrickSelector::splitPoints(unsigned int brickIndex, if (spatialPoints > 0 && spatialPoints > temporalPoints) { splitPoints = spatialPoints; splitType = BrickSelection::SplitType::Spatial; - } else if (temporalPoints > 0) { + } + else if (temporalPoints > 0) { splitPoints = temporalPoints; splitType = BrickSelection::SplitType::Temporal; - } else { + } + else { splitPoints = -1; splitType = BrickSelection::SplitType::None; } @@ -396,7 +407,8 @@ bool TfBrickSelector::calculateBrickErrors() { for (unsigned int brickIndex = 0; brickIndex < nHistograms; brickIndex++) { if (_tsp->isBstLeaf(brickIndex) && _tsp->isOctreeLeaf(brickIndex)) { _brickErrors[brickIndex] = 0; - } else { + } + else { const Histogram* histogram = _histogramManager->histogram(brickIndex); float error = 0; for (size_t i = 0; i < gradients.size(); i++) { diff --git a/modules/multiresvolume/rendering/tsp.cpp b/modules/multiresvolume/rendering/tsp.cpp index e18c62adc6..bcb194fcea 100644 --- a/modules/multiresvolume/rendering/tsp.cpp +++ b/modules/multiresvolume/rendering/tsp.cpp @@ -436,7 +436,8 @@ bool TSP::calculateTemporalError() { // 0.0 higher up in the tree if (coveredBricks.size() == 1) { errors[brick] = -0.1f; - } else { + } + else { // Calculate standard deviation per voxel, average over brick float avgStdDev = 0.f; for (unsigned int voxel = 0; voxelisDone()) { _topics.emplace(topicId, std::move(topic)); } - } else { + } + else { if (!isAuthorized()) { LERROR("Connection isn't authorized."); return; diff --git a/modules/server/src/serverinterface.cpp b/modules/server/src/serverinterface.cpp index 639535edd2..d5f8ca6517 100644 --- a/modules/server/src/serverinterface.cpp +++ b/modules/server/src/serverinterface.cpp @@ -155,7 +155,8 @@ ServerInterface::ServerInterface(const ghoul::Dictionary& config) const std::string type = config.value(TypeInfo.identifier); if (type == TcpSocketType) { _type = static_cast(InterfaceType::TcpSocket); - } else if (type == WebSocketType) { + } + else if (type == WebSocketType) { _type = static_cast(InterfaceType::WebSocket); } diff --git a/modules/server/src/topics/authorizationtopic.cpp b/modules/server/src/topics/authorizationtopic.cpp index e3c7394ff8..b761fa7da5 100644 --- a/modules/server/src/topics/authorizationtopic.cpp +++ b/modules/server/src/topics/authorizationtopic.cpp @@ -51,14 +51,16 @@ bool AuthorizationTopic::isDone() const { void AuthorizationTopic::handleJson(const nlohmann::json& json) { if (isDone()) { _connection->sendJson(wrappedPayload({ KeyStatus, Authorized })); - } else { + } + else { try { auto providedKey = json.at("key").get(); if (authorize(providedKey)) { _connection->setAuthorized(true); _connection->sendJson(wrappedPayload({ KeyStatus, Authorized })); LINFO("Client successfully authorized."); - } else { + } + else { _connection->sendJson(wrappedPayload({ KeyStatus, IncorrectKey })); } } catch (const std::out_of_range&) { diff --git a/modules/server/src/topics/documentationtopic.cpp b/modules/server/src/topics/documentationtopic.cpp index b3f4e2573b..24cbf84cf2 100644 --- a/modules/server/src/topics/documentationtopic.cpp +++ b/modules/server/src/topics/documentationtopic.cpp @@ -55,9 +55,11 @@ void DocumentationTopic::handleJson(const nlohmann::json& json) { // ghoul::Dictionary objects from ScriptEngine, FactoryManager, and KeybindingManager. if (requestedType == TypeLua) { response = json::parse(global::scriptEngine.generateJson()); - } else if (requestedType == TypeFactories) { + } + else if (requestedType == TypeFactories) { response = json::parse(FactoryManager::ref().generateJson()); - } else if (requestedType == TypeKeyboard) { + } + else if (requestedType == TypeKeyboard) { response = json::parse(global::keybindingManager.generateJson()); } diff --git a/modules/server/src/topics/setpropertytopic.cpp b/modules/server/src/topics/setpropertytopic.cpp index dc25536b53..76b05f1c37 100644 --- a/modules/server/src/topics/setpropertytopic.cpp +++ b/modules/server/src/topics/setpropertytopic.cpp @@ -70,11 +70,14 @@ namespace { std::string luaLiteralFromJson(nlohmann::json value) { if (value.is_string()) { return "'" + escapedLuaString(value.get()) + "'"; - } else if (value.is_boolean()) { + } + else if (value.is_boolean()) { return value.get() ? "true" : "false"; - } else if (value.is_number()) { + } + else if (value.is_number()) { return std::to_string(value.get()); - } else if (value.is_array()) { + } + else if (value.is_array()) { std::string literal = "{"; for (nlohmann::json::iterator it = value.begin(); it != value.end(); ++it) { literal += luaLiteralFromJson(it.value()) += ","; @@ -82,7 +85,8 @@ namespace { literal.pop_back(); // remove last comma literal += "}"; return literal; - } else if (value.is_object()) { + } + else if (value.is_object()) { std::string literal = "{"; for (nlohmann::json::iterator it = value.begin(); it != value.end(); ++it) { literal += it.key() + "=" + luaLiteralFromJson(it.value()) += ","; @@ -90,7 +94,8 @@ namespace { literal.pop_back(); // remove last comma literal += "}"; return literal; - }{ + } + else { return "nil"; } } diff --git a/modules/server/src/topics/shortcuttopic.cpp b/modules/server/src/topics/shortcuttopic.cpp index 396ae2c283..34376e0c69 100644 --- a/modules/server/src/topics/shortcuttopic.cpp +++ b/modules/server/src/topics/shortcuttopic.cpp @@ -102,7 +102,8 @@ void ShortcutTopic::handleJson(const nlohmann::json& input) { if (event == StartSubscription) { // TODO: Subscribe to shortcuts and keybindings // shortcutManager.subscribe(); ... - } else if (event == StopSubscription) { + } + else if (event == StopSubscription) { // TODO: Unsubscribe to shortcuts and keybindings // shortcutManager.unsubscribe(); ... return; diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index 3dcd0db954..377f8c77bd 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -631,7 +631,8 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary) if (sizeCompositionOption == "App Brightness") { _psfMultiplyOption = 0; - } else if (sizeCompositionOption == "Lum and Size") { + } + else if (sizeCompositionOption == "Lum and Size") { _psfMultiplyOption = 1; } else if (sizeCompositionOption == "Lum, Size and App Brightness") { diff --git a/modules/space/shaders/debrisViz_fs.glsl b/modules/space/shaders/debrisViz_fs.glsl index 23199cd727..2fd1b77264 100644 --- a/modules/space/shaders/debrisViz_fs.glsl +++ b/modules/space/shaders/debrisViz_fs.glsl @@ -86,8 +86,9 @@ Fragment getFragment() { // to debug using colors use this if-statment. // float ep = 0.01; - // if( fract(vertexID_f) < ep ){ //periodFraction < ep - // frag.color = vec4(1, 0, 0, 1); + // if (fract(vertexID_f) < ep) { + // periodFraction < ep + // frag.color = vec4(1, 0, 0, 1); // } return frag; diff --git a/modules/space/translation/tletranslation.cpp b/modules/space/translation/tletranslation.cpp index 7d41878a33..ec5fb75137 100644 --- a/modules/space/translation/tletranslation.cpp +++ b/modules/space/translation/tletranslation.cpp @@ -319,7 +319,8 @@ void TLETranslation::readTLEFile(const std::string& filename, int lineNum) { // 13 65-68 Element set number.Incremented when a new TLE is generated // 14 69-69 Checksum (modulo 10) keplerElements.epoch = epochFromSubstring(line.substr(18, 14)); - } else { + } + else { throw ghoul::RuntimeError(fmt::format( "File {} @ line {} does not have '1' header", filename, lineNum + 1 )); @@ -371,7 +372,8 @@ void TLETranslation::readTLEFile(const std::string& filename, int lineNum) { // Get mean motion stream.str(line.substr(52, 11)); stream >> keplerElements.meanMotion; - } else { + } + else { throw ghoul::RuntimeError(fmt::format( "File {} @ line {} does not have '2' header", filename, lineNum + 2 )); diff --git a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp index 6abdfaaff1..238ad1cd11 100644 --- a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp @@ -487,7 +487,8 @@ void RenderablePlanetProjection::imageProjectGPU( if (glm::vec3* radius = std::any_cast(&r)){ _fboProgramObject->setUniform(_fboUniformCache.radius, radius); } - } else { + } + else { LERROR("Geometry object needs to provide radius"); } if (_geometry->hasProperty("Segments")) { @@ -495,7 +496,8 @@ void RenderablePlanetProjection::imageProjectGPU( if (int* segments = std::any_cast(&s)) { _fboProgramObject->setUniform(_fboUniformCache.segments, segments[0]); } - }else{ + } + else{ LERROR("Geometry object needs to provide segment count"); } diff --git a/modules/spacecraftinstruments/shaders/renderablePlanetProjection_fs.glsl b/modules/spacecraftinstruments/shaders/renderablePlanetProjection_fs.glsl index a78f09d07e..3760905ab4 100644 --- a/modules/spacecraftinstruments/shaders/renderablePlanetProjection_fs.glsl +++ b/modules/spacecraftinstruments/shaders/renderablePlanetProjection_fs.glsl @@ -79,8 +79,8 @@ void main() { vec3 v_b = normalize(boresight); - if((inRange(projected.x, 0.0, 1.0) && inRange(projected.y, 0.0, 1.0)) && - dot(v_b, normal) < 0.0) + if ((inRange(projected.x, 0.0, 1.0) && inRange(projected.y, 0.0, 1.0)) && + dot(v_b, normal) < 0.0) { color = texture(projectionTexture, vec2(projected.x, projected.y)); stencil = vec4(1.0); diff --git a/modules/spacecraftinstruments/shaders/terminatorshadow_vs.glsl b/modules/spacecraftinstruments/shaders/terminatorshadow_vs.glsl index 3e5ab5cfbd..c837cac53b 100644 --- a/modules/spacecraftinstruments/shaders/terminatorshadow_vs.glsl +++ b/modules/spacecraftinstruments/shaders/terminatorshadow_vs.glsl @@ -41,7 +41,8 @@ uniform vec4 shadowColor; void main() { if (mod(gl_VertexID,2) == 0.0) { vs_color = shadowColor; - } else { + } + else { vs_color = vec4(0.0); } diff --git a/modules/spacecraftinstruments/util/instrumentdecoder.cpp b/modules/spacecraftinstruments/util/instrumentdecoder.cpp index 4ef3eeed44..a5b04f79ba 100644 --- a/modules/spacecraftinstruments/util/instrumentdecoder.cpp +++ b/modules/spacecraftinstruments/util/instrumentdecoder.cpp @@ -53,7 +53,8 @@ InstrumentDecoder::InstrumentDecoder(const ghoul::Dictionary& dictionary) { if (dictionary.hasKeyAndValue(KeyStopCommand) && _type == "SCANNER"){ dictionary.getValue(KeyStopCommand, _stopCommand); - } else { + } + else { LWARNING("Scanner must provide stop command, please check mod file."); } diff --git a/modules/sync/syncmodule.cpp b/modules/sync/syncmodule.cpp index 53a7151789..0bba0d59a0 100644 --- a/modules/sync/syncmodule.cpp +++ b/modules/sync/syncmodule.cpp @@ -62,7 +62,8 @@ void SyncModule::internalInitialize(const ghoul::Dictionary& configuration) { if (configuration.hasKey(KeySynchronizationRoot)) { _synchronizationRoot = configuration.value(KeySynchronizationRoot); - } else { + } + else { LWARNINGC( "SyncModule", "No synchronization root specified. Disabling resource synchronization" diff --git a/modules/touch/ext/CMakeLists.txt b/modules/touch/ext/CMakeLists.txt index 19a1dca056..9ce2824de9 100644 --- a/modules/touch/ext/CMakeLists.txt +++ b/modules/touch/ext/CMakeLists.txt @@ -44,9 +44,9 @@ set(TUIO_SOURCE ${PROJECT_SOURCE_DIR}/libTUIO11/TUIO/OscReceiver.cpp ${PROJECT_SOURCE_DIR}/libTUIO11/TUIO/OneEuroFilter.cpp ${PROJECT_SOURCE_DIR}/libTUIO11/TUIO/FlashSender.cpp - + ${PROJECT_SOURCE_DIR}/libTUIO11/oscpack/ip/IpEndpointName.cpp - + ${PROJECT_SOURCE_DIR}/libTUIO11/oscpack/osc/OscTypes.cpp ${PROJECT_SOURCE_DIR}/libTUIO11/oscpack/osc/OscReceivedElements.cpp ${PROJECT_SOURCE_DIR}/libTUIO11/oscpack/osc/OscPrintReceivedElements.cpp @@ -58,7 +58,7 @@ if (WIN32) ${TUIO_SOURCE} ${PROJECT_SOURCE_DIR}/libTUIO11/oscpack/ip/win32/NetworkingUtils.cpp ${PROJECT_SOURCE_DIR}/libTUIO11/oscpack/ip/win32/UdpSocket.cpp - ) + ) endif () if (UNIX) @@ -80,4 +80,4 @@ target_include_directories(libTUIO11 PUBLIC if (WIN32) # Tuio dependencies target_link_libraries(libTUIO11 PRIVATE winmm.lib wininet.lib ws2_32.lib) -endif() +endif () diff --git a/modules/touch/src/win32_touch.cpp b/modules/touch/src/win32_touch.cpp index 725c005c23..9507b5ef8a 100644 --- a/modules/touch/src/win32_touch.cpp +++ b/modules/touch/src/win32_touch.cpp @@ -237,13 +237,12 @@ 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!"); // } // MSG msg; - // while (GetMessage(&msg, NULL, 0, 0)) - // { + // while (GetMessage(&msg, NULL, 0, 0)) { // DispatchMessage(&msg); // } // }); diff --git a/modules/volume/rendering/renderabletimevaryingvolume.cpp b/modules/volume/rendering/renderabletimevaryingvolume.cpp index d689713104..0cad00ee51 100644 --- a/modules/volume/rendering/renderabletimevaryingvolume.cpp +++ b/modules/volume/rendering/renderabletimevaryingvolume.cpp @@ -452,7 +452,8 @@ void RenderableTimeVaryingVolume::update(const UpdateData&) { glm::dmat4 scaleMatrix = glm::scale(glm::dmat4(1.0), scale); modelTransform = modelTransform * scaleMatrix; _raycaster->setModelTransform(glm::mat4(modelTransform)); - } else { + } + else { // The diameter is two times the maximum radius. // No translation: the sphere is always centered in (0, 0, 0) _raycaster->setModelTransform( @@ -463,7 +464,8 @@ void RenderableTimeVaryingVolume::update(const UpdateData&) { ); } _raycaster->setVolumeTexture(t->texture); - } else { + } + else { _raycaster->setVolumeTexture(nullptr); } _raycaster->setStepSize(_stepSize); diff --git a/modules/volume/volumesampler.inl b/modules/volume/volumesampler.inl index 8fba419183..4c6f344607 100644 --- a/modules/volume/volumesampler.inl +++ b/modules/volume/volumesampler.inl @@ -59,17 +59,20 @@ typename VolumeType::VoxelType VolumeSampler::sample( if (x == minCoords.x) { filterCoefficient *= (1.f - t.x); - } else if (x == maxCoords.x) { + } + else if (x == maxCoords.x) { filterCoefficient *= t.x; } if (y == minCoords.y) { filterCoefficient *= (1.f - t.y); - } else if (y == maxCoords.y) { + } + else if (y == maxCoords.y) { filterCoefficient *= t.y; } if (z == minCoords.z) { filterCoefficient *= (1.f - t.z); - } else if (z == maxCoords.z) { + } + else if (z == maxCoords.z) { filterCoefficient *= t.z; } diff --git a/modules/webbrowser/CMakeLists.txt b/modules/webbrowser/CMakeLists.txt index b1f0022d6c..c914689fda 100644 --- a/modules/webbrowser/CMakeLists.txt +++ b/modules/webbrowser/CMakeLists.txt @@ -152,7 +152,7 @@ set(CEF_HELPER_TARGET "OpenSpace Helper" CACHE INTERNAL "CEF_HELPER_TARGET") # CEF platform-specific config # -if(OS_MACOSX) +if (OS_MACOSX) # Helper executable target. add_executable(${CEF_HELPER_TARGET} MACOSX_BUNDLE ${WEBBROWSER_HELPER_SOURCES}) SET_EXECUTABLE_TARGET_PROPERTIES(${CEF_HELPER_TARGET}) @@ -166,12 +166,12 @@ if(OS_MACOSX) target_compile_options(${CEF_HELPER_TARGET} PRIVATE -Wno-deprecated-declarations) target_compile_options(libcef_dll_wrapper PRIVATE -Wno-deprecated-declarations) - if(USE_SANDBOX) + if (USE_SANDBOX) # Logical target used to link the cef_sandbox library. ADD_LOGICAL_TARGET("cef_sandbox_lib" "${CEF_SANDBOX_LIB_DEBUG}" "${CEF_SANDBOX_LIB_RELEASE}") target_link_libraries(${CEF_HELPER_TARGET} cef_sandbox_lib) - endif() -endif() + endif () +endif () if (OS_WINDOWS) message(STATUS "Setting up WebBrowser CEF helper executable: ${CEF_HELPER_TARGET}") diff --git a/modules/webbrowser/src/webrenderhandler.cpp b/modules/webbrowser/src/webrenderhandler.cpp index 9c01a4e668..d0d081c7c1 100644 --- a/modules/webbrowser/src/webrenderhandler.cpp +++ b/modules/webbrowser/src/webrenderhandler.cpp @@ -71,7 +71,8 @@ void WebRenderHandler::OnPaint(CefRefPtr, CefRenderHandler::PaintEle const glm::ivec2 rectSize = upperUpdatingRectBound - lowerUpdatingRectBound; if (rectSize.x > 0 && rectSize.y > 0) { _textureIsDirty = true; - } else { + } + else { return; } @@ -117,7 +118,8 @@ void WebRenderHandler::updateTexture() { glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, GL_CLAMP_TO_EDGE); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, GL_CLAMP_TO_EDGE); glBindTexture(GL_TEXTURE_2D, 0); - } else if (_textureIsDirty) { + } + else if (_textureIsDirty) { glBindTexture(GL_TEXTURE_2D, _texture); glPixelStorei(GL_UNPACK_ROW_LENGTH, _browserBufferSize.x); diff --git a/modules/webbrowser/webbrowsermodule.cpp b/modules/webbrowser/webbrowsermodule.cpp index 4417787c7d..32d042581e 100644 --- a/modules/webbrowser/webbrowsermodule.cpp +++ b/modules/webbrowser/webbrowsermodule.cpp @@ -129,7 +129,8 @@ void WebBrowserModule::internalInitialize(const ghoul::Dictionary& dictionary) { if (dictionary.hasKeyAndValue("WebHelperLocation")) { _webHelperLocation = absPath(dictionary.value("WebHelperLocation")); - } else { + } + else { _webHelperLocation = findHelperExecutable(); } @@ -188,7 +189,8 @@ void WebBrowserModule::removeBrowser(BrowserInstance* browser) { const auto p = std::find(_browsers.begin(), _browsers.end(), browser); if (p != _browsers.end()) { _browsers.erase(p); - } else { + } + else { LWARNING("Could not find browser in list of browsers."); } diff --git a/modules/webgui/webguimodule.cpp b/modules/webgui/webguimodule.cpp index 8f3b83ddb0..ae0d3079fd 100644 --- a/modules/webgui/webguimodule.cpp +++ b/modules/webgui/webguimodule.cpp @@ -174,7 +174,8 @@ void WebGuiModule::internalInitialize(const ghoul::Dictionary& configuration) { auto startOrStop = [this]() { if (_enabled && !_entryPoint.value().empty()) { startProcess(); - } else { + } + else { stopProcess(); } }; diff --git a/src/documentation/documentationengine.cpp b/src/documentation/documentationengine.cpp index dd65a56231..06456dca21 100644 --- a/src/documentation/documentationengine.cpp +++ b/src/documentation/documentationengine.cpp @@ -113,7 +113,8 @@ std::string generateJsonDocumentation(const Documentation& d) { if (it == documentations.end()) { result << R"("reference": { "found": false })"; - } else { + } + else { result << R"("reference": {)" << R"("found": true,)" << R"("name": ")" << it->name << "\"," diff --git a/src/engine/downloadmanager.cpp b/src/engine/downloadmanager.cpp index f8e256f768..936b7c4672 100644 --- a/src/engine/downloadmanager.cpp +++ b/src/engine/downloadmanager.cpp @@ -271,17 +271,20 @@ std::future DownloadManager::fetchFile( getline(ss, extension ,'/'); getline(ss, extension); file.format = extension; - } else { + } + else { LWARNING("Could not get extension from file downloaded from: " + url); } successCb(file); curl_easy_cleanup(curl); return file; - } else { + } + else { std::string err = curl_easy_strerror(res); if (errorCb) { errorCb(err); - } else { + } + else { LWARNING(fmt::format("Error downloading '{}': {}", url, err)); } curl_easy_cleanup(curl); diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 3390914c42..2ed17ecb9a 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -723,7 +723,8 @@ void OpenSpaceEngine::loadSingleAsset(const std::string& assetPath) { unsigned int nAvailableThreads = std::thread::hardware_concurrency(); unsigned int nThreads = nAvailableThreads == 0 ? 2 : nAvailableThreads - 1; sceneInitializer = std::make_unique(nThreads); - } else { + } + else { sceneInitializer = std::make_unique(); } @@ -740,7 +741,8 @@ void OpenSpaceEngine::loadSingleAsset(const std::string& assetPath) { const SceneGraphNode* parent = camera->parent(); if (parent) { global::navigationHandler.orbitalNavigator().setFocusNode(parent->identifier()); - } else { + } + else { global::navigationHandler.orbitalNavigator().setFocusNode( _scene->root()->identifier() ); @@ -817,7 +819,8 @@ void OpenSpaceEngine::loadSingleAsset(const std::string& assetPath) { progressInfo ); ++it; - } else { + } + else { LoadingScreen::ProgressInfo progressInfo; progressInfo.progress = 1.f; diff --git a/src/interaction/sessionrecording.cpp b/src/interaction/sessionrecording.cpp index db8496e106..110eca4b43 100644 --- a/src/interaction/sessionrecording.cpp +++ b/src/interaction/sessionrecording.cpp @@ -523,7 +523,8 @@ void SessionRecording::saveTimeKeyframe() { writeToFileBuffer(kf._requiresTimeJump); saveKeyframeToFileBinary(_keyframeBuffer, _bufferIndex); - } else { + } + else { std::stringstream keyframeLine = std::stringstream(); //Add simulation timestamp, timestamp relative, simulation time to recording start keyframeLine << "time "; @@ -880,7 +881,8 @@ void SessionRecording::playbackTimeChange() { )); return; } - } else { + } + else { std::istringstream iss(_playbackLineParsing); std::string entryType; //double timeRef; @@ -943,7 +945,8 @@ void SessionRecording::playbackScript() { )); return; } - } else { + } + else { std::istringstream iss(_playbackLineParsing); std::string entryType; std::string tmpReadbackScript; @@ -958,7 +961,8 @@ void SessionRecording::playbackScript() { "Error parsing script line {} of playback file", _playbackLineNum )); return; - } else if (!iss.eof()) { + } + else if (!iss.eof()) { LERROR(fmt::format( "Did not find an EOL at line {} of playback file", _playbackLineNum )); @@ -1108,7 +1112,8 @@ bool SessionRecording::findNextFutureCameraIndex(double currTime) { _idxTimeline_cameraPtrNext = seekAheadIndex; } break; - } else { + } + else { // Force interpolation between consecutive keyframes _idxTimeline_cameraPtrPrev = seekAheadIndex; } diff --git a/src/network/parallelpeer.cpp b/src/network/parallelpeer.cpp index ec68ee23cb..7a6de5c9de 100644 --- a/src/network/parallelpeer.cpp +++ b/src/network/parallelpeer.cpp @@ -547,7 +547,8 @@ void ParallelPeer::setStatus(ParallelConnection::Status status) { global::timeManager.addTimelineChangeCallback([this]() { _timeTimelineChanged = true; }); - } else { + } + else { if (_timeJumpCallback != -1) { global::timeManager.removeTimeJumpCallback(_timeJumpCallback); } diff --git a/src/network/parallelserver.cpp b/src/network/parallelserver.cpp index b4f775cf48..499aa642f8 100644 --- a/src/network/parallelserver.cpp +++ b/src/network/parallelserver.cpp @@ -382,7 +382,8 @@ void ParallelServer::setToClient(Peer& peer) { it.second->status = ParallelConnection::Status::ClientWithoutHost; sendConnectionStatus(*it.second); } - } else { + } + else { peer.status = (_hostPeerId > 0) ? ParallelConnection::Status::ClientWithHost : ParallelConnection::Status::ClientWithoutHost; diff --git a/src/properties/matrix/dmat4x3property.cpp b/src/properties/matrix/dmat4x3property.cpp index 29153cfedc..95fa2beaaf 100644 --- a/src/properties/matrix/dmat4x3property.cpp +++ b/src/properties/matrix/dmat4x3property.cpp @@ -46,7 +46,8 @@ glm::dmat4x3 fromLuaConversion(lua_State* state, bool& success) { if (lua_isnumber(state, -1) != 1) { success = false; return glm::dmat4x3(0.0); - } else { + } + else { result[i][j] = lua_tonumber(state, -1); lua_pop(state, 1); ++number; diff --git a/src/properties/matrix/mat2property.cpp b/src/properties/matrix/mat2property.cpp index e9bde9a9a9..aaa69c6cbc 100644 --- a/src/properties/matrix/mat2property.cpp +++ b/src/properties/matrix/mat2property.cpp @@ -46,7 +46,8 @@ glm::mat2x2 fromLuaConversion(lua_State* state, bool& success) { if (lua_isnumber(state, -1) != 1) { success = false; return glm::mat2x2(1.f); - } else { + } + else { result[i][j] = static_cast( lua_tonumber(state, -1) ); diff --git a/src/properties/matrix/mat3property.cpp b/src/properties/matrix/mat3property.cpp index edd2cc0438..8cb87a6418 100644 --- a/src/properties/matrix/mat3property.cpp +++ b/src/properties/matrix/mat3property.cpp @@ -46,7 +46,8 @@ glm::mat3x3 fromLuaConversion(lua_State* state, bool& success) { if (lua_isnumber(state, -1) != 1) { success = false; return glm::mat3x3(1.f); - } else { + } + else { result[i][j] = static_cast(lua_tonumber(state, -1)); lua_pop(state, 1); diff --git a/src/properties/matrix/mat3x2property.cpp b/src/properties/matrix/mat3x2property.cpp index 7177f076b2..8e9b1b2ea9 100644 --- a/src/properties/matrix/mat3x2property.cpp +++ b/src/properties/matrix/mat3x2property.cpp @@ -43,10 +43,11 @@ glm::mat3x2 fromLuaConversion(lua_State* state, bool& success) { success = false; return glm::mat3x2(0.f); } - if (lua_isnumber(state, -1) != 1) { + if (lua_isnumber(state, -1) != 1) { success = false; return glm::mat3x2(0.f); - } else { + } + else { result[i][j] = static_cast(lua_tonumber(state, -1)); lua_pop(state, 1); diff --git a/src/properties/matrix/mat3x4property.cpp b/src/properties/matrix/mat3x4property.cpp index 82b81626ec..be54c8239e 100644 --- a/src/properties/matrix/mat3x4property.cpp +++ b/src/properties/matrix/mat3x4property.cpp @@ -46,7 +46,8 @@ glm::mat3x4 fromLuaConversion(lua_State* state, bool& success) { if (lua_isnumber(state, -1) != 1) { success = false; return glm::mat3x4(1.f); - } else { + } + else { result[i][j] = static_cast(lua_tonumber(state, -1)); lua_pop(state, 1); diff --git a/src/properties/matrix/mat4property.cpp b/src/properties/matrix/mat4property.cpp index 6141c71918..b224668489 100644 --- a/src/properties/matrix/mat4property.cpp +++ b/src/properties/matrix/mat4property.cpp @@ -48,7 +48,8 @@ glm::mat4x4 fromLuaConversion(lua_State* state, bool& success) { if (lua_isnumber(state, -1) != 1) { success = false; return glm::mat4x4(1.f); - } else { + } + else { result[i][j] = static_cast(lua_tonumber(state, -1)); lua_pop(state, 1); diff --git a/src/properties/matrix/mat4x2property.cpp b/src/properties/matrix/mat4x2property.cpp index a25b68c9be..c528dd49cc 100644 --- a/src/properties/matrix/mat4x2property.cpp +++ b/src/properties/matrix/mat4x2property.cpp @@ -46,7 +46,8 @@ glm::mat4x2 fromLuaConversion(lua_State* state, bool& success) { if (lua_isnumber(state, -1) != 1) { success = false; return glm::mat4x2(1.f); - } else { + } + else { result[i][j] = static_cast(lua_tonumber(state, -1)); lua_pop(state, 1); diff --git a/src/properties/matrix/mat4x3property.cpp b/src/properties/matrix/mat4x3property.cpp index 33ac21d96d..74bd66237e 100644 --- a/src/properties/matrix/mat4x3property.cpp +++ b/src/properties/matrix/mat4x3property.cpp @@ -46,7 +46,8 @@ glm::mat4x3 fromLuaConversion(lua_State* state, bool& success) { if (lua_isnumber(state, -1) != 1) { success = false; return glm::mat4x3(1.f); - } else { + } + else { result[i][j] = static_cast(lua_tonumber(state, -1)); lua_pop(state, 1); diff --git a/src/properties/propertyowner.cpp b/src/properties/propertyowner.cpp index 0bd235c565..b1c00328c8 100644 --- a/src/properties/propertyowner.cpp +++ b/src/properties/propertyowner.cpp @@ -190,7 +190,8 @@ void PropertyOwner::addProperty(Property* prop) { identifier() )); return; - } else { + } + else { // Otherwise we still have to look if there is a PropertyOwner with the same name const bool hasOwner = hasPropertySubOwner(prop->identifier()); if (hasOwner) { @@ -235,7 +236,8 @@ void PropertyOwner::addPropertySubOwner(openspace::properties::PropertyOwner* ow identifier() )); return; - } else { + } + else { // We still need to check if the PropertyOwners name is used in a Property const bool hasProp = hasProperty(owner->identifier()); if (hasProp) { @@ -269,7 +271,8 @@ void PropertyOwner::removeProperty(Property* prop) { if (it != _properties.end() && (*it)->identifier() == prop->identifier()) { (*it)->setPropertyOwner(nullptr); _properties.erase(it); - } else { + } + else { LERROR(fmt::format( "Property with identifier '{}' not found for removal", prop->identifier() )); @@ -295,7 +298,8 @@ void PropertyOwner::removePropertySubOwner(openspace::properties::PropertyOwner* // If we found the propertyowner, we can delete it if (it != _subOwners.end() && (*it)->identifier() == owner->identifier()) { _subOwners.erase(it); - } else { + } + else { LERROR(fmt::format( "PropertyOwner with name '{}' not found for removal", owner->identifier() )); diff --git a/src/rendering/abufferrenderer.cpp b/src/rendering/abufferrenderer.cpp index fb9be4e8a7..5bc54db990 100644 --- a/src/rendering/abufferrenderer.cpp +++ b/src/rendering/abufferrenderer.cpp @@ -975,7 +975,8 @@ void ABufferRenderer::updateRaycastData() { if (helperPath.empty()) { data.namespaceName = "NAMESPACE_" + std::to_string(nextNamespaceIndex++); - } else { + } + else { auto iter = namespaceIndices.find(helperPath); if (iter == namespaceIndices.end()) { int namespaceIndex = nextNamespaceIndex++; diff --git a/src/rendering/luaconsole.cpp b/src/rendering/luaconsole.cpp index 022c144dbb..84a4f3ba79 100644 --- a/src/rendering/luaconsole.cpp +++ b/src/rendering/luaconsole.cpp @@ -817,7 +817,8 @@ void LuaConsole::render() { const glm::vec2 loc = locationForRightJustifiedText(nClientsText); RenderFont(*_font, loc, nClientsText, Red); - } else if (global::parallelPeer.isHost()) { + } + else if (global::parallelPeer.isHost()) { const glm::vec4 LightBlue(0.4f, 0.4f, 1.f, 1.f); const std::string localExecutionText = "Local script execution"; diff --git a/src/rendering/renderable.cpp b/src/rendering/renderable.cpp index 908cd3d200..cc3bbbfb51 100644 --- a/src/rendering/renderable.cpp +++ b/src/rendering/renderable.cpp @@ -128,7 +128,8 @@ Renderable::Renderable(const ghoul::Dictionary& dictionary) if (!tagName.empty()) { addTag(std::move(tagName)); } - } else if (dictionary.hasKeyAndValue(KeyTag)) { + } + else if (dictionary.hasKeyAndValue(KeyTag)) { const ghoul::Dictionary& tagNames = dictionary.value(KeyTag); const std::vector& keys = tagNames.keys(); for (const std::string& key : keys) { diff --git a/src/rendering/screenspacerenderable.cpp b/src/rendering/screenspacerenderable.cpp index a153149ed1..ed9b3fbbeb 100644 --- a/src/rendering/screenspacerenderable.cpp +++ b/src/rendering/screenspacerenderable.cpp @@ -442,7 +442,8 @@ ScreenSpaceRenderable::ScreenSpaceRenderable(const ghoul::Dictionary& dictionary if (!tagName.empty()) { addTag(std::move(tagName)); } - } else if (dictionary.hasKeyAndValue(KeyTag)) { + } + else if (dictionary.hasKeyAndValue(KeyTag)) { const ghoul::Dictionary& tagNames = dictionary.value(KeyTag); const std::vector& keys = tagNames.keys(); for (const std::string& key : keys) { diff --git a/src/rendering/transferfunction.cpp b/src/rendering/transferfunction.cpp index f2abf5fc9e..f702b1d347 100644 --- a/src/rendering/transferfunction.cpp +++ b/src/rendering/transferfunction.cpp @@ -45,7 +45,8 @@ namespace { return (0 == filepath.compare( filepath.length() - ending.length(), ending.length(), ending)); - } else { + } + else { return false; } } @@ -95,7 +96,8 @@ void TransferFunction::update() { if (_needsUpdate) { if (hasExtension(_filepath, "txt")) { setTextureFromTxt(); - } else { + } + else { setTextureFromImage(); } _texture->uploadTexture(); @@ -133,13 +135,16 @@ void TransferFunction::setTextureFromTxt(std::shared_ptr if (key == "width") { iss >> width; - } else if (key == "lower") { + } + else if (key == "lower") { iss >> lower; lower = glm::clamp(lower, 0.f, 1.f); - } else if (key == "upper") { + } + else if (key == "upper") { iss >> upper; upper = glm::clamp(upper, lower, 1.f); - } else if (key == "mappingkey") { + } + else if (key == "mappingkey") { float intensity; glm::vec4 rgba = glm::vec4(0.f); iss >> intensity; diff --git a/src/scene/assetloader.cpp b/src/scene/assetloader.cpp index 15ce77bb86..6d4b7c95c0 100644 --- a/src/scene/assetloader.cpp +++ b/src/scene/assetloader.cpp @@ -323,7 +323,8 @@ std::string AssetLoader::generateAssetPath(const std::string& baseDirectory, std::string prefix; if (pathType == PathType::RelativeToAsset) { prefix = baseDirectory + ghoul::filesystem::FileSystem::PathSeparator; - } else if (pathType == PathType::RelativeToAssetRoot) { + } + else if (pathType == PathType::RelativeToAssetRoot) { prefix = _assetRootDirectory + ghoul::filesystem::FileSystem::PathSeparator; } @@ -464,7 +465,8 @@ void AssetLoader::unrequest(const std::string& identifier) { ghoul::filesystem::Directory AssetLoader::currentDirectory() const { if (_currentAsset->hasAssetFile()) { return _currentAsset->assetDirectory(); - } else { + } + else { return _assetRootDirectory; } } diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp index 459bc352a1..1f5574816f 100644 --- a/src/scene/scene.cpp +++ b/src/scene/scene.cpp @@ -469,7 +469,8 @@ SceneGraphNode* Scene::loadNode(const ghoul::Dictionary& nodeDictionary) { if (parent) { parent->attachChild(std::move(node)); - } else { + } + else { attachNode(std::move(node)); } diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index 4fdabb91e7..5177ea9c69 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -252,7 +252,8 @@ std::unique_ptr SceneGraphNode::createFromDictionary( if (!tagName.empty()) { result->addTag(std::move(tagName)); } - } else if (dictionary.hasKeyAndValue(KeyTag)) { + } + else if (dictionary.hasKeyAndValue(KeyTag)) { ghoul::Dictionary tagNames = dictionary.value(KeyTag); std::vector keys = tagNames.keys(); std::string tagName; diff --git a/src/scene/scenelicensewriter.cpp b/src/scene/scenelicensewriter.cpp index 84832573ba..9dc82ea163 100644 --- a/src/scene/scenelicensewriter.cpp +++ b/src/scene/scenelicensewriter.cpp @@ -66,7 +66,8 @@ std::string SceneLicenseWriter::generateJson() const { for (const char& c : json.str()) { if (c == '\'') { jsonString += "\\'"; - } else { + } + else { jsonString += c; } } diff --git a/src/scripting/scriptengine.cpp b/src/scripting/scriptengine.cpp index 3beb182fc4..8ff0a2e935 100644 --- a/src/scripting/scriptengine.cpp +++ b/src/scripting/scriptengine.cpp @@ -182,7 +182,8 @@ bool ScriptEngine::runScript(const std::string& script, ScriptCallback callback) ghoul::Dictionary returnValue = ghoul::lua::loadArrayDictionaryFromString(script, _state); callback(returnValue); - } else { + } + else { ghoul::lua::runScript(_state, script); } } @@ -651,7 +652,8 @@ bool ScriptEngine::writeLog(const std::string& script) { return false; } - } else { + } + else { _logScripts = false; return false; } @@ -738,7 +740,8 @@ void ScriptEngine::postSync(bool isMaster) { continue; } } - } else { + } + else { std::lock_guard guard(_slaveScriptsMutex); while (!_slaveScriptQueue.empty()) { try { diff --git a/src/scripting/scriptengine_lua.inl b/src/scripting/scriptengine_lua.inl index 0b9a076ece..4ffce5c454 100644 --- a/src/scripting/scriptengine_lua.inl +++ b/src/scripting/scriptengine_lua.inl @@ -412,18 +412,18 @@ int saveLastChangeToProfile(lua_State* L) { std::string strNew = fmt::format("{}\n{}",actualLastLine, strReplace); std::ifstream filein(assetPath); std::ofstream fileout(tempAssetPath); - if(!filein) { + if (!filein) { ghoul::lua::push(L, fmt::format("Could not open profile '{}'", assetPath)); printInternal(ghoul::logging::LogLevel::Error, L); } - if(!fileout) { + if (!fileout) { ghoul::lua::push(L, fmt::format("Could not open tmp profile '{}'", tempAssetPath)); printInternal(ghoul::logging::LogLevel::Error, L); } bool found = false; while(std::getline (filein, line)) { - if(line == strReplace){ + if (line == strReplace) { line = strNew; found = true; } @@ -444,7 +444,8 @@ int saveLastChangeToProfile(lua_State* L) { } FileSys.deleteFile(tempAssetPath); return 0; - } else { + } + else { ghoul::lua::push(L, "can not save to built in profiles"); printInternal(ghoul::logging::LogLevel::Error, L); return -1; diff --git a/src/util/camera.cpp b/src/util/camera.cpp index 82d912c52c..02cd915e04 100644 --- a/src/util/camera.cpp +++ b/src/util/camera.cpp @@ -156,20 +156,20 @@ float Camera::scaling() const { } const glm::dmat4& Camera::viewRotationMatrix() const { - if (_cachedViewRotationMatrix.isDirty) { + //if (_cachedViewRotationMatrix.isDirty) { _cachedViewRotationMatrix.datum = glm::mat4_cast( glm::inverse(static_cast(_rotation)) ); _cachedViewRotationMatrix.isDirty = false; - } + //} return _cachedViewRotationMatrix.datum; } const glm::dmat4& Camera::viewScaleMatrix() const { - if (_cachedViewScaleMatrix.isDirty) { + //if (_cachedViewScaleMatrix.isDirty) { _cachedViewScaleMatrix.datum = glm::scale(glm::mat4(1.f), glm::vec3(_scaling)); _cachedViewScaleMatrix.isDirty = false; - } + //} return _cachedViewScaleMatrix.datum; } @@ -178,7 +178,7 @@ const glm::dquat& Camera::rotationQuaternion() const { } const glm::dmat4& Camera::combinedViewMatrix() const { - if (_cachedCombinedViewMatrix.isDirty) { + //if (_cachedCombinedViewMatrix.isDirty) { const glm::dmat4 cameraTranslation = glm::inverse( glm::translate(glm::dmat4(1.0), static_cast(_position)) ); @@ -188,7 +188,7 @@ const glm::dmat4& Camera::combinedViewMatrix() const { glm::dmat4(viewRotationMatrix()) * cameraTranslation; _cachedCombinedViewMatrix.isDirty = false; - } + //} return _cachedCombinedViewMatrix.datum; } @@ -256,11 +256,11 @@ const glm::mat4& Camera::SgctInternal::projectionMatrix() const { } const glm::mat4& Camera::SgctInternal::viewProjectionMatrix() const { - if (_cachedViewProjectionMatrix.isDirty) { + //if (_cachedViewProjectionMatrix.isDirty) { std::lock_guard _lock(_mutex); _cachedViewProjectionMatrix.datum = _projectionMatrix * _viewMatrix; _cachedViewProjectionMatrix.isDirty = false; - } + //} return _cachedViewProjectionMatrix.datum; } diff --git a/src/util/histogram.cpp b/src/util/histogram.cpp index 15345b873b..148b3d2a19 100644 --- a/src/util/histogram.cpp +++ b/src/util/histogram.cpp @@ -127,7 +127,8 @@ bool Histogram::add(const Histogram& histogram) { } _numValues += histogram._numValues; return true; - } else { + } + else { LERROR("Dimension mismatch"); return false; } @@ -329,7 +330,8 @@ float Histogram::highestBinValue(bool equalized, int overBins){ _numBins * (_maxValue - _minValue); float high = low + (_maxValue - _minValue) / static_cast(_numBins); return (high+low) / 2.f; - } else { + } + else { return highestBin / static_cast(_numBins); // return equalize((high+low)/2.0); } diff --git a/src/util/httprequest.cpp b/src/util/httprequest.cpp index 4d9262a505..74e1749d1d 100644 --- a/src/util/httprequest.cpp +++ b/src/util/httprequest.cpp @@ -142,10 +142,12 @@ void HttpRequest::perform(RequestOptions opt) { curl_easy_getinfo(curl, CURLINFO_RESPONSE_CODE, &responseCode); // NOLINT if (responseCode == StatusCodeOk) { setReadyState(ReadyState::Success); - } else { + } + else { setReadyState(ReadyState::Fail); } - } else { + } + else { setReadyState(ReadyState::Fail); } curl_easy_cleanup(curl); @@ -218,7 +220,8 @@ void SyncHttpDownload::download(HttpRequest::RequestOptions opt) { LTRACE(fmt::format("Finished sync download '{}'", _httpRequest.url())); deinitDownload(); markAsSuccessful(); - } else if (rs == HttpRequest::ReadyState::Fail) { + } + else if (rs == HttpRequest::ReadyState::Fail) { LERROR(fmt::format("Failed sync download '{}'", _httpRequest.url())); deinitDownload(); markAsFailed(); diff --git a/src/util/taskloader.cpp b/src/util/taskloader.cpp index 2ef22f1b3a..75778d07d3 100644 --- a/src/util/taskloader.cpp +++ b/src/util/taskloader.cpp @@ -52,7 +52,8 @@ std::vector> TaskLoader::tasksFromDictionary( const std::string path = taskName + ".task"; std::vector> subTasks = tasksFromFile(path); std::move(subTasks.begin(), subTasks.end(), std::back_inserter(tasks)); - } else if (tasksDictionary.getValue(key, subTask)) { + } + else if (tasksDictionary.getValue(key, subTask)) { const std::string& taskType = subTask.value("Type"); std::unique_ptr task = Task::createFromDictionary(subTask); if (!task) { diff --git a/src/util/time_lua.inl b/src/util/time_lua.inl index 613b942839..008f129b91 100644 --- a/src/util/time_lua.inl +++ b/src/util/time_lua.inl @@ -56,7 +56,8 @@ int time_setDeltaTime(lua_State* L) { } const double newDeltaTime = lua_tonumber(L, 1); global::timeManager.setDeltaTime(newDeltaTime); - } else { + } + else { lua_settop(L, 0); const char* msg = lua_pushfstring(L, "Bad number of arguments. Expected 1 or 2."); @@ -159,7 +160,8 @@ int time_togglePause(lua_State* L) { if (nArguments == 0) { global::timeManager.setPause(!global::timeManager.isPaused()); - } else { + } + else { lua_settop(L, 0); return luaL_error( L, @@ -210,7 +212,8 @@ int time_interpolateTogglePause(lua_State* L) { global::timeManager.defaultPauseInterpolationDuration() : global::timeManager.defaultUnpauseInterpolationDuration() ); - } else { + } + else { lua_settop(L, 0); return luaL_error( L, @@ -236,7 +239,8 @@ int time_setPause(lua_State* L) { if (nArguments == 1) { const bool pause = lua_toboolean(L, 1) == 1; global::timeManager.setPause(pause); - } else { + } + else { lua_settop(L, 0); return luaL_error( L, @@ -284,7 +288,8 @@ int time_interpolatePause(lua_State* L) { global::timeManager.defaultPauseInterpolationDuration() : global::timeManager.defaultUnpauseInterpolationDuration() ); - } else { + } + else { lua_settop(L, 0); return luaL_error( L, @@ -342,7 +347,8 @@ int time_setTime(lua_State* L) { return 0; } ghoul_assert(lua_gettop(L) == 0, "Incorrect number of items left on stack"); - } else { + } + else { return luaL_error( L, "bad number of arguments, expected 1 or 2, got %i", diff --git a/src/util/timemanager.cpp b/src/util/timemanager.cpp index cc17806280..e1ecf58d74 100644 --- a/src/util/timemanager.cpp +++ b/src/util/timemanager.cpp @@ -193,7 +193,8 @@ TimeKeyframeData TimeManager::interpolate(double applicationTime) { *firstFutureKeyframe, applicationTime ); - } else if (hasPastKeyframes) { + } + else if (hasPastKeyframes) { // Extrapolate based on last past keyframe const double deltaApplicationTime = applicationTime - lastPastKeyframe->timestamp; Time predictedTime( @@ -271,9 +272,11 @@ void TimeManager::progressTime(double dt) { _currentTime.data().setTime(interpolated.time.j2000Seconds()); _deltaTime = interpolated.delta; - } else if (!hasConsumedLastPastKeyframe) { + } + else if (!hasConsumedLastPastKeyframe) { applyKeyframeData(lastPastKeyframe->data); - } else if (!isPaused()) { + } + else if (!isPaused()) { // If there are no keyframes to consider // and time is not paused, just advance time. _deltaTime = _targetDeltaTime; diff --git a/src/util/touch.cpp b/src/util/touch.cpp index 995e871850..aa0ef75ddd 100644 --- a/src/util/touch.cpp +++ b/src/util/touch.cpp @@ -128,7 +128,7 @@ float TouchInputHolder::speedX() const { } float TouchInputHolder::speedY() const { - if(_inputs.size() <= 1) { + if (_inputs.size() <= 1) { return 0.f; } const TouchInput& currentInput = _inputs[0]; diff --git a/src/util/transformationmanager.cpp b/src/util/transformationmanager.cpp index 663f06b605..08e14675ae 100644 --- a/src/util/transformationmanager.cpp +++ b/src/util/transformationmanager.cpp @@ -134,7 +134,8 @@ glm::dmat3 TransformationManager::frameTransformationMatrix( if (fromKameleon && toKameleon) { return kameleonTransformationMatrix(from, to, ephemerisTime); - } else if (fromKameleon && !toKameleon) { + } + else if (fromKameleon && !toKameleon) { glm::dmat3 kameleonTransformation = kameleonTransformationMatrix( from, "J2000", @@ -146,7 +147,8 @@ glm::dmat3 TransformationManager::frameTransformationMatrix( ephemerisTime ); return spiceTransformation*kameleonTransformation; - } else if (!fromKameleon && toKameleon) { + } + else if (!fromKameleon && toKameleon) { glm::dmat3 spiceTransformation = SpiceManager::ref().frameTransformationMatrix( from, "J2000", diff --git a/src/util/versionchecker.cpp b/src/util/versionchecker.cpp index 7f4b077bc0..aabec2be59 100644 --- a/src/util/versionchecker.cpp +++ b/src/util/versionchecker.cpp @@ -105,7 +105,8 @@ void VersionChecker::cancel() { currentVersion.minor, currentVersion.patch )); - } else { + } + else { LINFO(fmt::format( "OpenSpace version {}.{}.{} is up to date.", currentVersion.major,