From b39a5f3d7bb21eefa3e9d4bcdd6678e87e07a087 Mon Sep 17 00:00:00 2001 From: Alexander Bock Date: Mon, 19 May 2025 17:59:58 +0200 Subject: [PATCH] Remove deprecated Lua functions (#3664) --- include/openspace/camera/camera.h | 3 -- modules/exoplanets/exoplanetsmodule.cpp | 1 - modules/exoplanets/exoplanetsmodule_lua.inl | 14 ----- modules/globebrowsing/globebrowsingmodule.cpp | 2 - .../globebrowsing/globebrowsingmodule_lua.inl | 42 --------------- modules/skybrowser/skybrowsermodule.cpp | 3 -- modules/skybrowser/skybrowsermodule_lua.inl | 38 ------------- src/navigation/navigationhandler.cpp | 2 - src/navigation/navigationhandler_lua.inl | 53 ------------------- src/scene/scene.cpp | 11 ---- src/scene/scene_lua.inl | 13 ----- 11 files changed, 182 deletions(-) diff --git a/include/openspace/camera/camera.h b/include/openspace/camera/camera.h index 99fcba95fd..298391f336 100644 --- a/include/openspace/camera/camera.h +++ b/include/openspace/camera/camera.h @@ -137,11 +137,8 @@ public: } sgctInternal; // @TODO use Camera::SgctInternal interface instead - // [[deprecated("Replaced by Camera::SgctInternal::viewMatrix()")]] const glm::mat4& viewMatrix() const; - // [[deprecated("Replaced by Camera::SgctInternal::projectionMatrix()")]] const glm::mat4& projectionMatrix() const; - // [[deprecated("Replaced by Camera::SgctInternal::viewProjectionMatrix()")]] const glm::mat4& viewProjectionMatrix() const; std::vector syncables(); diff --git a/modules/exoplanets/exoplanetsmodule.cpp b/modules/exoplanets/exoplanetsmodule.cpp index 617f7192c9..81da2abf15 100644 --- a/modules/exoplanets/exoplanetsmodule.cpp +++ b/modules/exoplanets/exoplanetsmodule.cpp @@ -443,7 +443,6 @@ scripting::LuaLibrary ExoplanetsModule::luaLibrary() const { codegen::lua::RemoveExoplanetSystem, codegen::lua::SystemData, codegen::lua::ListOfExoplanets, - codegen::lua::ListOfExoplanetsDeprecated, codegen::lua::ListAvailableExoplanetSystems, codegen::lua::LoadSystemDataFromCsv }, diff --git a/modules/exoplanets/exoplanetsmodule_lua.inl b/modules/exoplanets/exoplanetsmodule_lua.inl index 0a435fc0b0..b2c18ad4cc 100644 --- a/modules/exoplanets/exoplanetsmodule_lua.inl +++ b/modules/exoplanets/exoplanetsmodule_lua.inl @@ -219,20 +219,6 @@ std::vector hostStarsWithSufficientData() { return names; } -/** - * Deprecated in favor of 'listOfExoplanets' - */ -[[codegen::luawrap("getListOfExoplanets")]] std::vector -listOfExoplanetsDeprecated() -{ - LWARNINGC( - "Deprecation", - "'getListOfExoplanets' function is deprecated and should be replaced with " - "'listOfExoplanets'" - ); - return listOfExoplanets(); -} - /** * Lists the names of the host stars of all exoplanet systems that have sufficient * data for generating a visualization, and prints the list to the console. diff --git a/modules/globebrowsing/globebrowsingmodule.cpp b/modules/globebrowsing/globebrowsingmodule.cpp index 5bda6e8f4b..770899abef 100644 --- a/modules/globebrowsing/globebrowsingmodule.cpp +++ b/modules/globebrowsing/globebrowsingmodule.cpp @@ -507,11 +507,9 @@ scripting::LuaLibrary GlobeBrowsingModule::luaLibrary() const { codegen::lua::AddLayer, codegen::lua::DeleteLayer, codegen::lua::Layers, - codegen::lua::LayersDeprecated, codegen::lua::MoveLayer, codegen::lua::GoToChunk, codegen::lua::GeoPositionForCamera, - codegen::lua::GeoPositionForCameraDeprecated, codegen::lua::LoadWMSCapabilities, codegen::lua::RemoveWMSServer, codegen::lua::CapabilitiesWMS, diff --git a/modules/globebrowsing/globebrowsingmodule_lua.inl b/modules/globebrowsing/globebrowsingmodule_lua.inl index 507de3540d..1082128c8b 100644 --- a/modules/globebrowsing/globebrowsingmodule_lua.inl +++ b/modules/globebrowsing/globebrowsingmodule_lua.inl @@ -163,26 +163,6 @@ namespace { return res; } - /** - * Returns the list of layers for the specified globe for a specific layer group. - * - * Deprecated in favor of `layers`. - * - * \param globeIdentifier The identifier of the scene graph node for the globe - * \param layerGroup The identifier of the layer group for which to list the layers - */ -[[codegen::luawrap("getLayers")]] std::vector layersDeprecated( - std::string globeIdentifier, - std::string layerGroup) -{ - LWARNINGC( - "Deprecation", - "'getLayers' function is deprecated and should be replaced with 'layers'" - ); - - return layers(std::move(globeIdentifier), std::move(layerGroup)); -} - /** * Rearranges the order of a single layer on a globe. The first position in the list * has index 0, and the last position is given by the number of layers minus one. @@ -364,28 +344,6 @@ namespace { return { glm::degrees(geo2.lat), glm::degrees(geo2.lon), altitude }; } -/** - * Get geographic coordinates of the camera position in latitude, longitude, and altitude - * (degrees and meters). - * - * Deprecated in favor of `geoPositionForCamera`. - * - * \param useEyePosition If true, use the view direction of the camera instead of the - * camera position - */ -[[codegen::luawrap("getGeoPositionForCamera")]] -std::tuple -geoPositionForCameraDeprecated(bool useEyePosition = false) -{ - LWARNINGC( - "Deprecation", - "'getGeoPositionForCamera' function is deprecated and should be replaced with " - "'geoPositionForCamera'" - ); - - return geoPositionForCamera(useEyePosition); -} - /** * Loads and parses the WMS capabilities XML file from a remote server. * diff --git a/modules/skybrowser/skybrowsermodule.cpp b/modules/skybrowser/skybrowsermodule.cpp index 49de89fe3e..5a532a3ba9 100644 --- a/modules/skybrowser/skybrowsermodule.cpp +++ b/modules/skybrowser/skybrowsermodule.cpp @@ -499,7 +499,6 @@ scripting::LuaLibrary SkyBrowserModule::luaLibrary() const { codegen::lua::InitializeBrowser, codegen::lua::SendOutIdsToBrowsers, codegen::lua::ListOfImages, - codegen::lua::ListOfImagesDeprecated, codegen::lua::SetHoverCircle, codegen::lua::MoveCircleToHoverImage, codegen::lua::DisableHoverCircle, @@ -509,7 +508,6 @@ scripting::LuaLibrary SkyBrowserModule::luaLibrary() const { codegen::lua::AdjustCamera, codegen::lua::SetSelectedBrowser, codegen::lua::TargetData, - codegen::lua::TargetDataDeprecated, codegen::lua::CreateTargetBrowserPair, codegen::lua::RemoveTargetBrowserPair, codegen::lua::SetOpacityOfImageLayer, @@ -529,7 +527,6 @@ scripting::LuaLibrary SkyBrowserModule::luaLibrary() const { codegen::lua::LoadingImageCollectionComplete, codegen::lua::ShowAllTargetsAndBrowsers, codegen::lua::WwtImageCollectionUrl, - codegen::lua::WwtImageCollectionUrlDeprecated, codegen::lua::StopAnimations, codegen::lua::SetBorderRadius, codegen::lua::ReloadDisplayCopyOnNode diff --git a/modules/skybrowser/skybrowsermodule_lua.inl b/modules/skybrowser/skybrowsermodule_lua.inl index bf3e3bc26f..64665110c3 100644 --- a/modules/skybrowser/skybrowsermodule_lua.inl +++ b/modules/skybrowser/skybrowsermodule_lua.inl @@ -332,20 +332,6 @@ std::string prunedIdentifier(std::string identifier) { return url; } -/** - * Deprecated in favor of 'wwtImageCollectionUrl' - */ -[[codegen::luawrap("getWwtImageCollectionUrl")]] -ghoul::Dictionary wwtImageCollectionUrlDeprecated() -{ - LWARNINGC( - "Deprecation", - "'getWwtImageCollectionUrl' function is deprecated and should be replaced with " - "'wwtImageCollectionUrl'" - ); - return wwtImageCollectionUrl(); -} - /** * Returns a list of all the loaded AAS WorldWide Telescope images that have been loaded. * Each image has a name, thumbnail url, equatorial spherical coordinates RA and Dec, @@ -388,19 +374,6 @@ ghoul::Dictionary wwtImageCollectionUrlDeprecated() return list; } -/** - * Deprecated in favor of 'listOfExoplanets' - */ -[[codegen::luawrap("getListOfImages")]] ghoul::Dictionary listOfImagesDeprecated() -{ - LWARNINGC( - "Deprecation", - "'getListOfImages' function is deprecated and should be replaced with " - "'listOfImages'" - ); - return listOfImages(); -} - /** * Returns a table of data regarding the current view and the sky browsers and targets. * returns a table of data regarding the current targets. @@ -471,17 +444,6 @@ ghoul::Dictionary wwtImageCollectionUrlDeprecated() return data; } -/** - * Deprecated in favor of 'targetData' - */ -[[codegen::luawrap("getTargetData")]] ghoul::Dictionary targetDataDeprecated() { - LWARNINGC( - "Deprecation", - "'getTargetData' function is deprecated and should be replaced with 'targetData'" - ); - return targetData(); -} - /** * Takes an identifier to a sky browser or sky target. Rotates the camera so that the * target is placed in the center of the view. diff --git a/src/navigation/navigationhandler.cpp b/src/navigation/navigationhandler.cpp index 61e9db397a..8e850be825 100644 --- a/src/navigation/navigationhandler.cpp +++ b/src/navigation/navigationhandler.cpp @@ -812,11 +812,9 @@ scripting::LuaLibrary NavigationHandler::luaLibrary() { codegen::lua::DistanceToFocusBoundingSphere, codegen::lua::DistanceToFocusInteractionSphere, codegen::lua::JumpToGeo, - codegen::lua::GoToGeoDeprecated, codegen::lua::FlyToGeo2, codegen::lua::FlyToGeo, codegen::lua::LocalPositionFromGeo, - codegen::lua::LocalPositionFromGeoDeprecated, codegen::lua::IsFlying, codegen::lua::FlyTo, codegen::lua::FlyToHeight, diff --git a/src/navigation/navigationhandler_lua.inl b/src/navigation/navigationhandler_lua.inl index 310cdac058..aea138766a 100644 --- a/src/navigation/navigationhandler_lua.inl +++ b/src/navigation/navigationhandler_lua.inl @@ -703,31 +703,6 @@ struct [[codegen::Dictionary(JoystickAxis)]] JoystickAxis { } } -/** - * Immediately move the camera to a geographic coordinate on a globe. If the node is a - * globe, the longitude and latitude is expressed in the body's native coordinate system. - * If it is not, the position on the surface of the interaction sphere is used instead. - * - * \param node The identifier of a scene graph node. If an empty string is provided, the - * current anchor node is used - * \param latitude The latitude of the target coordinate, in degrees - * \param longitude The longitude of the target coordinate, in degrees - * \param altitude An optional altitude, given in meters over the reference surface of - * the globe. If no altitude is provided, the altitude will be kept as - * the current distance to the reference surface of the specified globe. - */ -[[codegen::luawrap("goToGeo")]] void goToGeoDeprecated(std::string node, double latitude, - double longitude, - std::optional altitude) -{ - LWARNINGC( - "Deprecation", - "'goToGeo' function is deprecated and should be replaced with 'jumpToGeo'" - ); - - return jumpToGeo(std::move(node), latitude, longitude, altitude, 0); -} - void flyToGeoInternal(std::string node, double latitude, double longitude, std::optional altitude, std::optional duration, std::optional shouldUseUpVector) @@ -892,34 +867,6 @@ localPositionFromGeo(std::string nodeIdentifier, double latitude, double longitu return { p.x, p.y, p.z }; } -/** -* Returns the position in the local Cartesian coordinate system of the specified globe -* that corresponds to the given geographic coordinates. In the local coordinate system, -* the position (0,0,0) corresponds to the globe's center. If the node is a globe, the -* longitude and latitude is expressed in the body's native coordinate system. If it is -* not, the position on the surface of the interaction sphere is used instead. -* -* Deprecated in favor of `localPositionFromGeo`. -* -* \param globeIdentifier The identifier of the scene graph node -* \param latitude The latitude of the geograpic position, in degrees -* \param longitude The longitude of the geographic position, in degrees -* \param altitude The altitude, in meters -*/ -[[codegen::luawrap("getLocalPositionFromGeo")]] -std::tuple -localPositionFromGeoDeprecated(std::string nodeIdentifier, double latitude, - double longitude, double altitude) -{ - LWARNINGC( - "Deprecation", - "'getLocalPositionFromGeo' function is deprecated and should be replaced with " - "'localPositionFromGeo'" - ); - - return localPositionFromGeo(std::move(nodeIdentifier), latitude, longitude, altitude); -} - /** * Returns true if a camera path is currently running, and false otherwise. * diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp index 0cbc7ab58c..967b242796 100644 --- a/src/scene/scene.cpp +++ b/src/scene/scene.cpp @@ -940,16 +940,6 @@ change of property value is completed. If a duration larger than 0 was provided, at the end of the interpolation. If 0 was provided, the script runs immediately. )" }, - { - "getPropertyValue", - &luascriptfunctions::propertyGetValueDeprecated, - { - { "uri", "String" } - }, - "String | Number | Boolean | Table", - "Returns the value the property, identified by the provided URI. " - "Deprecated in favor of the 'propertyValue' function" - }, { "propertyValue", &luascriptfunctions::propertyGetValue, @@ -962,7 +952,6 @@ at the end of the interpolation. If 0 was provided, the script runs immediately. "is found." }, codegen::lua::HasProperty, - codegen::lua::PropertyDeprecated, codegen::lua::Property, codegen::lua::AddCustomProperty, codegen::lua::RemoveCustomProperty, diff --git a/src/scene/scene_lua.inl b/src/scene/scene_lua.inl index e1ee01b5c1..9d3ea95eba 100644 --- a/src/scene/scene_lua.inl +++ b/src/scene/scene_lua.inl @@ -670,19 +670,6 @@ namespace { return matches; } -/** - * Returns a list of property identifiers that match the passed regular expression - */ -[[codegen::luawrap("getProperty")]] std::vector propertyDeprecated( - std::string regex) -{ - LWARNINGC( - "Deprecation", - "'getProperty' function is deprecated and should be replaced with 'property'" - ); - return property(std::move(regex)); -} - /** * Loads the SceneGraphNode described in the table and adds it to the SceneGraph. */