Merge branch 'master' into thesis/2021/skybrowser

# Conflicts:
#	modules/webbrowser/CMakeLists.txt
This commit is contained in:
Ylva Selling
2022-04-04 16:14:50 -04:00
69 changed files with 3276 additions and 131 deletions
+1
View File
@@ -2155,6 +2155,7 @@ std::vector<std::string> SessionRecording::playbackList() const {
}
}
}
std::sort(fileList.begin(), fileList.end());
return fileList;
}
+3 -1
View File
@@ -70,7 +70,9 @@ namespace {
* value of true is given, then playback will continually loop until it is manually
* stopped.
*/
[[codegen::luawrap]] void startPlaybackDefault(std::string file, bool loop = false) {
[[codegen::luawrap("startPlayback")]] void startPlaybackDefault(std::string file,
bool loop = false)
{
using namespace openspace;
if (file.empty()) {
+7 -3
View File
@@ -218,8 +218,10 @@ joystickAxis(std::string joystickName, int axis)
* Finds the input joystick with the given 'name' and sets the deadzone for a particular
* joystick axis, which means that any input less than this value is completely ignored.
*/
[[codegen::luawrap]] void setJoystickAxisDeadZone(std::string joystickName, int axis,
float deadzone)
[[codegen::luawrap("setAxisDeadZone")]] void setJoystickAxisDeadZone(
std::string joystickName,
int axis,
float deadzone)
{
using namespace openspace;
global::navigationHandler->setJoystickAxisDeadzone(joystickName, axis, deadzone);
@@ -228,7 +230,9 @@ joystickAxis(std::string joystickName, int axis)
/**
* Returns the deadzone for the desired axis of the provided joystick.
*/
[[codegen::luawrap]] float joystickAxisDeadzone(std::string joystickName, int axis) {
[[codegen::luawrap("axisDeadzone")]] float joystickAxisDeadzone(std::string joystickName,
int axis)
{
float deadzone = openspace::global::navigationHandler->joystickAxisDeadzone(
joystickName,
axis
+31
View File
@@ -33,6 +33,7 @@
#include <openspace/navigation/pathcurves/avoidcollisioncurve.h>
#include <openspace/navigation/pathcurves/zoomoutoverviewcurve.h>
#include <openspace/navigation/pathnavigator.h>
#include <openspace/rendering/renderable.h>
#include <openspace/scene/scenegraphnode.h>
#include <openspace/query/query.h>
#include <openspace/util/collisionhelper.h>
@@ -533,6 +534,34 @@ Waypoint computeWaypointFromNodeInfo(const NodeInfo& info, const Waypoint& start
return Waypoint(targetPos, targetRot, info.identifier);
}
void checkVisibilityAndShowMessage(const SceneGraphNode* node) {
auto isEnabled = [](const Renderable* r) {
std::any propertyValueAny = r->property("Enabled")->get();
return std::any_cast<bool>(propertyValueAny);
};
// Show some info related to the visiblity of the object
const Renderable* renderable = node->renderable();
if (!renderable) {
// Check if any of the children are visible, if it has children
bool foundVisible = false;
for (const SceneGraphNode* child : node->children()) {
const Renderable* cr = child->renderable();
if (cr && isEnabled(cr)) {
foundVisible = true;
break;
}
}
if (!foundVisible) {
LINFO("Creating path to a node without a renderable or visible child nodes");
}
}
else if (!isEnabled(renderable)) {
LINFO("Creating path to disabled object");
}
}
Path createPathFromDictionary(const ghoul::Dictionary& dictionary,
std::optional<Path::Type> forceType)
{
@@ -606,6 +635,8 @@ Path createPathFromDictionary(const ghoul::Dictionary& dictionary,
throw PathCurve::TooShortPathError("Path too short!");
}
checkVisibilityAndShowMessage(waypointToAdd.node());
try {
return Path(startPoint, waypointToAdd, type, duration);
}
+5 -6
View File
@@ -123,10 +123,10 @@ PathNavigator::PathNavigator()
, _relevantNodeTags(RelevantNodeTagsInfo)
{
_defaultPathType.addOptions({
{ Path::Type::AvoidCollision, "AvoidCollision" },
{ Path::Type::ZoomOutOverview, "ZoomOutOverview"},
{ Path::Type::Linear, "Linear" },
{ Path::Type::AvoidCollisionWithLookAt, "AvoidCollisionWithLookAt"}
{ static_cast<int>(Path::Type::AvoidCollision), "AvoidCollision" },
{ static_cast<int>(Path::Type::ZoomOutOverview), "ZoomOutOverview" },
{ static_cast<int>(Path::Type::Linear), "Linear" },
{ static_cast<int>(Path::Type::AvoidCollisionWithLookAt), "AvoidCollisionWithLookAt"}
});
addProperty(_defaultPathType);
@@ -343,8 +343,7 @@ void PathNavigator::continuePath() {
}
Path::Type PathNavigator::defaultPathType() const {
const int pathType = _defaultPathType;
return Path::Type(pathType);
return static_cast<Path::Type>(_defaultPathType.value());
}
double PathNavigator::minValidBoundingSphere() const {
@@ -95,7 +95,7 @@ namespace {
}
// Returns the L2 associativity.
[[codegen::luawrap]] int l2Associativity() {
[[codegen::luawrap("L2Associativity")]] int l2Associativity() {
int assoc = static_cast<int>(CpuCap.L2Associativity());
return assoc;
}
+1
View File
@@ -164,6 +164,7 @@ scripting::LuaLibrary Time::luaLibrary() {
codegen::lua::InterpolateTimeRelative,
codegen::lua::CurrentTime,
codegen::lua::CurrentTimeUTC,
codegen::lua::CurrentTimeSpice,
codegen::lua::CurrentWallTime,
codegen::lua::CurrentApplicationTime,
codegen::lua::AdvancedTime
+10 -1
View File
@@ -273,7 +273,16 @@ namespace {
/**
* Returns the current time as an ISO 8601 date string (YYYY-MM-DDTHH:MN:SS).
*/
[[codegen::luawrap]] std::string currentTimeUTC() {
[[codegen::luawrap("UTC")]] std::string currentTimeUTC() {
return std::string(openspace::global::timeManager->time().ISO8601());
}
/**
* Returns the current time as an date string of the form
* (YYYY MON DDTHR:MN:SC.### ::RND) as returned by SPICE.
*/
[[codegen::luawrap("SPICE")]] std::string currentTimeSpice() {
return std::string(openspace::global::timeManager->time().UTC());
}