Remove unused lua functions

This commit is contained in:
Ylva Selling
2024-07-16 18:52:42 +02:00
parent 41163160f7
commit 81f990f661
2 changed files with 0 additions and 83 deletions
-2
View File
@@ -569,8 +569,6 @@ scripting::LuaLibrary SkyBrowserModule::luaLibrary() const {
codegen::lua::RemoveSelectedImageInBrowser,
codegen::lua::AdjustCamera,
codegen::lua::SetSelectedBrowser,
codegen::lua::TargetData,
codegen::lua::TargetDataDeprecated,
codegen::lua::CreateTargetBrowserPair,
codegen::lua::RemoveTargetBrowserPair,
codegen::lua::SetOpacityOfImageLayer,
@@ -340,87 +340,6 @@ ghoul::Dictionary wwtImageCollectionUrlDeprecated()
return wwtImageCollectionUrl();
}
/**
* Returns a table of data regarding the current view and the sky browsers and targets.
* returns a table of data regarding the current targets.
*/
[[codegen::luawrap]] ghoul::Dictionary targetData() {
using namespace openspace;
SkyBrowserModule* module = global::moduleEngine->module<SkyBrowserModule>();
ghoul::Dictionary data;
// The current viewport data for OpenSpace
ghoul::Dictionary openSpace;
// Camera directions
glm::dvec3 cartesianCam = skybrowser::cameraDirectionEquatorial();
glm::dvec2 sphericalCam = skybrowser::cartesianToSpherical(cartesianCam);
// Calculate the smallest FOV of vertical and horizontal
glm::dvec2 fovs = skybrowser::fovWindow();
double FOV = std::min(fovs.x, fovs.y);
// Set window data
openSpace.setValue("windowHFOV", FOV);
openSpace.setValue("cartesianDirection", cartesianCam);
openSpace.setValue("ra", sphericalCam.x);
openSpace.setValue("dec", sphericalCam.y);
openSpace.setValue("selectedBrowserId", module->selectedBrowserId());
openSpace.setValue("selectedTargetId", module->selectedTargetId());
openSpace.setValue("isFacingCamera", module->isSelectedPairFacingCamera());
openSpace.setValue("isUsingRadiusAzimuthElevation", module->isSelectedPairUsingRae());
openSpace.setValue("cameraInSolarSystem", module->isCameraInSolarSystem());
// Set table for the current ImageData
data.setValue("OpenSpace", openSpace);
// Pass data for all the browsers and the corresponding targets
if (module->isCameraInSolarSystem()) {
const std::vector<std::unique_ptr<TargetBrowserPair>>& pairs = module->pairs();
for (const std::unique_ptr<TargetBrowserPair>& pair : pairs) {
std::string id = pair->browserId();
glm::dvec2 spherical = pair->targetDirectionEquatorial();
glm::dvec3 cartesian = skybrowser::sphericalToCartesian(spherical);
ghoul::Dictionary target;
// Set ("Key", value)
target.setValue("id", id);
target.setValue("name", pair->browserGuiName());
target.setValue("FOV", static_cast<double>(pair->verticalFov()));
target.setValue("selectedImages", pair->selectedImages());
target.setValue("cartesianDirection", cartesian);
target.setValue("ra", spherical.x);
target.setValue("dec", spherical.y);
target.setValue("roll", pair->targetRoll());
target.setValue("color", pair->borderColor());
std::vector<std::pair<std::string, glm::dvec3>> copies =
pair->displayCopies();
ghoul::Dictionary copiesData;
for (size_t i = 0; i < copies.size(); i++) {
copiesData.setValue(copies[i].first, copies[i].second);
}
// Set table for the current target
target.setValue("displayCopies", copiesData);
data.setValue(id, target);
}
}
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.