diff --git a/data/assets/gaia.scene b/data/assets/gaia.scene index 9e11b65718..5a7c97ef15 100644 --- a/data/assets/gaia.scene +++ b/data/assets/gaia.scene @@ -1,3 +1,9 @@ +local has_gaia = openspace.modules.isLoaded('gaia2') +if not has_gaia then + openspace.printFatal('Could not load scene "' .. asset.filePath .. '" due to missing module "gaia"') + do return end +end + local assetHelper = asset.require('util/asset_helper') asset.require('default') diff --git a/modules/base/rendering/renderableboxgrid.cpp b/modules/base/rendering/renderableboxgrid.cpp index 0253237d22..2342905f4f 100644 --- a/modules/base/rendering/renderableboxgrid.cpp +++ b/modules/base/rendering/renderableboxgrid.cpp @@ -231,7 +231,7 @@ void RenderableBoxGrid::render(const RenderData& data, RendererTasks&){ glEnable(GL_LINE_SMOOTH); glBindVertexArray(_vaoID); - glDrawArrays(_mode, 0, _varray.size()); + glDrawArrays(_mode, 0, static_cast(_varray.size())); glBindVertexArray(0); _gridProgram->deactivate(); diff --git a/modules/cefwebgui/src/guikeyboardhandler.cpp b/modules/cefwebgui/src/guikeyboardhandler.cpp index 397f19504b..7e4ae58364 100644 --- a/modules/cefwebgui/src/guikeyboardhandler.cpp +++ b/modules/cefwebgui/src/guikeyboardhandler.cpp @@ -32,7 +32,7 @@ GUIKeyboardHandler::GUIKeyboardHandler() { _keyConsumed = false; global::callback::keyboard.push_back( - [&](Key key, KeyModifier mod, KeyAction action) -> bool { + [&](Key, KeyModifier, KeyAction) -> bool { const bool previous = _keyConsumed; _keyConsumed = false; return previous; diff --git a/modules/fitsfilereader/CMakeLists.txt b/modules/fitsfilereader/CMakeLists.txt index 566d7ab6cb..27befc12ae 100644 --- a/modules/fitsfilereader/CMakeLists.txt +++ b/modules/fitsfilereader/CMakeLists.txt @@ -23,24 +23,26 @@ ########################################################################################## include(${OPENSPACE_CMAKE_EXT_DIR}/module_definition.cmake) +include(${GHOUL_BASE_DIR}/support/cmake/handle_external_library.cmake) -set(HEADER_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/fitsfilereadermodule.h - ${CMAKE_CURRENT_SOURCE_DIR}/include/fitsfilereader.h +set(HEADER_FILES + ${CMAKE_CURRENT_SOURCE_DIR}/fitsfilereadermodule.h + ${CMAKE_CURRENT_SOURCE_DIR}/include/fitsfilereader.h ) source_group("Header Files" FILES ${HEADER_FILES}) set(SOURCE_FILES - ${CMAKE_CURRENT_SOURCE_DIR}/fitsfilereadermodule.cpp - ${CMAKE_CURRENT_SOURCE_DIR}/src/fitsfilereader.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/fitsfilereadermodule.cpp + ${CMAKE_CURRENT_SOURCE_DIR}/src/fitsfilereader.cpp ) source_group("Source Files" FILES ${SOURCE_FILES}) create_new_module( - "FitsFileReader" - fitsfilereader - ${HEADER_FILES} - ${SOURCE_FILES}) + "FitsFileReader" + fitsfilereader + ${HEADER_FILES} + ${SOURCE_FILES} +) # Set root directories for external libraries. set(CFITSIO_ROOT_DIR "${CMAKE_CURRENT_SOURCE_DIR}/ext/cfitsio/") @@ -50,7 +52,11 @@ set(MODULE_NAME openspace-module-fitsfilereader) # CCfits is dependent on cfitsio, let it handle the internal linking add_subdirectory(${CFITSIO_ROOT_DIR}) +set_folder_location(cfitsio "External") + add_subdirectory(${CCFITS_ROOT_DIR}) +set_folder_location(CCfits "External") + TARGET_INCLUDE_DIRECTORIES(${MODULE_NAME} SYSTEM PUBLIC ${INCLUDES_FOR_TARGET}) TARGET_LINK_LIBRARIES(${MODULE_NAME} CCfits) diff --git a/modules/gaia/gaiamodule.cpp b/modules/gaia/gaiamodule.cpp index d581ac2d6c..99351f89ea 100644 --- a/modules/gaia/gaiamodule.cpp +++ b/modules/gaia/gaiamodule.cpp @@ -64,7 +64,7 @@ scripting::LuaLibrary GaiaModule::luaLibrary() const { scripting::LuaLibrary res; res.name = "gaia"; res.scripts = { - absPath("${MODULE_GAIAMISSION}/scripts/filtering.lua") + absPath("${MODULE_GAIA}/scripts/filtering.lua") }; return res; } diff --git a/modules/gaia/include.cmake b/modules/gaia/include.cmake index a754a6bc03..75b787f114 100644 --- a/modules/gaia/include.cmake +++ b/modules/gaia/include.cmake @@ -1,4 +1,6 @@ -set (OPENSPACE_DEPENDENCIES +set(DEFAULT_MODULE ON) + +set(OPENSPACE_DEPENDENCIES fitsfilereader globebrowsing ) diff --git a/modules/gaia/rendering/renderablegaiastars.cpp b/modules/gaia/rendering/renderablegaiastars.cpp index ca61e2fc56..24fe3331c6 100644 --- a/modules/gaia/rendering/renderablegaiastars.cpp +++ b/modules/gaia/rendering/renderablegaiastars.cpp @@ -879,9 +879,9 @@ void RenderableGaiaStars::initializeGL() { case gaia::ShaderOption::Point_SSBO: { _program = ghoul::opengl::ProgramObject::Build( "GaiaStar", - absPath("${MODULE_GAIAMISSION}/shaders/gaia_ssbo_vs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_point_fs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_point_ge.glsl") + absPath("${MODULE_GAIA}/shaders/gaia_ssbo_vs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_point_fs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_point_ge.glsl") ); _uniformCache.maxStarsPerNode = _program->uniformLocation("maxStarsPerNode"); _uniformCache.valuesPerStar = _program->uniformLocation("valuesPerStar"); @@ -889,8 +889,8 @@ void RenderableGaiaStars::initializeGL() { _programTM = global::renderEngine.buildRenderProgram( "ToneMapping", - absPath("${MODULE_GAIAMISSION}/shaders/gaia_tonemapping_vs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_tonemapping_point_fs.glsl") + absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_vs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_point_fs.glsl") ); _uniformCacheTM.screenSize = _programTM->uniformLocation("screenSize"); _uniformCacheTM.filterSize = _programTM->uniformLocation("filterSize"); @@ -907,14 +907,14 @@ void RenderableGaiaStars::initializeGL() { case gaia::ShaderOption::Point_VBO: { _program = ghoul::opengl::ProgramObject::Build( "GaiaStar", - absPath("${MODULE_GAIAMISSION}/shaders/gaia_vbo_vs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_point_fs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_point_ge.glsl") + absPath("${MODULE_GAIA}/shaders/gaia_vbo_vs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_point_fs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_point_ge.glsl") ); _programTM = global::renderEngine.buildRenderProgram("ToneMapping", - absPath("${MODULE_GAIAMISSION}/shaders/gaia_tonemapping_vs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_tonemapping_point_fs.glsl") + absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_vs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_point_fs.glsl") ); _uniformCacheTM.screenSize = _programTM->uniformLocation("screenSize"); _uniformCacheTM.filterSize = _programTM->uniformLocation("filterSize"); @@ -931,9 +931,9 @@ void RenderableGaiaStars::initializeGL() { case gaia::ShaderOption::Billboard_SSBO: { _program = ghoul::opengl::ProgramObject::Build( "GaiaStar", - absPath("${MODULE_GAIAMISSION}/shaders/gaia_ssbo_vs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_billboard_fs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_billboard_ge.glsl") + absPath("${MODULE_GAIA}/shaders/gaia_ssbo_vs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_billboard_fs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_billboard_ge.glsl") ); _uniformCache.cameraPos = _program->uniformLocation("cameraPos"); _uniformCache.cameraLookUp = _program->uniformLocation("cameraLookUp"); @@ -951,10 +951,8 @@ void RenderableGaiaStars::initializeGL() { _programTM = global::renderEngine.buildRenderProgram( "ToneMapping", - absPath("${MODULE_GAIAMISSION}/shaders/gaia_tonemapping_vs.glsl"), - absPath( - "${MODULE_GAIAMISSION}/shaders/gaia_tonemapping_billboard_fs.glsl" - ) + absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_vs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_billboard_fs.glsl") ); addProperty(_magnitudeBoost); @@ -966,9 +964,9 @@ void RenderableGaiaStars::initializeGL() { } case gaia::ShaderOption::Billboard_SSBO_noFBO: { _program = global::renderEngine.buildRenderProgram("GaiaStar", - absPath("${MODULE_GAIAMISSION}/shaders/gaia_ssbo_vs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_billboard_nofbo_fs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_billboard_ge.glsl") + absPath("${MODULE_GAIA}/shaders/gaia_ssbo_vs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_billboard_nofbo_fs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_billboard_ge.glsl") ); _uniformCache.cameraPos = _program->uniformLocation("cameraPos"); _uniformCache.cameraLookUp = _program->uniformLocation("cameraLookUp"); @@ -993,9 +991,9 @@ void RenderableGaiaStars::initializeGL() { case gaia::ShaderOption::Billboard_VBO: { _program = ghoul::opengl::ProgramObject::Build( "GaiaStar", - absPath("${MODULE_GAIAMISSION}/shaders/gaia_vbo_vs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_billboard_fs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_billboard_ge.glsl") + absPath("${MODULE_GAIA}/shaders/gaia_vbo_vs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_billboard_fs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_billboard_ge.glsl") ); _uniformCache.cameraPos = _program->uniformLocation("cameraPos"); _uniformCache.cameraLookUp = _program->uniformLocation("cameraLookUp"); @@ -1008,10 +1006,8 @@ void RenderableGaiaStars::initializeGL() { _uniformCache.psfTexture = _program->uniformLocation("psfTexture"); _programTM = global::renderEngine.buildRenderProgram("ToneMapping", - absPath("${MODULE_GAIAMISSION}/shaders/gaia_tonemapping_vs.glsl"), - absPath( - "${MODULE_GAIAMISSION}/shaders/gaia_tonemapping_billboard_fs.glsl" - ) + absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_vs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_billboard_fs.glsl") ); addProperty(_magnitudeBoost); @@ -1589,9 +1585,9 @@ void RenderableGaiaStars::update(const UpdateData&) { std::unique_ptr program = ghoul::opengl::ProgramObject::Build( "GaiaStar", - absPath("${MODULE_GAIAMISSION}/shaders/gaia_ssbo_vs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_point_fs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_point_ge.glsl") + absPath("${MODULE_GAIA}/shaders/gaia_ssbo_vs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_point_fs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_point_ge.glsl") ); if (_program) { global::renderEngine.removeRenderProgram(_program.get()); @@ -1652,9 +1648,9 @@ void RenderableGaiaStars::update(const UpdateData&) { std::unique_ptr program = ghoul::opengl::ProgramObject::Build( "GaiaStar", - absPath("${MODULE_GAIAMISSION}/shaders/gaia_vbo_vs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_point_fs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_point_ge.glsl") + absPath("${MODULE_GAIA}/shaders/gaia_vbo_vs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_point_fs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_point_ge.glsl") ); if (_program) { global::renderEngine.removeRenderProgram(_program.get()); @@ -1694,18 +1690,16 @@ void RenderableGaiaStars::update(const UpdateData&) { if (shaderOption == gaia::ShaderOption::Billboard_SSBO) { program = ghoul::opengl::ProgramObject::Build( "GaiaStar", - absPath("${MODULE_GAIAMISSION}/shaders/gaia_ssbo_vs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_billboard_fs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_billboard_ge.glsl") + absPath("${MODULE_GAIA}/shaders/gaia_ssbo_vs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_billboard_fs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_billboard_ge.glsl") ); } else { program = global::renderEngine.buildRenderProgram("GaiaStar", - absPath("${MODULE_GAIAMISSION}/shaders/gaia_ssbo_vs.glsl"), - absPath( - "${MODULE_GAIAMISSION}/shaders/gaia_billboard_nofbo_fs.glsl" - ), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_billboard_ge.glsl") + absPath("${MODULE_GAIA}/shaders/gaia_ssbo_vs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_billboard_nofbo_fs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_billboard_ge.glsl") ); } @@ -1779,9 +1773,9 @@ void RenderableGaiaStars::update(const UpdateData&) { std::unique_ptr program = ghoul::opengl::ProgramObject::Build( "GaiaStar", - absPath("${MODULE_GAIAMISSION}/shaders/gaia_vbo_vs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_billboard_fs.glsl"), - absPath("${MODULE_GAIAMISSION}/shaders/gaia_billboard_ge.glsl") + absPath("${MODULE_GAIA}/shaders/gaia_vbo_vs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_billboard_fs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_billboard_ge.glsl") ); if (_program) { global::renderEngine.removeRenderProgram(_program.get()); @@ -1856,12 +1850,8 @@ void RenderableGaiaStars::update(const UpdateData&) { std::unique_ptr programTM = global::renderEngine.buildRenderProgram( "ToneMapping", - absPath( - "${MODULE_GAIAMISSION}/shaders/gaia_tonemapping_vs.glsl" - ), - absPath( - "${MODULE_GAIAMISSION}/shaders/gaia_tonemapping_point_fs.glsl" - ) + absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_vs.glsl"), + absPath("${MODULE_GAIA}/shaders/gaia_tonemapping_point_fs.glsl") ); if (_programTM) { global::renderEngine.removeRenderProgram(_programTM.get()); @@ -1880,10 +1870,10 @@ void RenderableGaiaStars::update(const UpdateData&) { case gaia::ShaderOption::Billboard_SSBO: case gaia::ShaderOption::Billboard_VBO: { std::string vs = absPath( - "${MODULE_GAIAMISSION}/shaders/gaia_tonemapping_vs.glsl" + "${MODULE_GAIA}/shaders/gaia_tonemapping_vs.glsl" ); std::string fs = absPath( - "${MODULE_GAIAMISSION}/shaders/gaia_tonemapping_billboard_fs.glsl" + "${MODULE_GAIA}/shaders/gaia_tonemapping_billboard_fs.glsl" ); std::unique_ptr programTM = global::renderEngine.buildRenderProgram("ToneMapping", vs, fs); diff --git a/modules/gaia/tasks/readfilejob.cpp b/modules/gaia/tasks/readfilejob.cpp index d85bb48e4b..2295c28840 100644 --- a/modules/gaia/tasks/readfilejob.cpp +++ b/modules/gaia/tasks/readfilejob.cpp @@ -127,7 +127,7 @@ void ReadFileJob::execute() { // https://gea.esac.esa.int/archive/documentation/GDR2/Gaia_archive/ // chap_datamodel/sec_dm_main_tables/ssec_dm_gaia_source.html //LINFO("Parallax: " + std::to_string(parallax[i])); - radiusInKiloParsec = 1.0 / parallax[i]; + radiusInKiloParsec = 1.f / parallax[i]; } /*// Convert to Galactic Coordinates from Galactic Lon & Lat. // https://gea.esac.esa.int/archive/documentation/GDR2/Data_processing/ @@ -191,17 +191,17 @@ void ReadFileJob::execute() { glm::vec3 pmVecGal = aPrimG * uICRS; // Convert to Tangential vector [m/s] from Proper Motion vector [mas/yr] - float tanVelX = 1000.0 * 4.74 * radiusInKiloParsec * pmVecGal.x; - float tanVelY = 1000.0 * 4.74 * radiusInKiloParsec * pmVecGal.y; - float tanVelZ = 1000.0 * 4.74 * radiusInKiloParsec * pmVecGal.z; + float tanVelX = 1000.f * 4.74f * radiusInKiloParsec * pmVecGal.x; + float tanVelY = 1000.f * 4.74f * radiusInKiloParsec * pmVecGal.y; + float tanVelZ = 1000.f * 4.74f * radiusInKiloParsec * pmVecGal.z; // Calculate True Space Velocity [m/s] if we have the radial velocity if (!std::isnan(radial_vel[i])) { // Calculate Radial Velocity in the direction of the star. // radial_vel is given in [km/s] -> convert to [m/s]. - float radVelX = 1000.0 * radial_vel[i] * rGal.x; - float radVelY = 1000.0 * radial_vel[i] * rGal.y; - float radVelZ = 1000.0 * radial_vel[i] * rGal.z; + float radVelX = 1000.f * radial_vel[i] * rGal.x; + float radVelY = 1000.f * radial_vel[i] * rGal.y; + float radVelZ = 1000.f * radial_vel[i] * rGal.z; // Use Pythagoras theorem for the final Space Velocity [m/s]. values[idx++] = sqrt(pow(radVelX, 2) + pow(tanVelX, 2)); // Vel X [U] diff --git a/src/properties/matrix/mat4x2property.cpp b/src/properties/matrix/mat4x2property.cpp index a7eeac591d..451a38e176 100644 --- a/src/properties/matrix/mat4x2property.cpp +++ b/src/properties/matrix/mat4x2property.cpp @@ -110,7 +110,7 @@ bool toStringConversion(std::string& outValue, glm::mat4x2 inValue) { } } outValue.pop_back(); - outValue + "]"; + outValue += "]"; return true; }