Merge branch 'feature/cef-update' into thesis/2021/skybrowser

This commit is contained in:
Ylva Selling
2022-03-21 16:19:42 -04:00
166 changed files with 5099 additions and 5294 deletions

View File

@@ -213,11 +213,6 @@ void setAdditionalScriptsFromProfile(const Profile& p);
} // namespace openspace
// Lua functions - exposed for testing
namespace openspace::luascriptfunctions {
int createSingleColorImage(lua_State* L);
} // openspace::luascriptfunctions
std::filesystem::path createSingleColorImage(std::string name, glm::dvec3 color);
#endif // __OPENSPACE_CORE___OPENSPACEENGINE___H__

View File

@@ -57,6 +57,26 @@ class KeyboardInputState;
class OrbitalNavigator : public properties::PropertyOwner {
public:
struct IdleBehavior : public properties::PropertyOwner {
enum class Behavior {
Orbit = 0,
OrbitAtConstantLat,
OrbitAroundUp
};
IdleBehavior();
properties::BoolProperty apply;
properties::BoolProperty shouldTriggerWhenIdle;
properties::FloatProperty idleWaitTime;
properties::BoolProperty abortOnCameraInteraction;
properties::FloatProperty speedScale;
properties::FloatProperty dampenInterpolationTime;
properties::OptionProperty defaultBehavior;
std::optional<Behavior> chosenBehavior = std::nullopt;
};
OrbitalNavigator();
void updateStatesFromInput(const MouseInputState& mouseInputState,
@@ -72,6 +92,9 @@ public:
*/
void updateOnCameraInteraction();
void tickIdleBehaviorTimer(double deltaTime);
void triggerIdleBehavior(std::string_view choice = "");
Camera* camera() const;
void setCamera(Camera* camera);
void clearPreviousState();
@@ -191,22 +214,8 @@ private:
Interpolator<double> _idleBehaviorDampenInterpolator;
bool _invertIdleBehaviorInterpolation = false;
struct IdleBehavior : public properties::PropertyOwner {
enum Behavior {
Orbit = 0,
OrbitAtConstantLat,
OrbitAroundUp
};
IdleBehavior();
properties::BoolProperty apply;
properties::OptionProperty chosenBehavior;
properties::FloatProperty speedScale;
properties::BoolProperty abortOnCameraInteraction;
properties::FloatProperty dampenInterpolationTime;
};
IdleBehavior _idleBehavior;
float _idleBehaviorTriggerTimer = 0.f;
/**
* Decomposes the camera's rotation in to a global and a local rotation defined by
@@ -344,6 +353,8 @@ private:
SurfacePositionHandle calculateSurfacePositionHandle(const SceneGraphNode& node,
const glm::dvec3 cameraPositionWorldSpace);
void resetIdleBehavior();
/**
* Apply the currently selected idle behavior to the position and rotations
*/

View File

@@ -237,9 +237,7 @@ public:
/**
* Returns the Lua library that contains all Lua functions available to change the
* scene graph. The functions contained are
* - openspace::luascriptfunctions::property_setValue
* - openspace::luascriptfunctions::property_getValue
* scene graph.
* \return The Lua library that contains all Lua functions available to change the
* scene graph
*/

View File

@@ -47,8 +47,18 @@ struct LuaLibrary {
std::string name;
/// The function pointer that is executed if the function is called
lua_CFunction function;
/// A text describing the arguments to this function
std::string argumentText;
struct Argument {
/// The name of the arguments
std::string name;
/// The type of the argument
std::string type;
/// The default value if it exists
std::optional<std::string> defaultValue = std::nullopt;
};
/// The ordered arguments that this function takes
std::vector<Argument> arguments;
/// Information about the type that this function returns
std::string returnType;
/// A help text describing what the function does/
std::string helpText;
};
@@ -61,19 +71,9 @@ struct LuaLibrary {
/// A list of all libraries that are children for this library
std::vector<LuaLibrary> subLibraries = std::vector<LuaLibrary>();
/// This struct contains information about a function or constant that is defined in
/// a Lua script
struct Documentation {
/// The name of the function/variable
std::string name;
/// The description of the parameters for a function
std::string parameter;
/// The description of the function/variable
std::string description;
};
/// The list of documentations will be populated automatically by parsing the Lua
/// scripts
std::vector<Documentation> documentations = std::vector<Documentation>();
std::vector<Function> documentations = std::vector<Function>();
/// Comparison function that compares two LuaLibrary%s name
bool operator<(const LuaLibrary& rhs) const;

View File

@@ -143,8 +143,6 @@ public:
/**
* Sets a relative time from profile.
* \param setTime a string containing time adjustment as described in documentation
* for luascriptfunctions::time_advancedTime
*/
void setTimeRelativeFromProfile(const std::string& setTime);