mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-05-05 10:59:47 -05:00
Remove unused lua functions
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user