mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-05 19:19:39 -06:00
Fix issue of sorting by placing arguments in array (#3238)
Co-authored-by: Ylva Selling <ylva.selling@liu.se>
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
openspace.gaia.documentation = {
|
||||
{
|
||||
Name = "addClippingBox",
|
||||
Arguments = { name = "String", size = "vec3", position = "vec3" },
|
||||
Arguments = {{ "name", "String" },{ "size", "vec3" }, { "position", "vec3" }},
|
||||
Documentation = "Creates a clipping box for the Gaia renderable in the first argument"
|
||||
},
|
||||
{
|
||||
@@ -11,7 +11,7 @@ openspace.gaia.documentation = {
|
||||
},
|
||||
{
|
||||
Name = "addClippingSphere",
|
||||
Arguments = { name = "String", radius = "Number" },
|
||||
Arguments = {{ "name", "String" }, { "radius", "Number" }},
|
||||
Documentation = "Creates a clipping sphere for the Gaia renderable in the first argument"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
openspace.globebrowsing.documentation = {
|
||||
{
|
||||
Name = "createTemporalGibsGdalXml",
|
||||
Arguments = { layerName = "String", resolution = "String", format = "String" },
|
||||
Arguments = {{ "layerName", "String" }, { "resolution", "String" }, { "format", "String" }},
|
||||
Documentation = [[
|
||||
Creates an XML configuration for a temporal GIBS dataset to be used in
|
||||
a TemporalTileprovider
|
||||
@@ -9,7 +9,7 @@ openspace.globebrowsing.documentation = {
|
||||
},
|
||||
{
|
||||
Name = "createGibsGdalXml",
|
||||
Arguments = { layerName = "String", date = "String", resolution = "String", format = "String" },
|
||||
Arguments = {{ "layerName", "String" }, { "date", "String" }, { "resolution", "String" }, { "format", "String" }},
|
||||
Documentation =
|
||||
"Creates an XML configuration for a GIBS dataset." ..
|
||||
"Arguments are: layerName, date, resolution, format." ..
|
||||
@@ -32,7 +32,7 @@ openspace.globebrowsing.documentation = {
|
||||
},
|
||||
{
|
||||
Name = "addGibsLayer",
|
||||
Arguments = { layer = "String", resolution = "String", format = "String", startDate = "String", endDate = "String" },
|
||||
Arguments = {{ "layer", "String" }, { "resolution", "String" }, { "format", "String" }, { "startDate", "String" }, { "endDate", "String" }},
|
||||
Documentation = "Adds a new layer from NASA GIBS to the Earth globe. Arguments " ..
|
||||
"are: imagery layer name, imagery resolution, start date, end date, format. " ..
|
||||
"For all specifications, see " ..
|
||||
@@ -42,7 +42,7 @@ openspace.globebrowsing.documentation = {
|
||||
},
|
||||
{
|
||||
Name = "parseInfoFile",
|
||||
Arguments = { file = "String" },
|
||||
Arguments = {{ "file", "String" }},
|
||||
Documentation =
|
||||
"Parses the passed info file and return the table with the information " ..
|
||||
"provided in the info file. The return table contains the optional keys: " ..
|
||||
@@ -53,7 +53,7 @@ openspace.globebrowsing.documentation = {
|
||||
},
|
||||
{
|
||||
Name = "addBlendingLayersFromDirectory",
|
||||
Arguments = { directory = "String", nodeName = "String" },
|
||||
Arguments = {{ "directory", "String" }, { "nodeName", "String" }},
|
||||
Documentation =
|
||||
"Retrieves all info files recursively in the directory passed as the first " ..
|
||||
"argument to this function. The color and height tables retrieved from these " ..
|
||||
@@ -63,7 +63,7 @@ openspace.globebrowsing.documentation = {
|
||||
},
|
||||
{
|
||||
Name = "addFocusNodesFromDirectory",
|
||||
Arguments = { directory = "String", nodeName = "String" },
|
||||
Arguments = {{ "directory", "String" }, { "nodeName", "String" }},
|
||||
Documentation =
|
||||
"Retrieves all info files recursively in the directory passed as the first " ..
|
||||
"argument to this function. The name and location retrieved from these info " ..
|
||||
@@ -73,7 +73,7 @@ openspace.globebrowsing.documentation = {
|
||||
},
|
||||
{
|
||||
Name = "addFocusNodeFromLatLong",
|
||||
Arguments = { name = "String", globeIdentifier = "String", latitude = "Number", longitude = "Number", altitude = "Number" },
|
||||
Arguments = {{ "name", "String" }, { "globeIdentifier", "String" }, { "latitude", "Number" }, { "longitude", "Number" }, { "altitude", "Number" }},
|
||||
Documentation =
|
||||
"Creates a new SceneGraphNode that can be used as focus node. " ..
|
||||
"Usage: openspace.globebrowsing.addFocusNodeFromLatLong(" ..
|
||||
@@ -81,7 +81,7 @@ openspace.globebrowsing.documentation = {
|
||||
},
|
||||
{
|
||||
Name = "loadWMSServersFromFile",
|
||||
Arguments = { filePath = "String" },
|
||||
Arguments = {{ "filePath", "String" }},
|
||||
Documentation =
|
||||
"Loads all WMS servers from the provided file and passes them to the " ..
|
||||
"'openspace.globebrowsing.loadWMSCapabilities' file."
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
openspace.globebrowsing.documentation = {
|
||||
{
|
||||
Name = "setNodePosition",
|
||||
Arguments = { nodeIdentifer = "String", globeIdentifier = "String", latitude = "Number", longitude = "Number", altitude = "Number" },
|
||||
Arguments = {{ "nodeIdentifer", "String" }, { "globeIdentifier", "String" }, { "latitude", "Number" }, { "longitude", "Number" }, { "altitude", "Number" }},
|
||||
Documentation =
|
||||
"Sets the position of a SceneGraphNode that has GlobeTranslation/GlobeRotations. " ..
|
||||
"Usage: openspace.globebrowsing.setNodePosition(" ..
|
||||
@@ -9,7 +9,7 @@ openspace.globebrowsing.documentation = {
|
||||
},
|
||||
{
|
||||
Name = "setNodePositionFromCamera",
|
||||
Arguments = { nodeIdentifer = "String", useAltitude = "Boolean" },
|
||||
Arguments = {{ "nodeIdentifer", "String" }, { "useAltitude", "Boolean" }},
|
||||
Documentation =
|
||||
"Sets the position of a SceneGraphNode that has GlobeTranslation/GlobeRotations" ..
|
||||
" to match the camera. Only uses camera position not rotation. If useAltitude" ..
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
openspace.space.documentation = {
|
||||
{
|
||||
Name = "tleToSpiceTranslation",
|
||||
Arguments = { tlePath = "String" },
|
||||
Arguments = {{ "tlePath", "String" }},
|
||||
Return = "{ Translation, SpiceKernel }",
|
||||
Documentation = [[
|
||||
Takes the provided TLE file, converts it into a SPICE kernel and returns a
|
||||
|
||||
@@ -1,20 +1,20 @@
|
||||
openspace.documentation = {
|
||||
{
|
||||
Name = "markInterestingNodes",
|
||||
Arguments = { sceneGraphNodes = "String[]" },
|
||||
Arguments = {{ "sceneGraphNodes", "String[]" }},
|
||||
Documentation = "This function marks the scene graph nodes identified by name " ..
|
||||
"as interesting, which will provide shortcut access to focus buttons and " ..
|
||||
"featured properties"
|
||||
},
|
||||
{
|
||||
Name = "markInterestingTimes",
|
||||
Arguments = { times = "Table[]" },
|
||||
Arguments = {{ "times", "Table[]" }},
|
||||
Documentation = "This function marks interesting times for the current scene, " ..
|
||||
"which will create shortcuts for a quick access"
|
||||
},
|
||||
{
|
||||
Name = "removeInterestingNodes",
|
||||
Arguments = { sceneGraphNodes = "String[]" },
|
||||
Arguments = {{ "sceneGraphNodes", "String[]" }},
|
||||
Documentation = "This function removes unmarks the scene graph nodes " ..
|
||||
"identified by name as interesting, thus removing the shortcuts from the " ..
|
||||
"features properties list"
|
||||
@@ -36,36 +36,36 @@ openspace.documentation = {
|
||||
},
|
||||
{
|
||||
Name = "rebindKey",
|
||||
Arguments = { oldKey = "String", newKey = "String" },
|
||||
Arguments = {{ "oldKey", "String" }, { "newKey", "String" }},
|
||||
Documentation = "Rebinds all scripts from the old key (first argument) to the " ..
|
||||
"new key (second argument)"
|
||||
},
|
||||
{
|
||||
Name = "appendToListProperty",
|
||||
Arguments = { identifier = "String", value = "any" },
|
||||
Arguments = {{ "identifier","String" }, { "value", "any" }},
|
||||
Documentation = "Add a value to the list property with the given identifier. " ..
|
||||
"The value can be any type, as long as it is the correct type for the given " ..
|
||||
"property. Note that a number will be converted to a string automatically."
|
||||
},
|
||||
{
|
||||
Name = "addToPropertyValue",
|
||||
Arguments = { identifier = "String", value = "String | Number" },
|
||||
Arguments = {{ "identifier", "String" } , { "value", "String | Number" }},
|
||||
Documentation = "Add a value to the property with the given identifier. " ..
|
||||
"Works on both numerical and string properties, where adding to a string " ..
|
||||
"property means appending the given string value to the existing string value."
|
||||
},
|
||||
{
|
||||
Name = "invertBooleanProperty",
|
||||
Arguments = { identifier = "String" },
|
||||
Arguments = {{ "identifier", "String" }},
|
||||
Documentation = "Inverts the value of a boolean property with the given "..
|
||||
"identifier"
|
||||
},
|
||||
{
|
||||
Name = "fadeIn",
|
||||
Arguments = {
|
||||
identifier = "String",
|
||||
fadeTime = "Number?",
|
||||
endScript = "String?"
|
||||
{ "identifier", "String" },
|
||||
{ "fadeTime", "Number?" },
|
||||
{ "endScript", "String?" }
|
||||
},
|
||||
Documentation = "Fades in the node(s) with the given identifier over the given " ..
|
||||
"time in seconds. The identifier can contain a tag and/or a wildcard to target " ..
|
||||
@@ -77,9 +77,9 @@ openspace.documentation = {
|
||||
{
|
||||
Name = "fadeOut",
|
||||
Arguments = {
|
||||
identifier = "String",
|
||||
fadeTime = "Number?",
|
||||
endScript = "String?"
|
||||
{ "identifier", "String" },
|
||||
{ "fadeTime", "Number?" },
|
||||
{ "endScript", "String?" }
|
||||
},
|
||||
Documentation = "Fades out the node(s) with the given identifier over the given " ..
|
||||
"time in seconds. The identifier can contain a tag and/or a wildcard to target " ..
|
||||
@@ -91,9 +91,9 @@ openspace.documentation = {
|
||||
{
|
||||
Name = "toggleFade",
|
||||
Arguments = {
|
||||
identifier = "String",
|
||||
fadeTime = "Number?",
|
||||
endScript = "String?"
|
||||
{ "identifier", "String" },
|
||||
{ "fadeTime", "Number?" },
|
||||
{ "endScript", "String?" }
|
||||
},
|
||||
Documentation = [[Toggles the fade state of the node(s) with the given identifier over the given
|
||||
time in seconds. The identifier can contain a tag and/or a wildcard to target
|
||||
|
||||
@@ -47,7 +47,7 @@ namespace {
|
||||
|
||||
struct [[codegen::Dictionary(Documentation)]] Parameters {
|
||||
std::string name;
|
||||
std::map<std::string, std::string> arguments;
|
||||
std::vector<std::vector<std::string>> arguments;
|
||||
std::optional<std::string> returnValue [[codegen::key("Return")]];
|
||||
std::optional<std::string> documentation;
|
||||
};
|
||||
@@ -347,11 +347,11 @@ void ScriptEngine::addLibraryFunctions(lua_State* state, LuaLibrary& library,
|
||||
|
||||
LuaLibrary::Function func;
|
||||
func.name = p.name;
|
||||
for (const std::pair<const std::string, std::string>& pair : p.arguments)
|
||||
for (const std::vector<std::string>& pair : p.arguments)
|
||||
{
|
||||
LuaLibrary::Function::Argument arg;
|
||||
arg.name = pair.first;
|
||||
arg.type = pair.second;
|
||||
arg.name = pair[0];
|
||||
arg.type = pair[1];
|
||||
func.arguments.push_back(arg);
|
||||
}
|
||||
func.returnType = p.returnValue.value_or(func.returnType);
|
||||
|
||||
Reference in New Issue
Block a user