Merge master in

This commit is contained in:
GPayne
2021-01-06 20:59:31 -07:00
1274 changed files with 8842 additions and 8825 deletions
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
+1 -30
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -39,35 +39,6 @@
#include <ghoul/logging/logmanager.h>
namespace {
constexpr const uint32_t ProtocolVersion = 3;
constexpr const size_t MaxLatencyDiffs = 64;
constexpr openspace::properties::Property::PropertyInfo BufferTimeInfo = {
"BufferTime",
"Buffer Time",
"" // @TODO Missing documentation
};
constexpr openspace::properties::Property::PropertyInfo TimeKeyFrameInfo = {
"TimeKeyframeInterval",
"Time keyframe interval",
"" // @TODO Missing documentation
};
constexpr openspace::properties::Property::PropertyInfo CameraKeyFrameInfo = {
"CameraKeyframeInterval",
"Camera Keyframe interval",
"" // @TODO Missing documentation
};
constexpr openspace::properties::Property::PropertyInfo TimeToleranceInfo = {
"TimeTolerance",
"Time tolerance",
"" // @TODO Missing documentation
};
} // namespace
namespace openspace {
ExternInteraction::ExternInteraction()
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
+1 -3
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -29,8 +29,6 @@
#include <ghoul/logging/logmanager.h>
namespace {
constexpr const char* _loggerCat = "InteractionMonitor";
constexpr openspace::properties::Property::PropertyInfo IdleTimeInfo = {
"IdleTime",
"Idle Time",
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
+2 -8
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -97,13 +97,7 @@ bool KeyframeNavigator::updateCamera(Camera& camera, bool ignoreFutureKeyframes)
return false;
}
return updateCamera(
&camera,
prevKeyframe->data,
nextKeyframe->data,
t,
ignoreFutureKeyframes
);
return updateCamera(&camera, prevPose, nextPose, t, ignoreFutureKeyframes);
}
bool KeyframeNavigator::updateCamera(Camera* camera, const CameraPose prevPose,
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
+15 -15
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -138,19 +138,19 @@ NavigationHandler::NavigationState::NavigationState(const ghoul::Dictionary& dic
}
}
NavigationHandler::NavigationState::NavigationState(std::string anchor, std::string aim,
std::string referenceFrame,
glm::dvec3 position,
std::optional<glm::dvec3> up,
double yaw,
double pitch)
: anchor(std::move(anchor))
, aim(std::move(aim))
, referenceFrame(std::move(referenceFrame))
, position(std::move(position))
, up(std::move(up))
, yaw(yaw)
, pitch(pitch)
NavigationHandler::NavigationState::NavigationState(std::string anchor_, std::string aim_,
std::string referenceFrame_,
glm::dvec3 position_,
std::optional<glm::dvec3> up_,
double yaw_,
double pitch_)
: anchor(std::move(anchor_))
, aim(std::move(aim_))
, referenceFrame(std::move(referenceFrame_))
, position(std::move(position_))
, up(std::move(up_))
, yaw(yaw_)
, pitch(pitch_)
{}
NavigationHandler::NavigationHandler()
@@ -295,7 +295,7 @@ void NavigationHandler::applyNavigationState(const NavigationHandler::Navigation
}
const glm::dvec3 cameraPositionWorld = anchorWorldPosition +
glm::dvec3(referenceFrameTransform * glm::dvec4(ns.position, 1.0));
referenceFrameTransform * glm::dvec4(ns.position, 1.0);
glm::dvec3 up = ns.up.has_value() ?
glm::normalize(referenceFrameTransform * *ns.up) :
+10 -10
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -73,14 +73,14 @@ int getNavigationState(lua_State* L) {
lua_settop(L, 0);
const auto pushVector = [](lua_State* L, const glm::dvec3& v) {
lua_newtable(L);
ghoul::lua::push(L, 1, v.x);
lua_rawset(L, -3);
ghoul::lua::push(L, 2, v.y);
lua_rawset(L, -3);
ghoul::lua::push(L, 3, v.z);
lua_rawset(L, -3);
const auto pushVector = [](lua_State* s, const glm::dvec3& v) {
lua_newtable(s);
ghoul::lua::push(s, 1, v.x);
lua_rawset(s, -3);
ghoul::lua::push(s, 2, v.y);
lua_rawset(s, -3);
ghoul::lua::push(s, 3, v.z);
lua_rawset(s, -3);
};
lua_newtable(L);
@@ -309,7 +309,7 @@ int joystickButton(lua_State* L) {
cmds.begin(),
cmds.end(),
std::string(),
[](std::string lhs, std::string rhs) {
[](const std::string& lhs, const std::string& rhs) {
return lhs + ";" + rhs;
}
);
+2 -14
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -103,13 +103,6 @@ namespace {
"the sensitivity is the less impact a mouse motion will have."
};
constexpr openspace::properties::Property::PropertyInfo JoystickEnabledInfo = {
"JoystickEnabled",
"Joystick Control Enabled",
"If this is selected, a connected joystick will be used as an optional input "
"device. If this is deselected, any joystick input will be ignored"
};
constexpr openspace::properties::Property::PropertyInfo JoystickSensitivityInfo = {
"JoystickSensitivity",
"Joystick Sensitivity",
@@ -1282,12 +1275,7 @@ glm::dvec3 OrbitalNavigator::moveCameraAlongVector(const glm::dvec3& camPos,
velocity = 1.0 - destination / distFromCameraToFocus;
}
else { // When flying away from anchor
if (destination == 0.0) {
velocity = -1.0;
}
else {
velocity = distFromCameraToFocus / destination - 1.0;
}
velocity = distFromCameraToFocus / destination - 1.0;
}
velocity *= _velocitySensitivity * deltaTime;
+1 -6
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -26,11 +26,6 @@
#include <openspace/interaction/inputstate.h>
namespace {
const double SENSITIVITY_ADJUSTMENT_INCREASE = 8.0;
const double SENSITIVITY_ADJUSTMENT_DECREASE = 0.5;
}
namespace openspace::interaction {
ScriptCameraStates::ScriptCameraStates() : CameraInteractionStates(1.0, 1.0) {}
+8 -12
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -301,7 +301,8 @@ bool SessionRecording::startPlayback(std::string& filename,
LERROR("Unknown data type in header (should be Ascii or Binary)");
cleanUpPlayback();
}
std::string throwawayNewlineChar = readHeaderElement(_playbackFile, 1);
// throwaway newline character
readHeaderElement(_playbackFile, 1);
if (_recordingDataMode == DataMode::Binary) {
//Close & re-open the file, starting from the beginning, and do dummy read
@@ -714,7 +715,7 @@ void SessionRecording::preSynchronization() {
//Handle callback(s) for change in idle/record/playback state
if (_state != _lastState) {
using K = const CallbackHandle;
using K = CallbackHandle;
using V = StateChangeCallback;
for (const std::pair<K, V>& it : _stateChangeCallbacks) {
it.second();
@@ -766,9 +767,8 @@ bool SessionRecording::playbackAddEntriesToTimeline() {
if (_recordingDataMode == DataMode::Binary) {
unsigned char frameType;
bool fileReadOk = true;
while (parsingStatusOk && fileReadOk) {
while (parsingStatusOk) {
frameType = readFromPlayback<unsigned char>(_playbackFile);
// Check if have reached EOF
if (!_playbackFile) {
@@ -776,7 +776,6 @@ bool SessionRecording::playbackAddEntriesToTimeline() {
"Finished parsing {} entries from playback file {}",
_playbackLineNum - 1, _playbackFilename
));
fileReadOk = false;
break;
}
if (frameType == HeaderCameraBinary) {
@@ -1810,9 +1809,8 @@ SessionRecording::DataMode SessionRecording::readModeFromHeader(std::string file
mode = DataMode::Binary;
}
else {
LERROR("Unknown data type in header (should be Ascii or Binary)");
throw ConversionError("Unknown data type in header (should be Ascii or Binary)");
}
inputFile.close();
return mode;
}
@@ -1959,9 +1957,8 @@ bool SessionRecording::convertEntries(std::string& inFilename,
if (mode == DataMode::Binary) {
unsigned char frameType;
bool fileReadOk = true;
while (conversionStatusOk && fileReadOk) {
while (conversionStatusOk) {
frameType = readFromPlayback<unsigned char>(inStream);
// Check if have reached EOF
if (!inStream) {
@@ -1969,7 +1966,6 @@ bool SessionRecording::convertEntries(std::string& inFilename,
"Finished converting {} entries from playback file {}",
lineNum - 1, inFilename
));
fileReadOk = false;
break;
}
if (frameType == HeaderCameraBinary) {
@@ -2093,7 +2089,7 @@ std::string SessionRecording::getLegacyConversionResult(std::string filename, in
}
std::string SessionRecording_legacy_0085::getLegacyConversionResult(std::string filename,
int depth)
int)
{
//This method is overriden in each legacy subclass, but does nothing in this instance
// as the oldest supported legacy version.
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -77,7 +77,7 @@ std::string ConvertRecFileVersionTask::description() {
return description;
}
void ConvertRecFileVersionTask::perform(const Task::ProgressCallback& progressCallback) {
void ConvertRecFileVersionTask::perform(const Task::ProgressCallback&) {
convert();
}
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -85,7 +85,7 @@ std::string ConvertRecFormatTask::description() {
return description;
}
void ConvertRecFormatTask::perform(const Task::ProgressCallback& progressCallback) {
void ConvertRecFormatTask::perform(const Task::ProgressCallback&) {
convert();
}
@@ -248,7 +248,6 @@ void ConvertRecFormatTask::convertToBinary() {
char tmpType = SessionRecording::DataFormatBinaryTag;
_oFile.write(&tmpType, 1);
_oFile.write("\n", 1);
size_t idx = 0;
while (std::getline(_iFile, lineContents)) {
lineNum++;
+8 -8
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
@@ -92,7 +92,7 @@ NSArray* focusIdentifiers;
if ([identifier isEqualToString:pauseResultId]) {
NSButton* button = [NSButton
buttonWithTitle:NSLocalizedString(
(global::timeManager.isPaused() ? @"Resume" : @"Pause"),
(global::timeManager->isPaused() ? @"Resume" : @"Pause"),
@""
)
target:self action:@selector(pauseResumeButtonAction:)
@@ -172,14 +172,14 @@ NSArray* focusIdentifiers;
}
- (void)pauseResumeButtonAction:(id)sender {
global::scriptEngine.queueScript(
global::scriptEngine->queueScript(
"openspace.time.togglePause();",
scripting::ScriptEngine::RemoteScripting::Yes
);
NSButton* button = static_cast<NSButton*>(sender);
// This check is inverted since the togglePause script has not run yet
[button setTitle: global::timeManager.isPaused() ? @"Pause" : @"Resume"];
[button setTitle: global::timeManager->isPaused() ? @"Pause" : @"Resume"];
}
- (void)focusObjectAction:(id)sender {
@@ -195,7 +195,7 @@ NSArray* focusIdentifiers;
"NavigationHandler.OrbitalNavigator.Aim",
"NavigationHandler.OrbitalNavigator.RetargetAnchor"
);
global::scriptEngine.queueScript(
global::scriptEngine->queueScript(
str,
scripting::ScriptEngine::RemoteScripting::Yes
);
@@ -205,7 +205,7 @@ NSArray* focusIdentifiers;
// Remove unused variable warning
(void)sender;
global::scriptEngine.queueScript(
global::scriptEngine->queueScript(
"local isEnabled = openspace.getPropertyValue('Dashboard.IsEnabled');\
openspace.setPropertyValueSingle('Dashboard.IsEnabled', not isEnabled);\
openspace.setPropertyValueSingle('RenderEngine.ShowLog', not isEnabled);\
@@ -218,7 +218,7 @@ NSArray* focusIdentifiers;
- (void)hideGuiAction:(id)sender {
// Remove unused variable warning
(void)sender;
global::scriptEngine.queueScript(
global::scriptEngine->queueScript(
"local isEnabled = openspace.getPropertyValue('Modules.CefWebGui.Visible');\
openspace.setPropertyValueSingle('Modules.CefWebGui.Visible', not isEnabled);",
scripting::ScriptEngine::RemoteScripting::No
@@ -242,7 +242,7 @@ void showTouchbar() {
[NSApplication sharedApplication].automaticCustomizeTouchBarMenuItemEnabled = YES;
}
std::vector<SceneGraphNode*> ns = global::renderEngine.scene()->allSceneGraphNodes();
std::vector<SceneGraphNode*> ns = global::renderEngine->scene()->allSceneGraphNodes();
std::sort(
ns.begin(),
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *
+1 -1
View File
@@ -2,7 +2,7 @@
* *
* OpenSpace *
* *
* Copyright (c) 2014-2020 *
* Copyright (c) 2014-2021 *
* *
* Permission is hereby granted, free of charge, to any person obtaining a copy of this *
* software and associated documentation files (the "Software"), to deal in the Software *