mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Merge-in all updates from master
This commit is contained in:
@@ -78,7 +78,7 @@ public:
|
||||
void setAtmosphereDimmingFactor(float atmosphereDimmingFactor);
|
||||
|
||||
// Relative mutators
|
||||
void rotate(glm::dquat rotation);
|
||||
void rotate(const glm::dquat& rotation);
|
||||
|
||||
// Accessors
|
||||
// Remove Vec3 from the name when psc is gone
|
||||
|
||||
@@ -34,6 +34,9 @@ namespace openspace::dataloader::csv {
|
||||
Dataset loadCsvFile(std::filesystem::path path,
|
||||
std::optional<DataMapping> specs = std::nullopt);
|
||||
|
||||
std::vector<Dataset::Texture> loadTextureMapFile(std::filesystem::path path,
|
||||
const std::set<int>& texturesInData);
|
||||
|
||||
} // namespace openspace::dataloader
|
||||
|
||||
#endif // __OPENSPACE_CORE___CSVLOADER___H__
|
||||
|
||||
@@ -103,8 +103,8 @@ namespace data {
|
||||
Dataset loadFile(std::filesystem::path path,
|
||||
std::optional<DataMapping> specs = std::nullopt);
|
||||
|
||||
std::optional<Dataset> loadCachedFile(std::filesystem::path path);
|
||||
void saveCachedFile(const Dataset& dataset, std::filesystem::path path);
|
||||
std::optional<Dataset> loadCachedFile(const std::filesystem::path& path);
|
||||
void saveCachedFile(const Dataset& dataset, const std::filesystem::path& path);
|
||||
|
||||
Dataset loadFileWithCache(std::filesystem::path path,
|
||||
std::optional<DataMapping> specs = std::nullopt);
|
||||
@@ -116,8 +116,8 @@ namespace label {
|
||||
Labelset loadFile(std::filesystem::path path,
|
||||
std::optional<DataMapping> specs = std::nullopt);
|
||||
|
||||
std::optional<Labelset> loadCachedFile(std::filesystem::path path);
|
||||
void saveCachedFile(const Labelset& labelset, std::filesystem::path path);
|
||||
std::optional<Labelset> loadCachedFile(const std::filesystem::path& path);
|
||||
void saveCachedFile(const Labelset& labelset, const std::filesystem::path& path);
|
||||
|
||||
Labelset loadFileWithCache(std::filesystem::path path);
|
||||
|
||||
@@ -129,8 +129,8 @@ namespace color {
|
||||
ColorMap loadFile(std::filesystem::path path,
|
||||
std::optional<DataMapping> specs = std::nullopt);
|
||||
|
||||
std::optional<ColorMap> loadCachedFile(std::filesystem::path path);
|
||||
void saveCachedFile(const ColorMap& colorMap, std::filesystem::path path);
|
||||
std::optional<ColorMap> loadCachedFile(const std::filesystem::path& path);
|
||||
void saveCachedFile(const ColorMap& colorMap, const std::filesystem::path& path);
|
||||
|
||||
ColorMap loadFileWithCache(std::filesystem::path path);
|
||||
|
||||
|
||||
@@ -41,10 +41,15 @@ struct DataMapping {
|
||||
bool hasExcludeColumns() const;
|
||||
bool isExcludeColumn(std::string_view column) const;
|
||||
|
||||
bool checkIfAllProvidedColumnsExist(const std::vector<std::string>& columns) const;
|
||||
|
||||
std::optional<std::string> xColumnName;
|
||||
std::optional<std::string> yColumnName;
|
||||
std::optional<std::string> zColumnName;
|
||||
std::optional<std::string> nameColumn;
|
||||
std::optional<std::string> textureColumn;
|
||||
|
||||
std::optional<std::filesystem::path> textureMap;
|
||||
|
||||
std::optional<float> missingDataValue;
|
||||
|
||||
@@ -72,6 +77,8 @@ bool isColumnZ(const std::string& c, const std::optional<DataMapping>& mapping);
|
||||
|
||||
bool isNameColumn(const std::string& c, const std::optional<DataMapping>& mapping);
|
||||
|
||||
bool isTextureColumn(const std::string& c, const std::optional<DataMapping>& mapping);
|
||||
|
||||
} // namespace openspace::dataloader
|
||||
|
||||
#endif // __OPENSPACE_CORE___DATAMAPPING___H__
|
||||
|
||||
@@ -27,6 +27,7 @@
|
||||
|
||||
#include <openspace/documentation/documentation.h>
|
||||
#include <openspace/json.h>
|
||||
#include <openspace/properties/propertyowner.h>
|
||||
#include <ghoul/misc/exception.h>
|
||||
|
||||
namespace openspace::documentation {
|
||||
@@ -86,9 +87,16 @@ public:
|
||||
*/
|
||||
static DocumentationEngine& ref();
|
||||
|
||||
std::string generateJson() const;
|
||||
void writeDocumentation() const;
|
||||
|
||||
nlohmann::json generateJsonJson() const;
|
||||
nlohmann::json generateScriptEngineJson() const;
|
||||
nlohmann::json generateFactoryManagerJson() const;
|
||||
nlohmann::json generateKeybindingsJson() const;
|
||||
nlohmann::json generatePropertyOwnerJson(properties::PropertyOwner* owner) const;
|
||||
nlohmann::json generateLicenseGroupsJson() const;
|
||||
nlohmann::json generateLicenseListJson() const;
|
||||
nlohmann::json generateActionJson() const;
|
||||
nlohmann::json generateEventJson() const;
|
||||
|
||||
private:
|
||||
/// The list of all Documentation%s that are stored by the DocumentationEngine
|
||||
|
||||
@@ -954,7 +954,7 @@ public:
|
||||
* necessary to make the codegen work in all cases without complications there
|
||||
*/
|
||||
OrVerifier(const std::vector<std::variant<Verifier*,
|
||||
std::shared_ptr<Verifier>>> values);
|
||||
std::shared_ptr<Verifier>>>& values);
|
||||
|
||||
/**
|
||||
* Checks whether the \p dictionary contains the \p key and whether this key passes
|
||||
|
||||
@@ -24,7 +24,7 @@
|
||||
|
||||
#include <ghoul/misc/dictionary.h>
|
||||
|
||||
#include <ghoul/fmt.h>
|
||||
#include <ghoul/format.h>
|
||||
#include <ghoul/misc/assert.h>
|
||||
#include <iterator>
|
||||
#include <numeric>
|
||||
@@ -378,13 +378,13 @@ TestResult InListVerifier<T>::operator()(const ghoul::Dictionary& dict,
|
||||
std::string list = std::accumulate(
|
||||
values.begin() + 1,
|
||||
values.end(),
|
||||
fmt::format("{}", values.front()),
|
||||
std::format("{}", values.front()),
|
||||
[](std::string lhs, typename T::Type rhs) {
|
||||
return fmt::format("{}, {}", lhs, rhs);
|
||||
return std::format("{}, {}", lhs, rhs);
|
||||
}
|
||||
);
|
||||
o.explanation = fmt::format(
|
||||
"{} not in list of accepted values '{}'",
|
||||
o.explanation = std::format(
|
||||
"'{}' not in list of accepted values '{}'",
|
||||
key, list
|
||||
);
|
||||
r.offenses.push_back(o);
|
||||
|
||||
@@ -47,7 +47,7 @@ struct Configuration {
|
||||
|
||||
ghoul::Dictionary createDictionary();
|
||||
|
||||
std::string windowConfiguration = "${CONFIG}/single.xml";
|
||||
std::string windowConfiguration = "${CONFIG}/single.json";
|
||||
std::string asset;
|
||||
std::string profile;
|
||||
|
||||
|
||||
@@ -104,15 +104,14 @@ public:
|
||||
OverrideFile overrideFile = OverrideFile::Yes,
|
||||
FailOnError failOnError = FailOnError::No, unsigned int timeout_secs = 0,
|
||||
DownloadFinishedCallback finishedCallback = DownloadFinishedCallback(),
|
||||
DownloadProgressCallback progressCallback = DownloadProgressCallback()
|
||||
);
|
||||
DownloadProgressCallback progressCallback = DownloadProgressCallback()) const;
|
||||
|
||||
std::future<MemoryFile> fetchFile(const std::string& url,
|
||||
SuccessCallback successCallback = SuccessCallback(),
|
||||
ErrorCallback errorCallback = ErrorCallback());
|
||||
|
||||
void getFileExtension(const std::string& url,
|
||||
RequestFinishedCallback finishedCallback = RequestFinishedCallback());
|
||||
void fileExtension(const std::string& url,
|
||||
RequestFinishedCallback finishedCallback = RequestFinishedCallback()) const;
|
||||
|
||||
private:
|
||||
bool _useMultithreadedDownload;
|
||||
|
||||
@@ -96,12 +96,10 @@ public:
|
||||
void deinitializeGL();
|
||||
void preSynchronization();
|
||||
void postSynchronizationPreDraw();
|
||||
void viewportChanged();
|
||||
void render(const glm::mat4& sceneMatrix, const glm::mat4& viewMatrix,
|
||||
const glm::mat4& projectionMatrix);
|
||||
void drawOverlays();
|
||||
void postDraw();
|
||||
void resetPropertyChangeFlags();
|
||||
void keyboardCallback(Key key, KeyModifier mod, KeyAction action,
|
||||
IsGuiWindow isGuiWindow);
|
||||
void charCallback(unsigned int codepoint, KeyModifier modifier,
|
||||
@@ -118,7 +116,6 @@ public:
|
||||
void decode(std::vector<std::byte> data);
|
||||
|
||||
properties::Property::Visibility visibility() const;
|
||||
bool showHiddenSceneGraphNodes() const;
|
||||
void toggleShutdownMode();
|
||||
|
||||
Mode currentMode() const;
|
||||
@@ -135,7 +132,6 @@ public:
|
||||
AssetManager& assetManager();
|
||||
LoadingScreen* loadingScreen();
|
||||
|
||||
void writeDocumentation();
|
||||
void createUserDirectoriesIfNecessary();
|
||||
|
||||
/**
|
||||
@@ -149,11 +145,9 @@ private:
|
||||
void loadFonts();
|
||||
|
||||
void runGlobalCustomizationScripts();
|
||||
void resetPropertyChangeFlagsOfSubowners(openspace::properties::PropertyOwner* po);
|
||||
|
||||
properties::BoolProperty _printEvents;
|
||||
properties::OptionProperty _visibility;
|
||||
properties::BoolProperty _showHiddenSceneGraphNodes;
|
||||
properties::FloatProperty _fadeOnEnableDuration;
|
||||
properties::BoolProperty _disableAllMouseInputs;
|
||||
|
||||
|
||||
@@ -114,7 +114,7 @@ struct WindowDelegate {
|
||||
|
||||
uint64_t (*swapGroupFrameNumber)() = []() { return uint64_t(0); };
|
||||
|
||||
void (*setScreenshotFolder)(std::string) = [](std::string) {};
|
||||
void (*setScreenshotFolder)(std::filesystem::path) = [](std::filesystem::path) {};
|
||||
|
||||
void (*showStatistics)(bool) = [](bool) {};
|
||||
|
||||
@@ -122,8 +122,8 @@ struct WindowDelegate {
|
||||
|
||||
int (*currentNode)() = []() { return 0; };
|
||||
|
||||
glm::vec2 (*mousePositionViewportRelative)(glm::vec2 mousePosition) =
|
||||
[](glm::vec2) { return glm::vec2(0); };
|
||||
glm::vec2 (*mousePositionViewportRelative)(const glm::vec2& mousePosition) =
|
||||
[](const glm::vec2&) { return glm::vec2(0); };
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -113,7 +113,7 @@ public:
|
||||
*/
|
||||
void unregisterEventAction(events::Event::Type type,
|
||||
const std::string& identifier,
|
||||
std::optional<ghoul::Dictionary> filter = std::nullopt);
|
||||
const std::optional<ghoul::Dictionary>& filter = std::nullopt);
|
||||
|
||||
/**
|
||||
* Removing registration for a specific event identified by the \p identifier.
|
||||
@@ -138,6 +138,14 @@ public:
|
||||
*/
|
||||
std::vector<ActionInfo> registeredActions() const;
|
||||
|
||||
/**
|
||||
* Returns the list of all registered actions, grouped by their event type.
|
||||
*
|
||||
* \return The unordered map of all registered actions
|
||||
*/
|
||||
const std::unordered_map<events::Event::Type, std::vector<ActionInfo>>&
|
||||
eventActions() const;
|
||||
|
||||
/**
|
||||
* Enables the event identified by the \p identifier. If the event is already enabled,
|
||||
* this function does nothing.
|
||||
|
||||
@@ -58,7 +58,7 @@ public:
|
||||
* Returns true if any of the velocities are larger than zero, i.e. wether an
|
||||
* interaction happened.
|
||||
*/
|
||||
bool hasNonZeroVelocities(bool checkOnlyMovement = false);
|
||||
bool hasNonZeroVelocities(bool checkOnlyMovement = false) const;
|
||||
|
||||
protected:
|
||||
struct InteractionState {
|
||||
|
||||
@@ -59,7 +59,7 @@ void Interpolator<T>::setInterpolationTime(float interpolationTime) {
|
||||
template <typename T>
|
||||
void Interpolator<T>::step() {
|
||||
_t += _scaledDeltaTime;
|
||||
_t = glm::clamp(_t, 0.0f, 1.0f);
|
||||
_t = glm::clamp(_t, 0.f, 1.f);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
||||
@@ -88,14 +88,14 @@ public:
|
||||
void updateStateFromInput(
|
||||
const JoystickInputStates& joystickInputStates, double deltaTime);
|
||||
|
||||
void setAxisMapping(std::string joystickName, int axis, AxisType mapping,
|
||||
void setAxisMapping(const std::string& joystickName, int axis, AxisType mapping,
|
||||
AxisInvert shouldInvert = AxisInvert::No,
|
||||
JoystickType joystickType = JoystickType::JoystickLike,
|
||||
bool isSticky = false, AxisFlip shouldFlip = AxisFlip::No,
|
||||
double sensitivity = 0.0
|
||||
);
|
||||
|
||||
void setAxisMappingProperty(std::string joystickName, int axis,
|
||||
void setAxisMappingProperty(const std::string& joystickName, int axis,
|
||||
std::string propertyUri, float min = 0.f, float max = 1.f,
|
||||
AxisInvert shouldInvert = AxisInvert::No, bool isRemote = true
|
||||
);
|
||||
@@ -196,7 +196,7 @@ from_string(std::string_view string)
|
||||
if (string == "Pan Y") { return T::PanY; }
|
||||
if (string == "Property") { return T::Property; }
|
||||
|
||||
throw RuntimeError(fmt::format("Unknown axis type '{}'", string), "Joystick");
|
||||
throw RuntimeError(std::format("Unknown axis type '{}'", string), "Joystick");
|
||||
}
|
||||
|
||||
template <>
|
||||
@@ -220,7 +220,7 @@ from_string(std::string_view string)
|
||||
if (string == "JoystickLike") { return T::JoystickLike; }
|
||||
if (string == "TriggerLike") { return T::TriggerLike; }
|
||||
|
||||
throw RuntimeError(fmt::format("Unknown joystick type '{}'", string), "Joystick");
|
||||
throw RuntimeError(std::format("Unknown joystick type '{}'", string), "Joystick");
|
||||
}
|
||||
|
||||
} // namespace ghoul
|
||||
|
||||
@@ -25,10 +25,10 @@
|
||||
#ifndef __OPENSPACE_CORE___JOYSTICKINPUTSTATE___H__
|
||||
#define __OPENSPACE_CORE___JOYSTICKINPUTSTATE___H__
|
||||
|
||||
#include <ghoul/format.h>
|
||||
#include <ghoul/misc/assert.h>
|
||||
#include <ghoul/misc/exception.h>
|
||||
#include <ghoul/misc/stringconversion.h>
|
||||
#include <ghoul/fmt.h>
|
||||
#include <array>
|
||||
#include <memory>
|
||||
#include <string>
|
||||
@@ -150,7 +150,7 @@ constexpr openspace::interaction::JoystickAction from_string(std::string_view st
|
||||
if (string == "Repeat") { return openspace::interaction::JoystickAction::Repeat; }
|
||||
if (string == "Release") { return openspace::interaction::JoystickAction::Release; }
|
||||
|
||||
throw RuntimeError(fmt::format("Unknown action '{}'", string));
|
||||
throw RuntimeError(std::format("Unknown action '{}'", string));
|
||||
}
|
||||
|
||||
} // namespace ghoul
|
||||
|
||||
@@ -38,8 +38,6 @@ namespace openspace::interaction {
|
||||
|
||||
class KeybindingManager {
|
||||
public:
|
||||
KeybindingManager();
|
||||
|
||||
void resetKeyBindings();
|
||||
|
||||
void bindKey(Key key, KeyModifier modifier, std::string action);
|
||||
@@ -53,8 +51,6 @@ public:
|
||||
|
||||
void keyboardCallback(Key key, KeyModifier modifier, KeyAction action);
|
||||
|
||||
nlohmann::json generateJson() const;
|
||||
|
||||
const std::multimap<KeyWithModifier, std::string>& keyBindings() const;
|
||||
|
||||
private:
|
||||
|
||||
@@ -36,8 +36,8 @@ class MouseCameraStates : public CameraInteractionStates {
|
||||
public:
|
||||
MouseCameraStates(double sensitivity, double velocityScaleFactor);
|
||||
|
||||
void updateStateFromInput(const MouseInputState& mouseinputState,
|
||||
const KeyboardInputState& keyboardinputState, double deltaTime);
|
||||
void updateStateFromInput(const MouseInputState& mouseState,
|
||||
const KeyboardInputState& keyboardState, double deltaTime);
|
||||
|
||||
void setInvertMouseButton(bool value);
|
||||
|
||||
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
SessionRecording();
|
||||
SessionRecording(bool isGlobal);
|
||||
|
||||
~SessionRecording() override;
|
||||
~SessionRecording() override = default;
|
||||
|
||||
/**
|
||||
* Used to de-initialize the session recording feature. Any recording or playback
|
||||
@@ -282,9 +282,9 @@ public:
|
||||
* Used to trigger a save of a script to the recording file, but only if a recording
|
||||
* is currently in progress.
|
||||
*
|
||||
* \param scriptToSave String of the Lua command to be saved
|
||||
* \param script String of the Lua command to be saved
|
||||
*/
|
||||
void saveScriptKeyframeToTimeline(std::string scriptToSave);
|
||||
void saveScriptKeyframeToTimeline(std::string script);
|
||||
|
||||
/**
|
||||
* \return The Lua library that contains all Lua functions available to affect the
|
||||
@@ -305,7 +305,7 @@ public:
|
||||
*
|
||||
* \param callback Function handle for the callback
|
||||
*/
|
||||
void removeStateChangeCallback(CallbackHandle callback);
|
||||
void removeStateChangeCallback(CallbackHandle handle);
|
||||
|
||||
/**
|
||||
* Provides list of available playback files.
|
||||
@@ -338,7 +338,7 @@ public:
|
||||
* \return `true` if data read has no errors
|
||||
*/
|
||||
bool readCameraKeyframeAscii(Timestamps& times,
|
||||
datamessagestructures::CameraKeyframe& kf, std::string currentParsingLine,
|
||||
datamessagestructures::CameraKeyframe& kf, const std::string& currentParsingLine,
|
||||
int lineN);
|
||||
|
||||
/**
|
||||
@@ -365,7 +365,7 @@ public:
|
||||
* \return `true` if data read has no errors
|
||||
*/
|
||||
bool readTimeKeyframeAscii(Timestamps& times,
|
||||
datamessagestructures::TimeKeyframe& kf, std::string currentParsingLine,
|
||||
datamessagestructures::TimeKeyframe& kf, const std::string& currentParsingLine,
|
||||
int lineN);
|
||||
|
||||
/**
|
||||
@@ -394,7 +394,7 @@ public:
|
||||
* \return `true` if data read has no errors
|
||||
*/
|
||||
bool readScriptKeyframeAscii(Timestamps& times,
|
||||
datamessagestructures::ScriptMessage& kf, std::string currentParsingLine,
|
||||
datamessagestructures::ScriptMessage& kf, const std::string& currentParsingLine,
|
||||
int lineN);
|
||||
|
||||
/**
|
||||
@@ -482,7 +482,7 @@ public:
|
||||
* \param readLen_chars Number of characters to be read, which may be the expected
|
||||
* length of the header line, or an arbitrary number of characters within it
|
||||
*/
|
||||
static std::string readHeaderElement(std::ifstream& stream, size_t readLen_chars);
|
||||
static std::string readHeaderElement(std::ifstream& stream, size_t readLenChars);
|
||||
|
||||
/**
|
||||
* Reads header information from a session recording file.
|
||||
@@ -491,7 +491,7 @@ public:
|
||||
* \param readLen_chars Number of characters to be read, which may be the expected
|
||||
* length of the header line, or an arbitrary number of characters within it
|
||||
*/
|
||||
static std::string readHeaderElement(std::stringstream& stream, size_t readLen_chars);
|
||||
static std::string readHeaderElement(std::stringstream& stream, size_t readLenChars);
|
||||
|
||||
/**
|
||||
* Writes a header to a binary recording file buffer.
|
||||
@@ -520,7 +520,7 @@ public:
|
||||
* \param entry The ASCII string version of the keyframe (any type)
|
||||
* \param file `std::ofstream` object to write to
|
||||
*/
|
||||
static void saveKeyframeToFile(std::string entry, std::ofstream& file);
|
||||
static void saveKeyframeToFile(const std::string& entry, std::ofstream& file);
|
||||
|
||||
/**
|
||||
* Checks if a specified recording file ends with a particular file extension.
|
||||
@@ -528,7 +528,8 @@ public:
|
||||
* \param filename The name of the file to record to
|
||||
* \param extension The file extension to check for
|
||||
*/
|
||||
static bool hasFileExtension(std::string filename, std::string extension);
|
||||
static bool hasFileExtension(const std::string& filename,
|
||||
const std::string& extension);
|
||||
|
||||
/**
|
||||
* Converts file format of a session recording file to the current format version
|
||||
@@ -589,7 +590,8 @@ public:
|
||||
*
|
||||
* \return pathname of the converted version of the file
|
||||
*/
|
||||
std::string determineConversionOutFilename(const std::string filename, DataMode mode);
|
||||
std::string determineConversionOutFilename(const std::string& filename,
|
||||
DataMode mode);
|
||||
|
||||
protected:
|
||||
properties::BoolProperty _renderPlaybackInformation;
|
||||
@@ -612,7 +614,7 @@ protected:
|
||||
double _timestampPlaybackStarted_application = 0.0;
|
||||
double _timestampPlaybackStarted_simulation = 0.0;
|
||||
double _timestampApplicationStarted_simulation = 0.0;
|
||||
bool hasCameraChangedFromPrev(datamessagestructures::CameraKeyframe kfNew);
|
||||
bool hasCameraChangedFromPrev(const datamessagestructures::CameraKeyframe& kfNew);
|
||||
double appropriateTimestamp(Timestamps t3stamps);
|
||||
double equivalentSimulationTime(double timeOs, double timeRec, double timeSim);
|
||||
double equivalentApplicationTime(double timeOs, double timeRec, double timeSim);
|
||||
@@ -620,7 +622,7 @@ protected:
|
||||
void recordCurrentTimeRate();
|
||||
bool handleRecordingFile(std::string filenameIn);
|
||||
static bool isPath(std::string& filename);
|
||||
void removeTrailingPathSlashes(std::string& filename);
|
||||
void removeTrailingPathSlashes(std::string& filename) const;
|
||||
bool playbackCamera();
|
||||
bool playbackTimeChange();
|
||||
bool playbackScript();
|
||||
@@ -629,10 +631,10 @@ protected:
|
||||
void handlePlaybackEnd();
|
||||
|
||||
bool findFirstCameraKeyframeInTimeline();
|
||||
Timestamps generateCurrentTimestamp3(double keyframeTime);
|
||||
Timestamps generateCurrentTimestamp3(double keyframeTime) const;
|
||||
static void saveStringToFile(const std::string& s, unsigned char* kfBuffer,
|
||||
size_t& idx, std::ofstream& file);
|
||||
static void saveKeyframeToFileBinary(unsigned char* bufferSource, size_t size,
|
||||
static void saveKeyframeToFileBinary(unsigned char* buffer, size_t size,
|
||||
std::ofstream& file);
|
||||
|
||||
bool addKeyframe(Timestamps t3stamps,
|
||||
@@ -675,7 +677,6 @@ protected:
|
||||
bool isPropertyAllowedForBaseline(const std::string& propString);
|
||||
unsigned int findIndexOfLastCameraKeyframeInTimeline();
|
||||
bool doesTimelineEntryContainCamera(unsigned int index) const;
|
||||
bool doesStartWithSubstring(const std::string& s, const std::string& matchSubstr);
|
||||
void trimCommandsFromScriptIfFound(std::string& script);
|
||||
void replaceCommandsFromScriptIfFound(std::string& script);
|
||||
|
||||
@@ -689,20 +690,21 @@ protected:
|
||||
bool convertEntries(std::string& inFilename, std::stringstream& inStream,
|
||||
DataMode mode, int lineNum, std::ofstream& outFile);
|
||||
virtual bool convertCamera(std::stringstream& inStream, DataMode mode, int lineNum,
|
||||
std::string& inputLine, std::ofstream& outFile, unsigned char* buff);
|
||||
std::string& inputLine, std::ofstream& outFile, unsigned char* buffer);
|
||||
virtual bool convertTimeChange(std::stringstream& inStream, DataMode mode,
|
||||
int lineNum, std::string& inputLine, std::ofstream& outFile, unsigned char* buff);
|
||||
int lineNum, std::string& inputLine, std::ofstream& outFile,
|
||||
unsigned char* buffer);
|
||||
virtual bool convertScript(std::stringstream& inStream, DataMode mode, int lineNum,
|
||||
std::string& inputLine, std::ofstream& outFile, unsigned char* buff);
|
||||
DataMode readModeFromHeader(std::string filename);
|
||||
std::string& inputLine, std::ofstream& outFile, unsigned char* buffer);
|
||||
DataMode readModeFromHeader(const std::string& filename);
|
||||
void readPlaybackHeader_stream(std::stringstream& conversionInStream,
|
||||
std::string& version, DataMode& mode);
|
||||
void populateListofLoadedSceneGraphNodes();
|
||||
|
||||
void checkIfScriptUsesScenegraphNode(std::string s);
|
||||
bool checkForScenegraphNodeAccessScene(std::string& s);
|
||||
bool checkForScenegraphNodeAccessScene(const std::string& s);
|
||||
bool checkForScenegraphNodeAccessNav(std::string& navTerm);
|
||||
std::string extractScenegraphNodeFromScene(std::string& s);
|
||||
std::string extractScenegraphNodeFromScene(const std::string& s);
|
||||
bool checkIfInitialFocusNodeIsLoaded(unsigned int firstCamIndex);
|
||||
std::string isolateTermFromQuotes(std::string s);
|
||||
void eraseSpacesFromString(std::string& s);
|
||||
|
||||
@@ -51,7 +51,6 @@ private:
|
||||
void convertToAscii();
|
||||
void convertToBinary();
|
||||
void determineFormatType();
|
||||
std::string addFileSuffix(const std::string& filePath, const std::string& suffix);
|
||||
std::filesystem::path _inFilePath;
|
||||
std::filesystem::path _outFilePath;
|
||||
std::ifstream _iFile;
|
||||
|
||||
@@ -69,8 +69,8 @@ public:
|
||||
* \return true only if a new future keyframe is available to set camera pose
|
||||
*/
|
||||
bool updateCamera(Camera& camera, bool ignoreFutureKeyframes);
|
||||
static bool updateCamera(Camera* camera, const CameraPose prevPose,
|
||||
const CameraPose nextPose, double t, bool ignoreFutureKeyframes);
|
||||
static bool updateCamera(Camera* camera, const CameraPose& prevPose,
|
||||
const CameraPose& nextPose, double t, bool ignoreFutureKeyframes);
|
||||
|
||||
Timeline<CameraPose>& timeline();
|
||||
void addKeyframe(double timestamp, KeyframeNavigator::CameraPose pose);
|
||||
|
||||
@@ -143,9 +143,9 @@ public:
|
||||
NavigationState navigationState(const SceneGraphNode& referenceFrame) const;
|
||||
|
||||
void saveNavigationState(const std::filesystem::path& filepath,
|
||||
const std::string& referenceFrameIdentifier);
|
||||
const std::string& referenceFrameIdentifier) const;
|
||||
|
||||
void loadNavigationState(const std::string& filepath);
|
||||
void loadNavigationState(const std::string& filepath, bool useTimeStamp);
|
||||
|
||||
/**
|
||||
* Set camera state from a provided navigation state next frame. The actual position
|
||||
|
||||
@@ -41,7 +41,8 @@ struct NavigationState {
|
||||
explicit NavigationState(const nlohmann::json& json);
|
||||
NavigationState(std::string anchor, std::string aim, std::string referenceFrame,
|
||||
glm::dvec3 position, std::optional<glm::dvec3> up = std::nullopt,
|
||||
double yaw = 0.0, double pitch = 0.0);
|
||||
double yaw = 0.0, double pitch = 0.0,
|
||||
std::optional<double> timestamp = std::nullopt);
|
||||
|
||||
CameraPose cameraPose() const;
|
||||
ghoul::Dictionary dictionary() const;
|
||||
@@ -55,6 +56,8 @@ struct NavigationState {
|
||||
std::optional<glm::dvec3> up;
|
||||
double yaw = 0.0;
|
||||
double pitch = 0.0;
|
||||
|
||||
std::optional<double> timestamp;
|
||||
};
|
||||
|
||||
} // namespace openspace::interaction
|
||||
|
||||
@@ -274,8 +274,8 @@ private:
|
||||
* from the global to the current total rotation so that
|
||||
* `cameraRotation = globalRotation * localRotation`.
|
||||
*/
|
||||
CameraRotationDecomposition decomposeCameraRotationSurface(const CameraPose pose,
|
||||
const SceneGraphNode& reference);
|
||||
CameraRotationDecomposition decomposeCameraRotationSurface(
|
||||
const CameraPose& cameraPose, const SceneGraphNode& reference);
|
||||
|
||||
/**
|
||||
* Decomposes the camera's rotation in to a global and a local rotation defined by
|
||||
@@ -285,22 +285,23 @@ private:
|
||||
* The local rotation defines the differential from the global to the current total
|
||||
* rotation so that `cameraRotation = globalRotation * localRotation`.
|
||||
*/
|
||||
CameraRotationDecomposition decomposeCameraRotation(const CameraPose pose,
|
||||
glm::dvec3 reference);
|
||||
CameraRotationDecomposition decomposeCameraRotation(const CameraPose& cameraPose,
|
||||
const glm::dvec3& reference);
|
||||
|
||||
/**
|
||||
* Composes a pair of global and local rotations into a quaternion that can be used as
|
||||
* the world rotation for a camera.
|
||||
*/
|
||||
glm::dquat composeCameraRotation(const CameraRotationDecomposition& composition);
|
||||
glm::dquat composeCameraRotation(
|
||||
const CameraRotationDecomposition& decomposition) const;
|
||||
|
||||
/**
|
||||
* Moves and rotates the camera around the anchor node in order to maintain the screen
|
||||
* space position of the aim node. Also interpolates to the aim node, when retargeting
|
||||
* the aim.
|
||||
*/
|
||||
CameraPose followAim(CameraPose pose, glm::dvec3 cameraToAnchor,
|
||||
Displacement anchorToAim);
|
||||
CameraPose followAim(CameraPose pose, const glm::dvec3& cameraToAnchor,
|
||||
const Displacement& anchorToAim);
|
||||
|
||||
/**
|
||||
* Perform a camera roll on the local camera rotation.
|
||||
@@ -325,8 +326,8 @@ private:
|
||||
glm::dquat interpolateLocalRotation(double deltaTime,
|
||||
const glm::dquat& localCameraRotation);
|
||||
|
||||
Displacement interpolateRetargetAim(double deltaTime, CameraPose pose,
|
||||
glm::dvec3 cameraToAnchor, Displacement anchorToAim);
|
||||
Displacement interpolateRetargetAim(double deltaTime, const CameraPose& pose,
|
||||
const glm::dvec3& prevCameraToAnchor, Displacement anchorToAim);
|
||||
|
||||
double interpolateCameraToSurfaceDistance(double deltaTime, double currentDistance,
|
||||
double targetDistance);
|
||||
@@ -354,12 +355,12 @@ private:
|
||||
|
||||
/**
|
||||
* Adds rotation to the camera position so that it follows the rotation of the anchor
|
||||
* node defined by the differential \p anchorNodeRotationDiff.
|
||||
* node defined by the differential \p focusNodeRotationDiff.
|
||||
*
|
||||
* \return A position updated with the rotation defined by \p anchorNodeRotationDiff
|
||||
*/
|
||||
glm::dvec3 followAnchorNodeRotation(const glm::dvec3& cameraPosition,
|
||||
const glm::dvec3& objectPosition, const glm::dquat& anchorNodeRotationDiff) const;
|
||||
const glm::dvec3& objectPosition, const glm::dquat& focusNodeRotationDiff) const;
|
||||
|
||||
/**
|
||||
* Updates the global rotation so that it points towards the anchor node.
|
||||
@@ -367,7 +368,7 @@ private:
|
||||
* \return A global rotation quaternion defining a rotation towards the anchor node
|
||||
*/
|
||||
glm::dquat rotateGlobally(const glm::dquat& globalCameraRotation,
|
||||
const glm::dquat& aimNodeRotationDiff,
|
||||
const glm::dquat& focusNodeRotationDiff,
|
||||
const SurfacePositionHandle& positionHandle) const;
|
||||
|
||||
/**
|
||||
@@ -410,12 +411,6 @@ private:
|
||||
glm::dvec3 cameraToSurfaceVector(const glm::dvec3& cameraPos,
|
||||
const glm::dvec3& centerPos, const SurfacePositionHandle& posHandle);
|
||||
|
||||
/**
|
||||
* Calculates a SurfacePositionHandle given a camera position in world space.
|
||||
*/
|
||||
SurfacePositionHandle calculateSurfacePositionHandle(const SceneGraphNode& node,
|
||||
const glm::dvec3& cameraPositionWorldSpace) const;
|
||||
|
||||
void resetIdleBehavior();
|
||||
|
||||
/**
|
||||
@@ -451,7 +446,7 @@ private:
|
||||
* \param position The position of the camera. Will be changed by the function
|
||||
* \param globalRotation The camera's global rotation. Will be changed by the function
|
||||
*/
|
||||
void orbitAroundAxis(const glm::dvec3 axis, double angle, glm::dvec3& position,
|
||||
void orbitAroundAxis(const glm::dvec3& axis, double angle, glm::dvec3& position,
|
||||
glm::dquat& globalRotation);
|
||||
|
||||
double rotationSpeedScaleFromCameraHeight(const glm::dvec3& cameraPosition,
|
||||
|
||||
@@ -36,11 +36,11 @@ class Waypoint;
|
||||
class PathCurve {
|
||||
public:
|
||||
struct InsufficientPrecisionError : public ghoul::RuntimeError {
|
||||
explicit InsufficientPrecisionError(std::string msg);
|
||||
explicit InsufficientPrecisionError(std::string error);
|
||||
};
|
||||
|
||||
struct TooShortPathError : public ghoul::RuntimeError {
|
||||
explicit TooShortPathError(std::string msg);
|
||||
explicit TooShortPathError(std::string error);
|
||||
};
|
||||
|
||||
virtual ~PathCurve() = 0;
|
||||
|
||||
@@ -105,7 +105,7 @@ private:
|
||||
*/
|
||||
void findRelevantNodes();
|
||||
|
||||
void removeRollRotation(CameraPose& pose);
|
||||
void removeRollRotation(CameraPose& pose) const;
|
||||
|
||||
std::unique_ptr<Path> _currentPath = nullptr;
|
||||
bool _isPlaying = false;
|
||||
|
||||
@@ -39,7 +39,7 @@ struct NavigationState;
|
||||
class Waypoint {
|
||||
public:
|
||||
Waypoint() = default;
|
||||
Waypoint(const glm::dvec3& pos, const glm::dquat& rot, const std::string& ref);
|
||||
Waypoint(const glm::dvec3& pos, const glm::dquat& rot, std::string ref);
|
||||
explicit Waypoint(const NavigationState& ns);
|
||||
|
||||
CameraPose pose() const;
|
||||
@@ -92,7 +92,7 @@ struct NodeCameraStateSpec {
|
||||
* \return The computed WayPoint
|
||||
*/
|
||||
Waypoint computeWaypointFromNodeInfo(const NodeCameraStateSpec& spec,
|
||||
std::optional<Waypoint> startPoint = std::nullopt, bool useLinear = false);
|
||||
const std::optional<Waypoint>& startPoint = std::nullopt, bool useLinear = false);
|
||||
|
||||
} // namespace openspace::interaction
|
||||
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#ifndef __OPENSPACE_CORE___MESSAGESTRUCTURES___H__
|
||||
#define __OPENSPACE_CORE___MESSAGESTRUCTURES___H__
|
||||
|
||||
#include <ghoul/fmt.h>
|
||||
#include <ghoul/format.h>
|
||||
#include <ghoul/glm.h>
|
||||
#include <ghoul/logging/logmanager.h>
|
||||
#include <ghoul/misc/stringhelper.h>
|
||||
@@ -50,8 +50,8 @@ struct CameraKeyframe {
|
||||
CameraKeyframe(const std::vector<char>& buffer) {
|
||||
deserialize(buffer);
|
||||
}
|
||||
CameraKeyframe(glm::dvec3&& pos, glm::dquat&& rot, std::string&& focusNode,
|
||||
bool&& followNodeRot, float&& scale)
|
||||
CameraKeyframe(glm::dvec3 pos, glm::dquat rot, std::string focusNode,
|
||||
bool followNodeRot, float scale)
|
||||
: _position(pos)
|
||||
, _rotation(rot)
|
||||
, _followNodeRotation(followNodeRot)
|
||||
@@ -408,7 +408,7 @@ struct ScriptMessage {
|
||||
if (buffer.size() != (sizeof(uint32_t) + len)) {
|
||||
LERRORC(
|
||||
"ParallelPeer",
|
||||
fmt::format(
|
||||
std::format(
|
||||
"Received buffer with wrong size. Expected {} got {}",
|
||||
len, buffer.size()
|
||||
)
|
||||
|
||||
@@ -61,7 +61,7 @@ public:
|
||||
|
||||
struct DataMessage {
|
||||
DataMessage() = default;
|
||||
DataMessage(datamessagestructures::Type t, double timestamp, std::vector<char> c);
|
||||
DataMessage(datamessagestructures::Type t, double time, std::vector<char> c);
|
||||
|
||||
datamessagestructures::Type type;
|
||||
double timestamp;
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
|
||||
class ConnectionLostError : public ghoul::RuntimeError {
|
||||
public:
|
||||
explicit ConnectionLostError(bool shouldLogError = true);
|
||||
explicit ConnectionLostError(bool shouldLogError_ = true);
|
||||
|
||||
bool shouldLogError;
|
||||
};
|
||||
|
||||
@@ -110,7 +110,7 @@ void NumericalProperty<T>::setExponent(float exponent) {
|
||||
if (!isValidRange(_minimumValue, _maximumValue)) {
|
||||
LWARNINGC(
|
||||
"NumericalProperty: setExponent",
|
||||
fmt::format(
|
||||
std::format(
|
||||
"Setting exponent for properties with negative values in "
|
||||
"[min, max] range is not yet supported. Property: {}",
|
||||
this->fullyQualifiedIdentifier()
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#ifndef __OPENSPACE_CORE___PROPERTYOWNER___H__
|
||||
#define __OPENSPACE_CORE___PROPERTYOWNER___H__
|
||||
|
||||
#include <openspace/json.h>
|
||||
#include <map>
|
||||
#include <string>
|
||||
#include <vector>
|
||||
@@ -295,11 +294,6 @@ public:
|
||||
*/
|
||||
void removeTag(const std::string& tag);
|
||||
|
||||
/**
|
||||
* Generate JSON for documentation.
|
||||
*/
|
||||
nlohmann::json generateJson() const;
|
||||
|
||||
protected:
|
||||
/// The unique identifier of this PropertyOwner
|
||||
std::string _identifier;
|
||||
|
||||
@@ -122,7 +122,7 @@ protected:
|
||||
|
||||
private:
|
||||
void sortOptions();
|
||||
bool removeInvalidKeys(std::set<std::string>& keys);
|
||||
bool removeInvalidKeys(std::set<std::string>& keys) const;
|
||||
|
||||
std::string generateAdditionalJsonDescription() const override;
|
||||
|
||||
|
||||
@@ -22,8 +22,8 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___COLORMAPCOMPONENT___H__
|
||||
#define __OPENSPACE_CORE___COLORMAPCOMPONENT___H__
|
||||
#ifndef __OPENSPACE_CORE___COLORMAPPINGCOMPONENT___H__
|
||||
#define __OPENSPACE_CORE___COLORMAPPINGCOMPONENT___H__
|
||||
|
||||
#include <openspace/properties/propertyowner.h>
|
||||
|
||||
@@ -74,7 +74,7 @@ public:
|
||||
|
||||
static documentation::Documentation Documentation();
|
||||
|
||||
glm::vec4 colorFromColorMap(float value) const;
|
||||
glm::vec4 colorFromColorMap(float valueToColorFrom) const;
|
||||
|
||||
properties::BoolProperty enabled;
|
||||
properties::BoolProperty invert;
|
||||
@@ -120,4 +120,4 @@ private:
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_CORE___COLORMAPCOMPONENT___H__
|
||||
#endif // __OPENSPACE_CORE___COLORMAPPINGCOMPONENT___H__
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
static documentation::Documentation Documentation();
|
||||
|
||||
static std::unique_ptr<DashboardItem> createFromDictionary(
|
||||
ghoul::Dictionary dictionary
|
||||
const ghoul::Dictionary& dictionary
|
||||
);
|
||||
|
||||
DashboardItem(const ghoul::Dictionary& dictionary);
|
||||
|
||||
@@ -156,9 +156,7 @@ public:
|
||||
void setResolution(glm::ivec2 res);
|
||||
void setHDRExposure(float hdrExposure);
|
||||
void setGamma(float gamma);
|
||||
void setHue(float hue);
|
||||
void setValue(float value);
|
||||
void setSaturation(float sat);
|
||||
void setHueValueSaturation(float hue, float value, float saturation);
|
||||
|
||||
void enableFXAA(bool enable);
|
||||
void setDisableHDR(bool disable);
|
||||
@@ -193,7 +191,7 @@ private:
|
||||
void resolveMSAA(float blackoutFactor);
|
||||
void applyTMO(float blackoutFactor, const glm::ivec4& viewport);
|
||||
void applyFXAA(const glm::ivec4& viewport);
|
||||
void updateDownscaleTextures();
|
||||
void updateDownscaleTextures() const;
|
||||
void updateExitVolumeTextures();
|
||||
void writeDownscaledVolume(const glm::ivec4& viewport);
|
||||
|
||||
|
||||
@@ -146,12 +146,12 @@ VertexXYZ convertToXYZ(const Vertex& v);
|
||||
std::vector<VertexXYZ> convert(std::vector<Vertex> v);
|
||||
|
||||
std::vector<Vertex> createRing(int nSegments, float radius,
|
||||
glm::vec4 colors = glm::vec4(1.f));
|
||||
const glm::vec4& colors = glm::vec4(1.f));
|
||||
|
||||
std::vector<VertexXYZ> createRingXYZ(int nSegments, float radius);
|
||||
|
||||
VertexIndexListCombo<Vertex>
|
||||
createSphere(int nSegments, glm::vec3 radii, glm::vec4 colors = glm::vec4(1.f));
|
||||
createSphere(int nSegments, glm::vec3 radii, const glm::vec4& colors = glm::vec4(1.f));
|
||||
|
||||
VertexIndexListCombo<VertexXYZNormal> createCylinder(unsigned int nSegments,
|
||||
float radius, float height);
|
||||
|
||||
@@ -46,7 +46,7 @@ namespace openspace {
|
||||
class LuaConsole : public properties::PropertyOwner {
|
||||
public:
|
||||
LuaConsole();
|
||||
~LuaConsole() override;
|
||||
~LuaConsole() override = default;
|
||||
|
||||
void initialize();
|
||||
void deinitialize();
|
||||
@@ -62,8 +62,7 @@ public:
|
||||
|
||||
private:
|
||||
void parallelConnectionChanged(const ParallelConnection::Status& status);
|
||||
|
||||
void addToCommand(std::string c);
|
||||
void addToCommand(const std::string& c);
|
||||
|
||||
properties::BoolProperty _isVisible;
|
||||
properties::BoolProperty _shouldBeSynchronized;
|
||||
|
||||
@@ -71,7 +71,7 @@ public:
|
||||
};
|
||||
|
||||
static ghoul::mm_unique_ptr<Renderable> createFromDictionary(
|
||||
ghoul::Dictionary dictionary);
|
||||
const ghoul::Dictionary& dictionary);
|
||||
|
||||
Renderable(const ghoul::Dictionary& dictionary,
|
||||
RenderableSettings settings = RenderableSettings());
|
||||
@@ -175,7 +175,7 @@ protected:
|
||||
* \return The resulting model view transformation matrix in double precision
|
||||
*/
|
||||
glm::dmat4 calcModelViewTransform(const RenderData& data,
|
||||
std::optional<glm::dmat4> modelTransform = std::nullopt) const;
|
||||
const std::optional<glm::dmat4>& modelTransform = std::nullopt) const;
|
||||
|
||||
/**
|
||||
* Calculates the model view projection transformation matrix with the given data and
|
||||
@@ -189,7 +189,7 @@ protected:
|
||||
* precision
|
||||
*/
|
||||
glm::dmat4 calcModelViewProjectionTransform(const RenderData& data,
|
||||
std::optional<glm::dmat4> modelTransform = std::nullopt) const;
|
||||
const std::optional<glm::dmat4>& modelTransform = std::nullopt) const;
|
||||
|
||||
/**
|
||||
* Calculates the model, model view, and the model view projection transformation
|
||||
|
||||
@@ -103,11 +103,12 @@ public:
|
||||
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject> buildRenderProgram(
|
||||
const std::string& name, const std::filesystem::path& vsPath,
|
||||
std::filesystem::path fsPath, ghoul::Dictionary data = ghoul::Dictionary());
|
||||
const std::filesystem::path& fsPath,
|
||||
ghoul::Dictionary data = ghoul::Dictionary());
|
||||
|
||||
std::unique_ptr<ghoul::opengl::ProgramObject> buildRenderProgram(
|
||||
const std::string& name, const std::filesystem::path& vsPath,
|
||||
std::filesystem::path fsPath, const std::filesystem::path& csPath,
|
||||
const std::filesystem::path& fsPath, const std::filesystem::path& csPath,
|
||||
ghoul::Dictionary data = ghoul::Dictionary());
|
||||
|
||||
void removeRenderProgram(ghoul::opengl::ProgramObject* program);
|
||||
@@ -164,7 +165,7 @@ private:
|
||||
void renderVersionInformation();
|
||||
void renderCameraInformation();
|
||||
void renderShutdownInformation(float timer, float fullTime);
|
||||
void renderDashboard();
|
||||
void renderDashboard() const;
|
||||
float combinedBlackoutFactor() const;
|
||||
|
||||
Camera* _camera = nullptr;
|
||||
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
glm::vec2 screenSpaceDimensions();
|
||||
glm::vec2 upperRightCornerScreenSpace();
|
||||
glm::vec2 lowerLeftCornerScreenSpace();
|
||||
bool isIntersecting(glm::vec2 coord);
|
||||
bool isIntersecting(const glm::vec2& coord);
|
||||
void translate(glm::vec2 translation, glm::vec2 position);
|
||||
void setCartesianPosition(const glm::vec3& position);
|
||||
void setRaeFromCartesianPosition(const glm::vec3& position);
|
||||
@@ -102,13 +102,13 @@ protected:
|
||||
glm::vec3 raeToCartesian(const glm::vec3& rae) const;
|
||||
glm::vec3 cartesianToRae(const glm::vec3& cartesian) const;
|
||||
|
||||
void draw(glm::mat4 modelTransform, float blackoutFactor);
|
||||
void draw(const glm::mat4& modelTransform, float blackoutFactor);
|
||||
|
||||
virtual void bindTexture() = 0;
|
||||
virtual void unbindTexture();
|
||||
|
||||
glm::vec3 sphericalToRae(glm::vec3 spherical) const;
|
||||
glm::vec3 raeToSpherical(glm::vec3 rae) const;
|
||||
glm::vec3 sphericalToRae(const glm::vec3& spherical) const;
|
||||
glm::vec3 raeToSpherical(const glm::vec3& rae) const;
|
||||
glm::vec3 cartesianToSpherical(const glm::vec3& cartesian) const;
|
||||
glm::vec3 sphericalToCartesian(glm::vec3 spherical) const;
|
||||
glm::vec3 sanitizeSphericalCoordinates(glm::vec3 spherical) const;
|
||||
|
||||
@@ -136,15 +136,11 @@ public:
|
||||
float downscaleRender() const;
|
||||
|
||||
private:
|
||||
/**
|
||||
* Maximum number of integration steps to be executed by the volume integrator.
|
||||
*/
|
||||
/// Maximum number of integration steps to be executed by the volume integrator
|
||||
int _rayCastMaxSteps = 1000;
|
||||
|
||||
/**
|
||||
* Enable and set the downscale rendering of the volume. Used to improve performance.
|
||||
*/
|
||||
float _downscaleRenderConst = 1.0f;
|
||||
/// Enable and set the downscale rendering of the volume. Used to improve performance
|
||||
float _downscaleRenderConst = 1.f;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
@@ -215,14 +215,14 @@ public:
|
||||
void deinitialize();
|
||||
|
||||
/**
|
||||
* Marks the passed \p child as being required by this Asset. If the \p child is
|
||||
* already required by this asset, this function does nothing.
|
||||
* Marks the passed \p dependency as being required by this Asset. If the
|
||||
* \p dependency is already required by this asset, this function does nothing.
|
||||
*
|
||||
* \param child The asset that is required by this asset
|
||||
* \param dependency The asset that is required by this asset
|
||||
*
|
||||
* \pre \p child must not be nullptr
|
||||
* \pre \p dependency must not be nullptr
|
||||
*/
|
||||
void require(Asset* child);
|
||||
void require(Asset* dependency);
|
||||
|
||||
/**
|
||||
* Returns `true` if the loading of the Asset has failed in any way so that
|
||||
|
||||
@@ -83,7 +83,7 @@ public:
|
||||
*/
|
||||
void update();
|
||||
|
||||
scripting::LuaLibrary luaLibrary();
|
||||
static scripting::LuaLibrary luaLibrary();
|
||||
|
||||
/**
|
||||
* Returns all assets that have been loaded by the AssetManager. The order of the
|
||||
|
||||
@@ -46,7 +46,7 @@ public:
|
||||
struct ParsingError : public ghoul::RuntimeError {
|
||||
enum class Severity { Info, Warning, Error };
|
||||
|
||||
explicit ParsingError(Severity severity, std::string msg);
|
||||
explicit ParsingError(Severity severity_, std::string msg);
|
||||
|
||||
Severity severity;
|
||||
};
|
||||
|
||||
@@ -241,7 +241,7 @@ public:
|
||||
* \return Vector of Property objs containing property names that matched the regex
|
||||
*/
|
||||
std::vector<properties::Property*> propertiesMatchingRegex(
|
||||
std::string propertyString);
|
||||
const std::string& propertyString);
|
||||
|
||||
/**
|
||||
* Returns a list of all unique tags that are used in the currently loaded scene.
|
||||
@@ -305,7 +305,6 @@ private:
|
||||
* Update dependencies.
|
||||
*/
|
||||
void updateNodeRegistry();
|
||||
std::chrono::steady_clock::time_point currentTimeForInterpolation();
|
||||
void sortTopologically();
|
||||
|
||||
std::unique_ptr<Camera> _camera;
|
||||
@@ -313,7 +312,7 @@ private:
|
||||
std::vector<SceneGraphNode*> _circularNodes;
|
||||
std::unordered_map<std::string, SceneGraphNode*> _nodesByIdentifier;
|
||||
bool _dirtyNodeRegistry = false;
|
||||
SceneGraphNode _rootDummy;
|
||||
SceneGraphNode _rootNode;
|
||||
std::unique_ptr<SceneInitializer> _initializer;
|
||||
std::string _profilePropertyName;
|
||||
bool _valueIsTable = false;
|
||||
|
||||
@@ -74,7 +74,6 @@ public:
|
||||
|
||||
BooleanType(UpdateScene);
|
||||
|
||||
static constexpr const char* RootNodeIdentifier = "Root";
|
||||
static constexpr std::string_view KeyIdentifier = "Identifier";
|
||||
static constexpr std::string_view KeyParentName = "Parent";
|
||||
static constexpr std::string_view KeyDependencies = "Dependencies";
|
||||
@@ -141,7 +140,7 @@ public:
|
||||
|
||||
bool supportsDirectInteraction() const;
|
||||
|
||||
SceneGraphNode* childNode(const std::string& identifier);
|
||||
SceneGraphNode* childNode(const std::string& id);
|
||||
|
||||
const Renderable* renderable() const;
|
||||
Renderable* renderable();
|
||||
@@ -156,7 +155,7 @@ private:
|
||||
glm::dmat3 calculateWorldRotation() const;
|
||||
glm::dvec3 calculateWorldScale() const;
|
||||
void computeScreenSpaceData(RenderData& newData);
|
||||
void renderDebugSphere(const Camera& camera, double size, glm::vec4 color);
|
||||
void renderDebugSphere(const Camera& camera, double size, const glm::vec4& color);
|
||||
|
||||
std::atomic<State> _state = State::Loaded;
|
||||
std::vector<ghoul::mm_unique_ptr<SceneGraphNode>> _children;
|
||||
|
||||
@@ -1,42 +0,0 @@
|
||||
/*****************************************************************************************
|
||||
* *
|
||||
* OpenSpace *
|
||||
* *
|
||||
* Copyright (c) 2014-2024 *
|
||||
* *
|
||||
* 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 *
|
||||
* without restriction, including without limitation the rights to use, copy, modify, *
|
||||
* merge, publish, distribute, sublicense, and/or sell copies of the Software, and to *
|
||||
* permit persons to whom the Software is furnished to do so, subject to the following *
|
||||
* conditions: *
|
||||
* *
|
||||
* The above copyright notice and this permission notice shall be included in all copies *
|
||||
* or substantial portions of the Software. *
|
||||
* *
|
||||
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, *
|
||||
* INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A *
|
||||
* PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT *
|
||||
* HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF *
|
||||
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#ifndef __OPENSPACE_CORE___SCENELICENSEWRITER___H__
|
||||
#define __OPENSPACE_CORE___SCENELICENSEWRITER___H__
|
||||
|
||||
#include <openspace/json.h>
|
||||
#include <vector>
|
||||
|
||||
namespace openspace {
|
||||
|
||||
class SceneLicenseWriter {
|
||||
public:
|
||||
SceneLicenseWriter();
|
||||
nlohmann::json generateJsonList() const;
|
||||
nlohmann::json generateJsonGroupedByLicense() const;
|
||||
};
|
||||
|
||||
} // namespace openspace
|
||||
|
||||
#endif // __OPENSPACE_CORE___SCENELICENSEWRITER___H__
|
||||
@@ -27,7 +27,6 @@
|
||||
|
||||
#include <openspace/util/syncable.h>
|
||||
#include <openspace/scripting/lualibrary.h>
|
||||
#include <openspace/json.h>
|
||||
#include <ghoul/lua/luastate.h>
|
||||
#include <ghoul/misc/boolean.h>
|
||||
#include <filesystem>
|
||||
@@ -84,7 +83,8 @@ public:
|
||||
void addLibrary(LuaLibrary library);
|
||||
bool hasLibrary(const std::string& name);
|
||||
|
||||
bool runScript(const std::string& script, ScriptCallback callback = ScriptCallback());
|
||||
bool runScript(const std::string& script,
|
||||
const ScriptCallback& callback = ScriptCallback());
|
||||
bool runScriptFile(const std::filesystem::path& filename);
|
||||
|
||||
virtual void preSync(bool isMaster) override;
|
||||
@@ -93,11 +93,11 @@ public:
|
||||
virtual void postSync(bool isMaster) override;
|
||||
|
||||
void queueScript(std::string script, ShouldBeSynchronized shouldBeSynchronized,
|
||||
ShouldSendToRemote shouldSendToRemote, ScriptCallback cb = ScriptCallback());
|
||||
ShouldSendToRemote shouldSendToRemote,
|
||||
ScriptCallback callback = ScriptCallback());
|
||||
|
||||
std::vector<std::string> allLuaFunctions() const;
|
||||
|
||||
nlohmann::json generateJson() const;
|
||||
const std::vector<LuaLibrary>& allLuaLibraries() const;
|
||||
|
||||
private:
|
||||
BooleanType(Replace);
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
void render();
|
||||
|
||||
void setBlockSize(glm::vec3 size);
|
||||
void setPlane(glm::vec3 normal, float distance);
|
||||
void setPlane(const glm::vec3& normal, float distance);
|
||||
|
||||
private:
|
||||
void updateVertices();
|
||||
|
||||
@@ -37,7 +37,7 @@ public:
|
||||
~BoxGeometry();
|
||||
|
||||
bool initialize();
|
||||
void render();
|
||||
void render() const;
|
||||
|
||||
GLuint _vaoId = 0;
|
||||
GLuint _vBufferId = 0;
|
||||
|
||||
@@ -45,8 +45,8 @@ namespace openspace::collision {
|
||||
* \return True if the line between \p p1 and \p p2 intersects the sphere given by
|
||||
* \p r and \p center, and false otherwise
|
||||
*/
|
||||
bool lineSphereIntersection(glm::dvec3 p1, glm::dvec3 p2, glm::dvec3 center,
|
||||
double r, glm::dvec3& intersectionPoint);
|
||||
bool lineSphereIntersection(const glm::dvec3& p1, const glm::dvec3& p2,
|
||||
const glm::dvec3& center, double r, glm::dvec3& intersectionPoint);
|
||||
|
||||
/**
|
||||
* Check if the point \p p is inside of the sphere defined by radius \p r and center
|
||||
|
||||
@@ -218,7 +218,7 @@ constexpr DistanceUnit distanceUnitFromString(std::string_view unitName) {
|
||||
found = i;
|
||||
break;
|
||||
}
|
||||
++i;
|
||||
i++;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
@@ -227,7 +227,7 @@ constexpr DistanceUnit distanceUnitFromString(std::string_view unitName) {
|
||||
found = i;
|
||||
break;
|
||||
}
|
||||
++i;
|
||||
i++;
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -25,7 +25,6 @@
|
||||
#ifndef __OPENSPACE_CORE___FACTORYMANAGER___H__
|
||||
#define __OPENSPACE_CORE___FACTORYMANAGER___H__
|
||||
|
||||
#include <openspace/json.h>
|
||||
#include <ghoul/misc/exception.h>
|
||||
#include <ghoul/misc/templatefactory.h>
|
||||
#include <memory>
|
||||
@@ -39,6 +38,11 @@ namespace openspace {
|
||||
*/
|
||||
class FactoryManager {
|
||||
public:
|
||||
struct FactoryInfo {
|
||||
std::unique_ptr<ghoul::TemplateFactoryBase> factory;
|
||||
std::string name;
|
||||
};
|
||||
|
||||
/**
|
||||
* This exception is thrown if the ghoul::TemplateFactory could not be found in the
|
||||
* #factory method.
|
||||
@@ -97,7 +101,7 @@ public:
|
||||
*
|
||||
* \tparam Factory The type for which a factory should be created and added
|
||||
* \param name A user-readable name for the registered factory
|
||||
* *
|
||||
*
|
||||
* \pre \p name must not be empty
|
||||
*/
|
||||
template <typename T>
|
||||
@@ -117,16 +121,12 @@ public:
|
||||
template <class T>
|
||||
ghoul::TemplateFactory<T>* factory() const;
|
||||
|
||||
nlohmann::json generateJson() const;
|
||||
const std::vector<FactoryInfo>& factories() const;
|
||||
|
||||
private:
|
||||
/// Singleton member for the Factory Manager
|
||||
static FactoryManager* _manager;
|
||||
|
||||
struct FactoryInfo {
|
||||
std::unique_ptr<ghoul::TemplateFactoryBase> factory;
|
||||
std::string name;
|
||||
};
|
||||
std::vector<FactoryInfo> _factories;
|
||||
};
|
||||
|
||||
|
||||
@@ -51,7 +51,7 @@ public:
|
||||
* \param repeat How many times you want to insert it
|
||||
* \return Returns `true` if succesful insertion, otherwise return `false`
|
||||
*/
|
||||
bool add(float value, float repeat = 1.0f);
|
||||
bool add(float value, float repeat = 1.f);
|
||||
bool add(const Histogram& histogram);
|
||||
bool addRectangle(float lowBin, float highBin, float value);
|
||||
|
||||
@@ -69,7 +69,7 @@ public:
|
||||
std::vector<char> getBinaryData() const;
|
||||
|
||||
float highestBinValue(bool equalized, int overBins=0);
|
||||
float binWidth();
|
||||
float binWidth() const;
|
||||
|
||||
void changeRange(float minValue, float maxValue);
|
||||
|
||||
|
||||
@@ -22,7 +22,7 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#include <ghoul/fmt.h>
|
||||
#include <ghoul/format.h>
|
||||
#include <ghoul/glm.h>
|
||||
#include <ghoul/misc/dictionaryjsonformatter.h>
|
||||
#include <type_traits>
|
||||
@@ -72,21 +72,21 @@ std::string formatJson(T value) {
|
||||
}
|
||||
else if constexpr (internal::isGlmVector<T>()) {
|
||||
std::string values;
|
||||
for (glm::length_t i = 0; i < ghoul::glm_components<T>::value; ++i) {
|
||||
for (glm::length_t i = 0; i < ghoul::glm_components<T>::value; i++) {
|
||||
values += std::to_string(value[i]) + ',';
|
||||
}
|
||||
values.pop_back();
|
||||
return fmt::format("[{}]", values);
|
||||
return std::format("[{}]", values);
|
||||
}
|
||||
else if constexpr (internal::isGlmMatrix<T>()) {
|
||||
std::string values;
|
||||
for (glm::length_t i = 0; i < T::type::row_type::length(); ++i) {
|
||||
for (glm::length_t j = 0; j < T::type::col_type::length(); ++j) {
|
||||
for (glm::length_t i = 0; i < T::type::row_type::length(); i++) {
|
||||
for (glm::length_t j = 0; j < T::type::col_type::length(); j++) {
|
||||
values += std::to_string(value[i][j]) + ',';
|
||||
}
|
||||
}
|
||||
values.pop_back();
|
||||
return fmt::format("[{}]", values);
|
||||
return std::format("[{}]", values);
|
||||
}
|
||||
else {
|
||||
static_assert(sizeof(T) == 0, "JSON formatting of type T not implemented");
|
||||
|
||||
@@ -400,7 +400,7 @@ constexpr inline bool isKeypadKey(Key key) noexcept {
|
||||
key == Key::KeypadDivide;
|
||||
}
|
||||
|
||||
KeyWithModifier stringToKey(std::string str);
|
||||
KeyWithModifier stringToKey(const std::string& str);
|
||||
std::string keyToString(KeyWithModifier keyWithModifier);
|
||||
|
||||
// @TODO (abock, 2021-08-12) This function should die
|
||||
@@ -430,7 +430,7 @@ template <>
|
||||
std::string to_string(const openspace::KeyModifier& mod);
|
||||
|
||||
template <>
|
||||
std::string to_string(const openspace::KeyWithModifier& key);
|
||||
std::string to_string(const openspace::KeyWithModifier& keyMod);
|
||||
|
||||
} // namespace ghoul
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
|
||||
void initialize();
|
||||
void deinitialize();
|
||||
void render();
|
||||
void render() const;
|
||||
|
||||
void updateSize(const glm::vec2& size);
|
||||
void updateSize(const float size);
|
||||
|
||||
@@ -39,7 +39,7 @@ public:
|
||||
|
||||
bool initialize();
|
||||
|
||||
void render();
|
||||
void render() const;
|
||||
|
||||
//private:
|
||||
struct Vertex {
|
||||
|
||||
@@ -25,7 +25,7 @@
|
||||
#ifndef __OPENSPACE_CORE___SPICEMANAGER___H__
|
||||
#define __OPENSPACE_CORE___SPICEMANAGER___H__
|
||||
|
||||
#include <ghoul/fmt.h>
|
||||
#include <ghoul/format.h>
|
||||
#include <ghoul/glm.h>
|
||||
#include <ghoul/misc/assert.h>
|
||||
#include <ghoul/misc/boolean.h>
|
||||
@@ -524,7 +524,7 @@ public:
|
||||
* specific spacecraft
|
||||
* \pre \p craft must not be empty
|
||||
*/
|
||||
double spacecraftClockToET(const std::string& craft, double craftTicks);
|
||||
double spacecraftClockToET(const std::string& craft, double craftTicks) const;
|
||||
|
||||
/**
|
||||
* Converts the \p timeString representing a date to a double precision value
|
||||
@@ -578,7 +578,7 @@ public:
|
||||
|
||||
timout_c(ephemerisTime, format, bufferSize, outBuf);
|
||||
if (failed_c()) {
|
||||
throwSpiceError(fmt::format(
|
||||
throwSpiceError(std::format(
|
||||
"Error converting ephemeris time '{}' to date with format '{}'",
|
||||
ephemerisTime, format
|
||||
));
|
||||
@@ -1122,6 +1122,12 @@ private:
|
||||
*/
|
||||
void loadLeapSecondsSpiceKernel();
|
||||
|
||||
/**
|
||||
* Loads pre defined geophysical constants kernel (geophysical.ker)
|
||||
*/
|
||||
void loadGeophysicalConstantsKernel();
|
||||
|
||||
|
||||
/// A list of all loaded kernels
|
||||
std::vector<KernelInformation> _loadedKernels;
|
||||
|
||||
|
||||
@@ -36,7 +36,7 @@ class SyncBuffer {
|
||||
public:
|
||||
SyncBuffer(size_t n);
|
||||
|
||||
~SyncBuffer();
|
||||
~SyncBuffer() = default;
|
||||
|
||||
void encode(const std::string& s);
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ class Task;
|
||||
class TaskLoader {
|
||||
public:
|
||||
std::vector<std::unique_ptr<Task>> tasksFromDictionary(
|
||||
const ghoul::Dictionary& tasksDictionary);
|
||||
const ghoul::Dictionary& dictionary);
|
||||
|
||||
std::vector<std::unique_ptr<Task>> tasksFromFile(const std::string& path);
|
||||
};
|
||||
|
||||
@@ -166,7 +166,7 @@ public:
|
||||
* (M)onths, and (y)ears as units and an optional - sign to move backwards in time.
|
||||
* The return value is in the form of an ISO 8601 date string.
|
||||
*/
|
||||
static std::string advancedTime(std::string base, std::string change);
|
||||
static std::string advancedTime(const std::string& base, std::string change);
|
||||
|
||||
/**
|
||||
* Returns the Lua library that contains all Lua functions available to change the
|
||||
|
||||
@@ -144,7 +144,7 @@ constexpr TimeUnit timeUnitFromString(std::string_view unitName) {
|
||||
found = i;
|
||||
break;
|
||||
}
|
||||
++i;
|
||||
i++;
|
||||
}
|
||||
|
||||
i = 0;
|
||||
@@ -153,7 +153,7 @@ constexpr TimeUnit timeUnitFromString(std::string_view unitName) {
|
||||
found = i;
|
||||
break;
|
||||
}
|
||||
++i;
|
||||
i++;
|
||||
}
|
||||
|
||||
if (found != -1) {
|
||||
|
||||
@@ -35,6 +35,8 @@ namespace openspace {
|
||||
* Base class for keyframes.
|
||||
*/
|
||||
struct KeyframeBase {
|
||||
KeyframeBase(size_t id_, double timestamp_);
|
||||
|
||||
size_t id;
|
||||
double timestamp;
|
||||
};
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace openspace {
|
||||
|
||||
template <typename T>
|
||||
Keyframe<T>::Keyframe(size_t i, double t, T d)
|
||||
: KeyframeBase{ i, t }
|
||||
: KeyframeBase(i, t)
|
||||
, data(std::move(d))
|
||||
{}
|
||||
|
||||
|
||||
@@ -98,8 +98,8 @@ public:
|
||||
|
||||
void interpolateTime(double targetTime, double durationSeconds);
|
||||
void interpolateTimeRelative(double delta, double durationSeconds);
|
||||
void interpolateDeltaTime(double targetDeltaTime, double durationSeconds);
|
||||
void interpolatePause(bool pause, double durationSeconds);
|
||||
void interpolateDeltaTime(double newDeltaTime, double interpolationDuration);
|
||||
void interpolatePause(bool pause, double interpolationDuration);
|
||||
|
||||
std::optional<double> nextDeltaTimeStep();
|
||||
std::optional<double> previousDeltaTimeStep();
|
||||
@@ -110,7 +110,7 @@ public:
|
||||
void interpolateNextDeltaTimeStep(double durationSeconds);
|
||||
void interpolatePreviousDeltaTimeStep(double durationSeconds);
|
||||
|
||||
void addKeyframe(double timestamp, TimeKeyframeData kf);
|
||||
void addKeyframe(double timestamp, TimeKeyframeData time);
|
||||
void removeKeyframesBefore(double timestamp, bool inclusive = false);
|
||||
void removeKeyframesAfter(double timestamp, bool inclusive = false);
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ namespace openspace {
|
||||
*/
|
||||
struct TouchInput {
|
||||
TouchInput(size_t touchDeviceId, size_t fingerId, float x, float y, double timestamp);
|
||||
glm::vec2 screenCoordinates(glm::vec2 resolution) const;
|
||||
glm::vec2 screenCoordinates(const glm::vec2& resolution) const;
|
||||
glm::vec2 currentWindowCoordinates() const;
|
||||
bool isMoving() const;
|
||||
float distanceToPos(float otherX, float otherY) const;
|
||||
|
||||
Reference in New Issue
Block a user