diff --git a/apps/OpenSpace/CMakeLists.txt b/apps/OpenSpace/CMakeLists.txt index d6f99b9c5e..03100a7f16 100644 --- a/apps/OpenSpace/CMakeLists.txt +++ b/apps/OpenSpace/CMakeLists.txt @@ -143,23 +143,27 @@ add_custom_command(TARGET OpenSpace POST_BUILD end_header("Dependency: SGCT") -begin_header("Dependency: Profile Editor") -add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ext/launcher) -target_link_libraries(OpenSpace PRIVATE openspace-ui-launcher) -end_header("Dependency: Profile Editor") +# Profile Editor / Launcher GUI +option(OPENSPACE_APPLICATION_OPENSPACE-LAUNCHER "Build Launcher GUI" ON) +if (OPENSPACE_APPLICATION_OPENSPACE-LAUNCHER) + begin_header("Dependency: Profile Editor") + add_subdirectory(${CMAKE_CURRENT_SOURCE_DIR}/ext/launcher) + target_link_libraries(OpenSpace PRIVATE openspace-ui-launcher) + target_compile_definitions(OpenSpace PRIVATE OPENSPACE_HAS_LAUNCHER) + end_header("Dependency: Profile Editor") -if (WIN32) - # Find the windeployqt application - get_target_property(_qmake_executable Qt6::qmake IMPORTED_LOCATION) - get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY) - add_custom_command( - TARGET OpenSpace POST_BUILD - COMMAND "${WINDEPLOYQT_EXECUTABLE}" --verbose 0 --no-compiler-runtime --no-translations \"$\" - COMMENT "Deploying Qt libraries" - ) + if (WIN32) + # Find the windeployqt application + get_target_property(_qmake_executable Qt6::qmake IMPORTED_LOCATION) + get_filename_component(_qt_bin_dir "${_qmake_executable}" DIRECTORY) + add_custom_command( + TARGET OpenSpace POST_BUILD + COMMAND "${WINDEPLOYQT_EXECUTABLE}" --verbose 0 --no-compiler-runtime --no-translations \"$\" + COMMENT "Deploying Qt libraries" + ) + endif () endif () - # Web Browser and Web gui # Why not put these in the module's path? Because they do not have access to the # target as of July 2017, which is needed. diff --git a/apps/OpenSpace/ext/launcher/include/backgroundimage.h b/apps/OpenSpace/ext/launcher/include/backgroundimage.h index dbfb3ee26c..062c8cefac 100644 --- a/apps/OpenSpace/ext/launcher/include/backgroundimage.h +++ b/apps/OpenSpace/ext/launcher/include/backgroundimage.h @@ -27,8 +27,11 @@ #include +#include #include +class QWidget; + class BackgroundImage final : public QLabel { Q_OBJECT public: diff --git a/apps/OpenSpace/ext/launcher/include/filesystemaccess.h b/apps/OpenSpace/ext/launcher/include/filesystemaccess.h index 0817c93efc..f49927c0de 100644 --- a/apps/OpenSpace/ext/launcher/include/filesystemaccess.h +++ b/apps/OpenSpace/ext/launcher/include/filesystemaccess.h @@ -25,8 +25,14 @@ #ifndef __OPENSPACE_UI_LAUNCHER___FILESYSTEMACCESS___H__ #define __OPENSPACE_UI_LAUNCHER___FILESYSTEMACCESS___H__ +#include #include +#include +#include + +class QFileInfo; + class FileSystemAccess { public: /** diff --git a/apps/OpenSpace/ext/launcher/include/launcherwindow.h b/apps/OpenSpace/ext/launcher/include/launcherwindow.h index c8b63783de..5a49a24ba1 100644 --- a/apps/OpenSpace/ext/launcher/include/launcherwindow.h +++ b/apps/OpenSpace/ext/launcher/include/launcherwindow.h @@ -27,14 +27,13 @@ #include -#include "sgctedit/sgctedit.h" #include -#include -#include -#include #include #include +#include +class QKeyEvent; +class QPushButton; class SplitComboBox; namespace openspace { struct Configuration; } diff --git a/apps/OpenSpace/ext/launcher/include/notificationwindow.h b/apps/OpenSpace/ext/launcher/include/notificationwindow.h index fd7007c88f..9ff164d812 100644 --- a/apps/OpenSpace/ext/launcher/include/notificationwindow.h +++ b/apps/OpenSpace/ext/launcher/include/notificationwindow.h @@ -30,6 +30,8 @@ #include #include +class QWidget; + class NotificationWindow final : public QTextEdit { Q_OBJECT public: diff --git a/apps/OpenSpace/ext/launcher/include/profile/actiondialog.h b/apps/OpenSpace/ext/launcher/include/profile/actiondialog.h index 7ccb610590..b4039f1715 100644 --- a/apps/OpenSpace/ext/launcher/include/profile/actiondialog.h +++ b/apps/OpenSpace/ext/launcher/include/profile/actiondialog.h @@ -28,6 +28,8 @@ #include #include +#include +#include class QCheckBox; class QComboBox; @@ -39,6 +41,7 @@ class QLineEdit; class QListWidget; class QPushButton; class QTextEdit; +class QWidget; class ActionDialog final : public QDialog { Q_OBJECT @@ -50,7 +53,6 @@ private: void createWidgets(); void createActionWidgets(QGridLayout* layout); void createKeyboardWidgets(QGridLayout* layout); - void applyChanges(); openspace::Profile::Action* selectedAction(); void actionAdd(); diff --git a/apps/OpenSpace/ext/launcher/include/profile/additionalscriptsdialog.h b/apps/OpenSpace/ext/launcher/include/profile/additionalscriptsdialog.h index 031e364f3e..c7c6180beb 100644 --- a/apps/OpenSpace/ext/launcher/include/profile/additionalscriptsdialog.h +++ b/apps/OpenSpace/ext/launcher/include/profile/additionalscriptsdialog.h @@ -27,7 +27,12 @@ #include +#include +#include + +class QPushButton; class QTextEdit; +class QWidget; class AdditionalScriptsDialog final : public QDialog { Q_OBJECT diff --git a/apps/OpenSpace/ext/launcher/include/profile/assetedit.h b/apps/OpenSpace/ext/launcher/include/profile/assetedit.h index a41b019d48..2afae40b94 100644 --- a/apps/OpenSpace/ext/launcher/include/profile/assetedit.h +++ b/apps/OpenSpace/ext/launcher/include/profile/assetedit.h @@ -27,11 +27,7 @@ #include -namespace openspace { class Asset; } - class QBoxLayout; -class QComboBox; -class QLabel; class QLineEdit; class QWidget; diff --git a/apps/OpenSpace/ext/launcher/include/profile/assetsdialog.h b/apps/OpenSpace/ext/launcher/include/profile/assetsdialog.h index 4b4cf20f48..937ac49a4b 100644 --- a/apps/OpenSpace/ext/launcher/include/profile/assetsdialog.h +++ b/apps/OpenSpace/ext/launcher/include/profile/assetsdialog.h @@ -26,12 +26,21 @@ #define __OPENSPACE_UI_LAUNCHER___ASSETSDIALOG___H__ #include -#include #include -#include "assettreemodel.h" +#include "assettreemodel.h" +#include + +class QObject; +class QString; +class QLineEdit; +class QModelIndex; +class QRegularExpression; class QTextEdit; class QTreeView; +class QWidget; + +namespace openspace { class Profile; } class SearchProxyModel : public QSortFilterProxyModel { Q_OBJECT @@ -81,7 +90,6 @@ private slots: void searchTextChanged(const QString& text); private: - void createWidgets(); void setViewToBaseModel(); void parseSelections(); void selected(const QModelIndex&); diff --git a/apps/OpenSpace/ext/launcher/include/profile/assettreeitem.h b/apps/OpenSpace/ext/launcher/include/profile/assettreeitem.h index a4100b9e3b..cd233d8b79 100644 --- a/apps/OpenSpace/ext/launcher/include/profile/assettreeitem.h +++ b/apps/OpenSpace/ext/launcher/include/profile/assettreeitem.h @@ -25,6 +25,7 @@ #ifndef __OPENSPACE_UI_LAUNCHER___ASSETTREEITEM___H__ #define __OPENSPACE_UI_LAUNCHER___ASSETTREEITEM___H__ +#include #include #include diff --git a/apps/OpenSpace/ext/launcher/include/profile/assettreemodel.h b/apps/OpenSpace/ext/launcher/include/profile/assettreemodel.h index 7409a34a31..69327691b1 100644 --- a/apps/OpenSpace/ext/launcher/include/profile/assettreemodel.h +++ b/apps/OpenSpace/ext/launcher/include/profile/assettreemodel.h @@ -29,7 +29,13 @@ #include "assettreeitem.h" #include "openspace/scene/profile.h" +#include +#include #include +#include +#include + +class QObject; class AssetTreeModel final : public QAbstractItemModel { Q_OBJECT diff --git a/apps/OpenSpace/ext/launcher/include/profile/cameradialog.h b/apps/OpenSpace/ext/launcher/include/profile/cameradialog.h index ae86162acb..1ddbde1bba 100644 --- a/apps/OpenSpace/ext/launcher/include/profile/cameradialog.h +++ b/apps/OpenSpace/ext/launcher/include/profile/cameradialog.h @@ -33,7 +33,9 @@ class QLabel; class QLineEdit; class QMessageBox; +class QString; class QTabWidget; +class QWidget; class CameraDialog final : public QDialog { Q_OBJECT diff --git a/apps/OpenSpace/ext/launcher/include/profile/deltatimesdialog.h b/apps/OpenSpace/ext/launcher/include/profile/deltatimesdialog.h index b27201888d..7858e5b17a 100644 --- a/apps/OpenSpace/ext/launcher/include/profile/deltatimesdialog.h +++ b/apps/OpenSpace/ext/launcher/include/profile/deltatimesdialog.h @@ -27,12 +27,18 @@ #include +#include +#include +#include + class QComboBox; class QDialogButtonBox; +class QKeyEvent; class QLabel; class QListWidget; class QLineEdit; class QPushButton; +class QWidget; class DeltaTimesDialog final : public QDialog { Q_OBJECT diff --git a/apps/OpenSpace/ext/launcher/include/profile/horizonsdialog.h b/apps/OpenSpace/ext/launcher/include/profile/horizonsdialog.h index f1cee0e0ea..7f5f58767b 100644 --- a/apps/OpenSpace/ext/launcher/include/profile/horizonsdialog.h +++ b/apps/OpenSpace/ext/launcher/include/profile/horizonsdialog.h @@ -30,6 +30,7 @@ #include #include #include +#include #ifdef OPENSPACE_MODULE_SPACE_ENABLED #include @@ -43,6 +44,9 @@ class QNetworkAccessManager; class QNetworkReply; class QPlainTextEdit; class QProgressBar; +class QPushButton; +class QVariant; +class QWidget; class HorizonsDialog final : public QDialog { Q_OBJECT diff --git a/apps/OpenSpace/ext/launcher/include/profile/marknodesdialog.h b/apps/OpenSpace/ext/launcher/include/profile/marknodesdialog.h index 3ddf7aceac..955a2821a3 100644 --- a/apps/OpenSpace/ext/launcher/include/profile/marknodesdialog.h +++ b/apps/OpenSpace/ext/launcher/include/profile/marknodesdialog.h @@ -27,10 +27,15 @@ #include +#include +#include + +class QKeyEvent; class QLineEdit; class QListWidget; class QListWidgetItem; class QPushButton; +class QWidget; class MarkNodesDialog final : public QDialog { Q_OBJECT diff --git a/apps/OpenSpace/ext/launcher/include/profile/metadialog.h b/apps/OpenSpace/ext/launcher/include/profile/metadialog.h index 25268a5c8e..132f0e1a4b 100644 --- a/apps/OpenSpace/ext/launcher/include/profile/metadialog.h +++ b/apps/OpenSpace/ext/launcher/include/profile/metadialog.h @@ -32,6 +32,7 @@ class QLineEdit; class QTextEdit; +class QWidget; class MetaDialog final : public QDialog { Q_OBJECT @@ -47,7 +48,6 @@ public: private: void createWidgets(); - void save(); std::optional* _meta = nullptr; diff --git a/apps/OpenSpace/ext/launcher/include/profile/modulesdialog.h b/apps/OpenSpace/ext/launcher/include/profile/modulesdialog.h index 96a961023b..39670c2b62 100644 --- a/apps/OpenSpace/ext/launcher/include/profile/modulesdialog.h +++ b/apps/OpenSpace/ext/launcher/include/profile/modulesdialog.h @@ -28,12 +28,15 @@ #include #include +#include class QDialogButtonBox; +class QKeyEvent; class QLabel; class QLineEdit; class QListWidget; class QPushButton; +class QWidget; class ModulesDialog final : public QDialog { Q_OBJECT diff --git a/apps/OpenSpace/ext/launcher/include/profile/profileedit.h b/apps/OpenSpace/ext/launcher/include/profile/profileedit.h index 59dfa6ae69..c54f85f63b 100644 --- a/apps/OpenSpace/ext/launcher/include/profile/profileedit.h +++ b/apps/OpenSpace/ext/launcher/include/profile/profileedit.h @@ -26,15 +26,17 @@ #define __OPENSPACE_UI_LAUNCHER___PROFILEEDIT___H__ #include + +#include #include -#include namespace openspace { class Profile; } -class QWidget; +class QKeyEvent; class QLabel; class QLineEdit; class QTextEdit; +class QWidget; class ProfileEdit final : public QDialog { Q_OBJECT diff --git a/apps/OpenSpace/ext/launcher/include/profile/propertiesdialog.h b/apps/OpenSpace/ext/launcher/include/profile/propertiesdialog.h index 99f6cac5b1..2a1b1a484e 100644 --- a/apps/OpenSpace/ext/launcher/include/profile/propertiesdialog.h +++ b/apps/OpenSpace/ext/launcher/include/profile/propertiesdialog.h @@ -28,14 +28,17 @@ #include #include +#include class QComboBox; class QDialogButtonBox; +class QKeyEvent; class QLabel; class QLineEdit; class QListWidget; class QMessageBox; class QPushButton; +class QWidget; class PropertiesDialog final : public QDialog { Q_OBJECT diff --git a/apps/OpenSpace/ext/launcher/include/profile/scriptlogdialog.h b/apps/OpenSpace/ext/launcher/include/profile/scriptlogdialog.h index 582741433d..a34b1f4d7c 100644 --- a/apps/OpenSpace/ext/launcher/include/profile/scriptlogdialog.h +++ b/apps/OpenSpace/ext/launcher/include/profile/scriptlogdialog.h @@ -27,9 +27,13 @@ #include +#include +#include + class QLineEdit; class QListWidget; class QPushButton; +class QWidget; class ScriptLogDialog final : public QDialog { Q_OBJECT diff --git a/apps/OpenSpace/ext/launcher/include/profile/timedialog.h b/apps/OpenSpace/ext/launcher/include/profile/timedialog.h index cb08267e1b..49717b80f4 100644 --- a/apps/OpenSpace/ext/launcher/include/profile/timedialog.h +++ b/apps/OpenSpace/ext/launcher/include/profile/timedialog.h @@ -28,12 +28,14 @@ #include #include +#include class QCheckBox; class QDateTimeEdit; class QLabel; class QLineEdit; class QTabWidget; +class QWidget; class TimeDialog final : public QDialog { Q_OBJECT diff --git a/apps/OpenSpace/ext/launcher/include/profile/uipanelsdialog.h b/apps/OpenSpace/ext/launcher/include/profile/uipanelsdialog.h index d6ea979a74..eae8b1a0b2 100644 --- a/apps/OpenSpace/ext/launcher/include/profile/uipanelsdialog.h +++ b/apps/OpenSpace/ext/launcher/include/profile/uipanelsdialog.h @@ -27,7 +27,11 @@ #include +#include +#include + class QCheckBox; +class QWidget; class UiPanelsDialog final : public QDialog { Q_OBJECT diff --git a/apps/OpenSpace/ext/launcher/include/settingsdialog.h b/apps/OpenSpace/ext/launcher/include/settingsdialog.h index 8180b5d2d9..731fe9f623 100644 --- a/apps/OpenSpace/ext/launcher/include/settingsdialog.h +++ b/apps/OpenSpace/ext/launcher/include/settingsdialog.h @@ -34,6 +34,7 @@ class QComboBox; class QDialogButtonBox; class QLabel; class QLineEdit; +class QWidget; class SettingsDialog : public QDialog { Q_OBJECT diff --git a/apps/OpenSpace/ext/launcher/include/sgctedit/displaywindowunion.h b/apps/OpenSpace/ext/launcher/include/sgctedit/displaywindowunion.h index 53d3f9f54a..e0341f7652 100644 --- a/apps/OpenSpace/ext/launcher/include/sgctedit/displaywindowunion.h +++ b/apps/OpenSpace/ext/launcher/include/sgctedit/displaywindowunion.h @@ -32,6 +32,8 @@ class QFrame; class QPushButton; +class QRect; +class QRectF; class QVBoxLayout; class WindowControl; diff --git a/apps/OpenSpace/ext/launcher/include/sgctedit/monitorbox.h b/apps/OpenSpace/ext/launcher/include/sgctedit/monitorbox.h index 5347e9c88e..b008d022fb 100644 --- a/apps/OpenSpace/ext/launcher/include/sgctedit/monitorbox.h +++ b/apps/OpenSpace/ext/launcher/include/sgctedit/monitorbox.h @@ -27,10 +27,12 @@ #include -#include -#include #include +class QPaintEvent; +class QRect; +class QRectF; + class MonitorBox final : public QWidget { Q_OBJECT public: diff --git a/apps/OpenSpace/ext/launcher/include/sgctedit/sgctedit.h b/apps/OpenSpace/ext/launcher/include/sgctedit/sgctedit.h index 6bb4201c41..82e41a0d6d 100644 --- a/apps/OpenSpace/ext/launcher/include/sgctedit/sgctedit.h +++ b/apps/OpenSpace/ext/launcher/include/sgctedit/sgctedit.h @@ -35,6 +35,7 @@ class DisplayWindowUnion; class QCheckBox; class QComboBox; class QLineEdit; +class QWidget; const sgct::config::GeneratorVersion VersionMin { "SgctWindowConfig", 1, 1 }; const sgct::config::GeneratorVersion VersionLegacy18 { "OpenSpace", 0, 18 }; diff --git a/apps/OpenSpace/ext/launcher/include/sgctedit/windowcontrol.h b/apps/OpenSpace/ext/launcher/include/sgctedit/windowcontrol.h index fccf2d45cc..0faf72d7e2 100644 --- a/apps/OpenSpace/ext/launcher/include/sgctedit/windowcontrol.h +++ b/apps/OpenSpace/ext/launcher/include/sgctedit/windowcontrol.h @@ -29,13 +29,18 @@ #include #include +#include #include class QCheckBox; class QComboBox; class QDoubleSpinBox; +class QFrame; class QLabel; class QLineEdit; +class QPushButton; +class QRect; +class QRectF; class QSpinBox; class WindowControl final : public QWidget { diff --git a/apps/OpenSpace/ext/launcher/include/splitcombobox.h b/apps/OpenSpace/ext/launcher/include/splitcombobox.h index e1420356c6..0f2b8202ff 100644 --- a/apps/OpenSpace/ext/launcher/include/splitcombobox.h +++ b/apps/OpenSpace/ext/launcher/include/splitcombobox.h @@ -28,9 +28,12 @@ #include #include +#include #include #include -#include +#include + +class QWidget; class SplitComboBox final : public QComboBox { Q_OBJECT diff --git a/apps/OpenSpace/ext/launcher/src/backgroundimage.cpp b/apps/OpenSpace/ext/launcher/src/backgroundimage.cpp index c9582e7d25..670bbe6d41 100644 --- a/apps/OpenSpace/ext/launcher/src/backgroundimage.cpp +++ b/apps/OpenSpace/ext/launcher/src/backgroundimage.cpp @@ -25,9 +25,13 @@ #include "backgroundimage.h" #include +#include #include #include #include +#include +#include +#include BackgroundImage::BackgroundImage(QRect size, const std::filesystem::path& syncFolder, QWidget* parent) diff --git a/apps/OpenSpace/ext/launcher/src/filesystemaccess.cpp b/apps/OpenSpace/ext/launcher/src/filesystemaccess.cpp index 858570061e..1caf5d46ec 100644 --- a/apps/OpenSpace/ext/launcher/src/filesystemaccess.cpp +++ b/apps/OpenSpace/ext/launcher/src/filesystemaccess.cpp @@ -24,6 +24,9 @@ #include "filesystemaccess.h" +#include +#include + FileSystemAccess::FileSystemAccess(std::string fileExtension, bool hideFileExtensions, bool useCheckboxes) : _fileExtension(std::move(fileExtension)) diff --git a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp index 9522db71bc..7e7cc0a79d 100644 --- a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp +++ b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp @@ -25,24 +25,29 @@ #include "launcherwindow.h" #include "profile/profileedit.h" +#include "sgctedit/sgctedit.h" #include "backgroundimage.h" #include "notificationwindow.h" #include "settingsdialog.h" #include "splitcombobox.h" +#include +#include #include +#include #include -#include +#include +#include +#include #include #include #include -#include #include #include #include -#include -#include -#include #include +#include +#include +#include using namespace openspace; @@ -148,9 +153,18 @@ LauncherWindow::LauncherWindow(bool profileEnabled, const Configuration& globalC { QFile file(":/qss/launcher.qss"); - file.open(QFile::ReadOnly); - const QString styleSheet = QLatin1String(file.readAll()); - setStyleSheet(styleSheet); + const bool success = file.open(QFile::ReadOnly); + if (!success) { + QMessageBox::critical( + this, + "Missing QSS", + "Could not find launcher.qss" + ); + } + else { + const QString styleSheet = QLatin1String(file.readAll()); + setStyleSheet(styleSheet); + } } QWidget* centralWidget = new QWidget; diff --git a/apps/OpenSpace/ext/launcher/src/notificationwindow.cpp b/apps/OpenSpace/ext/launcher/src/notificationwindow.cpp index b154cf8d75..648b27d926 100644 --- a/apps/OpenSpace/ext/launcher/src/notificationwindow.cpp +++ b/apps/OpenSpace/ext/launcher/src/notificationwindow.cpp @@ -27,15 +27,20 @@ #include #include #include +#include +#include #include #include #include #include -#include #include #include #include -#include +#include +#include +#include +#include +#include #include using namespace openspace; diff --git a/apps/OpenSpace/ext/launcher/src/profile/actiondialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/actiondialog.cpp index a1ba99e755..9665179a5b 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/actiondialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/actiondialog.cpp @@ -29,19 +29,19 @@ #include #include #include +#include #include #include #include #include #include -#include #include #include -#include +#include #include #include #include -#include +#include using namespace openspace; diff --git a/apps/OpenSpace/ext/launcher/src/profile/additionalscriptsdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/additionalscriptsdialog.cpp index 245b2f8ec3..f17cbb483c 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/additionalscriptsdialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/additionalscriptsdialog.cpp @@ -26,15 +26,19 @@ #include "profile/line.h" #include "profile/scriptlogdialog.h" -#include #include #include #include #include #include #include -#include +#include +#include +#include #include +#include +#include +#include AdditionalScriptsDialog::AdditionalScriptsDialog(QWidget* parent, std::vector* scripts) diff --git a/apps/OpenSpace/ext/launcher/src/profile/assetedit.cpp b/apps/OpenSpace/ext/launcher/src/profile/assetedit.cpp index 0ea4ab91bf..c5922e0b5d 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/assetedit.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/assetedit.cpp @@ -26,17 +26,10 @@ #include "profile/horizonsdialog.h" #include "profile/line.h" -#include -#include #include -#include #include -#include #include #include -#include -#include -#include AssetEdit::AssetEdit(QWidget* parent) : QDialog(parent) diff --git a/apps/OpenSpace/ext/launcher/src/profile/assetsdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/assetsdialog.cpp index 1481d7cce5..415a7eac72 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/assetsdialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/assetsdialog.cpp @@ -25,6 +25,7 @@ #include "profile/assetsdialog.h" #include "profile/assetedit.h" +#include #include "profile/line.h" #include #include @@ -35,6 +36,8 @@ #include #include #include +#include +#include namespace { bool traverseToExpandSelectedItems(QTreeView& tree, AssetTreeModel& model, int rows, diff --git a/apps/OpenSpace/ext/launcher/src/profile/assettreeitem.cpp b/apps/OpenSpace/ext/launcher/src/profile/assettreeitem.cpp index 1e4ec6e347..0c0f5d326d 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/assettreeitem.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/assettreeitem.cpp @@ -24,6 +24,10 @@ #include "profile/assettreeitem.h" +#include +#include +#include + AssetTreeItem::AssetTreeItem(std::vector data, AssetTreeItem* parentItem) : _itemData(std::move(data)) , _parentItem(parentItem) diff --git a/apps/OpenSpace/ext/launcher/src/profile/assettreemodel.cpp b/apps/OpenSpace/ext/launcher/src/profile/assettreemodel.cpp index bb250d98d1..4d38c1be55 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/assettreemodel.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/assettreemodel.cpp @@ -22,12 +22,14 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include "profile/assettreeitem.h" #include "profile/assettreemodel.h" + +#include "profile/assettreeitem.h" #include "filesystemaccess.h" #include #include -#include +#include +#include namespace { constexpr std::string_view Header1 = "Asset"; @@ -85,7 +87,8 @@ namespace { const int levelChange = elem.level - level; if (levelChange == 0) { - parent->insertChildren(++nChildInsert, 1, 3); + nChildInsert++; + parent->insertChildren(nChildInsert, 1, 3); parent->child(nChildInsert)->setData( 0, QString::fromStdString(elem.line) diff --git a/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp index fdc0e9baa8..1dd1824a1b 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/cameradialog.cpp @@ -27,18 +27,17 @@ #include "profile/line.h" #include #include -#include #include -#include #include -#include #include -#include #include -#include #include -#include #include +#include +#include +#include +#include +#include namespace { constexpr int CameraTypeNode = 0; diff --git a/apps/OpenSpace/ext/launcher/src/profile/deltatimesdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/deltatimesdialog.cpp index 79f5b47bfa..f7b69df523 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/deltatimesdialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/deltatimesdialog.cpp @@ -25,22 +25,23 @@ #include "profile/deltatimesdialog.h" #include "profile/line.h" -#include -#include #include #include -#include -#include #include #include #include -#include #include #include #include -#include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include namespace { constexpr int MaxNumberOfKeys = 30; diff --git a/apps/OpenSpace/ext/launcher/src/profile/horizonsdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/horizonsdialog.cpp index ac71422aea..60a96d2f03 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/horizonsdialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/horizonsdialog.cpp @@ -25,10 +25,10 @@ #include "profile/horizonsdialog.h" #include "profile/line.h" +#include #include #include #include -#include #include #include #include @@ -36,7 +36,6 @@ #include #include #include -#include #include #include #include @@ -44,11 +43,12 @@ #include #include #include -#include +#include +#include +#include #include - -//using json = nlohmann::json; -//using namespace openspace; +#include +#include namespace { constexpr std::string_view _loggerCat = "HorizonsDialog"; diff --git a/apps/OpenSpace/ext/launcher/src/profile/marknodesdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/marknodesdialog.cpp index bb1a664e18..b6310dddb7 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/marknodesdialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/marknodesdialog.cpp @@ -25,15 +25,16 @@ #include "profile/marknodesdialog.h" #include "profile/line.h" -#include #include -#include #include #include -#include #include #include #include +#include +#include +#include +#include MarkNodesDialog::MarkNodesDialog(QWidget* parent, std::vector* markedNodes) : QDialog(parent) diff --git a/apps/OpenSpace/ext/launcher/src/profile/metadialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/metadialog.cpp index 4fd0342c1f..bdf1bc78ea 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/metadialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/metadialog.cpp @@ -27,12 +27,11 @@ #include "profile/line.h" #include #include -#include #include -#include #include #include -#include +#include +#include MetaDialog::MetaDialog(QWidget* parent, std::optional* meta) : QDialog(parent) diff --git a/apps/OpenSpace/ext/launcher/src/profile/modulesdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/modulesdialog.cpp index d59b23d032..c37d3991ac 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/modulesdialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/modulesdialog.cpp @@ -26,14 +26,14 @@ #include "profile/line.h" #include -#include #include #include #include -#include #include #include #include +#include +#include using namespace openspace; diff --git a/apps/OpenSpace/ext/launcher/src/profile/profileedit.cpp b/apps/OpenSpace/ext/launcher/src/profile/profileedit.cpp index 1b562035f6..185e717f4e 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/profileedit.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/profileedit.cpp @@ -37,20 +37,23 @@ #include "profile/timedialog.h" #include "profile/uipanelsdialog.h" #include +#include #include +#include #include #include #include #include -#include #include #include #include #include #include -#include +#include #include -#include +#include +#include +#include #ifdef WIN32 #include diff --git a/apps/OpenSpace/ext/launcher/src/profile/propertiesdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/propertiesdialog.cpp index 168953a12a..8b4061bfbd 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/propertiesdialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/propertiesdialog.cpp @@ -26,20 +26,17 @@ #include "profile/line.h" #include "profile/scriptlogdialog.h" -#include #include #include -#include -#include #include #include -#include #include #include #include -#include #include -#include +#include +#include +#include using namespace openspace; diff --git a/apps/OpenSpace/ext/launcher/src/profile/scriptlogdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/scriptlogdialog.cpp index 7a88ce9c57..6e88076d55 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/scriptlogdialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/scriptlogdialog.cpp @@ -27,19 +27,20 @@ #include "profile/line.h" #include #include -#include #include #include #include #include #include #include -#include #include -#include #include #include #include +#include +#include +#include +#include ScriptLogDialog::ScriptLogDialog(QWidget* parent, std::string filter) : QDialog(parent) diff --git a/apps/OpenSpace/ext/launcher/src/profile/timedialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/timedialog.cpp index a1c86a2f7b..d7bde8ec34 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/timedialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/timedialog.cpp @@ -26,16 +26,12 @@ #include "profile/line.h" #include -#include #include #include -#include #include -#include -#include #include #include -#include +#include using namespace openspace; diff --git a/apps/OpenSpace/ext/launcher/src/profile/uipanelsdialog.cpp b/apps/OpenSpace/ext/launcher/src/profile/uipanelsdialog.cpp index 38d3f38e04..eed363fc5c 100644 --- a/apps/OpenSpace/ext/launcher/src/profile/uipanelsdialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/profile/uipanelsdialog.cpp @@ -31,8 +31,11 @@ #include #include #include +#include #include +#include #include +#include namespace { constexpr std::string_view DefaultPanelPath = "${DATA}/web/default_ui_panels.json"; diff --git a/apps/OpenSpace/ext/launcher/src/settingsdialog.cpp b/apps/OpenSpace/ext/launcher/src/settingsdialog.cpp index 5e943f99c3..dec8791b3c 100644 --- a/apps/OpenSpace/ext/launcher/src/settingsdialog.cpp +++ b/apps/OpenSpace/ext/launcher/src/settingsdialog.cpp @@ -25,15 +25,18 @@ #include "settingsdialog.h" #include "profile/line.h" - +#include +#include +#include #include #include #include #include #include -#include -#include #include +#include +#include +#include SettingsDialog::SettingsDialog(openspace::Settings settings, QWidget* parent) : QDialog(parent) diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/displaywindowunion.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/displaywindowunion.cpp index 87da6cdc2a..03769d131d 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/displaywindowunion.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/displaywindowunion.cpp @@ -27,12 +27,13 @@ #include "sgctedit/windowcontrol.h" #include #include -#include -#include #include #include -#include -#include +#include +#include +#include +#include +#include namespace { template struct overloaded : Ts... { using Ts::operator()...; }; diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/monitorbox.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/monitorbox.cpp index 95eb18c98a..e0d7922e36 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/monitorbox.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/monitorbox.cpp @@ -24,9 +24,9 @@ #include "sgctedit/monitorbox.h" -#include #include "windowcolors.h" #include +#include MonitorBox::MonitorBox(QRect widgetSize, const std::vector& monitorResolutions, QWidget* parent) diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp index 733dc087b6..938df0a13e 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp @@ -26,20 +26,25 @@ #include #include -#include +#include #include +#include #include #include #include -#include -#include #include #include #include #include #include #include +#include +#include #include +#include +#include +#include +#include namespace { constexpr int MaxNumberWindows = 4; diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp index deddf743ef..5f920a7ed4 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp @@ -26,17 +26,22 @@ #include #include -#include "sgctedit/displaywindowunion.h" +#include +#include #include "windowcolors.h" #include #include #include #include -#include -#include #include #include +#include #include +#include +#include +#include +#include +#include namespace { std::array, 10> Quality = { diff --git a/apps/OpenSpace/ext/launcher/src/splitcombobox.cpp b/apps/OpenSpace/ext/launcher/src/splitcombobox.cpp index c97e2b2f36..b14196c760 100644 --- a/apps/OpenSpace/ext/launcher/src/splitcombobox.cpp +++ b/apps/OpenSpace/ext/launcher/src/splitcombobox.cpp @@ -26,9 +26,9 @@ #include "usericon.h" #include -#include -#include +#include #include +#include SplitComboBox::SplitComboBox(QWidget* parent, std::filesystem::path userPath, std::string userHeader, std::filesystem::path hardcodedPath, diff --git a/apps/OpenSpace/ext/launcher/src/usericon.cpp b/apps/OpenSpace/ext/launcher/src/usericon.cpp index 2374c39e4a..5dab7f8936 100644 --- a/apps/OpenSpace/ext/launcher/src/usericon.cpp +++ b/apps/OpenSpace/ext/launcher/src/usericon.cpp @@ -24,7 +24,10 @@ #include "usericon.h" +#include +#include #include +#include QIcon userIcon() { QPixmap px = QPixmap(40, 50); diff --git a/apps/OpenSpace/ext/launcher/src/windowcolors.cpp b/apps/OpenSpace/ext/launcher/src/windowcolors.cpp index 7bedcbb6b1..aa05f1a384 100644 --- a/apps/OpenSpace/ext/launcher/src/windowcolors.cpp +++ b/apps/OpenSpace/ext/launcher/src/windowcolors.cpp @@ -25,6 +25,7 @@ #include "windowcolors.h" #include +#include QColor colorForWindow(int idx) { constexpr std::array Hardcoded = { diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index 4e1b1fdab9..58640fcd78 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit 4e1b1fdab9adadb224fbfb24e0ce7fb551560d1f +Subproject commit 58640fcd780a542a515adfae13f0915006e18210 diff --git a/apps/OpenSpace/main.cpp b/apps/OpenSpace/main.cpp index 40daa211bf..8ca4097605 100644 --- a/apps/OpenSpace/main.cpp +++ b/apps/OpenSpace/main.cpp @@ -22,6 +22,12 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +// Explicitly including OpenGL for APPLE +#ifdef __APPLE__ +#define GLFW_INCLUDE_NONE +#include +#endif // __APPLE__ + #include #include #include @@ -44,9 +50,10 @@ #include #include #include +#include #ifdef WIN32 #define GLFW_EXPOSE_NATIVE_WIN32 -#endif +#endif // WIN32 #include #include #include @@ -79,9 +86,11 @@ #include #endif // OPENSPACE_BREAK_ON_FLOATING_POINT_EXCEPTION +#ifdef OPENSPACE_HAS_LAUNCHER #include #include #include +#endif // OPENSPACE_HAS_LAUNCHER #ifdef WIN32 extern "C" { @@ -1183,7 +1192,7 @@ int main(int argc, char* argv[]) { // we need to explicitly tell the operating system where to find the PDB files. We // place them right next to the .exe file and this seems to be the only reliable way // to do it. - // Using SymInitialize and SymSetSearchPath from dbghelp.h didn't work + // Using SymInitialize and SymSetSearchPath from dbghelp.h didn't work // https://learn.microsoft.com/en-us/windows-hardware/drivers/debugger/symbol-path std::string exeFolder = std::filesystem::path(argv[0]).parent_path().string(); @@ -1450,6 +1459,7 @@ int main(int argc, char* argv[]) { #endif // __APPLE__ if (!global::configuration->bypassLauncher) { +#ifdef OPENSPACE_HAS_LAUNCHER #ifndef __APPLE__ int qac = 0; QApplication app(qac, nullptr); @@ -1542,6 +1552,9 @@ int main(int argc, char* argv[]) { } global::configuration->windowConfiguration = config; } +#else // ^^^^ OPENSPACE_HAS_LAUNCHER // !OPENSPACE_HAS_LAUNCHER + glfwInit(); +#endif // OPENSPACE_HAS_LAUNCHER } else { glfwInit(); diff --git a/data/assets/actions/nightsky/createsuntrails.asset b/data/assets/actions/nightsky/createsuntrails.asset index 8c4a70e389..5cc7e4c861 100644 --- a/data/assets/actions/nightsky/createsuntrails.asset +++ b/data/assets/actions/nightsky/createsuntrails.asset @@ -15,13 +15,12 @@ local AddSunTrail = { date = openspace.time.UTC() end - local datePlus = openspace.time.advancedTime(date, '1d') - - date = string.sub(date, 1, string.find(date, "T") - 1) - datePlus = string.sub(datePlus, 1, string.find(datePlus, "T") - 1) + dateSub = string.sub(date, 1, string.find(date, "T") - 1) + date = dateSub .. "T00:00:00Z" + local datePlus = dateSub .. "T23:59:59Z" local SunTrailEarth = { - Identifier = "SunTrailEarth" .. date, + Identifier = "SunTrailEarth" .. dateSub, Parent = "Earth", Renderable = { Type = "RenderableTrailTrajectory", @@ -40,12 +39,16 @@ local AddSunTrail = { }, Tag = { "sun_trail" }, GUI = { - Name = "Sun Trail " .. date, + Name = "Sun Trail " .. dateSub, Path = "/Night Sky/Sun Trails", } } - - openspace.addSceneGraphNode(SunTrailEarth) + + if not openspace.hasSceneGraphNode(SunTrailEarth.Identifier) then + openspace.addSceneGraphNode(SunTrailEarth) + else + openspace.printWarning("Sun trail for date " .. dateSub .. " already exists.") + end ]], Documentation = [[ Adds a trail for the sun, if an argument is provided, that date will be used instead of now diff --git a/data/assets/examples/renderable/renderablesphereimagelocal/sphereimagelocal_fisheye.asset b/data/assets/examples/renderable/renderablesphereimagelocal/sphereimagelocal_fisheye.asset new file mode 100644 index 0000000000..a38ff5454a --- /dev/null +++ b/data/assets/examples/renderable/renderablesphereimagelocal/sphereimagelocal_fisheye.asset @@ -0,0 +1,28 @@ +-- Fisheye Mapping +-- This example shows a sphere that is covered with an image which is retrieved from +-- a local file path and mapped to the sphere using Angular Fisheye projection. The image +-- will cover half of the sphere. + +local Node = { + Identifier = "RenderableSphereImageLocal_Example_FisheyeMapping", + Renderable = { + Type = "RenderableSphereImageLocal", + Texture = openspace.absPath("${DATA}/test3.jpg"), + TextureProjection = "Angular Fisheye", + -- Set orientation to also render the inside of the sphere (which is the correct view + -- for a fisheye/fulldome image) + Orientation = "Both" + }, + GUI = { + Name = "RenderableSphereImageLocal - Fisheye Mapping", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) +end) diff --git a/data/assets/examples/renderable/renderablesphereimageonline/sphereimageonline_fisheye.asset b/data/assets/examples/renderable/renderablesphereimageonline/sphereimageonline_fisheye.asset new file mode 100644 index 0000000000..1b81646550 --- /dev/null +++ b/data/assets/examples/renderable/renderablesphereimageonline/sphereimageonline_fisheye.asset @@ -0,0 +1,28 @@ +-- Fisheye Mapping +-- This example shows a sphere that is covered with an image which is retrieved from an +-- online URL and mapped to the sphere using Angular Fisheye projection. The image will +-- cover half of the sphere. + +local Node = { + Identifier = "RenderableSphereImageOnline_Example_FisheyeMapping", + Renderable = { + Type = "RenderableSphereImageOnline", + URL = "http://data.openspaceproject.com/examples/renderableplaneimageonline.jpg", + TextureProjection = "Angular Fisheye", + -- Set orientation to also render the inside of the sphere (which is the correct view + -- for a fisheye/fulldome image) + Orientation = "Both" + }, + GUI = { + Name = "RenderableSphereImageOnline - Fisheye Mapping", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) +end) diff --git a/data/assets/examples/renderable/renderablevideoplane/videoplane.asset b/data/assets/examples/renderable/renderablevideoplane/videoplane.asset new file mode 100644 index 0000000000..e30e4e2736 --- /dev/null +++ b/data/assets/examples/renderable/renderablevideoplane/videoplane.asset @@ -0,0 +1,37 @@ +-- Basic +-- Creates a video plane located in 3D space that plays a video file. The dimensions of +-- the plane are automatically set to match the aspect ratio of the video. + +-- The video file is here downloaded from a URL. This code returns the path to a folder +-- where the file is stored after download +local data = asset.resource({ + Name = "Example Video", + Type = "UrlSynchronization", + Identifier = "example_video", + Url = "https://liu-se.cdn.openspaceproject.com/files/examples/video/chlorophyll_model_2048.mp4" +}) + +-- For a local file, use "asset.resource("path/to/local/video.mp4")" here instead +local video = data .. "chlorophyll_model_2048.mp4" + +local Node = { + Identifier = "RenderableVideoPlane_Example", + Renderable = { + Type = "RenderableVideoPlane", + MirrorBackside = true, -- Make the plane render the video on both sides + Video = video + }, + GUI = { + Name = "RenderableVideoPlane - Basic", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) +end) + diff --git a/data/assets/examples/renderable/renderablevideosphere/videosphere.asset b/data/assets/examples/renderable/renderablevideosphere/videosphere.asset new file mode 100644 index 0000000000..6cf4e81b07 --- /dev/null +++ b/data/assets/examples/renderable/renderablevideosphere/videosphere.asset @@ -0,0 +1,34 @@ +-- Basic +-- Creates a 3D sphere with a video texture mapped onto its surface. + +-- The video file is here downloaded from a URL. This code returns the path to a folder +-- where the file is stored after download +local data = asset.resource({ + Name = "Example Video", + Type = "UrlSynchronization", + Identifier = "example_video", + Url = "https://liu-se.cdn.openspaceproject.com/files/examples/video/chlorophyll_model_2048.mp4" +}) + +-- For a local file, use "asset.resource("path/to/local/video.mp4")" here instead +local video = data .. "chlorophyll_model_2048.mp4" + +local Node = { + Identifier = "RenderableVideoSphere_Example", + Renderable = { + Type = "RenderableVideoSphere", + Video = video + }, + GUI = { + Name = "RenderableVideoSphere - Basic", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) +end) diff --git a/data/assets/examples/renderable/renderablevideosphere/videosphere_fisheye.asset b/data/assets/examples/renderable/renderablevideosphere/videosphere_fisheye.asset new file mode 100644 index 0000000000..108a005b96 --- /dev/null +++ b/data/assets/examples/renderable/renderablevideosphere/videosphere_fisheye.asset @@ -0,0 +1,42 @@ +-- Fulldome Fisheye Video +-- Creates a 3D sphere with an angular fisheye video (fulldome) mapped onto its surface. +-- The video will be shown on half of the sphere. + +-- The video file is here downloaded from a URL. This code returns the path to a folder +-- where the file is stored after download +local data = asset.resource({ + Name = "Example Video Angular Fisheye", + Type = "UrlSynchronization", + Identifier = "example_video_angularfisheye", + Url = "https://liu-se.cdn.openspaceproject.com/files/examples/video/examplevideo_fisheye.mp4" +}) + +-- For a local file, use "asset.resource("path/to/local/video.mp4")" here instead +local video = data .. "examplevideo_fisheye.mp4" + +local Node = { + Identifier = "RenderableVideoSphere_Example", + Renderable = { + Type = "RenderableVideoSphere", + Video = video, + TextureProjection = "Angular Fisheye", + -- Set orientation to also render the inside of the sphere (which is the correct view + -- for a fisheye/fulldome video) + Orientation = "Both", + -- Increasing the number of segments makes the sphere smoother and reduces distortion + -- at the edge of the video + Segments = 64 + }, + GUI = { + Name = "RenderableVideoSphere - Fisheye Video", + Path = "/Examples" + } +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Node) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(Node) +end) diff --git a/data/assets/examples/screenspacerenderable/screenspacetext/text_font.asset b/data/assets/examples/screenspacerenderable/screenspacetext/text_font.asset index 63cc28e035..96fd48dbd6 100644 --- a/data/assets/examples/screenspacerenderable/screenspacetext/text_font.asset +++ b/data/assets/examples/screenspacerenderable/screenspacetext/text_font.asset @@ -1,4 +1,4 @@ --- Basic +-- Changing Font -- This example creates a screen space renderable that displays a static text with a -- non-standard font. This is using one of the fonts that is loaded by default in the -- openspace.cfg file. diff --git a/data/assets/examples/screenspacerenderable/screenspacetext/text_fontsize.asset b/data/assets/examples/screenspacerenderable/screenspacetext/text_fontsize.asset index 662801c96f..21f32a73f3 100644 --- a/data/assets/examples/screenspacerenderable/screenspacetext/text_fontsize.asset +++ b/data/assets/examples/screenspacerenderable/screenspacetext/text_fontsize.asset @@ -1,4 +1,4 @@ --- Basic +-- Font Size -- This example creates a screen space renderable that displays a static text with a -- larger font. The FontSize parameter is increased to improve the fidelity of the text -- being rendered. The Scale parameter will make the text show up larger on the screen. diff --git a/data/assets/examples/screenspacerenderable/screenspacevideo/video.asset b/data/assets/examples/screenspacerenderable/screenspacevideo/video.asset new file mode 100644 index 0000000000..c9b6aac3d4 --- /dev/null +++ b/data/assets/examples/screenspacerenderable/screenspacevideo/video.asset @@ -0,0 +1,30 @@ +-- Basic +-- Creates a screenspace video plane that plays a video file. The dimensions of the plane +-- are automatically set to match the aspect ratio of the video. + +-- The video file is here downloaded from a URL. This code returns the path to a folder +-- where the file is stored after download +local data = asset.resource({ + Name = "Example Video", + Type = "UrlSynchronization", + Identifier = "example_video", + Url = "https://liu-se.cdn.openspaceproject.com/files/examples/video/chlorophyll_model_2048.mp4" +}) + +-- For a local file, use "asset.resource("path/to/local/video.mp4")" here instead +local video = data .. "chlorophyll_model_2048.mp4" + +local Item = { + Name = "ScreenSpaceVideo Example", + Type = "ScreenSpaceVideo", + Identifier = "ScreenSpaceVideo_Example", + Video = video +} + +asset.onInitialize(function() + openspace.addScreenSpaceRenderable(Item) +end) + +asset.onDeinitialize(function() + openspace.removeScreenSpaceRenderable(Item) +end) diff --git a/data/assets/examples/tileprovider/videotileprovider/video.asset b/data/assets/examples/tileprovider/videotileprovider/video.asset new file mode 100644 index 0000000000..ed4a201fa0 --- /dev/null +++ b/data/assets/examples/tileprovider/videotileprovider/video.asset @@ -0,0 +1,32 @@ +-- Basic +-- Adds a video as a layer on a globe, in this case Earth. + +local earth = asset.require("scene/solarsystem/planets/earth/earth") + +-- The video file is here downloaded from a URL. This code returns the path to a folder +-- where the file is stored after download +local data = asset.resource({ + Name = "Example Video", + Type = "UrlSynchronization", + Identifier = "example_video", + Url = "https://liu-se.cdn.openspaceproject.com/files/examples/video/chlorophyll_model_2048.mp4" +}) + +-- For a local file, use "asset.resource("path/to/local/video.mp4")" here instead +local video = data .. "chlorophyll_model_2048.mp4" + +local Layer = { + Name = "VideoLayer Example", + Type = "VideoTileProvider", + Identifier = "VideoLayer_Example", + Enabled = true, + Video = video +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(earth.Earth.Identifier, "ColorLayers", Layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(earth.Earth.Identifier, "ColorLayers", Layer) +end) diff --git a/data/assets/examples/tileprovider/videotileprovider/video_mappedtotime.asset b/data/assets/examples/tileprovider/videotileprovider/video_mappedtotime.asset new file mode 100644 index 0000000000..d1c8a3c25d --- /dev/null +++ b/data/assets/examples/tileprovider/videotileprovider/video_mappedtotime.asset @@ -0,0 +1,41 @@ +-- Mapped to Time +-- Adds a video as a layer on a globe (Earth) where the video playback is mapped to the +-- simulation time. In this case, the video will play from 20:00 to 21:00 on January 29, +-- 2023 in the simulation. + +local earth = asset.require("scene/solarsystem/planets/earth/earth") + +-- The video file is here downloaded from a URL. This code returns the path to a folder +-- where the file is stored after download +local data = asset.resource({ + Name = "Example Video", + Type = "UrlSynchronization", + Identifier = "example_video", + Url = "https://liu-se.cdn.openspaceproject.com/files/examples/video/chlorophyll_model_2048.mp4" +}) + +-- For a local file, use "asset.resource("path/to/local/video.mp4")" here instead +local video = data .. "chlorophyll_model_2048.mp4" + +local Layer = { + Name = "VideoLayer Example Mapped to Time", + Type = "VideoTileProvider", + Identifier = "VideoLayer_Example_MappedToTime", + Enabled = true, + Video = video, + StartTime = "2023 01 29 20:00:00", + EndTime = "2023 01 29 21:00:00", + PlaybackMode = "MapToSimulationTime", + Description = [[ + Video mapped to the simulation time in OpenSpace. The video will play from 20:00 to + 21:00 on January 29, 2023. + ]] +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(earth.Earth.Identifier, "ColorLayers", Layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(earth.Earth.Identifier, "ColorLayers", Layer) +end) diff --git a/data/assets/examples/video/examplevideo.mp4 b/data/assets/examples/video/examplevideo.mp4 deleted file mode 100644 index ed70354cbe..0000000000 Binary files a/data/assets/examples/video/examplevideo.mp4 and /dev/null differ diff --git a/data/assets/examples/video/videoglobe.asset b/data/assets/examples/video/videoglobe.asset deleted file mode 100644 index 312fd6fac9..0000000000 --- a/data/assets/examples/video/videoglobe.asset +++ /dev/null @@ -1,35 +0,0 @@ --- To learn how you can include your own video, see the wiki --- http://wiki.openspaceproject.com/docs/builders/assets/resources.html - -local earth = asset.require("scene/solarsystem/planets/earth/earth") - - - -local Layer = { - Name = "Globe Video Loop Example", - Identifier = "GlobeVideoLoopExample", - Enabled = true, - Type = "VideoTileProvider", - Video = asset.resource("examplevideo.mp4"), -} - - -asset.onInitialize(function() - openspace.globebrowsing.addLayer(earth.Earth.Identifier, "ColorLayers", Layer) -end) - -asset.onDeinitialize(function() - openspace.globebrowsing.deleteLayer(earth.Earth.Identifier, "ColorLayers", Layer) -end) - -asset.export("layer", Layer) - - - -asset.meta = { - Name = "Video Player on Globe Example", - Description = "An example asset that shows how to include a video on Earth.", - Author = "OpenSpace Team", - URL = "https://openspaceproject.com", - License = "MIT" -} diff --git a/data/assets/examples/video/videoplane.asset b/data/assets/examples/video/videoplane.asset deleted file mode 100644 index 34f136bbd1..0000000000 --- a/data/assets/examples/video/videoplane.asset +++ /dev/null @@ -1,48 +0,0 @@ --- To learn how you can include your own video, see the wiki --- http://wiki.openspaceproject.com/docs/builders/assets/resources.html - -local transforms = asset.require("scene/solarsystem/planets/earth/transforms") - - - -local Plane = { - Identifier = "VideoPlaneExample", - Parent = transforms.EarthCenter.Identifier, - Transform = { - Translation = { - Type = "StaticTranslation", - Position = { 0.0, -11E7, 0.0 } - } - }, - Renderable = { - Type = "RenderableVideoPlane", - MirrorBackside = true, - Size = 3E7, - Video = asset.resource("examplevideo.mp4"), - }, - GUI = { - Name = "Video Plane Example", - Path = "/Other/Planes" - } -} - - -asset.onInitialize(function() - openspace.addSceneGraphNode(Plane) -end) - -asset.onDeinitialize(function() - openspace.removeSceneGraphNode(Plane) -end) - -asset.export(Plane) - - - -asset.meta = { - Name = "Video Plane Example", - Description = "An example asset that shows how to include a video on a plane.", - Author = "OpenSpace Team", - URL = "https://openspaceproject.com", - License = "MIT" -} diff --git a/data/assets/examples/video/videoscreenspace.asset b/data/assets/examples/video/videoscreenspace.asset deleted file mode 100644 index 6fc11ec55c..0000000000 --- a/data/assets/examples/video/videoscreenspace.asset +++ /dev/null @@ -1,30 +0,0 @@ --- To learn how you can include your own video, see the wiki --- http://wiki.openspaceproject.com/docs/builders/assets/resources.html - -local ScreenSpace = { - Identifier = "ScreenSpaceVideoExample", - Type = "ScreenSpaceVideo", - Name = "Screen Space Video Example", - Video = asset.resource("examplevideo.mp4") -} - - -asset.onInitialize(function() - openspace.addScreenSpaceRenderable(ScreenSpace) -end) - -asset.onDeinitialize(function() - openspace.removeScreenSpaceRenderable(ScreenSpace) -end) - -asset.export(ScreenSpace) - - - -asset.meta = { - Name = "ScreenSpace Video Example", - Description = "An example asset that shows how to include a video in screen space.", - Author = "OpenSpace Team", - URL = "https://openspaceproject.com", - License = "MIT" -} diff --git a/data/assets/examples/video/videosphere.asset b/data/assets/examples/video/videosphere.asset deleted file mode 100644 index 2e658633d8..0000000000 --- a/data/assets/examples/video/videosphere.asset +++ /dev/null @@ -1,38 +0,0 @@ --- To learn how you can include your own video, see the wiki --- http://wiki.openspaceproject.com/docs/builders/assets/resources.html - -local Sphere = { - Identifier = "ExampleVideoOnSphere", - Renderable = { - Type = "RenderableVideoSphere", - Size = 100.0, - Segments = 80, - Video = asset.resource("examplevideo.mp4"), - Orientation = "Both" - }, - GUI = { - Name = "Video Sphere Example", - Path = "/Other/Spheres" - } -} - - -asset.onInitialize(function() - openspace.addSceneGraphNode(Sphere) -end) - -asset.onDeinitialize(function() - openspace.removeSceneGraphNode(Sphere) -end) - -asset.export(Sphere) - - - -asset.meta = { - Name = "Video Player on Sphere Example", - Description = "An example asset that shows how to include a video on a sphere.", - Author = "OpenSpace Team", - URL = "https://openspaceproject.com", - License = "MIT" -} diff --git a/data/assets/examples/video/videostretchedtotime.asset b/data/assets/examples/video/videostretchedtotime.asset deleted file mode 100644 index 0d7a792466..0000000000 --- a/data/assets/examples/video/videostretchedtotime.asset +++ /dev/null @@ -1,39 +0,0 @@ --- To learn how you can include your own video, see the wiki --- http://wiki.openspaceproject.com/docs/builders/assets/resources.html - -local earth = asset.require("scene/solarsystem/planets/earth/earth") - - - -local Layer = { - Name = "Stretched Video Example", - Identifier = "StretchedVideoExample", - Type = "VideoTileProvider", - Video = asset.resource("examplevideo.mp4"), - StartTime = "2023 01 29 20:00:00", - EndTime = "2023 01 29 21:00:00", - PlaybackMode = "MapToSimulationTime", - Enabled = asset.enabled, - Description = [[Video mapped to the simulation time in OpenSpace]] -} - - -asset.onInitialize(function() - openspace.globebrowsing.addLayer(earth.Earth.Identifier, "ColorLayers", Layer) -end) - -asset.onDeinitialize(function() - openspace.globebrowsing.deleteLayer(earth.Earth.Identifier, "ColorLayers", Layer) -end) - -asset.export(Layer) - - - -asset.meta = { - Name = "Stretched Video Example", - Description = "This is a video mapped to the simulation time in OpenSpace.", - Author = "OpenSpace Team", - URL = "https://openspaceproject.com", - License = "MIT" -} diff --git a/data/assets/nightsky/altaz.asset b/data/assets/nightsky/altaz.asset index 494ca1aeeb..1f171e0dd2 100644 --- a/data/assets/nightsky/altaz.asset +++ b/data/assets/nightsky/altaz.asset @@ -58,7 +58,10 @@ local AltAzGrid = { Opacity = 0.8, Color = { 0.2, 0.4, 0.2 }, LineWidth = 2.0, - RenderBinMode = "PostDeferredTransparent" + RenderBinMode = "PostDeferredTransparent", + LatSegments = 19, + LongSegments = 36 + }, Tag = { "nightsky_marking" }, GUI = { diff --git a/data/assets/nightsky/planets.asset b/data/assets/nightsky/planets.asset index ebca415882..d9e22e3a15 100644 --- a/data/assets/nightsky/planets.asset +++ b/data/assets/nightsky/planets.asset @@ -164,6 +164,8 @@ local Saturn = { File = textures .. "glare.png" }, SizeSettings = { + ScaleFactor = 10, + ScaleExponent = 15, MaxSize = 0.332, EnableMaxSizeControl = true }, diff --git a/data/assets/scene/digitaluniverse/grids.asset b/data/assets/scene/digitaluniverse/grids.asset index 78db5edd2d..5ee8f20cd7 100644 --- a/data/assets/scene/digitaluniverse/grids.asset +++ b/data/assets/scene/digitaluniverse/grids.asset @@ -104,7 +104,7 @@ local EquatorialSphere = { Opacity = 1.0, Color = { 0.3, 0.3, 0.15 }, LineWidth = 2.0, - LatSegments = 36, + LatSegments = 19, LongSegments = 24, }, Tag = { "du_grid" }, @@ -164,7 +164,9 @@ local EclipticSphere = { Enabled = false, Opacity = 1.0, Color = { 0.3, 0.15, 0.15 }, - LineWidth = 2.0 + LineWidth = 2.0, + LatSegments = 19, + LongSegments = 36 }, Tag = { "du_grid" }, GUI = { diff --git a/data/assets/scene/solarsystem/dwarf_planets/ceres/layers/colorlayers/lamo.wms b/data/assets/scene/solarsystem/dwarf_planets/ceres/layers/colorlayers/lamo.wms index b8b86df7b2..ace1215b9b 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/ceres/layers/colorlayers/lamo.wms +++ b/data/assets/scene/solarsystem/dwarf_planets/ceres/layers/colorlayers/lamo.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Ceres/LAMO/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Ceres/LAMO/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/system.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/system.asset index 19dfbfe927..8f31e21733 100644 --- a/data/assets/scene/solarsystem/dwarf_planets/pluto/system.asset +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/system.asset @@ -1,4 +1,5 @@ asset.require("./trail") +asset.require("./trail_barycentric") asset.require("./pluto") asset.require("./charon/charon") asset.require("./charon/charon_trail") diff --git a/data/assets/scene/solarsystem/dwarf_planets/pluto/trail_barycentric.asset b/data/assets/scene/solarsystem/dwarf_planets/pluto/trail_barycentric.asset new file mode 100644 index 0000000000..9fdc396bd0 --- /dev/null +++ b/data/assets/scene/solarsystem/dwarf_planets/pluto/trail_barycentric.asset @@ -0,0 +1,48 @@ +local transforms = asset.require("./transforms") +local coreKernels = asset.require("spice/core") + + + +local PlutoTrailBarycentric = { + Identifier = "PlutoBarycentricTrail", + Parent = transforms.PlutoBarycenter.Identifier, + Renderable = { + Type = "RenderableTrailOrbit", + Translation = { + Type = "SpiceTranslation", + Target = coreKernels.ID.Pluto, + Observer = coreKernels.ID.PlutoBarycenter + }, + Color = { 0.00, 0.62, 1.00 }, + Period = 6.38723, + Resolution = 1000 + }, + Tag = { "planetTrail_dwarf" }, + GUI = { + Name = "Pluto Barycentric Trail", + Path = "/Solar System/Dwarf Planets/Pluto", + Focusable = false, + Description = "Orbit of Pluto around its Barycenter" + } +} + + +asset.onInitialize(function() + openspace.addSceneGraphNode(PlutoTrailBarycentric) +end) + +asset.onDeinitialize(function() + openspace.removeSceneGraphNode(PlutoTrailBarycentric) +end) + +asset.export(PlutoTrailBarycentric) + + + +asset.meta = { + Name = "Pluto Barycentric Trail", + Description = "Trail of Pluto as observed by its Barycenter", + Author = "OpenSpace Team", + URL = "http://openspaceproject.com", + License = "MIT license" +} diff --git a/data/assets/scene/solarsystem/heliosphere/todayssun/grid.asset b/data/assets/scene/solarsystem/heliosphere/todayssun/grid.asset index b083d82a6b..804d9bcc4d 100644 --- a/data/assets/scene/solarsystem/heliosphere/todayssun/grid.asset +++ b/data/assets/scene/solarsystem/heliosphere/todayssun/grid.asset @@ -33,7 +33,7 @@ local CarringtonPrimeMeridian = { Color = { 1.0, 0.0, 0.0 }, LineWidth = 2.0, LongSegments = 2, - LatSegments = 64 + LatSegments = 19 }, GUI = { Name = "Carrington Prime Meridian", @@ -63,7 +63,7 @@ local WSA_GridSlice = { Color = { 0.8, 0.8, 0.8 }, LineWidth = 2.0, LongSegments = 2, - LatSegments = 64 + LatSegments = 19 }, GUI = { Name = "Solar Longitude Facing the Earth", @@ -86,8 +86,7 @@ local WSA_Grid10Degrees = { Type = "RenderableSphericalGrid", Size = gridSizeRadius, Color = { 0.035, 0.675, 0.255 }, - LineWidth = 1.0, - Segments = 36 + LineWidth = 1.0 }, GUI = { Name = "Grid on Sun", diff --git a/data/assets/scene/solarsystem/missions/newhorizons/label.asset b/data/assets/scene/solarsystem/missions/newhorizons/label.asset index 5afd69abac..f7169b4aa9 100644 --- a/data/assets/scene/solarsystem/missions/newhorizons/label.asset +++ b/data/assets/scene/solarsystem/missions/newhorizons/label.asset @@ -10,7 +10,7 @@ local models = asset.resource({ }) local Labels = { - Identifier = "Labels", + Identifier = "NewHorizonsLabels", Parent = NewHorizonsModel.NewHorizons.Identifier, Renderable = { Type = "RenderableModel", diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_sweden.wms b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_sweden.wms index e118500f8b..a5823c3ff9 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_sweden.wms +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Earth/Bmng/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Earth/Bmng/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_utah.wms b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_utah.wms index 8ff71a4e45..6381f2d2d3 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_utah.wms +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Earth/Bmng/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Earth/Bmng/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_sweden.wms b/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_sweden.wms index eb202dbd2d..9c7c5626b4 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_sweden.wms +++ b/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Earth/Gebco/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Earth/Gebco/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_utah.wms b/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_utah.wms index ebc8ffec21..c70438769c 100644 --- a/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_utah.wms +++ b/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Earth/Gebco/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Earth/Gebco/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_sweden.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_sweden.wms index 7df84ff7cb..11b667f944 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_sweden.wms +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Moon/Clem_Uvvis/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Moon/Clem_Uvvis/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_utah.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_utah.wms index 12b1323e9d..f2ce0302f6 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_utah.wms +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Moon/ClemUvvis/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Moon/ClemUvvis/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_sweden.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_sweden.wms index f9c4b8ebcc..a951c0fe99 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_sweden.wms +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Moon/Kaguya/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Moon/Kaguya/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_utah.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_utah.wms index db57eac121..2469012509 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_utah.wms +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Moon/Kaguya/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Moon/Kaguya/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lo_mr_mosaic_sweden.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lo_mr_mosaic_sweden.wms index 3bdb1dbae0..b9e9e2fce1 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lo_mr_mosaic_sweden.wms +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lo_mr_mosaic_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Moon/LO_MR_Mosaic_Global_59m/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Moon/LO_MR_Mosaic_Global_59m/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_sweden.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_sweden.wms index fe510f9b0b..6bd5205595 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_sweden.wms +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Moon/Lola_Clr_Shade/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Moon/Lola_Clr_Shade/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_utah.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_utah.wms index 7e1b349f89..e6460f398f 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_utah.wms +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Moon/LolaClrShade/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Moon/LolaClrShade/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_sweden.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_sweden.wms index 7dd5f9f173..c005b30c7e 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_sweden.wms +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Moon/Lola_Shade/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Moon/Lola_Shade/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_utah.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_utah.wms index 059346576d..97f09faed6 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_utah.wms +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Moon/LolaShade/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Moon/LolaShade/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_sweden.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_sweden.wms index 46203c927e..2a37338a4c 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_sweden.wms +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Moon/Uvvis_Hybrid/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Moon/Uvvis_Hybrid/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_utah.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_utah.wms index 2ef7206982..c0ff434b2a 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_utah.wms +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Moon/UvvisHybrid/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Moon/UvvisHybrid/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_sweden.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_sweden.wms index 610e26a6de..54a91cbef8 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_sweden.wms +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Moon/WAC3/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Moon/WAC3/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_utah.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_utah.wms index 2a071a7041..9b7183c729 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_utah.wms +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Moon/Wac3/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Moon/Wac3/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_v1_sweden.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_v1_sweden.wms index 20a8109b55..a3b3e51f70 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_v1_sweden.wms +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_v1_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Moon/WAC/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Moon/WAC/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_v1_utah.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_v1_utah.wms index 2a33d4d941..1365a8ea3e 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_v1_utah.wms +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_v1_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Moon/Wac/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Moon/Wac/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_sweden.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_sweden.wms index 4bd6ed5421..80513f0248 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_sweden.wms +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Moon/Lola_DEM/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Moon/Lola_DEM/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_utah.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_utah.wms index 3a16a6b122..b6087fb678 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_utah.wms +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Moon/LolaDem/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Moon/LolaDem/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/earth/noaa-sos/land/paleo_map.asset b/data/assets/scene/solarsystem/planets/earth/noaa-sos/land/paleo_map.asset index 24074a5ab5..395122df8c 100644 --- a/data/assets/scene/solarsystem/planets/earth/noaa-sos/land/paleo_map.asset +++ b/data/assets/scene/solarsystem/planets/earth/noaa-sos/land/paleo_map.asset @@ -127,7 +127,7 @@ for i,v in ipairs(layers_names) do local layer = { Identifier = Identifier .. "-" .. v, Name = Name .. " " .. v, - Enabled = asset.enabled, + Enabled = false, ZIndex = 100, FilePath = imagesDestination .. "/" .. v .. ".jpg", Description = Description diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/amateur.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/amateur.asset index b46ed23b85..84cb720794 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/amateur.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/amateur.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Amateur Radio)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_amateur_radio", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=amateur&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=amateur&FORMAT=kvn", Filename = "amateur.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/experimental.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/experimental.asset index 2696e21905..a61fb5e3ee 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/experimental.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/experimental.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Experimental)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_x-comm", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=x-comm&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=x-comm&FORMAT=kvn", Filename = "x-comm.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/geostationary.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/geostationary.asset index 67e814edc4..92eadb231b 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/geostationary.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/geostationary.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Geostationary)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_geo", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=geo&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=geo&FORMAT=kvn", Filename = "geo.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/globalstar.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/globalstar.asset index 3ea3ade5a0..40b650fd12 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/globalstar.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/globalstar.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (GlobalStar)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_globalstar", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=globalstar&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=globalstar&FORMAT=kvn", Filename = "globalstar.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/gorizont.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/gorizont.asset index 0b3858db90..1939d3c789 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/gorizont.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/gorizont.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Gorizont)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_gorizont", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=gorizont&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=gorizont&FORMAT=kvn", Filename = "gorizont.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/intelsat.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/intelsat.asset index 74246f3bd5..323c7d0cdd 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/intelsat.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/intelsat.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Intelsat)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_intelsat", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=intelsat&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=intelsat&FORMAT=kvn", Filename = "intelsat.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/iridium.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/iridium.asset index 9588ffbd7b..3aac4b67a9 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/iridium.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/iridium.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Iridium)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_iridium", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=iridium&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=iridium&FORMAT=kvn", Filename = "iridium.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/iridium_next.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/iridium_next.asset index 1d632a70d9..8c1c25112f 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/iridium_next.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/iridium_next.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Iridium NEXT)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_iridium-NEXT", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=iridium-NEXT&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=iridium-NEXT&FORMAT=kvn", Filename = "iridium-NEXT.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/molniya.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/molniya.asset index 5f15a1695e..912a3114ae 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/molniya.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/molniya.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Molniya)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_molniya", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=molniya&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=molniya&FORMAT=kvn", Filename = "molniya.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/orbcomm.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/orbcomm.asset index bd0fc73554..0566d0e772 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/orbcomm.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/orbcomm.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Orbcomm)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_orbcomm", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=orbcomm&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=orbcomm&FORMAT=kvn", Filename = "orbcomm.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/other_comm.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/other_comm.asset index b3ad87f9e8..1d2303a8b1 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/other_comm.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/other_comm.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Other comm)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_other-comm", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=other-comm&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=other-comm&FORMAT=kvn", Filename = "other-comm.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/raduga.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/raduga.asset index 645d481fac..261a3c740c 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/raduga.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/raduga.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Raduga)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_raduga", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=raduga&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=raduga&FORMAT=kvn", Filename = "raduga.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/ses.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/ses.asset index a0cce6703a..5f8eba3ccc 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/ses.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/ses.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (SES)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_ses", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=ses&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=ses&FORMAT=kvn", Filename = "ses.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/communications/starlink.asset b/data/assets/scene/solarsystem/planets/earth/satellites/communications/starlink.asset index 0797b0b5eb..25b24fb6b4 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/communications/starlink.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/communications/starlink.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Starlink)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_starlink", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=starlink&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=starlink&FORMAT=kvn", Filename = "starlink.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_breezem.asset b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_breezem.asset index 6325970fc4..c88a012901 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_breezem.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_breezem.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Breeze-M Breakup)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_2012-044", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?INTDES=2012-044&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?INTDES=2012-044&FORMAT=kvn", Filename = "2012-044.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_fengyun.asset b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_fengyun.asset index 6b082194a9..a55db8dd6d 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_fengyun.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_fengyun.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Fengyun Debris)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_1999-025", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?INTDES=1999-025&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?INTDES=1999-025&FORMAT=kvn", Filename = "1999-025.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_iridium33.asset b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_iridium33.asset index 3cbefd817d..3608d0cc2e 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_iridium33.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_iridium33.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Iridium 33 Debris)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_iridium-33-debris", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=iridium-33-debris&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=iridium-33-debris&FORMAT=kvn", Filename = "iridium-33-debris.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_kosmos2251.asset b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_kosmos2251.asset index 71949a168f..bd2c2fe85b 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_kosmos2251.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/debris/debris_kosmos2251.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Kosmos 2251 Debris)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_cosmos-2251-debris", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=cosmos-2251-debris&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=cosmos-2251-debris&FORMAT=kvn", Filename = "cosmos-2251-debris.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/active.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/active.asset index f24b1331bf..b1f2f8061a 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/active.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/active.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Active)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_active", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=active&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=active&FORMAT=kvn", Filename = "active.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/brightest.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/brightest.asset index 31941a1481..c443c3ba29 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/brightest.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/brightest.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (100 Brightest)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_visual", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=visual&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=visual&FORMAT=kvn", Filename = "visual.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/cubesats.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/cubesats.asset index 5c769c5cf2..ede6bac24e 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/cubesats.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/cubesats.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (CubeSat)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_cubesat", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=cubesat&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=cubesat&FORMAT=kvn", Filename = "cubesat.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/hubble_trail.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/hubble_trail.asset index 9849267e6f..f966920f25 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/hubble_trail.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/hubble_trail.asset @@ -7,7 +7,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Hubble)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_hst", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?CATNR=20580&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?CATNR=20580&FORMAT=kvn", Filename = "hst.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset index abb3ee01e5..22e74c1790 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/iss.asset @@ -22,7 +22,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (ISS)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_iss", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?CATNR=25544&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?CATNR=25544&FORMAT=kvn", Filename = "ISS.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) @@ -31,7 +31,7 @@ local tle = asset.resource({ Name = "Satellite TLE Data (ISS)", Type = "UrlSynchronization", Identifier = "satellite_tle_data_iss", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?CATNR=25544&FORMAT=tle", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?CATNR=25544&FORMAT=tle", Filename = "ISS.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/military.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/military.asset index 1a5bade094..0e154055c9 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/military.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/military.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Military)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_military", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=military&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=military&FORMAT=kvn", Filename = "military.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/other.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/other.asset index 2521eaf549..fff55f126f 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/other.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/other.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Other)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_other", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=other&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=other&FORMAT=kvn", Filename = "other.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/radar.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/radar.asset index ef0cbd1306..df2292b30e 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/radar.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/radar.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Radar Calibration)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_radar", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=radar&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=radar&FORMAT=kvn", Filename = "radar.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/spacestations.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/spacestations.asset index 63c5cd5a7a..ae8f917961 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/spacestations.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/spacestations.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (SpaceStations)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_stations", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=stations&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=stations&FORMAT=kvn", Filename = "stations.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/tiangong.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/tiangong.asset index 4cc73cf686..2464778e91 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/tiangong.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/tiangong.asset @@ -14,7 +14,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Tiangong)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_tiangong", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?CATNR=48274&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?CATNR=48274&FORMAT=kvn", Filename = "Tiangong.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/misc/tle-new.asset b/data/assets/scene/solarsystem/planets/earth/satellites/misc/tle-new.asset index 8e34e99bfc..71db6c8a07 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/misc/tle-new.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/misc/tle-new.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Last 30 Days)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_tle-new", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=last-30-days&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=last-30-days&FORMAT=kvn", Filename = "tle-new.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/beidou.asset b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/beidou.asset index 8770680ded..554473c031 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/beidou.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/beidou.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Beidou)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_beidou", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=beidou&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=beidou&FORMAT=kvn", Filename = "beidou.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/galileo.asset b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/galileo.asset index a13e237a8c..038eb5212d 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/galileo.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/galileo.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Galileo)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_galileo", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=galileo&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=galileo&FORMAT=kvn", Filename = "galileo.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/glosnass.asset b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/glosnass.asset index 06b3e20dd6..25a69f9155 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/glosnass.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/glosnass.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Glosnass)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_glo-ops", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=glo-ops&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=glo-ops&FORMAT=kvn", Filename = "glo-ops.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/gps.asset b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/gps.asset index 796dd46f0c..9017679085 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/gps.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/gps.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (GPS)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_gps-ops", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=gps-ops&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=gps-ops&FORMAT=kvn", Filename = "gps-ops.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/musson.asset b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/musson.asset index 1123530e2e..72795868fa 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/musson.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/musson.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Russian LEO Navigation)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_musson", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=musson&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=musson&FORMAT=kvn", Filename = "musson.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/nnss.asset b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/nnss.asset index a18fbb2aef..d90da2eca3 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/nnss.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/nnss.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Navy Navigation Satellite System)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_nnss", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=nnss&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=nnss&FORMAT=kvn", Filename = "nnss.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/sbas.asset b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/sbas.asset index c2d1883ec3..9debc8ab5b 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/navigation/sbas.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/navigation/sbas.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Satellite Based Augmentation System)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_sbas", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=sbas&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=sbas&FORMAT=kvn", Filename = "sbas.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/science/education.asset b/data/assets/scene/solarsystem/planets/earth/satellites/science/education.asset index 7d7cd0165b..17daff8969 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/science/education.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/science/education.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Education)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_education", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=education&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=education&FORMAT=kvn", Filename = "education.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/science/engineering.asset b/data/assets/scene/solarsystem/planets/earth/satellites/science/engineering.asset index 65d74ea8aa..d8f55c4ec8 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/science/engineering.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/science/engineering.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Engineering)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_engineering", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=engineering&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=engineering&FORMAT=kvn", Filename = "engineering.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/science/geodetic.asset b/data/assets/scene/solarsystem/planets/earth/satellites/science/geodetic.asset index a8dcb6d935..df804f06f2 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/science/geodetic.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/science/geodetic.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Geodetic)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_geodetic", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=geodetic&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=geodetic&FORMAT=kvn", Filename = "geodetic.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/science/spaceearth.asset b/data/assets/scene/solarsystem/planets/earth/satellites/science/spaceearth.asset index 89fa152d9e..9d789e7fe9 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/science/spaceearth.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/science/spaceearth.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Space & Earth Science)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_science", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=science&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=science&FORMAT=kvn", Filename = "science.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/aqua.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/aqua.asset index f5c0123979..eb81d65917 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/aqua.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/aqua.asset @@ -7,7 +7,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Aqua)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_aqua", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?CATNR=27424&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?CATNR=27424&FORMAT=kvn", Filename = "Aqua.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/argos.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/argos.asset index 6f5871d6ac..4f10f2b38c 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/argos.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/argos.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (ARGOS)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_argos", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=argos&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=argos&FORMAT=kvn", Filename = "argos.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/dmc.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/dmc.asset index f7810d2894..e9819a8461 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/dmc.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/dmc.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Disaster Monitoring)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_dmc", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=dmc&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=dmc&FORMAT=kvn", Filename = "dmc.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/earth_resources.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/earth_resources.asset index 22de3bad19..cdc444f443 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/earth_resources.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/earth_resources.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Earth Resources)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_resource", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=resource&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=resource&FORMAT=kvn", Filename = "resource.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/goes.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/goes.asset index b43d3205ae..35e600fa60 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/goes.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/goes.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (GOES)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_goes", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=goes&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=goes&FORMAT=kvn", Filename = "goes.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/noaa.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/noaa.asset index 77227dcbeb..b746aa5ab2 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/noaa.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/noaa.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (NOAA)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_noaa", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=noaa&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=noaa&FORMAT=kvn", Filename = "noaa.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/planet.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/planet.asset index 99dfc5fa0d..5ee54f5cbf 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/planet.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/planet.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Planet)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_planet", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=planet&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=planet&FORMAT=kvn", Filename = "planet.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/sarsat.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/sarsat.asset index e7fa6f5132..afd57317e0 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/sarsat.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/sarsat.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Search & Rescue (SARSAT))", Type = "UrlSynchronization", Identifier = "satellite_omm_data_sarsat", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=sarsat&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=sarsat&FORMAT=kvn", Filename = "sarsat.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/snpp.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/snpp.asset index b3bac7fb97..7830e78af0 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/snpp.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/snpp.asset @@ -7,7 +7,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (SNPP)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_snpp", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?CATNR=37849&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?CATNR=37849&FORMAT=kvn", Filename = "SNPP.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/spire.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/spire.asset index 38174babb3..b79b391e0a 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/spire.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/spire.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Spire)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_spire", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=spire&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=spire&FORMAT=kvn", Filename = "spire.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/tdrss.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/tdrss.asset index d1f8a5cee4..0d8b28e459 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/tdrss.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/tdrss.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Tracking and Data Relay Satellite System (TDRSS))", Type = "UrlSynchronization", Identifier = "satellite_omm_data_tdrss", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=tdrss&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=tdrss&FORMAT=kvn", Filename = "tdrss.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/terra.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/terra.asset index 4e6e7c860b..37ed734f01 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/terra.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/terra.asset @@ -7,7 +7,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Terra)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_terra", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?CATNR=25994&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?CATNR=25994&FORMAT=kvn", Filename = "Terra.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/earth/satellites/weather/weather.asset b/data/assets/scene/solarsystem/planets/earth/satellites/weather/weather.asset index bddba2caa1..52b3d5df2a 100644 --- a/data/assets/scene/solarsystem/planets/earth/satellites/weather/weather.asset +++ b/data/assets/scene/solarsystem/planets/earth/satellites/weather/weather.asset @@ -6,7 +6,7 @@ local omm = asset.resource({ Name = "Satellite OMM Data (Weather)", Type = "UrlSynchronization", Identifier = "satellite_omm_data_weather", - Url = "https://www.celestrak.com/NORAD/elements/gp.php?GROUP=weather&FORMAT=kvn", + Url = "http://www.celestrak.org/NORAD/elements/gp.php?GROUP=weather&FORMAT=kvn", Filename = "weather.txt", SecondsUntilResync = openspace.time.secondsPerDay() }) diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_sweden.wms b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_sweden.wms index f36a03bb5c..525a5b1ace 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_sweden.wms +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Europa/Voyager_GalileoSSI_global_mosaic_500m/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Europa/Voyager_GalileoSSI_global_mosaic_500m/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_sweden.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_sweden.wms index 5d4c6b0622..0a57a83f6f 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_sweden.wms +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Mars/CTX/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Mars/CTX/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_utah.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_utah.wms index eb57ecb39f..520ff7e365 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_utah.wms +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mars/CTX/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mars/CTX/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_sweden.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_sweden.wms index 4ea03c3a24..19b094af37 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_sweden.wms +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Mars/Color/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Mars/Color/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_utah.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_utah.wms index 294a2bcbef..1770bdce29 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_utah.wms +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mars/mainColV007/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mars/mainColV007/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_sweden.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_sweden.wms index 434f9b8be7..d73aac7ef0 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_sweden.wms +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Mars/Mola_HRSC/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Mars/Mola_HRSC/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_utah.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_utah.wms index bc86d93875..e802401c47 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_utah.wms +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mars/MolaHRSC/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mars/MolaHRSC/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_sweden.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_sweden.wms index cdfd9ae5eb..87657b6dc5 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_sweden.wms +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Mars/Mola_PseudoColor/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Mars/Mola_PseudoColor/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_utah.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_utah.wms index f1134104b9..9b9c50cbbd 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_utah.wms +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mars/MolaPseudoColor/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mars/MolaPseudoColor/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_sweden.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_sweden.wms index 08951c67f1..3347400ee4 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_sweden.wms +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_sweden.wms @@ -1,6 +1,6 @@ - http:/wms.itn.liu.se/Mars/Themis_IR_Day/tile/${z}/${y}/${x} + http:/liu-se.wms.openspaceproject.com/Mars/Themis_IR_Day/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_utah.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_utah.wms index 2f0d09b9ad..72f0ed6180 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_utah.wms +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mars/ThemisIRDay/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mars/ThemisIRDay/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_sweden.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_sweden.wms index 4ec51d1669..f4a1e1562d 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_sweden.wms +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Mars/Themis_IR_Night/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Mars/Themis_IR_Night/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_utah.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_utah.wms index e481d4870f..39ede6a8bc 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_utah.wms +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mars/ThemisIRNight/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mars/ThemisIRNight/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_sweden.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_sweden.wms index 6fb65da473..c64f157d8b 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_sweden.wms +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Mars/MDIM/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Mars/MDIM/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_utah.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_utah.wms index 15f42f20e7..ac9abdeaf7 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_utah.wms +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mars/Mdim/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mars/Mdim/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_sweden.wms b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_sweden.wms index e0589a73bc..401687eda4 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_sweden.wms +++ b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Mars/Mola_Elevation/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Mars/Mola_Elevation/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_utah.wms b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_utah.wms index 67b8266b52..533560e35c 100644 --- a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_utah.wms +++ b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mars/MolaElevation/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mars/MolaElevation/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_sweden.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_sweden.wms index 44311dff11..9247c0b054 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_sweden.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Mercury/Messenger_BDR/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Mercury/Messenger_BDR/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_utah.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_utah.wms index 3096861ca9..51c5491a60 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_utah.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mercury/MessengerBDR/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mercury/MessengerBDR/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_sweden.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_sweden.wms index bd14ff7a10..a4138ebb36 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_sweden.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Mercury/Messenger_HIE/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Mercury/Messenger_HIE/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_utah.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_utah.wms index 46d22c3f36..c2076feaff 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_utah.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mercury/MessengerHIE/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mercury/MessengerHIE/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_sweden.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_sweden.wms index 85c933d31b..b33447ad3d 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_sweden.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Mercury/Messenger_HIW/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Mercury/Messenger_HIW/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_utah.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_utah.wms index 0e60cf0b16..40c867df31 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_utah.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mercury/MessengerHIW/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mercury/MessengerHIW/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_sweden.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_sweden.wms index 79056a5c31..866776550f 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_sweden.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Mercury/Messenger_LOI/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Mercury/Messenger_LOI/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_utah.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_utah.wms index c0feac0a09..3627b4d22b 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_utah.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mercury/MessengerLOI/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mercury/MessengerLOI/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_sweden.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_sweden.wms index 04a83aa840..2a429460ec 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_sweden.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Mercury/Messenger_MDIS/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Mercury/Messenger_MDIS/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_utah.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_utah.wms index 5c12895257..f1a664307f 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_utah.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mercury/MessengerMdis/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mercury/MessengerMdis/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdr_utah.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdr_utah.wms index 51e83b289f..360fe3f429 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdr_utah.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdr_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mercury/MessengerMDR/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mercury/MessengerMDR/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_sweden.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_sweden.wms index 7fdf74c39e..41ba86cf73 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_sweden.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Mercury/Messenger_Mosaic_2/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Mercury/Messenger_Mosaic_2/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_utah.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_utah.wms index 2a5770877a..558a47b7d5 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_utah.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mercury/MessengerMosaic2/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mercury/MessengerMosaic2/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_sweden.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_sweden.wms index 938574d8f0..d37f9ecb2c 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_sweden.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Mercury/Messenger_Mosaic/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Mercury/Messenger_Mosaic/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_utah.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_utah.wms index e32b969efe..cbee055d7d 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_utah.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mercury/MessengerMosaic/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mercury/MessengerMosaic/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mp3_utah.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mp3_utah.wms index d1d572ee8a..33b7b081f3 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mp3_utah.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mp3_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mercury/MessengerMP3/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mercury/MessengerMP3/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_sweden.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_sweden.wms index 0213e0922e..bd28ec61dc 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_sweden.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Mercury/Messenger_Shade/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Mercury/Messenger_Shade/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_utah.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_utah.wms index dfbceb4255..45a11296e0 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_utah.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mercury/MessengerSHADE/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mercury/MessengerSHADE/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/heightlayers/messenger_dem_utah.wms b/data/assets/scene/solarsystem/planets/mercury/layers/heightlayers/messenger_dem_utah.wms index f97d363efd..c0c7e9f695 100644 --- a/data/assets/scene/solarsystem/planets/mercury/layers/heightlayers/messenger_dem_utah.wms +++ b/data/assets/scene/solarsystem/planets/mercury/layers/heightlayers/messenger_dem_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Mercury/MessengerDEM/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Mercury/MessengerDEM/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf_sweden.wms b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf_sweden.wms index 18d6caaac2..b0760e36dc 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf_sweden.wms +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Enceladus/Cassini_ISS_Global_Mosaic_100m_HPF/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Enceladus/Cassini_ISS_Global_Mosaic_100m_HPF/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_sweden.wms b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_sweden.wms index 029305c3f7..5e2ef4ea10 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_sweden.wms +++ b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Titan/ISS_P19658_Mosaic_Global_4km/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Titan/ISS_P19658_Mosaic_Global_4km/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_sar_hisar_global_mosaic_351m_sweden.wms b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_sar_hisar_global_mosaic_351m_sweden.wms index 2eddf8c8a3..d49369b471 100644 --- a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_sar_hisar_global_mosaic_351m_sweden.wms +++ b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_sar_hisar_global_mosaic_351m_sweden.wms @@ -1,6 +1,6 @@ - http://wms.itn.liu.se/Titan/HiSAR_Global_Mosaic_351m/tile/${z}/${y}/${x} + http://liu-se.wms.openspaceproject.com/Titan/HiSAR_Global_Mosaic_351m/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_utah.wms b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_utah.wms index 084e231ea4..359c64cb5a 100644 --- a/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_utah.wms +++ b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Venus/MagellanMosaic/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Venus/MagellanMosaic/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan_utah.wms b/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan_utah.wms index c8072a6e30..9376bf5f93 100644 --- a/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan_utah.wms +++ b/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan_utah.wms @@ -1,6 +1,6 @@ - http://openspace.sci.utah.edu/Venus/MagellanDEM/tile/${z}/${y}/${x} + http://sci-us.wms.openspaceproject.com/Venus/MagellanDEM/tile/${z}/${y}/${x} -180.0 diff --git a/data/assets/scene/solarsystem/sssb/itokawa.asset b/data/assets/scene/solarsystem/sssb/itokawa.asset index 42ea794cd2..849cd67865 100644 --- a/data/assets/scene/solarsystem/sssb/itokawa.asset +++ b/data/assets/scene/solarsystem/sssb/itokawa.asset @@ -44,8 +44,8 @@ local ItokawaTrail = { } } -local ItokawaPosition = { - Identifier = "ItokawaPosition", +local ItokawaModel = { + Identifier = "ItokawaModel", Parent = sunTransforms.SolarSystemBarycenter.Identifier, Transform = { Translation = { @@ -53,17 +53,6 @@ local ItokawaPosition = { HorizonsTextFile = orbit .. "horizons_itokawa.hrz" } }, - GUI = { - Name = "Itokawa Position", - Path = "/Solar System/Small Bodies/Itokawa", - Description = [[Position of asteroid 25143 Itokawa from 1950 JAN 1 00:00:00 - to 2050 JAN 1 00:00:00. Data from JPL Horizons]] - } -} - -local ItokawaModel = { - Identifier = "ItokawaModel", - Parent = ItokawaPosition.Identifier, Renderable = { Type = "RenderableModel", GeometryFile = model .. "itokawa.glb", @@ -83,7 +72,6 @@ local ItokawaModel = { asset.onInitialize(function() - openspace.addSceneGraphNode(ItokawaPosition) openspace.addSceneGraphNode(ItokawaTrail) openspace.addSceneGraphNode(ItokawaModel) end) @@ -91,10 +79,8 @@ end) asset.onDeinitialize(function() openspace.removeSceneGraphNode(ItokawaModel) openspace.removeSceneGraphNode(ItokawaTrail) - openspace.removeSceneGraphNode(ItokawaPosition) end) -asset.export(ItokawaPosition) asset.export(ItokawaTrail) asset.export(ItokawaModel) diff --git a/data/assets/scene/solarsystem/telescopes/gaia/gaia.asset b/data/assets/scene/solarsystem/telescopes/gaia/gaia.asset index 7528a0a9a7..f9d6510606 100644 --- a/data/assets/scene/solarsystem/telescopes/gaia/gaia.asset +++ b/data/assets/scene/solarsystem/telescopes/gaia/gaia.asset @@ -1,4 +1,4 @@ -local transforms = asset.require("./transforms") +local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms") local sunTransform = asset.require("scene/solarsystem/sun/transforms") local sun = asset.require("scene/solarsystem/sun/sun") @@ -11,11 +11,30 @@ local model = asset.resource({ Version = 2 }) +local trail = asset.resource({ + Name = "Gaia Trail", + Type = "HttpSynchronization", + Identifier = "gaia_trail", + Version = 3 +}) + local Gaia = { Identifier = "Gaia", - Parent = transforms.GaiaPosition.Identifier, + Parent = earthTransforms.EarthCenter.Identifier, Transform = { + Translation = { + Type = "HorizonsTranslation", + HorizonsTextFile = { + trail .. "gaia_orbit_horizons_1.hrz", --2013-12-19 09:55:27 to 2014-01-19 00:00:00 + trail .. "gaia_orbit_horizons_2.hrz" --2014-01-19 00:00:00 to 2026-09-14 00:00:00 + -- Target: Gaia (spacecraft) (-139479) + -- Observer: Earth (399 GEOCENTRIC) + -- Start time: 2013-Dec-19 09:55:27 (first data point) + -- End time: 2026-Sep-14 00:00:00 (last data point) + -- Step size: First file has 40 minutes and seocnd has 1 day step size + } + }, Rotation = { Type = "FixedRotation", Attached = "Gaia", diff --git a/data/assets/scene/solarsystem/telescopes/gaia/transforms.asset b/data/assets/scene/solarsystem/telescopes/gaia/transforms.asset deleted file mode 100644 index 702bded85b..0000000000 --- a/data/assets/scene/solarsystem/telescopes/gaia/transforms.asset +++ /dev/null @@ -1,56 +0,0 @@ -local earthTransforms = asset.require("scene/solarsystem/planets/earth/transforms") - - - -local trail = asset.resource({ - Name = "Gaia Trail", - Type = "HttpSynchronization", - Identifier = "gaia_trail", - Version = 3 -}) - - -local GaiaPosition = { - Identifier = "GaiaPosition", - Parent = earthTransforms.EarthCenter.Identifier, - Transform = { - Translation = { - Type = "HorizonsTranslation", - HorizonsTextFile = { - trail .. "gaia_orbit_horizons_1.hrz", --2013-12-19 09:55:27 to 2014-01-19 00:00:00 - trail .. "gaia_orbit_horizons_2.hrz" --2014-01-19 00:00:00 to 2026-09-14 00:00:00 - -- Target: Gaia (spacecraft) (-139479) - -- Observer: Earth (399 GEOCENTRIC) - -- Start time: 2013-Dec-19 09:55:27 (first data point) - -- End time: 2026-Sep-14 00:00:00 (last data point) - -- Step size: First file has 40 minutes and seocnd has 1 day step size - } - } - }, - GUI = { - Name = "Position", - Path = "/Solar System/Telescopes/Gaia" - } -} - - -asset.onInitialize(function() - openspace.addSceneGraphNode(GaiaPosition) -end) - -asset.onDeinitialize(function() - openspace.removeSceneGraphNode(GaiaPosition) -end) - -asset.export(GaiaPosition) - - - -asset.meta = { - Name = "Gaia Transform", - Description = [[This asset contains the position of Gaia from 2013 DEC 19 09:55:27 to - 2026 SEP 14 21:15:27. Data from JPL Horizons]], - Author = "OpenSpace Team", - URL = "https://ssd.jpl.nasa.gov/horizons.cgi", - License = "NASA" -} diff --git a/data/assets/util/webgui.asset b/data/assets/util/webgui.asset index 035b835f92..98a5a54119 100644 --- a/data/assets/util/webgui.asset +++ b/data/assets/util/webgui.asset @@ -4,7 +4,7 @@ local guiCustomization = asset.require("customization/gui") -- Select which commit hashes to use for the UI frontend -local frontendHash = "baabd171ecbe61b2758970a2cdafb43fbcd1a23b" +local frontendHash = "dfec6044957586573048cdc91861544471fb5283" -- The name of the file to download from the server local frontendFile = "frontend.zip" diff --git a/data/web/default_ui_panels.json b/data/web/default_ui_panels.json index e964e1f23d..36f2b4eefe 100644 --- a/data/web/default_ui_panels.json +++ b/data/web/default_ui_panels.json @@ -1,110 +1,122 @@ { - "0": { - "id": "scene", - "visible": true, - "name": "Scene", - "isOpen": false - }, - "1": { - "id": "settings", - "visible": false, - "name": "Settings", - "isOpen": false - }, - "2": { - "id": "navigation", - "visible": true, - "name": "Navigation", - "isOpen": false - }, - "3": { - "id": "timePanel", - "visible": true, - "name": "Time Panel", - "isOpen": false - }, - "4": { - "id": "sessionRecording", - "visible": true, - "name": "Session Recording", - "isOpen": false - }, - "5": { - "id": "geoLocation", - "visible": true, - "name": "Geo Location", - "isOpen": false - }, - "6": { - "id": "screenSpaceRenderables", - "visible": true, - "name": "Screenspace Renderables", - "isOpen": false - }, - "7": { - "id": "exoplanets", - "visible": true, - "name": "Exoplanets", - "isOpen": false - }, - "8": { - "id": "userPanels", - "visible": true, - "name": "User Panels", - "isOpen": false - }, - "9": { - "id": "actions", - "visible": true, - "name": "Actions", - "isOpen": false - }, - "10": { - "id": "skyBrowser", - "visible": true, - "name": "SkyBrowser", - "isOpen": false - }, - "11": { - "id": "mission", - "visible": false, - "name": "Mission", - "isOpen": false - }, - "12": { - "id": "flightControl", - "visible": true, - "name": "Flight Control", - "isOpen": false - }, - "13": { - "id": "keybindingsLayout", - "visible": false, - "name": "Keybinds", - "isOpen": false - }, - "14": { - "id": "nightSky", - "visible": false, - "name": "Night Sky", - "isOpen": false - }, - "15": { - "id": "gettingStartedTour", - "visible": false, - "name": "Getting Started Tour", - "isOpen": false - }, - "16": { - "id": "scriptLogPanel", - "visible": false, - "name": "Script Log", - "isOpen": false - }, - "17": { - "id": "devPanel", - "visible": false, - "name": "Dev Panel", - "isOpen": false - } -} \ No newline at end of file + "0": { + "id": "scene", + "visible": true, + "name": "Scene", + "isOpen": false + }, + "1": { + "id": "settings", + "visible": false, + "name": "Settings", + "isOpen": false + }, + "2": { + "id": "navigation", + "visible": true, + "name": "Navigation", + "isOpen": false + }, + "3": { + "id": "timePanel", + "visible": true, + "name": "Time Panel", + "isOpen": false + }, + "4": { + "id": "sessionRecording", + "visible": true, + "name": "Session Recording", + "isOpen": false + }, + "5": { + "id": "geoLocation", + "visible": true, + "name": "Geo Location", + "isOpen": false + }, + "6": { + "id": "screenSpaceRenderables", + "visible": true, + "name": "Screenspace Renderables", + "isOpen": false + }, + "7": { + "id": "exoplanets", + "visible": true, + "name": "Exoplanets", + "isOpen": false + }, + "8": { + "id": "userPanels", + "visible": true, + "name": "User Panels", + "isOpen": false + }, + "9": { + "id": "actions", + "visible": true, + "name": "Actions", + "isOpen": false + }, + "10": { + "id": "skyBrowser", + "visible": true, + "name": "SkyBrowser", + "isOpen": false + }, + "11": { + "id": "mission", + "visible": false, + "name": "Mission", + "isOpen": false + }, + "12": { + "id": "flightControl", + "visible": true, + "name": "Flight Control", + "isOpen": false + }, + "13": { + "id": "keybindingsLayout", + "visible": false, + "name": "Keybinds", + "isOpen": false + }, + "14": { + "id": "nightSky", + "visible": false, + "name": "Night Sky", + "isOpen": false + }, + "15": { + "id": "gettingStartedTour", + "visible": false, + "name": "Getting Started Tour", + "isOpen": false + }, + "16": { + "id": "scriptLogPanel", + "visible": false, + "name": "Script Log", + "isOpen": false + }, + "17": { + "id": "assetsFolderPanel", + "visible": false, + "name": "Assets", + "isOpen": false + }, + "18": { + "id": "globeImageryBrowserPanel", + "visible": false, + "name": "Globe Imagery Browser", + "isOpen": false + }, + "19": { + "id": "devPanel", + "visible": false, + "name": "Dev Panel", + "isOpen": false + } +} diff --git a/ext/ghoul b/ext/ghoul index 04688d7568..c748bc9d41 160000 --- a/ext/ghoul +++ b/ext/ghoul @@ -1 +1 @@ -Subproject commit 04688d75685afec8a9a4f32362785a4828b70d90 +Subproject commit c748bc9d416821b46af25d1e23ff4f4c89a75993 diff --git a/include/openspace/camera/camera.h b/include/openspace/camera/camera.h index 298391f336..a19e114561 100644 --- a/include/openspace/camera/camera.h +++ b/include/openspace/camera/camera.h @@ -27,12 +27,16 @@ #include #include +#include #include +#include +#include namespace openspace { struct CameraPose; class SceneGraphNode; +class Syncable; /** * This class still needs some more love. Suggested improvements: @@ -56,7 +60,7 @@ public: * Used to explicitly show which variables within the Camera class that are used * for caching. */ - template + template struct Cached { T datum = T(0); bool isDirty = true; diff --git a/include/openspace/data/csvloader.h b/include/openspace/data/csvloader.h index ad4b6c297c..d1a2da683c 100644 --- a/include/openspace/data/csvloader.h +++ b/include/openspace/data/csvloader.h @@ -26,8 +26,11 @@ #define __OPENSPACE_CORE___CSVLOADER___H__ #include +#include #include #include +#include +#include namespace openspace::dataloader::csv { diff --git a/include/openspace/data/dataloader.h b/include/openspace/data/dataloader.h index c0f22cc7de..0e9a173454 100644 --- a/include/openspace/data/dataloader.h +++ b/include/openspace/data/dataloader.h @@ -27,8 +27,6 @@ #include #include -#include -#include #include #include #include diff --git a/include/openspace/data/datamapping.h b/include/openspace/data/datamapping.h index 5554c630d9..1777b1ac04 100644 --- a/include/openspace/data/datamapping.h +++ b/include/openspace/data/datamapping.h @@ -25,12 +25,14 @@ #ifndef __OPENSPACE_CORE___DATAMAPPING___H__ #define __OPENSPACE_CORE___DATAMAPPING___H__ +#include #include #include +#include #include -namespace openspace::documentation { struct Documentation; } namespace ghoul { class Dictionary; } +namespace openspace::documentation { struct Documentation; } namespace openspace::dataloader { @@ -62,8 +64,8 @@ struct DataMapping { }; /** - * Generate a string based on the data mapping, that can be used to uniquely - * identify the dataset. + * Generate a string based on the data mapping, that can be used to uniquely identify the + * dataset. */ std::string generateHashString(const DataMapping& dm); diff --git a/include/openspace/data/speckloader.h b/include/openspace/data/speckloader.h index fe4175f9f4..3419350253 100644 --- a/include/openspace/data/speckloader.h +++ b/include/openspace/data/speckloader.h @@ -25,10 +25,16 @@ #ifndef __OPENSPACE_CORE___SPECKLOADER___H__ #define __OPENSPACE_CORE___SPECKLOADER___H__ -#include +#include #include #include +namespace openspace::dataloader { + struct ColorMap; + struct Dataset; + struct Labelset; +} // namespace openspace::dataloader + namespace openspace::dataloader::speck { Dataset loadSpeckFile(std::filesystem::path path, diff --git a/include/openspace/documentation/documentationengine.h b/include/openspace/documentation/documentationengine.h index 4b8c08e1bc..38b538e961 100644 --- a/include/openspace/documentation/documentationengine.h +++ b/include/openspace/documentation/documentationengine.h @@ -28,13 +28,13 @@ #include #include #include -#include +#include namespace openspace::documentation { /** * The DocumentationEngine has the ability to collect all Documentation%s that are - * produced in the application an write them out as a documentation file for human + * produced in the application and write them out as a documentation file for human * consumption. */ class DocumentationEngine { diff --git a/include/openspace/documentation/verifier.h b/include/openspace/documentation/verifier.h index ce5610db4c..f6aaa0e214 100644 --- a/include/openspace/documentation/verifier.h +++ b/include/openspace/documentation/verifier.h @@ -27,7 +27,16 @@ #include #include +#include +#include +#include +#include +#include #include +#include +#include + +namespace ghoul { class Dictionary; } namespace openspace::documentation { diff --git a/include/openspace/documentation/verifier.inl b/include/openspace/documentation/verifier.inl index 61aa451861..94b944344f 100644 --- a/include/openspace/documentation/verifier.inl +++ b/include/openspace/documentation/verifier.inl @@ -22,14 +22,34 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include #include #include -#include +#include #include #include +#include +#include +#include namespace openspace::documentation { +// Workaround for macOS libc++ std::format with std::vector +namespace detail { + template + decltype(auto) format_value(T&& value) { + using Type = std::remove_cvref_t; + if constexpr (std::is_same_v::reference> || + std::is_same_v::const_reference>) + { + return static_cast(std::forward(value)); + } + else { + return std::forward(value); + } + } +} // detail + template <> TestResult TemplateVerifier::operator()(const ghoul::Dictionary& dict, const std::string& key) const; @@ -71,7 +91,7 @@ TestResult TemplateVerifier::operator()(const ghoul::Dictionary& dict, template std::string TemplateVerifier::documentation() const { - return "Value of type '" + type() + "'"; + return std::format("Value of type '{}'", type()); } template @@ -83,7 +103,7 @@ std::string Vector2Verifier::type() const { return "Vector2"; } else { - return std::string("Vector2<") + typeid(T).name() + ">"; + return std::format("Vector2<{}>", typeid(T).name()); } } @@ -96,7 +116,7 @@ std::string Vector3Verifier::type() const { return "Vector3"; } else { - return std::string("Vector3<") + typeid(T).name() + ">"; + return std::format("Vector3<{}>", typeid(T).name()); } } @@ -109,7 +129,7 @@ std::string Vector4Verifier::type() const { return "Vector4"; } else { - return std::string("Vector4<") + typeid(T).name() + ">"; + return std::format("Vector4<{}>", typeid(T).name()); } } @@ -122,7 +142,7 @@ std::string Matrix2x2Verifier::type() const { return "Matrix2x2"; } else { - return std::string("Matrix2x2<") + typeid(T).name() + ">"; + return std::format("Matrix2x2<{}>", typeid(T).name()); } } @@ -135,7 +155,7 @@ std::string Matrix2x3Verifier::type() const { return "Matrix2x3"; } else { - return std::string("Matrix2x3<") + typeid(T).name() + ">"; + return std::format("Matrix2x3<{}>", typeid(T).name()); } } @@ -148,7 +168,7 @@ std::string Matrix2x4Verifier::type() const { return "Matrix2x4"; } else { - return std::string("Matrix2x4<") + typeid(T).name() + ">"; + return std::format("Matrix2x4<{}>", typeid(T).name()); } } @@ -161,7 +181,7 @@ std::string Matrix3x2Verifier::type() const { return "Matrix3x2"; } else { - return std::string("Matrix3x2<") + typeid(T).name() + ">"; + return std::format("Matrix3x2<{}>", typeid(T).name()); } } @@ -174,7 +194,7 @@ std::string Matrix3x3Verifier::type() const { return "Matrix3x3"; } else { - return std::string("Matrix3x3<") + typeid(T).name() + ">"; + return std::format("Matrix3x3<{}>", typeid(T).name()); } } @@ -187,7 +207,7 @@ std::string Matrix3x4Verifier::type() const { return "Matrix3x4"; } else { - return std::string("Matrix3x4<") + typeid(T).name() + ">"; + return std::format("Matrix3x4<{}>", typeid(T).name()); } } @@ -200,7 +220,7 @@ std::string Matrix4x2Verifier::type() const { return "Matrix4x2"; } else { - return std::string("Matrix4x2<") + typeid(T).name() + ">"; + return std::format("Matrix4x2<{}>", typeid(T).name()); } } @@ -213,7 +233,7 @@ std::string Matrix4x3Verifier::type() const { return "Matrix4x3"; } else { - return std::string("Matrix4x3<") + typeid(T).name() + ">"; + return std::format("Matrix4x3<{}>", typeid(T).name()); } } @@ -226,7 +246,7 @@ std::string Matrix4x4Verifier::type() const { return "Matrix4x4"; } else { - return std::string("Matrix4x4<") + typeid(T).name() + ">"; + return std::format("Matrix4x4<{}>", typeid(T).name()); } } @@ -254,7 +274,7 @@ TestResult OperatorVerifier::operator()(const ghoul::Dictionary& di else if constexpr (std::is_same_v) { const double d = dict.value(key); double intPart; - bool isInt = modf(d, &intPart) == 0.0; + bool isInt = std::modf(d, &intPart) == 0.0; if (isInt) { val = static_cast(d); } @@ -292,32 +312,32 @@ TestResult OperatorVerifier::operator()(const ghoul::Dictionary& di template std::string LessVerifier::documentation() const { - return "Less than: " + ghoul::to_string(value); + return std::format("Less than: {}", ghoul::to_string(value)); } template std::string LessEqualVerifier::documentation() const { - return "Less or equal to: " + ghoul::to_string(value); + return std::format("Less or equal to: {}", ghoul::to_string(value)); } template std::string GreaterVerifier::documentation() const { - return "Greater than: " + ghoul::to_string(value); + return std::format("Greater than: {}", ghoul::to_string(value)); } template std::string GreaterEqualVerifier::documentation() const { - return "Greater or equal to: " + ghoul::to_string(value); + return std::format("Greater or equal to: {}", ghoul::to_string(value)); } template std::string EqualVerifier::documentation() const { - return "Equal to: " + ghoul::to_string(value); + return std::format("Equal to: {}", ghoul::to_string(value)); } template std::string UnequalVerifier::documentation() const { - return "Unequal to: " + ghoul::to_string(value); + return std::format("Unequal to: {}", ghoul::to_string(value)); } template @@ -376,7 +396,7 @@ TestResult InListVerifier::operator()(const ghoul::Dictionary& dict, std::string list = std::accumulate( values.begin() + 1, values.end(), - std::format("{}", values.front()), + std::format("{}", detail::format_value(values.front())), [](std::string lhs, typename T::Type rhs) { return std::format("{}, {}", lhs, rhs); } @@ -543,7 +563,7 @@ TestResult InRangeVerifier::operator()(const ghoul::Dictionary& dict, else if constexpr (std::is_same_v) { const double d = dict.value(key); double intPart; - bool isInt = modf(d, &intPart) == 0.0; + const bool isInt = std::modf(d, &intPart) == 0.0; if (isInt) { val = static_cast(d); } @@ -583,8 +603,9 @@ TestResult InRangeVerifier::operator()(const ghoul::Dictionary& dict, template std::string InRangeVerifier::documentation() const { - return "In range: ( " + ghoul::to_string(lower) + "," + - ghoul::to_string(upper) + " )"; + return std::format( + "In range: ( {}, {})", ghoul::to_string(lower), ghoul::to_string(upper) + ); } template @@ -636,7 +657,7 @@ TestResult NotInRangeVerifier::operator()(const ghoul::Dictionary& dict, else if constexpr (std::is_same_v) { const double d = dict.value(key); double intPart; - bool isInt = modf(d, &intPart) == 0.0; + const bool isInt = std::modf(d, &intPart) == 0.0; if (isInt) { val = static_cast(d); } diff --git a/include/openspace/engine/configuration.h b/include/openspace/engine/configuration.h index 920b6b51b6..eb566f686d 100644 --- a/include/openspace/engine/configuration.h +++ b/include/openspace/engine/configuration.h @@ -25,9 +25,9 @@ #ifndef __OPENSPACE_CORE___CONFIGURATION___H__ #define __OPENSPACE_CORE___CONFIGURATION___H__ -#include #include #include +#include #include #include #include diff --git a/include/openspace/engine/downloadmanager.h b/include/openspace/engine/downloadmanager.h index 5f49f0a07d..243a4c3de6 100644 --- a/include/openspace/engine/downloadmanager.h +++ b/include/openspace/engine/downloadmanager.h @@ -26,6 +26,7 @@ #define __OPENSPACE_CORE___DOWNLOADMANAGER___H__ #include +#include #include #include #include @@ -84,7 +85,7 @@ public: // Just a helper function to check if a future is ready to ".get()". Not specific // to DownloadManager but is useful for anyone using the DownloadManager - template + template static bool futureReady(std::future const& f) { return f.wait_for(std::chrono::seconds(0)) == std::future_status::ready; } diff --git a/include/openspace/engine/globals.h b/include/openspace/engine/globals.h index c85039cf88..942422fc99 100644 --- a/include/openspace/engine/globals.h +++ b/include/openspace/engine/globals.h @@ -32,24 +32,6 @@ namespace ghoul::fontrendering { class FontManager; } namespace openspace { -struct Configuration; -class Dashboard; -class DeferredcasterManager; -class DownloadManager; -class EventEngine; -class LuaConsole; -class MemoryManager; -class MissionManager; -class ModuleEngine; -class OpenSpaceEngine; -class ParallelPeer; -class RaycasterManager; -class RenderEngine; -class ScreenSpaceRenderable; -class SyncEngine; -class TimeManager; -class VersionChecker; -struct WindowDelegate; namespace interaction { struct JoystickInputStates; struct WebsocketInputStates; @@ -65,13 +47,33 @@ namespace scripting { class ScriptEngine; class ScriptScheduler; } // namespace scripting +struct Configuration; +class Dashboard; +class DeferredcasterManager; +class DownloadEventEngine; +class DownloadManager; +class EventEngine; +class LuaConsole; +class MemoryManager; +class MissionManager; +class ModuleEngine; +class OpenSpaceEngine; +class ParallelPeer; class Profile; +class RaycasterManager; +class RenderEngine; +class ScreenSpaceRenderable; +class SyncEngine; +class TimeManager; +class VersionChecker; +struct WindowDelegate; namespace global { inline ghoul::fontrendering::FontManager* fontManager; inline Dashboard* dashboard; inline DeferredcasterManager* deferredcasterManager; +inline DownloadEventEngine* downloadEventEngine; inline DownloadManager* downloadManager; inline EventEngine* eventEngine; inline LuaConsole* luaConsole; diff --git a/include/openspace/engine/moduleengine.h b/include/openspace/engine/moduleengine.h index 9cb789dc81..e9413d55de 100644 --- a/include/openspace/engine/moduleengine.h +++ b/include/openspace/engine/moduleengine.h @@ -30,6 +30,7 @@ #include #include #include +#include #include namespace ghoul { class Dictionary; } @@ -37,10 +38,9 @@ namespace ghoul::systemcapabilities { struct Version; } namespace openspace { -class OpenSpaceModule; - namespace documentation { struct Documentation; } namespace scripting { struct LuaLibrary; } +class OpenSpaceModule; /** * The ModuleEngine is the central repository for registering and accessing diff --git a/include/openspace/engine/moduleengine.inl b/include/openspace/engine/moduleengine.inl index c53d2105af..ca8cc74deb 100644 --- a/include/openspace/engine/moduleengine.inl +++ b/include/openspace/engine/moduleengine.inl @@ -30,16 +30,14 @@ namespace openspace { template ModuleSubClass* ModuleEngine::module() const { - const auto it = std::find_if(_modules.begin(), _modules.end(), + const auto it = std::find_if( + _modules.begin(), + _modules.end(), [](const std::unique_ptr& m) { - return m->identifier() == ModuleSubClass::Name; - }); - if (it != _modules.end()) { - return dynamic_cast(it->get()); - } - else { - return nullptr; - } + return m->identifier() == ModuleSubClass::Name; + } + ); + return it != _modules.end() ? dynamic_cast(it->get()) : nullptr; } } // namespace openspace diff --git a/include/openspace/engine/openspaceengine.h b/include/openspace/engine/openspaceengine.h index 597d09f295..50515a8db5 100644 --- a/include/openspace/engine/openspaceengine.h +++ b/include/openspace/engine/openspaceengine.h @@ -27,7 +27,6 @@ #include #include -#include #include #include #include @@ -38,19 +37,24 @@ #include #include #include +#include +#include +#include +#include #include #include +#include #include +#include #include namespace openspace { +namespace scripting { struct LuaLibrary; } class AssetManager; class LoadingScreen; class Scene; -namespace scripting { struct LuaLibrary; } - /** * Structure that is responsible for the delayed shutdown of the application. */ diff --git a/include/openspace/engine/settings.h b/include/openspace/engine/settings.h index e549fc57a0..ee51f2b51e 100644 --- a/include/openspace/engine/settings.h +++ b/include/openspace/engine/settings.h @@ -29,6 +29,7 @@ #include #include #include +#include namespace openspace { diff --git a/include/openspace/engine/syncengine.h b/include/openspace/engine/syncengine.h index d26907f22e..f2cfc395fe 100644 --- a/include/openspace/engine/syncengine.h +++ b/include/openspace/engine/syncengine.h @@ -26,9 +26,8 @@ #define __OPENSPACE_CORE___SYNCENGINE___H__ #include - #include -#include +#include #include namespace openspace { diff --git a/include/openspace/events/event.h b/include/openspace/events/event.h index 179be598cf..146e057e5c 100644 --- a/include/openspace/events/event.h +++ b/include/openspace/events/event.h @@ -28,10 +28,12 @@ #include #include #include +#include +#include +#include namespace openspace { namespace properties { class Property; } - class Camera; class Layer; class Profile; @@ -60,7 +62,7 @@ struct Event { enum class Type : uint8_t { ParallelConnection, ProfileLoadingFinished, - AssetLoadingFinished, + AssetLoading, ApplicationShutdown, CameraFocusTransition, TimeOfInterestReached, @@ -152,17 +154,32 @@ struct EventProfileLoadingFinished : public Event { }; /** -* This event is created when the loading of all assets are finished. This is emitted -* regardless of whether it is the initial startup of a profile, or any subsequent asset -* being loaded e.g., through add or drag-and-drop. +* This event is created whenever the loading state of an assets changes. An asset can +* enter one of four states: `Loading`, `Loaded`, `Unloaded`, or `Error`. This event is +* emitted regardless of whether it is the initial startup of a profile, or any subsequent +* asset being added or revmoed e.g., through add or drag-and-drop. */ -struct EventAssetLoadingFinished : public Event { - static constexpr Type Type = Event::Type::AssetLoadingFinished; +struct EventAssetLoading : public Event { + static constexpr Type Type = Event::Type::AssetLoading; + + enum class State { + Loaded, + Loading, + Unloaded, + Error + }; /** - * Creates an instance of an AssetLoadingFinished event. + * Creates an instance of an AssetLoading event. + * + * \param assetPath_ The path to the asset + * \param newState The new state of the asset given by 'asstPath_'; is one of + `Loading`, `Loaded`, `Unloaded`, or `Error` */ - EventAssetLoadingFinished(); + EventAssetLoading(const std::filesystem::path& assetPath_, State newState); + + std::filesystem::path assetPath; + State state; }; /** diff --git a/include/openspace/events/eventengine.h b/include/openspace/events/eventengine.h index 1c3d484cd0..1aa671dd1a 100644 --- a/include/openspace/events/eventengine.h +++ b/include/openspace/events/eventengine.h @@ -26,13 +26,17 @@ #define __OPENSPACE_CORE___EVENTENGINE___H__ #include -#include +#include #include +#include +#include +#include #include +#include namespace openspace { -namespace events { struct Event; } +namespace scripting { struct LuaLibrary; } class EventEngine { public: diff --git a/include/openspace/interaction/actionmanager.h b/include/openspace/interaction/actionmanager.h index ef139163f3..aa43fcfdbd 100644 --- a/include/openspace/interaction/actionmanager.h +++ b/include/openspace/interaction/actionmanager.h @@ -26,7 +26,9 @@ #define __OPENSPACE_CORE___ACTIONMANAGER___H__ #include +#include #include +#include namespace ghoul { class Dictionary; } namespace openspace::scripting { struct LuaLibrary; } diff --git a/include/openspace/interaction/camerainteractionstates.h b/include/openspace/interaction/camerainteractionstates.h index edd300a4dc..4a4dc2c744 100644 --- a/include/openspace/interaction/camerainteractionstates.h +++ b/include/openspace/interaction/camerainteractionstates.h @@ -55,7 +55,7 @@ public: void resetVelocities(); /** - * Returns true if any of the velocities are larger than zero, i.e. wether an + * Returns true if any of the velocities are larger than zero, i.e. whether an * interaction happened. */ bool hasNonZeroVelocities(bool checkOnlyMovement = false) const; @@ -63,7 +63,7 @@ public: protected: template struct InteractionState { - InteractionState(double scaleFactor); + explicit InteractionState(double scaleFactor); void setFriction(double friction); void setVelocityScaleFactor(double scaleFactor); diff --git a/include/openspace/interaction/delayedvariable.h b/include/openspace/interaction/delayedvariable.h index 790e0d5ac5..0b284fb1e1 100644 --- a/include/openspace/interaction/delayedvariable.h +++ b/include/openspace/interaction/delayedvariable.h @@ -36,6 +36,7 @@ template class DelayedVariable { public: DelayedVariable(ScaleType scaleFactor, ScaleType friction); + void set(T value, double dt); void decelerate(double dt); void setHard(T value); diff --git a/include/openspace/interaction/joystickcamerastates.h b/include/openspace/interaction/joystickcamerastates.h index edd4e86bc3..b32dc8b70b 100644 --- a/include/openspace/interaction/joystickcamerastates.h +++ b/include/openspace/interaction/joystickcamerastates.h @@ -28,9 +28,12 @@ #include #include +#include #include -#include +#include #include +#include +#include #include namespace openspace::interaction { diff --git a/include/openspace/interaction/joystickinputstate.h b/include/openspace/interaction/joystickinputstate.h index 12b81e1ee4..2b4e8bb376 100644 --- a/include/openspace/interaction/joystickinputstate.h +++ b/include/openspace/interaction/joystickinputstate.h @@ -28,10 +28,11 @@ #include #include #include -#include #include -#include +#include #include +#include +#include namespace openspace::interaction { diff --git a/include/openspace/interaction/keybindingmanager.h b/include/openspace/interaction/keybindingmanager.h index 94707e68e4..5e89f8172f 100644 --- a/include/openspace/interaction/keybindingmanager.h +++ b/include/openspace/interaction/keybindingmanager.h @@ -26,14 +26,16 @@ #define __OPENSPACE_CORE___KEYBINDINGMANAGER___H__ #include +#include +#include +#include namespace openspace { + namespace scripting { struct LuaLibrary; } class Camera; class SceneGraphNode; } // namespace openspace -namespace openspace::scripting { struct LuaLibrary; } - namespace openspace::interaction { class KeybindingManager { diff --git a/include/openspace/interaction/keyboardinputstate.h b/include/openspace/interaction/keyboardinputstate.h index 481ebae77c..8ea75ab294 100644 --- a/include/openspace/interaction/keyboardinputstate.h +++ b/include/openspace/interaction/keyboardinputstate.h @@ -26,6 +26,7 @@ #define __OPENSPACE_CORE___KEYBOARDINPUTSTATE___H__ #include +#include #include namespace openspace::interaction { diff --git a/include/openspace/interaction/keyframerecordinghandler.h b/include/openspace/interaction/keyframerecordinghandler.h index 64e96ed3b1..807a3b7956 100644 --- a/include/openspace/interaction/keyframerecordinghandler.h +++ b/include/openspace/interaction/keyframerecordinghandler.h @@ -28,11 +28,13 @@ #include #include -#include #include #include #include +namespace ghoul { class Dictionary; } +namespace openspace::scripting { struct LuaLibrary; } + namespace openspace::interaction { class KeyframeRecordingHandler : public properties::PropertyOwner { diff --git a/include/openspace/interaction/mousecamerastates.h b/include/openspace/interaction/mousecamerastates.h index dcffb435bc..36d0d786e7 100644 --- a/include/openspace/interaction/mousecamerastates.h +++ b/include/openspace/interaction/mousecamerastates.h @@ -29,8 +29,8 @@ namespace openspace::interaction { -class MouseInputState; class KeyboardInputState; +class MouseInputState; class MouseCameraStates : public CameraInteractionStates { public: @@ -43,7 +43,6 @@ public: private: bool _isMouseButtonInverted = false; - double _currentSensitivityRamp = 1.0; }; diff --git a/include/openspace/interaction/scriptcamerastates.h b/include/openspace/interaction/scriptcamerastates.h index f9617f5cc3..342f736d87 100644 --- a/include/openspace/interaction/scriptcamerastates.h +++ b/include/openspace/interaction/scriptcamerastates.h @@ -27,6 +27,8 @@ #include +#include + namespace openspace::interaction { class ScriptCameraStates : public CameraInteractionStates { diff --git a/include/openspace/interaction/sessionrecording.h b/include/openspace/interaction/sessionrecording.h index 2eee114608..42ce14fa28 100644 --- a/include/openspace/interaction/sessionrecording.h +++ b/include/openspace/interaction/sessionrecording.h @@ -26,13 +26,14 @@ #define __OPENSPACE_CORE___SESSIONRECORDING___H__ #include -#include #include #include #include #include #include +namespace ghoul { class Dictionary; } + namespace openspace::interaction { enum class DataMode { diff --git a/include/openspace/interaction/sessionrecordinghandler.h b/include/openspace/interaction/sessionrecordinghandler.h index 1e2114a21d..a511a2b8dc 100644 --- a/include/openspace/interaction/sessionrecordinghandler.h +++ b/include/openspace/interaction/sessionrecordinghandler.h @@ -30,6 +30,17 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace openspace::properties { class Property; } namespace openspace::interaction { diff --git a/include/openspace/interaction/tasks/convertrecformattask.h b/include/openspace/interaction/tasks/convertrecformattask.h index 2f8ae62366..413acae70f 100644 --- a/include/openspace/interaction/tasks/convertrecformattask.h +++ b/include/openspace/interaction/tasks/convertrecformattask.h @@ -26,11 +26,9 @@ #define __OPENSPACE_CORE___CONVERTRECFORMATTASK___H__ #include -#include -#include +#include #include -#include namespace openspace::interaction { diff --git a/include/openspace/interaction/websocketcamerastates.h b/include/openspace/interaction/websocketcamerastates.h index 2fc50547bf..79d0bb4cc8 100644 --- a/include/openspace/interaction/websocketcamerastates.h +++ b/include/openspace/interaction/websocketcamerastates.h @@ -29,8 +29,11 @@ #include #include -#include +#include +#include #include +#include +#include #include namespace openspace::interaction { diff --git a/include/openspace/interaction/websocketinputstate.h b/include/openspace/interaction/websocketinputstate.h index 593fb22394..6d7bce59bc 100644 --- a/include/openspace/interaction/websocketinputstate.h +++ b/include/openspace/interaction/websocketinputstate.h @@ -27,11 +27,11 @@ #include #include -#include #include -#include +#include #include #include +#include namespace openspace::interaction { diff --git a/include/openspace/mission/mission.h b/include/openspace/mission/mission.h index 0258bec3e1..7ae028c18a 100644 --- a/include/openspace/mission/mission.h +++ b/include/openspace/mission/mission.h @@ -27,6 +27,7 @@ #include #include +#include #include #include #include @@ -121,7 +122,6 @@ public: */ const std::vector& phases() const; - /** * Returns all important dates. * @@ -129,7 +129,6 @@ public: */ const std::vector& milestones() const; - /** * Returns all actions. * diff --git a/include/openspace/mission/missionmanager.h b/include/openspace/mission/missionmanager.h index 50bd573e47..f61e1350ad 100644 --- a/include/openspace/mission/missionmanager.h +++ b/include/openspace/mission/missionmanager.h @@ -26,9 +26,6 @@ #define __OPENSPACE_CORE___MISSIONMANAGER___H__ #include - -#include -#include #include #include diff --git a/include/openspace/navigation/keyframenavigator.h b/include/openspace/navigation/keyframenavigator.h index dd946f3125..3e93b81f04 100644 --- a/include/openspace/navigation/keyframenavigator.h +++ b/include/openspace/navigation/keyframenavigator.h @@ -25,25 +25,19 @@ #ifndef __OPENSPACE_CORE___KEYFRAMENAVIGATOR___H__ #define __OPENSPACE_CORE___KEYFRAMENAVIGATOR___H__ -#include #include #include #include -#include +#include namespace openspace { + namespace datamessagestructures { struct CameraKeyframe; } class Camera; class TimeManager; } // namespace openspace namespace openspace::interaction { -enum class KeyframeTimeRef { - Relative_applicationStart, - Relative_recordedStart, - Absolute_simTimeJ2000 -}; - class KeyframeNavigator { public: BooleanType(Inclusive); @@ -79,11 +73,10 @@ public: void clearKeyframes(); size_t nKeyframes() const; double currentTime() const; - void setTimeReferenceMode(KeyframeTimeRef refType, double referenceTimestamp); + void setReferenceTime(double referenceTimestamp); private: Timeline _cameraPoseTimeline; - KeyframeTimeRef _timeframeMode = KeyframeTimeRef::Relative_applicationStart; double _referenceTimestamp = 0.0; }; diff --git a/include/openspace/navigation/navigationhandler.h b/include/openspace/navigation/navigationhandler.h index 9e4b598cd5..41a8320745 100644 --- a/include/openspace/navigation/navigationhandler.h +++ b/include/openspace/navigation/navigationhandler.h @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -38,23 +39,26 @@ #include #include #include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include namespace openspace { + namespace scripting { struct LuaLibrary; } class Camera; class SceneGraphNode; } // namespace openspace -namespace openspace::scripting { struct LuaLibrary; } - namespace openspace::interaction { struct JoystickInputStates; -class KeyframeNavigator; struct NavigationState; -class OrbitalNavigator; -class PathNavigator; struct NodeCameraStateSpec; struct WebsocketInputStates; diff --git a/include/openspace/navigation/navigationstate.h b/include/openspace/navigation/navigationstate.h index ced0f6dd3b..78dffabfcf 100644 --- a/include/openspace/navigation/navigationstate.h +++ b/include/openspace/navigation/navigationstate.h @@ -25,11 +25,14 @@ #ifndef __OPENSPACE_CORE___NAVIGATIONSTATE___H__ #define __OPENSPACE_CORE___NAVIGATIONSTATE___H__ -#include #include +#include #include +#include +namespace ghoul { class Dictionary; } namespace openspace { + namespace documentation { struct Documentation; } struct CameraPose; } // namespace openspace diff --git a/include/openspace/navigation/orbitalnavigator.h b/include/openspace/navigation/orbitalnavigator.h index f3601b7bc3..bd968b2035 100644 --- a/include/openspace/navigation/orbitalnavigator.h +++ b/include/openspace/navigation/orbitalnavigator.h @@ -27,7 +27,6 @@ #include -#include #include #include #include @@ -40,18 +39,18 @@ #include #include #include -#include #include +#include namespace openspace { + namespace scripting { struct LuaLibrary; } class Camera; struct CameraPose; class SceneGraphNode; struct SurfacePositionHandle; + class Syncable; } // namespace -namespace openspace::scripting { struct LuaLibrary; } - namespace openspace::interaction { class MouseInputState; diff --git a/include/openspace/navigation/path.h b/include/openspace/navigation/path.h index ffa0661a57..59a650a837 100644 --- a/include/openspace/navigation/path.h +++ b/include/openspace/navigation/path.h @@ -25,14 +25,16 @@ #ifndef __OPENSPACE_CORE___PATH___H__ #define __OPENSPACE_CORE___PATH___H__ -#include #include #include -#include +#include #include +#include #include +namespace ghoul { class Dictionary; } namespace openspace { + namespace documentation { struct Documentation; } struct CameraPose; } // namespace openspace diff --git a/include/openspace/navigation/pathcurve.h b/include/openspace/navigation/pathcurve.h index 3b5e312b2f..6748e45718 100644 --- a/include/openspace/navigation/pathcurve.h +++ b/include/openspace/navigation/pathcurve.h @@ -28,6 +28,7 @@ #include #include #include +#include namespace openspace::interaction { diff --git a/include/openspace/navigation/pathcurves/avoidcollisioncurve.h b/include/openspace/navigation/pathcurves/avoidcollisioncurve.h index f42257f2f3..ee384e0b36 100644 --- a/include/openspace/navigation/pathcurves/avoidcollisioncurve.h +++ b/include/openspace/navigation/pathcurves/avoidcollisioncurve.h @@ -27,11 +27,13 @@ #include +#include + namespace openspace { class SceneGraphNode; } namespace openspace::interaction { -class WayPoint; +class Waypoint; class AvoidCollisionCurve : public PathCurve { public: diff --git a/include/openspace/navigation/pathcurves/zoomoutoverviewcurve.h b/include/openspace/navigation/pathcurves/zoomoutoverviewcurve.h index 32ee9ee5d8..756d71de9a 100644 --- a/include/openspace/navigation/pathcurves/zoomoutoverviewcurve.h +++ b/include/openspace/navigation/pathcurves/zoomoutoverviewcurve.h @@ -29,7 +29,7 @@ namespace openspace::interaction { -class WayPoint; +class Waypoint; class ZoomOutOverviewCurve : public PathCurve { public: diff --git a/include/openspace/navigation/pathnavigator.h b/include/openspace/navigation/pathnavigator.h index 1cc0633d19..15aa10e777 100644 --- a/include/openspace/navigation/pathnavigator.h +++ b/include/openspace/navigation/pathnavigator.h @@ -33,17 +33,15 @@ #include #include #include -#include #include namespace openspace { + namespace scripting { struct LuaLibrary; } class Camera; struct CameraPose; class SceneGraphNode; } // namespace openspace -namespace openspace::scripting { struct LuaLibrary; } - namespace openspace::interaction { class Path; diff --git a/include/openspace/network/messagestructures.h b/include/openspace/network/messagestructures.h index bf6b50b94d..fb0794a36b 100644 --- a/include/openspace/network/messagestructures.h +++ b/include/openspace/network/messagestructures.h @@ -25,12 +25,8 @@ #ifndef __OPENSPACE_CORE___MESSAGESTRUCTURES___H__ #define __OPENSPACE_CORE___MESSAGESTRUCTURES___H__ -#include #include -#include -#include -#include -#include +#include #include #include #include @@ -47,17 +43,18 @@ enum class Type : uint32_t { struct CameraKeyframe { CameraKeyframe() = default; - explicit CameraKeyframe(const std::vector& buffer) { - deserialize(buffer); - } + explicit CameraKeyframe(const std::vector& buffer); CameraKeyframe(glm::dvec3 pos, glm::dquat rot, std::string focusNode, - bool followNodeRot, float scale) - : _position(pos) - , _rotation(rot) - , _followNodeRotation(followNodeRot) - , _focusNode(focusNode) - , _scale(scale) - {} + bool followNodeRot, float scale); + + void serialize(std::vector& buffer) const; + size_t deserialize(const std::vector& buffer, size_t offset = 0); + + void write(std::ostream& out) const; + void write(std::stringstream& out) const; + + void read(std::istream* in); + void read(std::istringstream& iss); glm::dvec3 _position = glm::dvec3(0.0); glm::dquat _rotation = glm::dquat(1.0, 0.0, 0.0, 0.0); @@ -66,411 +63,57 @@ struct CameraKeyframe { float _scale = 0.f; double _timestamp = 0.0; - - void serialize(std::vector& buffer) const { - // Add position - buffer.insert( - buffer.end(), - reinterpret_cast(&_position), - reinterpret_cast(&_position) + sizeof(_position) - ); - - // Add orientation - buffer.insert( - buffer.end(), - reinterpret_cast(&_rotation), - reinterpret_cast(&_rotation) + sizeof(_rotation) - ); - - // Follow focus node rotation? - buffer.insert( - buffer.end(), - reinterpret_cast(&_followNodeRotation), - reinterpret_cast(&_followNodeRotation) + - sizeof(_followNodeRotation) - ); - - uint32_t nodeNameLength = static_cast(_focusNode.size()); - - // Add focus node - buffer.insert( - buffer.end(), - reinterpret_cast(&nodeNameLength), - reinterpret_cast(&nodeNameLength) + sizeof(uint32_t) - ); - buffer.insert( - buffer.end(), - _focusNode.data(), - _focusNode.data() + nodeNameLength - ); - - buffer.insert( - buffer.end(), - reinterpret_cast(&_scale), - reinterpret_cast(&_scale) + sizeof(_scale) - ); - - // Add timestamp - buffer.insert( - buffer.end(), - reinterpret_cast(&_timestamp), - reinterpret_cast(&_timestamp) + sizeof(_timestamp) - ); - } - - size_t deserialize(const std::vector& buffer, size_t offset = 0) { - int size = 0; - - // Position - size = sizeof(_position); - std::memcpy(glm::value_ptr(_position), buffer.data() + offset, size); - offset += size; - - // Orientation - size = sizeof(_rotation); - std::memcpy(glm::value_ptr(_rotation), buffer.data() + offset, size); - offset += size; - - // Follow focus node rotation? - size = sizeof(_followNodeRotation); - std::memcpy(&_followNodeRotation, buffer.data() + offset, size); - offset += size; - - // Focus node - int nodeNameLength; - size = sizeof(int); - std::memcpy(&nodeNameLength, buffer.data() + offset, size); - offset += size; - size = nodeNameLength; - _focusNode = std::string(buffer.data() + offset, buffer.data() + offset + size); - offset += size; - - // Scale - size = sizeof(_scale); - std::memcpy(&_scale, buffer.data() + offset, size); - offset += size; - - // Timestamp - size = sizeof(_timestamp); - std::memcpy(&_timestamp, buffer.data() + offset, size); - offset += size; - - return offset; - } - - void write(std::ostream& out) const { - out.write( - reinterpret_cast(glm::value_ptr(_position)), - sizeof(_position) - ); - out.write( - reinterpret_cast(glm::value_ptr(_rotation)), - sizeof(_rotation) - ); - - // Write follow focus node rotation? - out.write( - reinterpret_cast(&_followNodeRotation), - sizeof(_followNodeRotation) - ); - - int nodeNameLength = static_cast(_focusNode.size()); - - // Write focus node - out.write(reinterpret_cast(&nodeNameLength), sizeof(nodeNameLength)); - out.write(_focusNode.c_str(), _focusNode.size()); - - // Write scale - out.write(reinterpret_cast(&_scale), sizeof(_scale)); - - // Write timestamp - out.write(reinterpret_cast(&_timestamp), sizeof(_timestamp)); - } - - void write(std::stringstream& out) const { - // Add camera position - out << std::setprecision(std::numeric_limits::max_digits10); - out << _position.x << ' ' << _position.y << ' ' << _position.z << ' '; - // Add camera rotation - out << _rotation.x << ' ' - << _rotation.y << ' ' - << _rotation.z << ' ' - << _rotation.w << ' '; - out << std::scientific << _scale << ' '; - if (_followNodeRotation) { - out << "F "; - } - else { - out << "- "; - } - out << _focusNode; - } - - void read(std::istream* in) { - // Read position - in->read(reinterpret_cast(&_position), sizeof(_position)); - - // Read orientation - in->read(reinterpret_cast(&_rotation), sizeof(_rotation)); - - // Read follow focus node rotation - unsigned char b; - in->read(reinterpret_cast(&b), sizeof(unsigned char)); - _followNodeRotation = (b == 1); - - // Read focus node - int nodeNameLength = static_cast(_focusNode.size()); - in->read(reinterpret_cast(&nodeNameLength), sizeof(nodeNameLength)); - std::vector temp(static_cast(nodeNameLength) + 1); - in->read(temp.data(), nodeNameLength); - - temp[nodeNameLength] = '\0'; - _focusNode = temp.data(); - - // Read scale - in->read(reinterpret_cast(&_scale), sizeof(_scale)); - - // Read timestamp - in->read(reinterpret_cast(&_timestamp), sizeof(_timestamp)); - } - - void read(std::istringstream& iss) { - std::string rotationFollowing; - - iss >> _position.x - >> _position.y - >> _position.z - >> _rotation.x - >> _rotation.y - >> _rotation.z - >> _rotation.w - >> _scale - >> rotationFollowing - >> _focusNode; - _followNodeRotation = (rotationFollowing == "F"); - } }; struct TimeKeyframe { TimeKeyframe() = default; - TimeKeyframe(const std::vector& buffer) { - deserialize(buffer); - } + TimeKeyframe(const std::vector& buffer); + + void serialize(std::vector& buffer) const; + size_t deserialize(const std::vector& buffer, size_t offset = 0); + + void write(std::ostream* out) const; + void write(std::stringstream& out) const; + + void read(std::istream* in); + void read(std::istringstream& iss); double _time = 0.0; double _dt = 0.0; bool _paused = false; bool _requiresTimeJump = false; double _timestamp = 0.0; - - void serialize(std::vector& buffer) const { - buffer.insert( - buffer.end(), - reinterpret_cast(this), - reinterpret_cast(this) + sizeof(TimeKeyframe) - ); - } - - size_t deserialize(const std::vector& buffer, size_t offset = 0) { - *this = *reinterpret_cast(buffer.data() + offset); - offset += sizeof(TimeKeyframe); - return offset; - } - - void write(std::ostream* out) const { - out->write(reinterpret_cast(this), sizeof(TimeKeyframe)); - } - - void write(std::stringstream& out) const { - out << ' ' << _dt; - if (_paused) { - out << " P"; - } - else { - out << " R"; - } - if (_requiresTimeJump) { - out << " J"; - } - else { - out << " -"; - } - } - - void read(std::istream* in) { - in->read(reinterpret_cast(this), sizeof(TimeKeyframe)); - } - - void read(std::istringstream& iss) { - std::string paused, jump; - - iss >> _dt - >> paused - >> jump; - _paused = (paused == "P"); - _requiresTimeJump = (jump == "J"); - } }; struct TimeTimeline { TimeTimeline() = default; - TimeTimeline(const std::vector& buffer) { - deserialize(buffer); - } + TimeTimeline(const std::vector& buffer); + + void serialize(std::vector& buffer) const; + size_t deserialize(const std::vector& buffer, size_t offset = 0); + + void write(std::ostream* out) const; + void read(std::istream* in); bool _clear = true; std::vector _keyframes; - - void serialize(std::vector& buffer) const { - buffer.insert( - buffer.end(), - reinterpret_cast(&_clear), - reinterpret_cast(&_clear) + sizeof(bool) - ); - - int64_t nKeyframes = _keyframes.size(); - buffer.insert( - buffer.end(), - reinterpret_cast(&nKeyframes), - reinterpret_cast(&nKeyframes) + sizeof(int64_t) - ); - for (const TimeKeyframe& k : _keyframes) { - k.serialize(buffer); - } - } - - size_t deserialize(const std::vector& buffer, size_t offset = 0) { - int size = 0; - - size = sizeof(_clear); - std::memcpy(&_clear, buffer.data() + offset, size); - offset += size; - - int64_t nKeyframes = _keyframes.size(); - size = sizeof(nKeyframes); - std::memcpy(&nKeyframes, buffer.data() + offset, size); - offset += size; - - _keyframes.resize(nKeyframes); - for (TimeKeyframe& k : _keyframes) { - offset = k.deserialize(buffer, offset); - } - return offset; - } - - void write(std::ostream* out) const { - out->write(reinterpret_cast(&_clear), sizeof(bool)); - - int64_t nKeyframes = _keyframes.size(); - out->write(reinterpret_cast(&nKeyframes), sizeof(int64_t)); - for (const TimeKeyframe& k : _keyframes) { - k.write(out); - } - } - - void read(std::istream* in) { - in->read(reinterpret_cast(&_clear), sizeof(bool)); - - int64_t nKeyframes = _keyframes.size(); - in->read(reinterpret_cast(&nKeyframes), sizeof(int64_t)); - for (TimeKeyframe& k : _keyframes) { - k.read(in); - } - } }; struct ScriptMessage { ScriptMessage() = default; + void serialize(std::vector& buffer) const; + void deserialize(const std::vector& buffer); + + void write(std::ostream* out) const; + void write(unsigned char* buf, size_t& idx, std::ofstream& file) const; + void write(std::stringstream& ss) const; + + void read(std::istream* in); + void read(std::istringstream& iss); + std::string _script; double _timestamp = 0.0; - - void serialize(std::vector& buffer) const { - uint32_t strLen = static_cast(_script.size()); - - const char* p = reinterpret_cast(&strLen); - buffer.insert(buffer.end(), p, p + sizeof(uint32_t)); - - buffer.insert(buffer.end(), _script.begin(), _script.end()); - } - - void deserialize(const std::vector& buffer) { - const char* p = buffer.data(); - const uint32_t len = *reinterpret_cast(p); - - if (buffer.size() != (sizeof(uint32_t) + len)) { - LERRORC( - "ParallelPeer", - std::format( - "Received buffer with wrong size. Expected {} got {}", - len, buffer.size() - ) - ); - return; - } - - // We can skip over the first uint32_t that encoded the length - _script.assign(buffer.begin() + sizeof(uint32_t), buffer.end()); - } - - void write(std::ostream* out) const { - out->write(_script.c_str(), _script.size()); - } - - void write(unsigned char* buf, size_t& idx, std::ofstream& file) const { - size_t strLen = _script.size(); - size_t writeSize_bytes = sizeof(size_t); - - unsigned char const *p = reinterpret_cast(&strLen); - memcpy((buf + idx), p, writeSize_bytes); - idx += static_cast(writeSize_bytes); - - memcpy((buf + idx), _script.c_str(), _script.size()); - idx += static_cast(strLen); - file.write(reinterpret_cast(buf), idx); - //Write directly to file because some scripts can be very long - file.write(_script.c_str(), _script.size()); - } - - void write(std::stringstream& ss) const { - unsigned int numLinesInScript = static_cast( - std::count(_script.begin(), _script.end(), '\n') - ); - ss << ' ' << (numLinesInScript + 1) << ' '; - ss << _script; - } - - void read(std::istream* in) { - uint32_t strLen = 0; - //Read string length from file - in->read(reinterpret_cast(&strLen), sizeof(strLen)); - //Read back full string - std::vector temp(strLen + 1); - in->read(temp.data(), strLen); - temp[strLen] = '\0'; - - _script.erase(); - _script = temp.data(); - } - - void read(std::istringstream& iss) { - int numScriptLines; - iss >> numScriptLines; - if (numScriptLines < 0) { - numScriptLines = 0; - } - std::string tmpReadbackScript; - _script.erase(); - for (int i = 0; i < numScriptLines; i++) { - ghoul::getline(iss, tmpReadbackScript); - size_t start = tmpReadbackScript.find_first_not_of(" "); - tmpReadbackScript = tmpReadbackScript.substr(start); - _script.append(tmpReadbackScript); - if (i < (numScriptLines - 1)) { - _script.append("\n"); - } - } - } }; } // namespace openspace::messagestructures diff --git a/include/openspace/network/messagestructureshelper.h b/include/openspace/network/messagestructureshelper.h index dac6cd0504..5e034cfa20 100644 --- a/include/openspace/network/messagestructureshelper.h +++ b/include/openspace/network/messagestructureshelper.h @@ -25,10 +25,14 @@ #ifndef __OPENSPACE_CORE___MESSAGESTRUCTURESHELPER___H__ #define __OPENSPACE_CORE___MESSAGESTRUCTURESHELPER___H__ -#include +#include namespace openspace::datamessagestructures { +struct CameraKeyframe; +struct ScriptMessage; +struct TimeKeyframe; + /** * Method that creates a CameraKeyframe object and populates it with the current * properties of the camera from the navigation handler. diff --git a/include/openspace/network/parallelconnection.h b/include/openspace/network/parallelconnection.h index 1eebac617c..191139c2dc 100644 --- a/include/openspace/network/parallelconnection.h +++ b/include/openspace/network/parallelconnection.h @@ -28,11 +28,13 @@ #include #include #include +#include +#include #include namespace openspace { -class ParallelConnection { +class ParallelConnection { public: enum class Status : uint32_t { Disconnected = 0, diff --git a/include/openspace/network/parallelpeer.h b/include/openspace/network/parallelpeer.h index a5cbbeab39..d59920cd1c 100644 --- a/include/openspace/network/parallelpeer.h +++ b/include/openspace/network/parallelpeer.h @@ -27,7 +27,6 @@ #include -#include #include #include #include @@ -35,6 +34,7 @@ #include #include #include +#include #include #include #include diff --git a/include/openspace/properties/list/doublelistproperty.h b/include/openspace/properties/list/doublelistproperty.h index 060c2a2142..0469828c86 100644 --- a/include/openspace/properties/list/doublelistproperty.h +++ b/include/openspace/properties/list/doublelistproperty.h @@ -31,7 +31,7 @@ namespace openspace::properties { class DoubleListProperty : public ListProperty { public: - DoubleListProperty(Property::PropertyInfo info, + explicit DoubleListProperty(Property::PropertyInfo info, std::vector values = std::vector()); std::string_view className() const override final; diff --git a/include/openspace/properties/list/intlistproperty.h b/include/openspace/properties/list/intlistproperty.h index eb13bceba8..ab7bd5100b 100644 --- a/include/openspace/properties/list/intlistproperty.h +++ b/include/openspace/properties/list/intlistproperty.h @@ -31,7 +31,7 @@ namespace openspace::properties { class IntListProperty : public ListProperty { public: - IntListProperty(Property::PropertyInfo info, + explicit IntListProperty(Property::PropertyInfo info, std::vector values = std::vector()); std::string_view className() const override final; diff --git a/include/openspace/properties/list/stringlistproperty.h b/include/openspace/properties/list/stringlistproperty.h index ca56b50aea..c5531087d5 100644 --- a/include/openspace/properties/list/stringlistproperty.h +++ b/include/openspace/properties/list/stringlistproperty.h @@ -26,13 +26,12 @@ #define __OPENSPACE_CORE___STRINGLISTPROPERTY___H__ #include -#include namespace openspace::properties { class StringListProperty : public ListProperty { public: - StringListProperty(Property::PropertyInfo info, + explicit StringListProperty(Property::PropertyInfo info, std::vector values = std::vector()); std::string_view className() const override final; diff --git a/include/openspace/properties/matrix/dmat2property.h b/include/openspace/properties/matrix/dmat2property.h index 8c25086ef4..cfd6b00118 100644 --- a/include/openspace/properties/matrix/dmat2property.h +++ b/include/openspace/properties/matrix/dmat2property.h @@ -34,7 +34,8 @@ namespace openspace::properties { class DMat2Property : public NumericalProperty { public: - DMat2Property(Property::PropertyInfo info, glm::dmat2x2 value = glm::dmat2x2(0.0), + explicit DMat2Property(Property::PropertyInfo info, + glm::dmat2x2 value = glm::dmat2x2(0.0), glm::dmat2x2 minValue = ghoul::createFillMat2x2(std::numeric_limits::lowest()), glm::dmat2x2 maxValue = diff --git a/include/openspace/properties/matrix/dmat3property.h b/include/openspace/properties/matrix/dmat3property.h index 954e56e12a..7d184bd2b0 100644 --- a/include/openspace/properties/matrix/dmat3property.h +++ b/include/openspace/properties/matrix/dmat3property.h @@ -34,7 +34,8 @@ namespace openspace::properties { class DMat3Property : public NumericalProperty { public: - DMat3Property(Property::PropertyInfo info, glm::dmat3x3 value = glm::dmat3x3(0.0), + explicit DMat3Property(Property::PropertyInfo info, + glm::dmat3x3 value = glm::dmat3x3(0.0), glm::dmat3x3 minValue = ghoul::createFillMat3x3(std::numeric_limits::lowest()), glm::dmat3x3 maxValue = diff --git a/include/openspace/properties/matrix/dmat4property.h b/include/openspace/properties/matrix/dmat4property.h index 3a21e502c9..8e3ff61135 100644 --- a/include/openspace/properties/matrix/dmat4property.h +++ b/include/openspace/properties/matrix/dmat4property.h @@ -34,7 +34,8 @@ namespace openspace::properties { class DMat4Property : public NumericalProperty { public: - DMat4Property(Property::PropertyInfo info, glm::dmat4x4 value = glm::dmat4x4(0.0), + explicit DMat4Property(Property::PropertyInfo info, + glm::dmat4x4 value = glm::dmat4x4(0.0), glm::dmat4x4 minValue = ghoul::createFillMat4x4(std::numeric_limits::lowest()), glm::dmat4x4 maxValue = diff --git a/include/openspace/properties/matrix/mat2property.h b/include/openspace/properties/matrix/mat2property.h index 68513c377d..5e5eb80e28 100644 --- a/include/openspace/properties/matrix/mat2property.h +++ b/include/openspace/properties/matrix/mat2property.h @@ -28,13 +28,13 @@ #include #include -#include namespace openspace::properties { class Mat2Property : public NumericalProperty { public: - Mat2Property(Property::PropertyInfo info, glm::mat2x2 value = glm::mat2x2(0.f), + explicit Mat2Property(Property::PropertyInfo info, + glm::mat2x2 value = glm::mat2x2(0.f), glm::mat2x2 minValue = ghoul::createFillMat2x2(std::numeric_limits::lowest()), glm::mat2x2 maxValue = diff --git a/include/openspace/properties/matrix/mat3property.h b/include/openspace/properties/matrix/mat3property.h index 17cc04876e..372c1116b8 100644 --- a/include/openspace/properties/matrix/mat3property.h +++ b/include/openspace/properties/matrix/mat3property.h @@ -34,7 +34,8 @@ namespace openspace::properties { class Mat3Property : public NumericalProperty { public: - Mat3Property(Property::PropertyInfo info, glm::mat3x3 value = glm::mat3x3(), + explicit Mat3Property(Property::PropertyInfo info, + glm::mat3x3 value = glm::mat3x3(0.f), glm::mat3x3 minValue = ghoul::createFillMat3x3(std::numeric_limits::lowest()), glm::mat3x3 maxValue = diff --git a/include/openspace/properties/matrix/mat4property.h b/include/openspace/properties/matrix/mat4property.h index 0ba714173b..8ae4b0b7cd 100644 --- a/include/openspace/properties/matrix/mat4property.h +++ b/include/openspace/properties/matrix/mat4property.h @@ -34,7 +34,7 @@ namespace openspace::properties { class Mat4Property : public NumericalProperty { public: - Mat4Property(Property::PropertyInfo info, glm::mat4 value = glm::mat4(), + explicit Mat4Property(Property::PropertyInfo info, glm::mat4 value = glm::mat4(0.f), glm::mat4 minValue = ghoul::createFillMat4x4(std::numeric_limits::lowest()), glm::mat4 maxValue = diff --git a/include/openspace/properties/misc/listproperty.h b/include/openspace/properties/misc/listproperty.h index aa70fb3d21..dd15f7e192 100644 --- a/include/openspace/properties/misc/listproperty.h +++ b/include/openspace/properties/misc/listproperty.h @@ -26,14 +26,13 @@ #define __OPENSPACE_CORE___LISTPROPERTY___H__ #include -#include namespace openspace::properties { template class ListProperty : public TemplateProperty> { public: - ListProperty(Property::PropertyInfo info, std::vector values); + explicit ListProperty(Property::PropertyInfo info, std::vector values); virtual ~ListProperty() override = 0; }; diff --git a/include/openspace/properties/misc/optionproperty.h b/include/openspace/properties/misc/optionproperty.h index deeadd946d..d1f639037c 100644 --- a/include/openspace/properties/misc/optionproperty.h +++ b/include/openspace/properties/misc/optionproperty.h @@ -25,9 +25,7 @@ #ifndef __OPENSPACE_CORE___OPTIONPROPERTY___H__ #define __OPENSPACE_CORE___OPTIONPROPERTY___H__ -#include - -#include +#include namespace openspace::properties { @@ -57,7 +55,7 @@ public: * \pre \p info.identifier must not be empty * \pre \p info.guiName must not be empty */ - OptionProperty(Property::PropertyInfo info); + explicit OptionProperty(Property::PropertyInfo info); /** * Returns the name of the class for reflection purposes. diff --git a/include/openspace/properties/misc/selectionproperty.h b/include/openspace/properties/misc/selectionproperty.h index 17c0c24023..e3beef6e1d 100644 --- a/include/openspace/properties/misc/selectionproperty.h +++ b/include/openspace/properties/misc/selectionproperty.h @@ -28,7 +28,6 @@ #include #include -#include namespace openspace::properties { diff --git a/include/openspace/properties/misc/stringproperty.h b/include/openspace/properties/misc/stringproperty.h index aa63a0d7a7..7441a771c8 100644 --- a/include/openspace/properties/misc/stringproperty.h +++ b/include/openspace/properties/misc/stringproperty.h @@ -31,7 +31,7 @@ namespace openspace::properties { class StringProperty : public TemplateProperty { public: - StringProperty(Property::PropertyInfo info, std::string value = ""); + explicit StringProperty(Property::PropertyInfo info, std::string value = ""); std::string_view className() const override final; ghoul::lua::LuaTypes typeLua() const override final; diff --git a/include/openspace/properties/misc/triggerproperty.h b/include/openspace/properties/misc/triggerproperty.h index e12f06ae98..de8168e041 100644 --- a/include/openspace/properties/misc/triggerproperty.h +++ b/include/openspace/properties/misc/triggerproperty.h @@ -44,7 +44,7 @@ public: * \pre \p info.identifier must not be empty * \pre \p info.guiName must not be empty */ - TriggerProperty(PropertyInfo info); + explicit TriggerProperty(PropertyInfo info); /** * Returns the class name `TriggerProperty`. diff --git a/include/openspace/properties/numericalproperty.h b/include/openspace/properties/numericalproperty.h index a83fad6e6d..3aef60e433 100644 --- a/include/openspace/properties/numericalproperty.h +++ b/include/openspace/properties/numericalproperty.h @@ -26,7 +26,8 @@ #define __OPENSPACE_CORE___NUMERICALPROPERTY___H__ #include -#include + +#include namespace openspace::properties { diff --git a/include/openspace/properties/property.h b/include/openspace/properties/property.h index 54c646f3e9..2b71d590ba 100644 --- a/include/openspace/properties/property.h +++ b/include/openspace/properties/property.h @@ -29,9 +29,16 @@ #include #include #include +#include #include +#include +#include #include #include +#include +#include +#include +#include struct lua_State; diff --git a/include/openspace/properties/propertyowner.h b/include/openspace/properties/propertyowner.h index 77d4e6bdd9..c965cd3fb1 100644 --- a/include/openspace/properties/propertyowner.h +++ b/include/openspace/properties/propertyowner.h @@ -27,6 +27,7 @@ #include #include +#include #include namespace openspace::properties { @@ -159,7 +160,7 @@ public: * \return If the Property cannot be found, `nullptr` is returned, otherwise the * pointer to the Property is returned */ - Property* property(const std::string& uri) const; + Property* property(std::string_view uri) const; /** * Retrieves a PropertyOwner identified by \p uri from this PropertyOwner. If \p uri @@ -173,7 +174,7 @@ public: * \return If the PropertyOwner cannot be found, `nullptr` is returned, otherwise the * pointer to the PropertyOwner is returned */ - PropertyOwner* propertyOwner(const std::string& uri) const; + PropertyOwner* propertyOwner(std::string_view uri) const; /** * Returns a uri for this PropertyOwner. This is created by looking up all the owners @@ -223,7 +224,7 @@ public: * \param identifier The identifier of the sub-owner that should be returned * \return The PropertyOwner with the given \p identifier, or `nullptr` */ - PropertyOwner* propertySubOwner(const std::string& identifier) const; + PropertyOwner* propertySubOwner(std::string_view identifier) const; /** * Returns `true` if this PropertyOwner owns a sub-owner with the provided diff --git a/include/openspace/properties/scalar/boolproperty.h b/include/openspace/properties/scalar/boolproperty.h index cf3d364e26..54039ffdce 100644 --- a/include/openspace/properties/scalar/boolproperty.h +++ b/include/openspace/properties/scalar/boolproperty.h @@ -35,7 +35,7 @@ namespace openspace::properties { */ class BoolProperty : public TemplateProperty { public: - BoolProperty(Property::PropertyInfo info, bool value = false); + explicit BoolProperty(Property::PropertyInfo info, bool value = false); std::string_view className() const override final; ghoul::lua::LuaTypes typeLua() const override final; diff --git a/include/openspace/properties/scalar/doubleproperty.h b/include/openspace/properties/scalar/doubleproperty.h index b1e1f682fd..2db5ed3eaf 100644 --- a/include/openspace/properties/scalar/doubleproperty.h +++ b/include/openspace/properties/scalar/doubleproperty.h @@ -26,6 +26,7 @@ #define __OPENSPACE_CORE___DOUBLEPROPERTY___H__ #include + #include namespace openspace::properties { @@ -36,7 +37,7 @@ namespace openspace::properties { */ class DoubleProperty : public NumericalProperty { public: - DoubleProperty(Property::PropertyInfo info, double value = 0.0, + explicit DoubleProperty(Property::PropertyInfo info, double value = 0.0, double minValue = std::numeric_limits::lowest(), double maxValue = std::numeric_limits::max(), double stepValue = 0.01); diff --git a/include/openspace/properties/scalar/floatproperty.h b/include/openspace/properties/scalar/floatproperty.h index 074dc44b11..851953b6d3 100644 --- a/include/openspace/properties/scalar/floatproperty.h +++ b/include/openspace/properties/scalar/floatproperty.h @@ -26,6 +26,7 @@ #define __OPENSPACE_CORE___FLOATPROPERTY___H__ #include + #include namespace openspace::properties { @@ -36,7 +37,7 @@ namespace openspace::properties { */ class FloatProperty : public NumericalProperty { public: - FloatProperty(Property::PropertyInfo info, float value = 0.f, + explicit FloatProperty(Property::PropertyInfo info, float value = 0.f, float minValue = std::numeric_limits::lowest(), float maxValue = std::numeric_limits::max(), float stepValue = 0.01f); diff --git a/include/openspace/properties/scalar/intproperty.h b/include/openspace/properties/scalar/intproperty.h index 9872c0c223..a3dc40f75c 100644 --- a/include/openspace/properties/scalar/intproperty.h +++ b/include/openspace/properties/scalar/intproperty.h @@ -26,6 +26,7 @@ #define __OPENSPACE_CORE___INTPROPERTY___H__ #include + #include namespace openspace::properties { diff --git a/include/openspace/properties/scalar/longproperty.h b/include/openspace/properties/scalar/longproperty.h index e5f78d3fdf..c66206eb5d 100644 --- a/include/openspace/properties/scalar/longproperty.h +++ b/include/openspace/properties/scalar/longproperty.h @@ -26,6 +26,7 @@ #define __OPENSPACE_CORE___LONGPROPERTY___H__ #include + #include namespace openspace::properties { @@ -36,7 +37,7 @@ namespace openspace::properties { */ class LongProperty : public NumericalProperty { public: - LongProperty(Property::PropertyInfo info, long value = long(0), + explicit LongProperty(Property::PropertyInfo info, long value = long(0), long minValue = std::numeric_limits::lowest(), long maxValue = std::numeric_limits::max(), long stepValue = long(1)); diff --git a/include/openspace/properties/scalar/shortproperty.h b/include/openspace/properties/scalar/shortproperty.h index 044fb95b8d..8515b92614 100644 --- a/include/openspace/properties/scalar/shortproperty.h +++ b/include/openspace/properties/scalar/shortproperty.h @@ -26,6 +26,7 @@ #define __OPENSPACE_CORE___SHORTPROPERTY___H__ #include + #include namespace openspace::properties { @@ -36,7 +37,7 @@ namespace openspace::properties { */ class ShortProperty : public NumericalProperty { public: - ShortProperty(Property::PropertyInfo info, short value = short(0), + explicit ShortProperty(Property::PropertyInfo info, short value = short(0), short minValue = std::numeric_limits::lowest(), short maxValue = std::numeric_limits::max(), short stepValue = short(1)); diff --git a/include/openspace/properties/scalar/uintproperty.h b/include/openspace/properties/scalar/uintproperty.h index 9ad692a75c..f0dce518ee 100644 --- a/include/openspace/properties/scalar/uintproperty.h +++ b/include/openspace/properties/scalar/uintproperty.h @@ -26,6 +26,7 @@ #define __OPENSPACE_CORE___UINTPROPERTY___H__ #include + #include namespace openspace::properties { @@ -36,7 +37,7 @@ namespace openspace::properties { */ class UIntProperty : public NumericalProperty { public: - UIntProperty(Property::PropertyInfo info, unsigned int value = 0, + explicit UIntProperty(Property::PropertyInfo info, unsigned int value = 0, unsigned int minValue = std::numeric_limits::lowest(), unsigned int maxValue = std::numeric_limits::max(), unsigned int stepValue = 1); diff --git a/include/openspace/properties/scalar/ulongproperty.h b/include/openspace/properties/scalar/ulongproperty.h index 64c7464438..8e6d0757df 100644 --- a/include/openspace/properties/scalar/ulongproperty.h +++ b/include/openspace/properties/scalar/ulongproperty.h @@ -26,6 +26,7 @@ #define __OPENSPACE_CORE___ULONGPROPERTY___H__ #include + #include namespace openspace::properties { @@ -36,7 +37,7 @@ namespace openspace::properties { */ class ULongProperty : public NumericalProperty { public: - ULongProperty(Property::PropertyInfo info, unsigned long value = 0ul, + explicit ULongProperty(Property::PropertyInfo info, unsigned long value = 0ul, unsigned long minValue = std::numeric_limits::lowest(), unsigned long maxValue = std::numeric_limits::max(), unsigned long stepValue = 1ul); diff --git a/include/openspace/properties/scalar/ushortproperty.h b/include/openspace/properties/scalar/ushortproperty.h index 175b6c721f..921a4e17cb 100644 --- a/include/openspace/properties/scalar/ushortproperty.h +++ b/include/openspace/properties/scalar/ushortproperty.h @@ -26,6 +26,7 @@ #define __OPENSPACE_CORE___USHORTPROPERTY___H__ #include + #include namespace openspace::properties { @@ -36,7 +37,7 @@ namespace openspace::properties { */ class UShortProperty : public NumericalProperty { public: - UShortProperty(Property::PropertyInfo info, unsigned short value = 0, + explicit UShortProperty(Property::PropertyInfo info, unsigned short value = 0, unsigned short minValue = std::numeric_limits::lowest(), unsigned short maxValue = std::numeric_limits::max(), unsigned short stepValue = 1); diff --git a/include/openspace/properties/vector/dvec2property.h b/include/openspace/properties/vector/dvec2property.h index 61dd0a8562..bc6b982454 100644 --- a/include/openspace/properties/vector/dvec2property.h +++ b/include/openspace/properties/vector/dvec2property.h @@ -34,7 +34,8 @@ namespace openspace::properties { class DVec2Property : public NumericalProperty { public: - DVec2Property(Property::PropertyInfo info, glm::dvec2 value = glm::dvec2(0.0), + explicit DVec2Property(Property::PropertyInfo info, + glm::dvec2 value = glm::dvec2(0.0), glm::dvec2 minValue = glm::dvec2(std::numeric_limits::lowest()), glm::dvec2 maxValue = glm::dvec2(std::numeric_limits::max()), glm::dvec2 stepValue = glm::dvec2(0.01)); diff --git a/include/openspace/properties/vector/dvec3property.h b/include/openspace/properties/vector/dvec3property.h index f78c8a3be2..2f6e222746 100644 --- a/include/openspace/properties/vector/dvec3property.h +++ b/include/openspace/properties/vector/dvec3property.h @@ -34,7 +34,8 @@ namespace openspace::properties { class DVec3Property : public NumericalProperty { public: - DVec3Property(Property::PropertyInfo info, glm::dvec3 value = glm::dvec3(0.0), + explicit DVec3Property(Property::PropertyInfo info, + glm::dvec3 value = glm::dvec3(0.0), glm::dvec3 minValue = glm::dvec3(std::numeric_limits::lowest()), glm::dvec3 maxValue = glm::dvec3(std::numeric_limits::max()), glm::dvec3 stepValue = glm::dvec3(0.01)); diff --git a/include/openspace/properties/vector/dvec4property.h b/include/openspace/properties/vector/dvec4property.h index 63c3836fb0..1c999ac62c 100644 --- a/include/openspace/properties/vector/dvec4property.h +++ b/include/openspace/properties/vector/dvec4property.h @@ -34,7 +34,8 @@ namespace openspace::properties { class DVec4Property : public NumericalProperty { public: - DVec4Property(Property::PropertyInfo info, glm::dvec4 value = glm::dvec4(0.0), + explicit DVec4Property(Property::PropertyInfo info, + glm::dvec4 value = glm::dvec4(0.0), glm::dvec4 minValue = glm::dvec4(std::numeric_limits::lowest()), glm::dvec4 maxValue = glm::dvec4(std::numeric_limits::max()), glm::dvec4 stepValue = glm::dvec4(0.01)); diff --git a/include/openspace/properties/vector/ivec2property.h b/include/openspace/properties/vector/ivec2property.h index 49517b1b8f..ba6473df78 100644 --- a/include/openspace/properties/vector/ivec2property.h +++ b/include/openspace/properties/vector/ivec2property.h @@ -34,7 +34,7 @@ namespace openspace::properties { class IVec2Property : public NumericalProperty { public: - IVec2Property(Property::PropertyInfo info, glm::ivec2 value = glm::ivec2(0), + explicit IVec2Property(Property::PropertyInfo info, glm::ivec2 value = glm::ivec2(0), glm::ivec2 minValue = glm::ivec2(std::numeric_limits::lowest()), glm::ivec2 maxValue = glm::ivec2(std::numeric_limits::max()), glm::ivec2 stepValue = glm::ivec2(1)); diff --git a/include/openspace/properties/vector/ivec3property.h b/include/openspace/properties/vector/ivec3property.h index 9126a24b79..a8b6db456b 100644 --- a/include/openspace/properties/vector/ivec3property.h +++ b/include/openspace/properties/vector/ivec3property.h @@ -34,7 +34,7 @@ namespace openspace::properties { class IVec3Property : public NumericalProperty { public: - IVec3Property(Property::PropertyInfo info, glm::ivec3 value = glm::ivec3(0), + explicit IVec3Property(Property::PropertyInfo info, glm::ivec3 value = glm::ivec3(0), glm::ivec3 minValue = glm::ivec3(std::numeric_limits::lowest()), glm::ivec3 maxValue = glm::ivec3(std::numeric_limits::max()), glm::ivec3 stepValue = glm::ivec3(1)); diff --git a/include/openspace/properties/vector/ivec4property.h b/include/openspace/properties/vector/ivec4property.h index 3c54337213..cb90554fc9 100644 --- a/include/openspace/properties/vector/ivec4property.h +++ b/include/openspace/properties/vector/ivec4property.h @@ -34,7 +34,7 @@ namespace openspace::properties { class IVec4Property : public NumericalProperty { public: - IVec4Property(Property::PropertyInfo info, glm::ivec4 value = glm::ivec4(0), + explicit IVec4Property(Property::PropertyInfo info, glm::ivec4 value = glm::ivec4(0), glm::ivec4 minValue = glm::ivec4(std::numeric_limits::lowest()), glm::ivec4 maxValue = glm::ivec4(std::numeric_limits::max()), glm::ivec4 stepValue = glm::ivec4(1)); diff --git a/include/openspace/properties/vector/uvec2property.h b/include/openspace/properties/vector/uvec2property.h index c5bb2d8676..0b76a83fca 100644 --- a/include/openspace/properties/vector/uvec2property.h +++ b/include/openspace/properties/vector/uvec2property.h @@ -34,7 +34,7 @@ namespace openspace::properties { class UVec2Property : public NumericalProperty { public: - UVec2Property(Property::PropertyInfo info, glm::uvec2 value = glm::uvec2(0), + explicit UVec2Property(Property::PropertyInfo info, glm::uvec2 value = glm::uvec2(0), glm::uvec2 minValue = glm::uvec2(std::numeric_limits::lowest()), glm::uvec2 maxValue = glm::uvec2(std::numeric_limits::max()), glm::uvec2 stepValue = glm::uvec2(1)); diff --git a/include/openspace/properties/vector/uvec3property.h b/include/openspace/properties/vector/uvec3property.h index 92dcbc5d70..d190436f23 100644 --- a/include/openspace/properties/vector/uvec3property.h +++ b/include/openspace/properties/vector/uvec3property.h @@ -34,7 +34,7 @@ namespace openspace::properties { class UVec3Property : public NumericalProperty { public: - UVec3Property(Property::PropertyInfo info, glm::uvec3 value = glm::uvec3(0), + explicit UVec3Property(Property::PropertyInfo info, glm::uvec3 value = glm::uvec3(0), glm::uvec3 minValue = glm::uvec3(std::numeric_limits::lowest()), glm::uvec3 maxValue = glm::uvec3(std::numeric_limits::max()), glm::uvec3 stepValue = glm::uvec3(1)); diff --git a/include/openspace/properties/vector/uvec4property.h b/include/openspace/properties/vector/uvec4property.h index 9e5a4dd89d..72bd965a45 100644 --- a/include/openspace/properties/vector/uvec4property.h +++ b/include/openspace/properties/vector/uvec4property.h @@ -34,7 +34,7 @@ namespace openspace::properties { class UVec4Property : public NumericalProperty { public: - UVec4Property(Property::PropertyInfo info, glm::uvec4 value = glm::uvec4(0), + explicit UVec4Property(Property::PropertyInfo info, glm::uvec4 value = glm::uvec4(0), glm::uvec4 minValue = glm::uvec4(std::numeric_limits::lowest()), glm::uvec4 maxValue = glm::uvec4(std::numeric_limits::max()), glm::uvec4 stepValue = glm::uvec4(1)); diff --git a/include/openspace/properties/vector/vec2property.h b/include/openspace/properties/vector/vec2property.h index fedecf1dda..c5334176ae 100644 --- a/include/openspace/properties/vector/vec2property.h +++ b/include/openspace/properties/vector/vec2property.h @@ -34,7 +34,7 @@ namespace openspace::properties { class Vec2Property : public NumericalProperty { public: - Vec2Property(Property::PropertyInfo info, glm::vec2 value = glm::vec2(0.f), + explicit Vec2Property(Property::PropertyInfo info, glm::vec2 value = glm::vec2(0.f), glm::vec2 minValue = glm::vec2(std::numeric_limits::lowest()), glm::vec2 maxValue = glm::vec2(std::numeric_limits::max()), glm::vec2 stepValue = glm::vec2(0.01f)); diff --git a/include/openspace/properties/vector/vec3property.h b/include/openspace/properties/vector/vec3property.h index 2a90a724e9..f5226956e1 100644 --- a/include/openspace/properties/vector/vec3property.h +++ b/include/openspace/properties/vector/vec3property.h @@ -34,7 +34,7 @@ namespace openspace::properties { class Vec3Property : public NumericalProperty { public: - Vec3Property(Property::PropertyInfo info, glm::vec3 value = glm::vec3(0.f), + explicit Vec3Property(Property::PropertyInfo info, glm::vec3 value = glm::vec3(0.f), glm::vec3 minValue = glm::vec3(std::numeric_limits::lowest()), glm::vec3 maxValue = glm::vec3(std::numeric_limits::max()), glm::vec3 stepValue = glm::vec3(0.01f)); diff --git a/include/openspace/properties/vector/vec4property.h b/include/openspace/properties/vector/vec4property.h index 4179867b4b..4cad546ee5 100644 --- a/include/openspace/properties/vector/vec4property.h +++ b/include/openspace/properties/vector/vec4property.h @@ -34,7 +34,7 @@ namespace openspace::properties { class Vec4Property : public NumericalProperty { public: - Vec4Property(Property::PropertyInfo info, glm::vec4 value = glm::vec4(0.f), + explicit Vec4Property(Property::PropertyInfo info, glm::vec4 value = glm::vec4(0.f), glm::vec4 minValue = glm::vec4(std::numeric_limits::lowest()), glm::vec4 maxValue = glm::vec4(std::numeric_limits::max()), glm::vec4 stepValue = glm::vec4(0.01f)); diff --git a/include/openspace/query/query.h b/include/openspace/query/query.h index 9af26edcd7..29e41f2623 100644 --- a/include/openspace/query/query.h +++ b/include/openspace/query/query.h @@ -25,24 +25,26 @@ #ifndef __OPENSPACE_CORE___QUERY___H__ #define __OPENSPACE_CORE___QUERY___H__ -#include +#include #include namespace openspace { -namespace properties { class Property; } - +namespace properties { + class Property; + class PropertyOwner; +} // namespace properties +class IswaGroup; class Renderable; class Scene; class SceneGraphNode; -class IswaGroup; class ScreenSpaceRenderable; Scene* sceneGraph(); -SceneGraphNode* sceneGraphNode(const std::string& name); -const Renderable* renderable(const std::string& name); -properties::Property* property(const std::string& uri); -properties::PropertyOwner* propertyOwner(const std::string& uri); +SceneGraphNode* sceneGraphNode(std::string_view name); +const Renderable* renderable(std::string_view name); +properties::Property* property(std::string_view uri); +properties::PropertyOwner* propertyOwner(std::string_view uri); const std::vector& allProperties(); const std::vector& allPropertyOwners(); diff --git a/include/openspace/rendering/colormappingcomponent.h b/include/openspace/rendering/colormappingcomponent.h index 456309be56..158d2ceaa8 100644 --- a/include/openspace/rendering/colormappingcomponent.h +++ b/include/openspace/rendering/colormappingcomponent.h @@ -34,7 +34,14 @@ #include #include #include +#include #include +#include +#include +#include +#include + +namespace ghoul { class Dictionary; } namespace openspace { diff --git a/include/openspace/rendering/dashboard.h b/include/openspace/rendering/dashboard.h index ed30d0a4ec..ccfcf893ab 100644 --- a/include/openspace/rendering/dashboard.h +++ b/include/openspace/rendering/dashboard.h @@ -32,7 +32,9 @@ #include #include #include +#include #include +#include #include namespace openspace { diff --git a/include/openspace/rendering/dashboarditem.h b/include/openspace/rendering/dashboarditem.h index a2024e26e8..2854909256 100644 --- a/include/openspace/rendering/dashboarditem.h +++ b/include/openspace/rendering/dashboarditem.h @@ -29,6 +29,7 @@ #include #include +#include namespace ghoul { class Dictionary; } diff --git a/include/openspace/rendering/dashboardtextitem.h b/include/openspace/rendering/dashboardtextitem.h index f5b10b0dd7..a748d5b30a 100644 --- a/include/openspace/rendering/dashboardtextitem.h +++ b/include/openspace/rendering/dashboardtextitem.h @@ -30,13 +30,10 @@ #include #include -namespace ghoul { class Dictionary; } namespace ghoul::fontrendering { class Font; } namespace openspace { -namespace documentation { struct Documentation; } - class DashboardTextItem : public DashboardItem { public: explicit DashboardTextItem(const ghoul::Dictionary& dictionary); diff --git a/include/openspace/rendering/deferredcaster.h b/include/openspace/rendering/deferredcaster.h index 7705f43643..e5c9c3520f 100644 --- a/include/openspace/rendering/deferredcaster.h +++ b/include/openspace/rendering/deferredcaster.h @@ -26,7 +26,6 @@ #define __OPENSPACE_CORE___DEFERREDCASTER___H #include -#include namespace ghoul::opengl { class Texture; @@ -35,21 +34,21 @@ namespace ghoul::opengl { namespace openspace { -struct RenderData; struct DeferredcastData; +struct RenderData; struct UpdateData; class Deferredcaster { public: virtual ~Deferredcaster() = default; - virtual void preRaycast(const RenderData& /*renderData*/, - const DeferredcastData& /*deferredData*/, - ghoul::opengl::ProgramObject& /*program*/) {} + virtual void preRaycast(const RenderData& renderData, + const DeferredcastData& deferredData, + ghoul::opengl::ProgramObject& program); - virtual void postRaycast(const RenderData& /*renderData*/, - const DeferredcastData& /*deferredData*/, - ghoul::opengl::ProgramObject& /*program*/) {} + virtual void postRaycast(const RenderData& renderData, + const DeferredcastData& deferredData, + ghoul::opengl::ProgramObject& program); virtual std::filesystem::path deferredcastVSPath() const = 0; diff --git a/include/openspace/rendering/framebufferrenderer.h b/include/openspace/rendering/framebufferrenderer.h index 5d447c3556..e117828717 100644 --- a/include/openspace/rendering/framebufferrenderer.h +++ b/include/openspace/rendering/framebufferrenderer.h @@ -29,16 +29,13 @@ #include #include -#include #include #include #include -#include #include namespace ghoul { class Dictionary; } namespace ghoul::filesystem { class File; } - namespace ghoul::opengl { class ProgramObject; class Texture; @@ -195,11 +192,9 @@ private: std::unique_ptr >; - void resolveMSAA(float blackoutFactor); void applyTMO(float blackoutFactor, const glm::ivec4& viewport); void applyFXAA(const glm::ivec4& viewport); void updateDownscaleTextures() const; - void updateExitVolumeTextures(); void writeDownscaledVolume(const glm::ivec4& viewport); std::map _raycastData; diff --git a/include/openspace/rendering/helper.h b/include/openspace/rendering/helper.h index 635b4102fa..44c5f91677 100644 --- a/include/openspace/rendering/helper.h +++ b/include/openspace/rendering/helper.h @@ -25,7 +25,11 @@ #ifndef __OPENSPACE_CORE___HELPER___H__ #define __OPENSPACE_CORE___HELPER___H__ +#include +#include #include +#include +#include namespace ghoul::opengl { class ProgramObject; @@ -39,13 +43,7 @@ namespace openspace { namespace openspace::rendering::helper { -enum class Anchor { - Center, - NW, - NE, - SW, - SE -}; +enum class Anchor { Center, NW, NE, SW, SE }; void initialize(); void deinitialize(); diff --git a/include/openspace/rendering/labelscomponent.h b/include/openspace/rendering/labelscomponent.h index 71dfb8cc14..f63c22ab7d 100644 --- a/include/openspace/rendering/labelscomponent.h +++ b/include/openspace/rendering/labelscomponent.h @@ -36,13 +36,15 @@ #include #include #include +#include +namespace ghoul { class Dictionary; } namespace ghoul::fontrendering { class Font; } namespace openspace { -struct RenderData; namespace documentation { struct Documentation; } +struct RenderData; class LabelsComponent : public properties::PropertyOwner, public Fadeable { public: diff --git a/include/openspace/rendering/loadingscreen.h b/include/openspace/rendering/loadingscreen.h index cdb7f2f27b..772140785f 100644 --- a/include/openspace/rendering/loadingscreen.h +++ b/include/openspace/rendering/loadingscreen.h @@ -28,17 +28,17 @@ #include #include #include -#include -#include -#include +#include +#include #include #include #include +#include +#include // #define LOADINGSCREEN_DEBUGGING namespace ghoul::fontrendering { class Font; } - namespace ghoul::opengl { class ProgramObject; class Texture; diff --git a/include/openspace/rendering/luaconsole.h b/include/openspace/rendering/luaconsole.h index 03095dc516..ab03f51bdf 100644 --- a/include/openspace/rendering/luaconsole.h +++ b/include/openspace/rendering/luaconsole.h @@ -32,11 +32,12 @@ #include #include #include -#include -#include +#include +#include #include #include #include +#include #include namespace ghoul::fontrendering { class Font; } @@ -54,6 +55,8 @@ public: bool keyboardCallback(Key key, KeyModifier modifier, KeyAction action); void charCallback(unsigned int codepoint, KeyModifier modifier); + bool mouseActivationCallback(glm::vec2 pos, MouseButton button, MouseAction action, + KeyModifier mods); void update(); void render(); @@ -65,7 +68,8 @@ private: void parallelConnectionChanged(const ParallelConnection::Status& status); void addToCommand(const std::string& c); void registerKeyHandlers(); - void registerKeyHandler(Key key, KeyModifier modifier, std::function callback); + void registerKeyHandler(Key key, KeyModifier modifier, + std::function callback); // Helper functions for tab autocomplete void autoCompleteCommand(); diff --git a/include/openspace/rendering/raycastermanager.h b/include/openspace/rendering/raycastermanager.h index 66d9ae913f..8cc338b191 100644 --- a/include/openspace/rendering/raycastermanager.h +++ b/include/openspace/rendering/raycastermanager.h @@ -29,8 +29,8 @@ namespace openspace { -class VolumeRaycaster; class RaycasterListener; +class VolumeRaycaster; class RaycasterManager { public: diff --git a/include/openspace/rendering/renderable.h b/include/openspace/rendering/renderable.h index f434928015..486be431a4 100644 --- a/include/openspace/rendering/renderable.h +++ b/include/openspace/rendering/renderable.h @@ -30,20 +30,24 @@ #include #include -#include -#include #include #include +#include +#include #include +#include -namespace ghoul { class Dictionary; } -namespace ghoul::opengl { - class ProgramObject; - class Texture; -} // namespace ghoul::opengl +namespace ghoul { + namespace opengl { + class ProgramObject; + class Texture; + } // namespace opengl + class Dictionary; +} // namespace ghoul namespace openspace { +namespace documentation { struct Documentation; } class Camera; class Ellipsoid; struct RenderData; @@ -51,8 +55,6 @@ struct RendererTasks; struct SurfacePositionHandle; struct UpdateData; -namespace documentation { struct Documentation; } - // Unfortunately we can't move this struct into the Renderable until // https://bugs.llvm.org/show_bug.cgi?id=36684 is fixed struct RenderableSettings { diff --git a/include/openspace/rendering/renderengine.h b/include/openspace/rendering/renderengine.h index 734d5c3f12..114d7766aa 100644 --- a/include/openspace/rendering/renderengine.h +++ b/include/openspace/rendering/renderengine.h @@ -28,16 +28,19 @@ #include #include -#include -#include #include #include #include #include #include #include +#include #include #include +#include +#include +#include +#include namespace ghoul { namespace fontrendering { class Font; } @@ -45,7 +48,6 @@ namespace ghoul { class ProgramObject; class OpenGLStateCache; } // namespace opengl - class Dictionary; class SharedMemory; } // ghoul @@ -53,10 +55,9 @@ namespace ghoul { namespace openspace { namespace scripting { struct LuaLibrary; } - class Camera; -class RaycasterManager; class DeferredcasterManager; +class RaycasterManager; class Scene; class SceneManager; class ScreenLog; diff --git a/include/openspace/rendering/screenspacerenderable.h b/include/openspace/rendering/screenspacerenderable.h index 47c7cd4b68..adcaa8adbe 100644 --- a/include/openspace/rendering/screenspacerenderable.h +++ b/include/openspace/rendering/screenspacerenderable.h @@ -33,15 +33,17 @@ #include #include #include -#include +#include #include #include +namespace ghoul { class Dictionary; } namespace ghoul::opengl { class ProgramObject; } namespace openspace { namespace documentation { struct Documentation; } +struct RenderData; /** * The base class for screen space images and screen space framebuffers. This base class diff --git a/include/openspace/rendering/screenspacerenderableframebuffer.h b/include/openspace/rendering/screenspacerenderableframebuffer.h index 13f8f6f89f..813ff3bee1 100644 --- a/include/openspace/rendering/screenspacerenderableframebuffer.h +++ b/include/openspace/rendering/screenspacerenderableframebuffer.h @@ -22,22 +22,18 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_CORE___SCREENSPACEFRAMEBUFFER___H__ -#define __OPENSPACE_CORE___SCREENSPACEFRAMEBUFFER___H__ +#ifndef __OPENSPACE_CORE___SCREENSPACERENDERABLEFRAMEBUFFER___H__ +#define __OPENSPACE_CORE___SCREENSPACERENDERABLEFRAMEBUFFER___H__ #include #include - -namespace ghoul::opengl { - class FramebufferObject; - class Texture; -} // namespace ghoul::opengl +#include +#include +#include namespace openspace { -namespace documentation { struct Documentation; } - /** * Creates a texture by rendering to a framebuffer, this is then used on a screen space * plane. This class lets you add renderfunctions that should render to a framebuffer with @@ -78,4 +74,4 @@ private: } //namespace openspace -#endif // __OPENSPACE_CORE___SCREENSPACEFRAMEBUFFER___H__ +#endif // __OPENSPACE_CORE___SCREENSPACERENDERABLEFRAMEBUFFER___H__ diff --git a/include/openspace/rendering/screenspacerenderabletext.h b/include/openspace/rendering/screenspacerenderabletext.h index ed5f10429e..b2666f6cce 100644 --- a/include/openspace/rendering/screenspacerenderabletext.h +++ b/include/openspace/rendering/screenspacerenderabletext.h @@ -29,19 +29,13 @@ #include #include +#include #include - -namespace ghoul { class Dictionary; } -namespace ghoul::opengl { - class FramebufferObject; - class Texture; -} // namespace ghoul::opengl -namespace ghoul::fontrendering { class Font; } +#include +#include namespace openspace { -namespace documentation { struct Documentation; } - class ScreenSpaceRenderableText : public ScreenSpaceRenderable { public: explicit ScreenSpaceRenderableText(const ghoul::Dictionary& dictionary); diff --git a/include/openspace/rendering/texturecomponent.h b/include/openspace/rendering/texturecomponent.h index 5b623d8907..161e3a5751 100644 --- a/include/openspace/rendering/texturecomponent.h +++ b/include/openspace/rendering/texturecomponent.h @@ -27,9 +27,10 @@ #include #include +#include namespace ghoul::filesystem { class File; } -namespace ghoul::opengl {class Texture; } +namespace ghoul::opengl { class Texture; } namespace openspace { diff --git a/include/openspace/rendering/transferfunction.h b/include/openspace/rendering/transferfunction.h index 1b0fe415c5..045af80965 100644 --- a/include/openspace/rendering/transferfunction.h +++ b/include/openspace/rendering/transferfunction.h @@ -29,7 +29,6 @@ #include #include #include -#include namespace ghoul::filesystem { class File; } namespace ghoul::opengl { class Texture; } @@ -57,7 +56,6 @@ public: private: void setTextureFromImage(); - void uploadTexture(); std::filesystem::path _filepath; std::unique_ptr _file; diff --git a/include/openspace/rendering/volumeraycaster.h b/include/openspace/rendering/volumeraycaster.h index f9d8809e39..f643cec6cc 100644 --- a/include/openspace/rendering/volumeraycaster.h +++ b/include/openspace/rendering/volumeraycaster.h @@ -27,8 +27,6 @@ #include #include -#include -#include namespace ghoul::opengl { class Texture; @@ -37,27 +35,24 @@ namespace ghoul::opengl { namespace openspace { -struct RenderData; struct RaycastData; +struct RenderData; class VolumeRaycaster { public: - /** - * Destructor. - */ virtual ~VolumeRaycaster() = default; /** * Render the volume's entry points (front face of the bounding geometry). */ - virtual void renderEntryPoints(const RenderData& /*data*/, - ghoul::opengl::ProgramObject& /*program*/) = 0; + virtual void renderEntryPoints(const RenderData& data, + ghoul::opengl::ProgramObject& program) = 0; /** * Render the volume's exit points (back face of the bounding geometry). */ - virtual void renderExitPoints(const RenderData& /*data*/, - ghoul::opengl::ProgramObject& /*program*/) = 0; + virtual void renderExitPoints(const RenderData& data, + ghoul::opengl::ProgramObject& program) = 0; /** * Prepare the volume for the ABuffer's resolve step. Make sure textures are up to diff --git a/include/openspace/scene/asset.h b/include/openspace/scene/asset.h index 89041e63cf..9861311caa 100644 --- a/include/openspace/scene/asset.h +++ b/include/openspace/scene/asset.h @@ -25,13 +25,16 @@ #ifndef __OPENSPACE_CORE___ASSET___H__ #define __OPENSPACE_CORE___ASSET___H__ -#include +#include #include #include +#include +#include namespace openspace { class AssetManager; +class ResourceSynchronization; /** * This class represents a successfully loaded Asset. Each Lua asset file results in @@ -207,6 +210,14 @@ public: */ bool hasInitializedParent() const; + /** + * Returns a list of the parents of this Asset that is currently in an initialized + * state, meaning any parent that is still interested in this Asset at all. + * + * \return A list of parent filepaths that are interested in this asset + */ + std::vector initializedParents() const; + /** * Deinitializes this Asset and recursively deinitializes the required assets if this * Asset was their ownly initialized parent. If the Asset was already deinitialized, diff --git a/include/openspace/scene/assetmanager.h b/include/openspace/scene/assetmanager.h index 45bcf91302..318d5126af 100644 --- a/include/openspace/scene/assetmanager.h +++ b/include/openspace/scene/assetmanager.h @@ -25,16 +25,19 @@ #ifndef __OPENSPACE_CORE___ASSETMANAGER___H__ #define __OPENSPACE_CORE___ASSETMANAGER___H__ -#include #include -#include -#include #include +#include +#include +#include +#include +#include + +namespace ghoul::lua { class LuaState; } namespace openspace { namespace scripting { struct LuaLibrary; } - class Asset; class ResourceSynchronization; diff --git a/include/openspace/scene/lightsource.h b/include/openspace/scene/lightsource.h index 964d6f0f26..d8fd28b3a9 100644 --- a/include/openspace/scene/lightsource.h +++ b/include/openspace/scene/lightsource.h @@ -36,7 +36,6 @@ namespace ghoul { class Dictionary; } namespace openspace { namespace documentation { struct Documentation; } - class SceneGraphNode; struct RenderData; diff --git a/include/openspace/scene/profile.h b/include/openspace/scene/profile.h index ebf3b2222f..71de42875f 100644 --- a/include/openspace/scene/profile.h +++ b/include/openspace/scene/profile.h @@ -25,20 +25,21 @@ #ifndef __OPENSPACE_CORE___PROFILE___H__ #define __OPENSPACE_CORE___PROFILE___H__ -#include -#include #include #include #include +#include #include #include +#include #include #include +#include namespace openspace { namespace interaction { struct NavigationState; } - +namespace properties { class PropertyOwner; } namespace scripting { struct LuaLibrary; } class Profile { diff --git a/include/openspace/scene/rotation.h b/include/openspace/scene/rotation.h index 7db4d7ea9c..f7b81f9f30 100644 --- a/include/openspace/scene/rotation.h +++ b/include/openspace/scene/rotation.h @@ -30,14 +30,14 @@ #include #include #include +#include namespace ghoul { class Dictionary; } namespace openspace { -struct UpdateData; - namespace documentation { struct Documentation; } +struct UpdateData; /** * This class represents a configurable rotation which may or may not be time-dependent. @@ -60,7 +60,6 @@ public: static ghoul::mm_unique_ptr createFromDictionary( const ghoul::Dictionary& dictionary); - explicit Rotation(const ghoul::Dictionary& dictionary); virtual ~Rotation() override = default; diff --git a/include/openspace/scene/scale.h b/include/openspace/scene/scale.h index 188a18e6f4..30cd000d6a 100644 --- a/include/openspace/scene/scale.h +++ b/include/openspace/scene/scale.h @@ -30,14 +30,14 @@ #include #include #include +#include namespace ghoul { class Dictionary; } namespace openspace { -struct UpdateData; - namespace documentation { struct Documentation; } +struct UpdateData; class Scale : public properties::PropertyOwner { public: diff --git a/include/openspace/scene/scene.h b/include/openspace/scene/scene.h index d0a60a71e0..9663634fe6 100644 --- a/include/openspace/scene/scene.h +++ b/include/openspace/scene/scene.h @@ -28,25 +28,35 @@ #include #include +#include #include -#include +#include +#include +#include +#include +#include #include #include +#include +#include #include #include -namespace ghoul { - -class Dictionary; -namespace lua { class LuaState; } -namespace opengl { class ProgramObject; } - -} // namespace ghoul +namespace ghoul { class Dictionary; } +namespace ghoul::lua { class LuaState; } +namespace ghoul::opengl { class ProgramObject; } namespace openspace { namespace documentation { struct Documentation; } +namespace properties { class Property; } namespace scripting { struct LuaLibrary; } +class Camera; +class Profile; +struct RenderData; +struct RendererTasks; +class SceneInitializer; +struct UpdateData; enum class PropertyValueType { Boolean = 0, @@ -56,9 +66,6 @@ enum class PropertyValueType { Nil }; -class Profile; -class SceneInitializer; - // Notifications: // SceneGraphFinishedLoading class Scene : public properties::PropertyOwner { @@ -116,7 +123,7 @@ public: * Return the scenegraph node with the specified name or `nullptr` if that name does * not exist. */ - SceneGraphNode* sceneGraphNode(const std::string& name) const; + SceneGraphNode* sceneGraphNode(std::string_view name) const; /** * Add a node and all its children to the scene. @@ -138,11 +145,6 @@ public: */ const std::vector& allSceneGraphNodes() const; - /** - * Returns a map from identifier to scene graph node. - */ - const std::unordered_map& nodesByIdentifier() const; - /** * Load a scene graph node from a dictionary and return it. */ @@ -269,7 +271,6 @@ private: */ void propertyPushProfileValueToLua(ghoul::lua::LuaState& L, const std::string& value); - /** * Update dependencies. */ @@ -279,7 +280,11 @@ private: std::unique_ptr _camera; std::vector _topologicallySortedNodes; std::vector _circularNodes; - std::unordered_map _nodesByIdentifier; + std::unordered_map< + std::string, SceneGraphNode*, + transparent_string_hash, + std::equal_to<> + > _nodesByIdentifier; bool _dirtyNodeRegistry = false; SceneGraphNode _rootNode; std::unique_ptr _initializer; diff --git a/include/openspace/scene/scenegraphnode.h b/include/openspace/scene/scenegraphnode.h index 7f08699654..17458d645d 100644 --- a/include/openspace/scene/scenegraphnode.h +++ b/include/openspace/scene/scenegraphnode.h @@ -39,31 +39,31 @@ #include #include #include -#include #include +#include +#include #include - //#define Debugging_Core_SceneGraphNode_Indices +// #define Debugging_Core_SceneGraphNode_Indices namespace ghoul { class Dictionary; } namespace ghoul::opengl { class ProgramObject; } namespace openspace { +namespace documentation { struct Documentation; } class Camera; -struct RenderData; class Renderable; +struct RenderData; struct RendererTasks; class Rotation; -class Translation; class Scale; class Scene; -struct UpdateData; struct SurfacePositionHandle; -class TimeFrame; class Time; - -namespace documentation { struct Documentation; } +class TimeFrame; +class Translation; +struct UpdateData; class SceneGraphNode : public properties::PropertyOwner { public: diff --git a/include/openspace/scene/sceneinitializer.h b/include/openspace/scene/sceneinitializer.h index c1014a311c..aeb33a8311 100644 --- a/include/openspace/scene/sceneinitializer.h +++ b/include/openspace/scene/sceneinitializer.h @@ -27,6 +27,7 @@ #include #include +#include #include namespace openspace { @@ -41,7 +42,7 @@ class SceneGraphNode; */ class SceneInitializer { public: - SceneInitializer(unsigned int nThreads = 0); + explicit SceneInitializer(unsigned int nThreads = 0); void initializeNode(SceneGraphNode* node); std::vector takeInitializedNodes(); diff --git a/include/openspace/scene/timeframe.h b/include/openspace/scene/timeframe.h index 344ee1b428..87eb4dbfa4 100644 --- a/include/openspace/scene/timeframe.h +++ b/include/openspace/scene/timeframe.h @@ -27,18 +27,15 @@ #include -#include -#include +#include #include -#include namespace ghoul { class Dictionary; } namespace openspace { -class Time; - namespace documentation { struct Documentation; } +class Time; class TimeFrame : public properties::PropertyOwner { public: diff --git a/include/openspace/scene/translation.h b/include/openspace/scene/translation.h index 9096e9a1af..de4e2f52be 100644 --- a/include/openspace/scene/translation.h +++ b/include/openspace/scene/translation.h @@ -31,15 +31,15 @@ #include #include #include +#include namespace ghoul { class Dictionary; } namespace openspace { +namespace documentation { struct Documentation; } struct UpdateData; -namespace documentation { struct Documentation; } - class Translation : public properties::PropertyOwner { public: static ghoul::mm_unique_ptr createFromDictionary( diff --git a/include/openspace/scripting/lualibrary.h b/include/openspace/scripting/lualibrary.h index 716dfad495..0a6caab48e 100644 --- a/include/openspace/scripting/lualibrary.h +++ b/include/openspace/scripting/lualibrary.h @@ -26,6 +26,7 @@ #define __OPENSPACE_CORE___LUALIBRARY___H__ #include +#include #include #include @@ -44,7 +45,7 @@ struct LuaLibrary { * the function. */ struct Function { - using lua_CFunction =int(*)(lua_State* L); + using lua_CFunction = int(*)(lua_State* L); /// The name of the function std::string name; diff --git a/include/openspace/scripting/scriptengine.h b/include/openspace/scripting/scriptengine.h index a5e1c7612d..e0e09480ae 100644 --- a/include/openspace/scripting/scriptengine.h +++ b/include/openspace/scripting/scriptengine.h @@ -30,12 +30,16 @@ #include #include #include -#include -#include -#include #include +#include +#include +#include +#include +#include +namespace ghoul { class Dictionary; } namespace openspace { class SyncBuffer; } +struct lua_State; namespace openspace::scripting { diff --git a/include/openspace/scripting/scriptscheduler.h b/include/openspace/scripting/scriptscheduler.h index 68189c7952..72c45827fa 100644 --- a/include/openspace/scripting/scriptscheduler.h +++ b/include/openspace/scripting/scriptscheduler.h @@ -27,13 +27,9 @@ #include -#include #include -#include - -#include +#include #include -#include #include #include diff --git a/include/openspace/util/collisionhelper.h b/include/openspace/util/collisionhelper.h index 5e9eab4082..7cfc662137 100644 --- a/include/openspace/util/collisionhelper.h +++ b/include/openspace/util/collisionhelper.h @@ -50,7 +50,7 @@ bool lineSphereIntersection(const glm::dvec3& p1, const glm::dvec3& p2, /** * Check if the point \p p is inside of the sphere defined by radius \p r and center - * point \p c + * point \p c. */ bool isPointInsideSphere(const glm::dvec3& p, const glm::dvec3& c, double r); diff --git a/include/openspace/util/concurrentjobmanager.h b/include/openspace/util/concurrentjobmanager.h index 46d0a37f9e..91ebf03113 100644 --- a/include/openspace/util/concurrentjobmanager.h +++ b/include/openspace/util/concurrentjobmanager.h @@ -27,7 +27,7 @@ #include #include - +#include #include namespace openspace { @@ -38,7 +38,7 @@ template struct Job; * Templated Concurrent Job Manager * This class is used execute specific jobs on one (1) parallel thread */ -template +template class ConcurrentJobManager { public: explicit ConcurrentJobManager(ThreadPool pool); diff --git a/include/openspace/util/concurrentjobmanager.inl b/include/openspace/util/concurrentjobmanager.inl index 14e5bf1792..d4a69194e5 100644 --- a/include/openspace/util/concurrentjobmanager.inl +++ b/include/openspace/util/concurrentjobmanager.inl @@ -27,12 +27,12 @@ namespace openspace { -template +template ConcurrentJobManager

::ConcurrentJobManager(ThreadPool pool) : threadPool(pool) {} -template +template void ConcurrentJobManager

::enqueueJob(std::shared_ptr> job) { threadPool.enqueue([this, job]() { job->execute(); @@ -41,12 +41,12 @@ void ConcurrentJobManager

::enqueueJob(std::shared_ptr> job) { }); } -template +template void ConcurrentJobManager

::clearEnqueuedJobs() { threadPool.clearTasks(); } -template +template std::shared_ptr> ConcurrentJobManager

::popFinishedJob() { ghoul_assert(!_finishedJobs.empty(), "There is no finished job to pop"); @@ -54,7 +54,7 @@ std::shared_ptr> ConcurrentJobManager

::popFinishedJob() { return _finishedJobs.pop(); } -template +template size_t ConcurrentJobManager

::numFinishedJobs() const { return _finishedJobs.size(); } diff --git a/include/openspace/util/concurrentqueue.inl b/include/openspace/util/concurrentqueue.inl index 043cb3dac6..50a54fafbb 100644 --- a/include/openspace/util/concurrentqueue.inl +++ b/include/openspace/util/concurrentqueue.inl @@ -75,5 +75,4 @@ bool ConcurrentQueue::empty() const { return size() == 0; } - } // namespace openspace diff --git a/include/openspace/util/coordinateconversion.h b/include/openspace/util/coordinateconversion.h index 42b557dbee..3b04d9ad7c 100644 --- a/include/openspace/util/coordinateconversion.h +++ b/include/openspace/util/coordinateconversion.h @@ -27,6 +27,7 @@ #include #include +#include namespace openspace { diff --git a/include/openspace/util/distanceconstants.h b/include/openspace/util/distanceconstants.h index 332b69a03b..294f2d4b97 100644 --- a/include/openspace/util/distanceconstants.h +++ b/include/openspace/util/distanceconstants.h @@ -26,23 +26,25 @@ #define __OPENSPACE_CORE___DISTANCECONSTANTS___H__ namespace openspace::distanceconstants { - constexpr double EarthRadius = 6371E3; - constexpr double JupiterRadius = 7.1492E7; - constexpr double SolarRadius = 6.95700E8; - constexpr double LightYear = 9.4607304725808E15; - constexpr double LightMonth = LightYear / 12; - constexpr double LightDay = LightYear / 365; - constexpr double LightHour = LightDay / 24; - constexpr double LightSecond = 299792458.0; - constexpr double AstronomicalUnit = 1.495978707E11; - constexpr double Parsec = 3.0856776E16; - constexpr double Inch = 0.0254; - constexpr double Foot = 0.3048; - constexpr double Yard = 0.9144; - constexpr double Chain = 20.1168; - constexpr double Mile = 1609.344; - constexpr double NauticalMile = 1852.0; +constexpr double EarthRadius = 6371E3; +constexpr double JupiterRadius = 7.1492E7; +constexpr double SolarRadius = 6.95700E8; +constexpr double LightYear = 9.4607304725808E15; +constexpr double LightMonth = LightYear / 12; +constexpr double LightDay = LightYear / 365; +constexpr double LightHour = LightDay / 24; +constexpr double LightSecond = 299792458.0; +constexpr double AstronomicalUnit = 1.495978707E11; +constexpr double Parsec = 3.0856776E16; + +constexpr double Inch = 0.0254; +constexpr double Foot = 0.3048; +constexpr double Yard = 0.9144; +constexpr double Chain = 20.1168; +constexpr double Mile = 1609.344; +constexpr double NauticalMile = 1852.0; + } // openspace::distanceconstants #endif // __OPENSPACE_CORE___DISTANCECONSTANTS___H__ diff --git a/include/openspace/util/distanceconversion.h b/include/openspace/util/distanceconversion.h index 7f061896db..1f4e3691cd 100644 --- a/include/openspace/util/distanceconversion.h +++ b/include/openspace/util/distanceconversion.h @@ -26,13 +26,13 @@ #define __OPENSPACE_CORE___DISTANCECONVERSION___H__ #include - #include -#include #include #include #include +#include #include +#include namespace openspace { diff --git a/include/openspace/util/downloadeventengine.h b/include/openspace/util/downloadeventengine.h new file mode 100644 index 0000000000..ec3f77cc5f --- /dev/null +++ b/include/openspace/util/downloadeventengine.h @@ -0,0 +1,73 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2025 * + * * + * 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___DOWNLOAD_EVENT_ENGINE___H__ +#define __OPENSPACE_CORE___DOWNLOAD_EVENT_ENGINE___H__ + +#include +#include +#include +#include +#include +#include + +namespace openspace { + +// @TODO (anden88 2025-10-10): This class was specifically written for the multi-threaded +// url- and httpSynchronization events. In the future we should make this more general +// purposed. +class DownloadEventEngine { +public: + struct DownloadEvent { + enum class Type { + Started, + Progress, + Finished, + Failed + }; + + Type type; + std::string id; + int64_t downloadedBytes; + std::optional totalBytes; + }; + + using Callback = std::function; + + int subscribe(Callback cb); + void unsubscribe(int id); + + void publish(const DownloadEvent& event); + void publish(const std::string& id, DownloadEvent::Type type, + int64_t downloadedBytes = 0, std::optional totalBytes = std::nullopt); + +private: + std::mutex _mutex; + int _id = 0; + std::unordered_map _subscribers; +}; + +} // namespace openspace + +#endif // __OPENSPACE_CORE___DOWNLOAD_EVENT_ENGINE___H__ diff --git a/include/openspace/util/dynamicfilesequencedownloader.h b/include/openspace/util/dynamicfilesequencedownloader.h index 699c5a20d9..b113275e65 100644 --- a/include/openspace/util/dynamicfilesequencedownloader.h +++ b/include/openspace/util/dynamicfilesequencedownloader.h @@ -26,13 +26,9 @@ #define __OPENSPACE_CORE___DYNAMICFILESEQUENCEDOWNLOADER___H__ #include -#include #include -#include #include -#include #include -#include #include namespace openspace { @@ -60,7 +56,7 @@ public: DynamicFileSequenceDownloader(int dataID, const std::string& identifier, std::string infoUrl, std::string dataUrl, size_t nFilesToQueue); - void deinitialize(bool cacheFiles); + void deinitialize(bool cacheFiles) const; void requestDataInfo(std::string httpInfoRequest); void requestAvailableFiles(std::string httpDataRequest, std::filesystem::path syncDir); diff --git a/include/openspace/util/ellipsoid.h b/include/openspace/util/ellipsoid.h index 5a4dd2e186..a6064c61e9 100644 --- a/include/openspace/util/ellipsoid.h +++ b/include/openspace/util/ellipsoid.h @@ -26,7 +26,7 @@ #define __OPENSPACE_CORE___ELLIPSOID___H__ #include - +#include #include namespace openspace { diff --git a/include/openspace/util/factorymanager.h b/include/openspace/util/factorymanager.h index 71a97266ff..e31ae1e310 100644 --- a/include/openspace/util/factorymanager.h +++ b/include/openspace/util/factorymanager.h @@ -28,6 +28,8 @@ #include #include #include +#include +#include namespace openspace { diff --git a/include/openspace/util/factorymanager.inl b/include/openspace/util/factorymanager.inl index 8b093f3519..b4ab1764a2 100644 --- a/include/openspace/util/factorymanager.inl +++ b/include/openspace/util/factorymanager.inl @@ -23,6 +23,7 @@ ****************************************************************************************/ #include +#include namespace openspace { @@ -33,7 +34,6 @@ void FactoryManager::addFactory(std::string name) { _factories.push_back({ std::move(f), std::move(name) }); } - template ghoul::TemplateFactory* FactoryManager::factory() const { for (const FactoryInfo& f : _factories) { diff --git a/include/openspace/util/geodetic.h b/include/openspace/util/geodetic.h index 66b2a42a20..fd42f2e54d 100644 --- a/include/openspace/util/geodetic.h +++ b/include/openspace/util/geodetic.h @@ -74,14 +74,14 @@ glm::dvec3 geoPositionFromCamera(); /** * Returns the camera view direction relative to the current anchor node as geodetic * coordinates. The returned value contains the latitude and longitude in degrees in the - * x, and y-coordinate respectively. + * x, and y-coordinate respectively. */ glm::dvec3 geoViewFromCamera(); /** * Return the coordinates where the sun is at its zenith at the current anchor at the * current time. The returned value contains the latitude and longitude in degrees. - */ + */ glm::dvec2 subSolarCoordinates(); /** diff --git a/include/openspace/util/histogram.h b/include/openspace/util/histogram.h index b473526b4c..01cc1c2a80 100644 --- a/include/openspace/util/histogram.h +++ b/include/openspace/util/histogram.h @@ -25,6 +25,7 @@ #ifndef __OPENSPACE_CORE___HISTOGRAM___H__ #define __OPENSPACE_CORE___HISTOGRAM___H__ +#include #include namespace openspace { @@ -58,7 +59,7 @@ public: float interpolate(float bin) const; float sample(int binIndex) const; const float* data() const; - std::vector> getDecimated(int numBins) const; + std::vector> getDecimated(int numBins) const; void normalize(); void print() const; diff --git a/include/openspace/util/httprequest.h b/include/openspace/util/httprequest.h index 2dde039fde..b9f0d81ff1 100644 --- a/include/openspace/util/httprequest.h +++ b/include/openspace/util/httprequest.h @@ -25,18 +25,19 @@ #ifndef __OPENSPACE_CORE___HTTPREQUEST___H__ #define __OPENSPACE_CORE___HTTPREQUEST___H__ -#include +#include #include #include +#include #include #include #include #include +#include #include #include #include #include -#include namespace openspace { diff --git a/include/openspace/util/job.h b/include/openspace/util/job.h index 01350aa21c..0cdc8cb96c 100644 --- a/include/openspace/util/job.h +++ b/include/openspace/util/job.h @@ -25,8 +25,6 @@ #ifndef __OPENSPACE_CORE___JOB___H__ #define __OPENSPACE_CORE___JOB___H__ -#include - namespace openspace { /** diff --git a/include/openspace/util/json_helper.h b/include/openspace/util/json_helper.h index 1cc2079bcf..ef291e3c62 100644 --- a/include/openspace/util/json_helper.h +++ b/include/openspace/util/json_helper.h @@ -26,8 +26,10 @@ #define __OPENSPACE_CORE___JSON_HELPER___H__ #include -#include #include +#include + +namespace ghoul { class Dictionary; } namespace openspace { @@ -74,7 +76,7 @@ std::string formatJson(T value); * \param json The JSON object to sort * \param key The key the JSON should be sorted by */ -void sortJson(nlohmann::json& json, const std::string& key); +void sortJson(nlohmann::json& json, std::string_view key); /** * Converts the provided JSON object into its corresponding Dictionary format. Please note diff --git a/include/openspace/util/json_helper.inl b/include/openspace/util/json_helper.inl index 86d52a96b6..54f11937e1 100644 --- a/include/openspace/util/json_helper.inl +++ b/include/openspace/util/json_helper.inl @@ -22,7 +22,6 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include #include #include #include diff --git a/include/openspace/util/keys.h b/include/openspace/util/keys.h index b4a626f0cf..83e43e09ea 100644 --- a/include/openspace/util/keys.h +++ b/include/openspace/util/keys.h @@ -59,9 +59,10 @@ #include #include -#include +#include #include -#include +#include +#include namespace openspace { diff --git a/include/openspace/util/openspacemodule.h b/include/openspace/util/openspacemodule.h index 4ff6d55c43..548941283a 100644 --- a/include/openspace/util/openspacemodule.h +++ b/include/openspace/util/openspacemodule.h @@ -28,16 +28,13 @@ #include #include -#include -#include namespace ghoul { class Dictionary; } namespace openspace { -namespace documentation { struct Documentation; } +namespace documentation { struct Documentation; } namespace scripting { struct LuaLibrary; } - class ModuleEngine; /** diff --git a/include/openspace/util/planegeometry.h b/include/openspace/util/planegeometry.h index c3f32f8c2c..6ab6d025c5 100644 --- a/include/openspace/util/planegeometry.h +++ b/include/openspace/util/planegeometry.h @@ -42,10 +42,10 @@ public: void render() const; void updateSize(const glm::vec2& size); - void updateSize(const float size); + void updateSize(float size); private: - void updateGeometry(); + void updateGeometry() const; GLuint _vaoId = 0; GLuint _vBufferId = 0; diff --git a/include/openspace/util/resourcesynchronization.h b/include/openspace/util/resourcesynchronization.h index e19c528c7c..0b7ed964b6 100644 --- a/include/openspace/util/resourcesynchronization.h +++ b/include/openspace/util/resourcesynchronization.h @@ -27,6 +27,7 @@ #include #include +#include #include namespace ghoul { class Dictionary; } diff --git a/include/openspace/util/sphere.h b/include/openspace/util/sphere.h index 528ef60595..1caa496ec0 100644 --- a/include/openspace/util/sphere.h +++ b/include/openspace/util/sphere.h @@ -32,7 +32,7 @@ namespace openspace { class Sphere { public: - Sphere(float radius, int segments = 8); + explicit Sphere(float radius, int segments = 8); Sphere(glm::vec3 radius, int segments); Sphere(const Sphere& cpy); ~Sphere(); diff --git a/include/openspace/util/spicemanager.h b/include/openspace/util/spicemanager.h index e7c71f30ef..b66d821120 100644 --- a/include/openspace/util/spicemanager.h +++ b/include/openspace/util/spicemanager.h @@ -27,7 +27,6 @@ #include #include -#include #include #include #include diff --git a/include/openspace/util/syncable.h b/include/openspace/util/syncable.h index 584e74bf6d..e4303b9769 100644 --- a/include/openspace/util/syncable.h +++ b/include/openspace/util/syncable.h @@ -41,10 +41,10 @@ protected: // from the used of implementations of the interface friend class SyncEngine; - virtual void preSync(bool /*isMaster*/) {} - virtual void encode(SyncBuffer* /*syncBuffer*/) = 0; - virtual void decode(SyncBuffer* /*syncBuffer*/) = 0; - virtual void postSync(bool /*isMaster*/) {} + virtual void preSync(bool isMaster); + virtual void encode(SyncBuffer* syncBuffer) = 0; + virtual void decode(SyncBuffer* syncBuffer) = 0; + virtual void postSync(bool isMaster); }; } // namespace openspace diff --git a/include/openspace/util/syncbuffer.h b/include/openspace/util/syncbuffer.h index a486eefabc..cfd072d84f 100644 --- a/include/openspace/util/syncbuffer.h +++ b/include/openspace/util/syncbuffer.h @@ -26,7 +26,7 @@ #define __OPENSPACE_CORE___SYNCBUFFER___H__ #include -#include +#include #include #include diff --git a/include/openspace/util/syncbuffer.inl b/include/openspace/util/syncbuffer.inl index 10fd4c748d..09a18d0099 100644 --- a/include/openspace/util/syncbuffer.inl +++ b/include/openspace/util/syncbuffer.inl @@ -23,7 +23,6 @@ ****************************************************************************************/ #include -#include #include namespace openspace { diff --git a/include/openspace/util/syncdata.h b/include/openspace/util/syncdata.h index 141f28e161..f9bdb0b9e5 100644 --- a/include/openspace/util/syncdata.h +++ b/include/openspace/util/syncdata.h @@ -42,7 +42,7 @@ namespace openspace { * * `((T&) t).method();` */ -template +template class SyncData : public Syncable { public: SyncData() = default; diff --git a/include/openspace/util/syncdata.inl b/include/openspace/util/syncdata.inl index 915150b913..6037f26e09 100644 --- a/include/openspace/util/syncdata.inl +++ b/include/openspace/util/syncdata.inl @@ -26,56 +26,56 @@ namespace openspace { -template +template SyncData::SyncData(const T& val) : _data(val) {} -template +template SyncData::SyncData(const SyncData& o) : _data(o._data) , _doubleBufferedData(o._doubleBufferedData) {} -template +template SyncData& SyncData::operator=(const T& rhs) { _data = rhs; return *this; } -template +template SyncData::operator T&() { return _data; } -template +template SyncData::operator const T&() const { return _data; } -template +template T& SyncData::data() { return _data; } -template +template const T& SyncData::data() const { return _data; } -template +template void SyncData::encode(SyncBuffer* syncBuffer) { _mutex.lock(); syncBuffer->encode(_data); _mutex.unlock(); } -template +template void SyncData::decode(SyncBuffer* syncBuffer) { _mutex.lock(); syncBuffer->decode(_doubleBufferedData); _mutex.unlock(); } -template +template void SyncData::postSync(bool isMaster) { // apply synced update if (!isMaster) { diff --git a/include/openspace/util/task.h b/include/openspace/util/task.h index eb3904047d..48d83faf70 100644 --- a/include/openspace/util/task.h +++ b/include/openspace/util/task.h @@ -27,6 +27,7 @@ #include #include +#include namespace ghoul { class Dictionary; } @@ -38,14 +39,14 @@ class Task { public: using ProgressCallback = std::function; - virtual ~Task() = default; - virtual void perform(const ProgressCallback& onProgress) = 0; - virtual std::string description() = 0; - static std::unique_ptr createFromDictionary( const ghoul::Dictionary& dictionary ); + virtual ~Task() = default; + virtual void perform(const ProgressCallback& onProgress) = 0; + virtual std::string description() = 0; + static documentation::Documentation documentation(); }; diff --git a/include/openspace/util/threadpool.h b/include/openspace/util/threadpool.h index 8bb74b9e21..10f2c20d39 100644 --- a/include/openspace/util/threadpool.h +++ b/include/openspace/util/threadpool.h @@ -26,9 +26,9 @@ #define __OPENSPACE_CORE___THREAD_POOL___H__ #include +#include #include #include -#include #include #include @@ -44,7 +44,7 @@ public: void operator()(); private: - ThreadPool& pool; + ThreadPool& _pool; }; class ThreadPool { @@ -61,14 +61,14 @@ public: private: friend class Worker; - std::vector workers; + std::vector _workers; - std::deque> tasks; + std::deque> _tasks; - std::mutex queue_mutex; - std::condition_variable condition; + std::mutex _queueMutex; + std::condition_variable _condition; - bool stop; + bool _shouldStop = false; }; } // namespace openspace diff --git a/include/openspace/util/timeconversion.h b/include/openspace/util/timeconversion.h index 2fa5b0507b..ba039dc56e 100644 --- a/include/openspace/util/timeconversion.h +++ b/include/openspace/util/timeconversion.h @@ -28,10 +28,12 @@ #include #include -#include #include #include #include +#include +#include +#include namespace openspace { diff --git a/include/openspace/util/timeline.h b/include/openspace/util/timeline.h index a998153f8c..58bdce1d87 100644 --- a/include/openspace/util/timeline.h +++ b/include/openspace/util/timeline.h @@ -25,9 +25,7 @@ #ifndef __OPENSPACE_CORE___TIMELINE___H__ #define __OPENSPACE_CORE___TIMELINE___H__ -#include #include -#include namespace openspace { diff --git a/include/openspace/util/timeline.inl b/include/openspace/util/timeline.inl index c4663e8dfb..d27942bfac 100644 --- a/include/openspace/util/timeline.inl +++ b/include/openspace/util/timeline.inl @@ -22,6 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include + namespace openspace { template @@ -32,7 +34,8 @@ Keyframe::Keyframe(size_t i, double t, T d) template void Timeline::addKeyframe(double timestamp, T&& data) { - Keyframe keyframe(++_nextKeyframeId, timestamp, std::move(data)); + _nextKeyframeId++; + Keyframe keyframe(_nextKeyframeId, timestamp, std::move(data)); const auto iter = std::upper_bound( _keyframes.cbegin(), _keyframes.cend(), @@ -44,7 +47,8 @@ void Timeline::addKeyframe(double timestamp, T&& data) { template void Timeline::addKeyframe(double timestamp, const T& data) { - Keyframe keyframe(++_nextKeyframeId, timestamp, data); + _nextKeyframeId++; + Keyframe keyframe(_nextKeyframeId, timestamp, data); const auto iter = std::upper_bound( _keyframes.cbegin(), _keyframes.cend(), diff --git a/include/openspace/util/touch.h b/include/openspace/util/touch.h index ca3d1ed90f..047c394163 100644 --- a/include/openspace/util/touch.h +++ b/include/openspace/util/touch.h @@ -25,9 +25,7 @@ #ifndef __OPENSPACE_CORE___TOUCH___H__ #define __OPENSPACE_CORE___TOUCH___H__ -#include - -#include +#include #include namespace openspace { @@ -39,6 +37,7 @@ namespace openspace { */ struct TouchInput { TouchInput(size_t touchDeviceId, size_t fingerId, float x, float y, double timestamp); + glm::vec2 screenCoordinates(const glm::vec2& resolution) const; glm::vec2 currentWindowCoordinates() const; bool isMoving() const; @@ -60,7 +59,7 @@ struct TouchInput { */ class TouchInputHolder { public: - TouchInputHolder(TouchInput input); + explicit TouchInputHolder(TouchInput input); /** * Succeeds upon a different input than last. Fails upon a too similar input as last. diff --git a/modules/atmosphere/rendering/atmospheredeferredcaster.cpp b/modules/atmosphere/rendering/atmospheredeferredcaster.cpp index c28c9f8ea2..3fa3aa5a49 100644 --- a/modules/atmosphere/rendering/atmospheredeferredcaster.cpp +++ b/modules/atmosphere/rendering/atmospheredeferredcaster.cpp @@ -56,16 +56,31 @@ #include +#include #include #include #include #include +#include #include +#include #include #include +#include #include +#include +#include +#include +#include +#include +#include #include +#include +#include #include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "AtmosphereDeferredcaster"; diff --git a/modules/atmosphere/rendering/atmospheredeferredcaster.h b/modules/atmosphere/rendering/atmospheredeferredcaster.h index f7cb74db4b..8b9baf5acb 100644 --- a/modules/atmosphere/rendering/atmospheredeferredcaster.h +++ b/modules/atmosphere/rendering/atmospheredeferredcaster.h @@ -27,22 +27,14 @@ #include -#include #include #include #include -#include #include -namespace ghoul::opengl { - class Texture; - class ProgramObject; -} // namespace ghoul::opengl - namespace openspace { -struct RenderData; -struct DeferredcastData; +class SceneGraphNode; struct ShadowConfiguration; struct ShadowRenderingStruct { @@ -113,7 +105,6 @@ private: void calculateInscattering(int scatteringOrder, ghoul::opengl::ProgramObject& program, GLuint deltaSRayleigh); - UniformCache(cullAtmosphere, opacity, Rg, Rt, groundRadianceEmission, HR, betaRayleigh, HM, betaMieExtinction, mieG, sunRadiance, ozoneLayerEnabled, HO, betaOzoneExtinction, SAMPLES_R, SAMPLES_MU, SAMPLES_MU_S, SAMPLES_NU, diff --git a/modules/atmosphere/rendering/renderableatmosphere.cpp b/modules/atmosphere/rendering/renderableatmosphere.cpp index 5b2d0dd92c..baf3b2e6d0 100644 --- a/modules/atmosphere/rendering/renderableatmosphere.cpp +++ b/modules/atmosphere/rendering/renderableatmosphere.cpp @@ -27,15 +27,21 @@ #include #include #include -#include #include #include -#include -#include #include +#include #include +#include +#include +#include +#include +#include +#include +#include #include #include +#include namespace { constexpr float KM_TO_M = 1000.f; diff --git a/modules/atmosphere/rendering/renderableatmosphere.h b/modules/atmosphere/rendering/renderableatmosphere.h index 15d95b4b12..cc3234d899 100644 --- a/modules/atmosphere/rendering/renderableatmosphere.h +++ b/modules/atmosphere/rendering/renderableatmosphere.h @@ -28,26 +28,15 @@ #include #include -#include -#include #include #include #include -#include -#include #include -#include -#include - -namespace ghoul::opengl { - class ProgramObject; - class Texture; -} // namespace ghoul::opengl +#include namespace openspace { class AtmosphereDeferredcaster; - struct TransformData; // Shadow structure @@ -60,9 +49,6 @@ struct ShadowConfiguration { bool printedCasterError = false; }; -namespace documentation { struct Documentation; } -namespace planetgeometry { class PlanetGeometry; } - class RenderableAtmosphere : public Renderable { public: explicit RenderableAtmosphere(const ghoul::Dictionary& dictionary); @@ -77,7 +63,7 @@ public: static documentation::Documentation Documentation(); private: - glm::dmat4 computeModelTransformMatrix(const openspace::TransformData& data); + glm::dmat4 computeModelTransformMatrix(const TransformData& data); void updateAtmosphereParameters(); void setDimmingCoefficient(const glm::dmat4& modelTransform); diff --git a/modules/audio/audiomodule.cpp b/modules/audio/audiomodule.cpp index d94eb09293..1cc6055894 100644 --- a/modules/audio/audiomodule.cpp +++ b/modules/audio/audiomodule.cpp @@ -24,11 +24,20 @@ #include -#include +#include #include +#include +#include +#include #include +#include +#include +#include #include #include +#include +#include +#include #include "audiomodule_lua.inl" diff --git a/modules/audio/audiomodule.h b/modules/audio/audiomodule.h index 6087fbd7a9..63bad67f60 100644 --- a/modules/audio/audiomodule.h +++ b/modules/audio/audiomodule.h @@ -27,9 +27,11 @@ #include -#include -#include +#include #include +#include +#include +#include namespace SoLoud { class Soloud; diff --git a/modules/audio/audiomodule_lua.inl b/modules/audio/audiomodule_lua.inl index 2f54c348c1..51516b29ec 100644 --- a/modules/audio/audiomodule_lua.inl +++ b/modules/audio/audiomodule_lua.inl @@ -22,8 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include #include -#include namespace { diff --git a/modules/base/basemodule.cpp b/modules/base/basemodule.cpp index 22f16a8437..f4e7fc5d81 100644 --- a/modules/base/basemodule.cpp +++ b/modules/base/basemodule.cpp @@ -96,12 +96,13 @@ #include #include #include -#include -#include #include #include #include #include +#include +#include +#include namespace openspace { diff --git a/modules/base/dashboard/dashboarditemangle.cpp b/modules/base/dashboard/dashboarditemangle.cpp index d39bd100c2..038a6e26a8 100644 --- a/modules/base/dashboard/dashboarditemangle.cpp +++ b/modules/base/dashboard/dashboarditemangle.cpp @@ -26,18 +26,20 @@ #include #include -#include #include #include #include #include #include #include -#include -#include -#include +#include #include +#include #include +#include +#include +#include +#include namespace { enum Type { diff --git a/modules/base/dashboard/dashboarditemangle.h b/modules/base/dashboard/dashboarditemangle.h index cde4aedb8e..410fd5830a 100644 --- a/modules/base/dashboard/dashboarditemangle.h +++ b/modules/base/dashboard/dashboarditemangle.h @@ -35,8 +35,6 @@ namespace openspace { class SceneGraphNode; -namespace documentation { struct Documentation; } - class DashboardItemAngle : public DashboardTextItem { public: explicit DashboardItemAngle(const ghoul::Dictionary& dictionary); diff --git a/modules/base/dashboard/dashboarditemcameraorientation.cpp b/modules/base/dashboard/dashboarditemcameraorientation.cpp index e4887ec377..7808790146 100644 --- a/modules/base/dashboard/dashboarditemcameraorientation.cpp +++ b/modules/base/dashboard/dashboarditemcameraorientation.cpp @@ -29,7 +29,9 @@ #include #include #include -#include +#include +#include +#include namespace { // This `DashboardItem` shows the current camera orientation in the yaw, pitch, and diff --git a/modules/base/dashboard/dashboarditemdate.cpp b/modules/base/dashboard/dashboarditemdate.cpp index 5f4287629d..ee88d71f14 100644 --- a/modules/base/dashboard/dashboarditemdate.cpp +++ b/modules/base/dashboard/dashboarditemdate.cpp @@ -25,15 +25,14 @@ #include #include -#include #include #include #include -#include -#include -#include +#include #include +#include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo FormatStringInfo = { diff --git a/modules/base/dashboard/dashboarditemdate.h b/modules/base/dashboard/dashboarditemdate.h index d620f1f699..d465a3dcac 100644 --- a/modules/base/dashboard/dashboarditemdate.h +++ b/modules/base/dashboard/dashboarditemdate.h @@ -31,8 +31,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class DashboardItemDate : public DashboardTextItem { public: explicit DashboardItemDate(const ghoul::Dictionary& dictionary); diff --git a/modules/base/dashboard/dashboarditemdistance.cpp b/modules/base/dashboard/dashboarditemdistance.cpp index 57d28fbf68..1f0eeb6aee 100644 --- a/modules/base/dashboard/dashboarditemdistance.cpp +++ b/modules/base/dashboard/dashboarditemdistance.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -34,11 +33,13 @@ #include #include #include -#include -#include -#include +#include #include +#include #include +#include +#include +#include namespace { enum Type { diff --git a/modules/base/dashboard/dashboarditemdistance.h b/modules/base/dashboard/dashboarditemdistance.h index cea0fd1966..3a81c6fc52 100644 --- a/modules/base/dashboard/dashboarditemdistance.h +++ b/modules/base/dashboard/dashboarditemdistance.h @@ -36,8 +36,6 @@ namespace openspace { class SceneGraphNode; -namespace documentation { struct Documentation; } - class DashboardItemDistance : public DashboardTextItem { public: explicit DashboardItemDistance(const ghoul::Dictionary& dictionary); diff --git a/modules/base/dashboard/dashboarditemelapsedtime.cpp b/modules/base/dashboard/dashboarditemelapsedtime.cpp index 7595594b06..ed874ee38f 100644 --- a/modules/base/dashboard/dashboarditemelapsedtime.cpp +++ b/modules/base/dashboard/dashboarditemelapsedtime.cpp @@ -25,15 +25,15 @@ #include #include -#include #include -#include #include #include #include -#include -#include -#include +#include +#include +#include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo FormatStringInfo = { diff --git a/modules/base/dashboard/dashboarditemelapsedtime.h b/modules/base/dashboard/dashboarditemelapsedtime.h index fecbab5712..b7c646754a 100644 --- a/modules/base/dashboard/dashboarditemelapsedtime.h +++ b/modules/base/dashboard/dashboarditemelapsedtime.h @@ -33,8 +33,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class DashboardItemElapsedTime : public DashboardTextItem { public: explicit DashboardItemElapsedTime(const ghoul::Dictionary& dictionary); diff --git a/modules/base/dashboard/dashboarditemframerate.cpp b/modules/base/dashboard/dashboarditemframerate.cpp index 4b4c32d29e..c78b35de84 100644 --- a/modules/base/dashboard/dashboarditemframerate.cpp +++ b/modules/base/dashboard/dashboarditemframerate.cpp @@ -25,14 +25,14 @@ #include #include -#include #include #include -#include -#include -#include +#include +#include +#include #include #include +#include namespace { enum FrametimeType { diff --git a/modules/base/dashboard/dashboarditemframerate.h b/modules/base/dashboard/dashboarditemframerate.h index feaddb7075..c8ff593fe3 100644 --- a/modules/base/dashboard/dashboarditemframerate.h +++ b/modules/base/dashboard/dashboarditemframerate.h @@ -30,12 +30,8 @@ #include #include -namespace ghoul { class Dictionary; } - namespace openspace { -namespace documentation { struct Documentation; } - class DashboardItemFramerate : public DashboardTextItem { public: explicit DashboardItemFramerate(const ghoul::Dictionary& dictionary); diff --git a/modules/base/dashboard/dashboarditeminputstate.cpp b/modules/base/dashboard/dashboarditeminputstate.cpp index 89a68e4d18..7b082f7c8f 100644 --- a/modules/base/dashboard/dashboarditeminputstate.cpp +++ b/modules/base/dashboard/dashboarditeminputstate.cpp @@ -25,13 +25,13 @@ #include #include -#include #include #include -#include -#include -#include +#include +#include #include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo ShowWhenEnabledInfo = { diff --git a/modules/base/dashboard/dashboarditeminputstate.h b/modules/base/dashboard/dashboarditeminputstate.h index 84cdee23f3..734fb753f0 100644 --- a/modules/base/dashboard/dashboarditeminputstate.h +++ b/modules/base/dashboard/dashboarditeminputstate.h @@ -31,9 +31,6 @@ namespace openspace { -namespace properties { class Property; } -namespace documentation { struct Documentation; } - class DashboardItemInputState : public DashboardTextItem { public: explicit DashboardItemInputState(const ghoul::Dictionary& dictionary); diff --git a/modules/base/dashboard/dashboarditemmission.cpp b/modules/base/dashboard/dashboarditemmission.cpp index 571773cb23..a831d86ec7 100644 --- a/modules/base/dashboard/dashboarditemmission.cpp +++ b/modules/base/dashboard/dashboarditemmission.cpp @@ -25,16 +25,18 @@ #include #include -#include #include #include #include #include #include -#include #include +#include +#include #include +#include #include +#include namespace { std::string progressToStr(int size, double t) { diff --git a/modules/base/dashboard/dashboarditemmission.h b/modules/base/dashboard/dashboarditemmission.h index 8a7c9a87db..fabb4326cf 100644 --- a/modules/base/dashboard/dashboarditemmission.h +++ b/modules/base/dashboard/dashboarditemmission.h @@ -29,8 +29,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class DashboardItemMission : public DashboardTextItem { public: explicit DashboardItemMission(const ghoul::Dictionary& dictionary); diff --git a/modules/base/dashboard/dashboarditemparallelconnection.cpp b/modules/base/dashboard/dashboarditemparallelconnection.cpp index 6a15e397a4..3286fbaffd 100644 --- a/modules/base/dashboard/dashboarditemparallelconnection.cpp +++ b/modules/base/dashboard/dashboarditemparallelconnection.cpp @@ -25,13 +25,11 @@ #include #include -#include #include #include #include -#include -#include -#include +#include +#include #include namespace { @@ -44,6 +42,7 @@ namespace { // The information presented contains how many clients are connected to the same // session and whether this machine is currently the host of the session. struct [[codegen::Dictionary(DashboardItemParallelConnection)]] Parameters {}; + #include "dashboarditemparallelconnection_codegen.cpp" } // namespace diff --git a/modules/base/dashboard/dashboarditemparallelconnection.h b/modules/base/dashboard/dashboarditemparallelconnection.h index 6191a8e382..90c599a585 100644 --- a/modules/base/dashboard/dashboarditemparallelconnection.h +++ b/modules/base/dashboard/dashboarditemparallelconnection.h @@ -29,8 +29,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class DashboardItemParallelConnection : public DashboardTextItem { public: explicit DashboardItemParallelConnection(const ghoul::Dictionary& dictionary); diff --git a/modules/base/dashboard/dashboarditempropertyvalue.cpp b/modules/base/dashboard/dashboarditempropertyvalue.cpp index c88b0ad23b..4957588df0 100644 --- a/modules/base/dashboard/dashboarditempropertyvalue.cpp +++ b/modules/base/dashboard/dashboarditempropertyvalue.cpp @@ -25,8 +25,8 @@ #include #include -#include -#include +#include +#include #include #include #include @@ -46,11 +46,11 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo PropertyUriInfo = { diff --git a/modules/base/dashboard/dashboarditempropertyvalue.h b/modules/base/dashboard/dashboarditempropertyvalue.h index e69ecd30ed..ad2d946b8d 100644 --- a/modules/base/dashboard/dashboarditempropertyvalue.h +++ b/modules/base/dashboard/dashboarditempropertyvalue.h @@ -33,8 +33,6 @@ namespace openspace { namespace properties { class Property; } -namespace documentation { struct Documentation; } - class DashboardItemPropertyValue : public DashboardTextItem { public: DashboardItemPropertyValue(const ghoul::Dictionary& dictionary); diff --git a/modules/base/dashboard/dashboarditemsimulationincrement.cpp b/modules/base/dashboard/dashboarditemsimulationincrement.cpp index 52ee00caa6..e0ae86b24d 100644 --- a/modules/base/dashboard/dashboarditemsimulationincrement.cpp +++ b/modules/base/dashboard/dashboarditemsimulationincrement.cpp @@ -25,15 +25,16 @@ #include #include -#include #include #include #include -#include -#include -#include +#include #include +#include #include +#include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo SimplificationInfo = { diff --git a/modules/base/dashboard/dashboarditemsimulationincrement.h b/modules/base/dashboard/dashboarditemsimulationincrement.h index 3354a9a5ff..3252fbd094 100644 --- a/modules/base/dashboard/dashboarditemsimulationincrement.h +++ b/modules/base/dashboard/dashboarditemsimulationincrement.h @@ -33,8 +33,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class DashboardItemSimulationIncrement : public DashboardTextItem { public: explicit DashboardItemSimulationIncrement(const ghoul::Dictionary& dictionary); diff --git a/modules/base/dashboard/dashboarditemspacing.cpp b/modules/base/dashboard/dashboarditemspacing.cpp index 0d7809494c..0e8b287c3a 100644 --- a/modules/base/dashboard/dashboarditemspacing.cpp +++ b/modules/base/dashboard/dashboarditemspacing.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include #include namespace { diff --git a/modules/base/dashboard/dashboarditemspacing.h b/modules/base/dashboard/dashboarditemspacing.h index 0fe59e4a34..b40977ee18 100644 --- a/modules/base/dashboard/dashboarditemspacing.h +++ b/modules/base/dashboard/dashboarditemspacing.h @@ -31,8 +31,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class DashboardItemSpacing : public DashboardItem { public: explicit DashboardItemSpacing(const ghoul::Dictionary& dictionary); diff --git a/modules/base/dashboard/dashboarditemtext.cpp b/modules/base/dashboard/dashboarditemtext.cpp index 1000e830e1..6bcb6f306c 100644 --- a/modules/base/dashboard/dashboarditemtext.cpp +++ b/modules/base/dashboard/dashboarditemtext.cpp @@ -25,10 +25,7 @@ #include #include -#include -#include -#include -#include +#include #include namespace { diff --git a/modules/base/dashboard/dashboarditemtext.h b/modules/base/dashboard/dashboarditemtext.h index 02fee87f81..783a954a88 100644 --- a/modules/base/dashboard/dashboarditemtext.h +++ b/modules/base/dashboard/dashboarditemtext.h @@ -31,8 +31,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class DashboardItemText : public DashboardTextItem { public: explicit DashboardItemText(const ghoul::Dictionary& dictionary); diff --git a/modules/base/dashboard/dashboarditemtimevaryingtext.cpp b/modules/base/dashboard/dashboarditemtimevaryingtext.cpp index 98671ceaa9..e3f2b0cc47 100644 --- a/modules/base/dashboard/dashboarditemtimevaryingtext.cpp +++ b/modules/base/dashboard/dashboarditemtimevaryingtext.cpp @@ -25,13 +25,18 @@ #include #include -#include #include -#include +#include #include -#include +#include #include +#include +#include +#include +#include #include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo FormatStringInfo = { diff --git a/modules/base/dashboard/dashboarditemtimevaryingtext.h b/modules/base/dashboard/dashboarditemtimevaryingtext.h index 80a4f330de..2225ce493b 100644 --- a/modules/base/dashboard/dashboarditemtimevaryingtext.h +++ b/modules/base/dashboard/dashboarditemtimevaryingtext.h @@ -27,13 +27,12 @@ #include -#include #include +#include +#include namespace openspace { -namespace documentation { struct Documentation; } - class DashboardItemTimeVaryingText : public DashboardTextItem { public: explicit DashboardItemTimeVaryingText(const ghoul::Dictionary& dictionary); diff --git a/modules/base/dashboard/dashboarditemvelocity.cpp b/modules/base/dashboard/dashboarditemvelocity.cpp index aa0556ee5f..be19e5b121 100644 --- a/modules/base/dashboard/dashboarditemvelocity.cpp +++ b/modules/base/dashboard/dashboarditemvelocity.cpp @@ -26,16 +26,16 @@ #include #include -#include #include #include #include #include -#include #include -#include -#include +#include +#include #include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo SimplificationInfo = { diff --git a/modules/base/dashboard/dashboarditemvelocity.h b/modules/base/dashboard/dashboarditemvelocity.h index caf2d5c660..f5fdf17cdb 100644 --- a/modules/base/dashboard/dashboarditemvelocity.h +++ b/modules/base/dashboard/dashboarditemvelocity.h @@ -29,14 +29,9 @@ #include #include -#include namespace openspace { -class SceneGraphNode; - -namespace documentation { struct Documentation; } - class DashboardItemVelocity : public DashboardTextItem { public: explicit DashboardItemVelocity(const ghoul::Dictionary& dictionary); diff --git a/modules/base/lightsource/cameralightsource.cpp b/modules/base/lightsource/cameralightsource.cpp index 07d4a4ff13..0bebb4c7fa 100644 --- a/modules/base/lightsource/cameralightsource.cpp +++ b/modules/base/lightsource/cameralightsource.cpp @@ -25,8 +25,8 @@ #include #include -#include #include +#include #include namespace { diff --git a/modules/base/lightsource/cameralightsource.h b/modules/base/lightsource/cameralightsource.h index c3ccad79a7..b09c4bd16f 100644 --- a/modules/base/lightsource/cameralightsource.h +++ b/modules/base/lightsource/cameralightsource.h @@ -31,8 +31,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class CameraLightSource : public LightSource { public: explicit CameraLightSource(const ghoul::Dictionary& dictionary); diff --git a/modules/base/lightsource/scenegraphlightsource.cpp b/modules/base/lightsource/scenegraphlightsource.cpp index 0f71a9effb..401fda4d6a 100644 --- a/modules/base/lightsource/scenegraphlightsource.cpp +++ b/modules/base/lightsource/scenegraphlightsource.cpp @@ -25,11 +25,11 @@ #include #include -#include #include #include #include #include +#include #include #include diff --git a/modules/base/lightsource/scenegraphlightsource.h b/modules/base/lightsource/scenegraphlightsource.h index 3333cf731a..a0c8ebcf39 100644 --- a/modules/base/lightsource/scenegraphlightsource.h +++ b/modules/base/lightsource/scenegraphlightsource.h @@ -32,7 +32,7 @@ namespace openspace { -namespace documentation { struct Documentation; } +class SceneGraphNode; class SceneGraphLightSource : public LightSource { public: diff --git a/modules/base/rendering/grids/renderableboxgrid.cpp b/modules/base/rendering/grids/renderableboxgrid.cpp index 6a82d972cf..0991c8f6c1 100644 --- a/modules/base/rendering/grids/renderableboxgrid.cpp +++ b/modules/base/rendering/grids/renderableboxgrid.cpp @@ -25,15 +25,16 @@ #include #include +#include #include -#include #include #include -#include -#include #include +#include +#include #include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo ColorInfo = { diff --git a/modules/base/rendering/grids/renderableboxgrid.h b/modules/base/rendering/grids/renderableboxgrid.h index 12b9ee7ac1..8157cf992e 100644 --- a/modules/base/rendering/grids/renderableboxgrid.h +++ b/modules/base/rendering/grids/renderableboxgrid.h @@ -31,12 +31,6 @@ #include #include -namespace ghoul::opengl { - class ProgramObject; -} // namespace ghoul::opengl - -namespace openspace::documentation { struct Documentation; } - namespace openspace { class RenderableBoxGrid : public Renderable { diff --git a/modules/base/rendering/grids/renderablegrid.cpp b/modules/base/rendering/grids/renderablegrid.cpp index a66e631600..e0c5ee5c93 100644 --- a/modules/base/rendering/grids/renderablegrid.cpp +++ b/modules/base/rendering/grids/renderablegrid.cpp @@ -25,15 +25,17 @@ #include #include -#include +#include #include -#include #include #include #include #include +#include #include #include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo ColorInfo = { diff --git a/modules/base/rendering/grids/renderablegrid.h b/modules/base/rendering/grids/renderablegrid.h index 3173ee10c2..1b713b95a7 100644 --- a/modules/base/rendering/grids/renderablegrid.h +++ b/modules/base/rendering/grids/renderablegrid.h @@ -27,16 +27,13 @@ #include -#include #include #include #include #include #include #include - -namespace ghoul::opengl { class ProgramObject; } -namespace openspace::documentation { struct Documentation; } +#include namespace openspace { diff --git a/modules/base/rendering/grids/renderableradialgrid.cpp b/modules/base/rendering/grids/renderableradialgrid.cpp index 2683aecbbb..cdec94acb6 100644 --- a/modules/base/rendering/grids/renderableradialgrid.cpp +++ b/modules/base/rendering/grids/renderableradialgrid.cpp @@ -26,15 +26,18 @@ #include #include +#include #include +#include #include #include -#include #include #include #include #include +#include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo ColorInfo = { diff --git a/modules/base/rendering/grids/renderableradialgrid.h b/modules/base/rendering/grids/renderableradialgrid.h index cc9a8db7bf..5fb5525483 100644 --- a/modules/base/rendering/grids/renderableradialgrid.h +++ b/modules/base/rendering/grids/renderableradialgrid.h @@ -35,10 +35,7 @@ #include #include #include - -namespace ghoul::opengl { class ProgramObject; } - -namespace openspace::documentation { struct Documentation; } +#include namespace openspace { @@ -93,6 +90,6 @@ protected: std::unique_ptr _labels; }; -}// namespace openspace +} // namespace openspace #endif // __OPENSPACE_MODULE_BASE___RENDERABLERADIALGRID___H__ diff --git a/modules/base/rendering/grids/renderablesphericalgrid.cpp b/modules/base/rendering/grids/renderablesphericalgrid.cpp index 87f22292a6..8c5ee80c90 100644 --- a/modules/base/rendering/grids/renderablesphericalgrid.cpp +++ b/modules/base/rendering/grids/renderablesphericalgrid.cpp @@ -25,14 +25,18 @@ #include #include +#include #include #include #include -#include #include #include +#include #include #include +#include +#include +#include #include namespace { @@ -124,7 +128,7 @@ RenderableSphericalGrid::RenderableSphericalGrid(const ghoul::Dictionary& dictio , _gridProgram(nullptr) , _color(ColorInfo, glm::vec3(0.5f), glm::vec3(0.f), glm::vec3(1.f)) , _longSegments(LongSegmentsInfo, 36, 4, 200) - , _latSegments(LatSegmentsInfo, 36, 4, 200) + , _latSegments(LatSegmentsInfo, 19, 4, 200) , _lineWidth(LineWidthInfo, 0.5f, 1.f, 20.f) { const Parameters p = codegen::bake(dictionary); diff --git a/modules/base/rendering/grids/renderablesphericalgrid.h b/modules/base/rendering/grids/renderablesphericalgrid.h index 3f24f9d331..ef5d4fe773 100644 --- a/modules/base/rendering/grids/renderablesphericalgrid.h +++ b/modules/base/rendering/grids/renderablesphericalgrid.h @@ -32,13 +32,10 @@ #include #include #include - -namespace ghoul::opengl { class ProgramObject; } +#include namespace openspace { -namespace documentation { struct Documentation; } - class RenderableSphericalGrid : public Renderable { public: explicit RenderableSphericalGrid(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rendering/pointcloud/renderableinterpolatedpoints.cpp b/modules/base/rendering/pointcloud/renderableinterpolatedpoints.cpp index 9f0be053e6..d913e5c39a 100644 --- a/modules/base/rendering/pointcloud/renderableinterpolatedpoints.cpp +++ b/modules/base/rendering/pointcloud/renderableinterpolatedpoints.cpp @@ -30,12 +30,14 @@ #include #include #include +#include #include #include -#include +#include +#include #include -#include -#include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderableInterpolatedPoints"; diff --git a/modules/base/rendering/pointcloud/renderableinterpolatedpoints.h b/modules/base/rendering/pointcloud/renderableinterpolatedpoints.h index 97bb597b4b..60482391ed 100644 --- a/modules/base/rendering/pointcloud/renderableinterpolatedpoints.h +++ b/modules/base/rendering/pointcloud/renderableinterpolatedpoints.h @@ -31,15 +31,12 @@ #include #include #include - -namespace ghoul::opengl { class Texture; } +#include namespace openspace { -namespace documentation { struct Documentation; } - /** - * A specialization of the RenderablePointCloud that supports interpolation beetween + * A specialization of the RenderablePointCloud that supports interpolation between * different positions for the points. */ class RenderableInterpolatedPoints : public RenderablePointCloud { diff --git a/modules/base/rendering/pointcloud/renderablepointcloud.cpp b/modules/base/rendering/pointcloud/renderablepointcloud.cpp index f0db1b28a1..9d3ab6d46e 100644 --- a/modules/base/rendering/pointcloud/renderablepointcloud.cpp +++ b/modules/base/rendering/pointcloud/renderablepointcloud.cpp @@ -25,35 +25,32 @@ #include #include +#include #include -#include #include -#include #include -#include +#include #include +#include #include #include #include -#include -#include +#include +#include +#include #include #include #include #include #include #include -#include #include -#include -#include +#include #include #include -#include -#include -#include -#include -#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderablePointCloud"; diff --git a/modules/base/rendering/pointcloud/renderablepointcloud.h b/modules/base/rendering/pointcloud/renderablepointcloud.h index df3419492f..3bb2673a15 100644 --- a/modules/base/rendering/pointcloud/renderablepointcloud.h +++ b/modules/base/rendering/pointcloud/renderablepointcloud.h @@ -28,32 +28,28 @@ #include #include +#include +#include #include #include -#include #include #include #include -#include #include #include #include #include #include +#include #include +#include #include #include -#include - -namespace ghoul::opengl { - class ProgramObject; - class Texture; -} // namespace ghoul::opengl +#include +#include namespace openspace { -namespace documentation { struct Documentation; } - struct TextureFormat { glm::uvec2 resolution; bool useAlpha = false; @@ -157,7 +153,7 @@ protected: void renderPoints(const RenderData& data, const glm::dmat4& modelMatrix, const glm::dvec3& orthoRight, const glm::dvec3& orthoUp, float fadeInVariable); - gl::GLenum internalGlFormat(bool useAlpha) const; + GLenum internalGlFormat(bool useAlpha) const; ghoul::opengl::Texture::Format glFormat(bool useAlpha) const; bool _dataIsDirty = true; diff --git a/modules/base/rendering/pointcloud/renderablepolygoncloud.cpp b/modules/base/rendering/pointcloud/renderablepolygoncloud.cpp index f69a9ba302..f901c5b4d2 100644 --- a/modules/base/rendering/pointcloud/renderablepolygoncloud.cpp +++ b/modules/base/rendering/pointcloud/renderablepolygoncloud.cpp @@ -26,11 +26,12 @@ #include #include -#include #include +#include +#include #include -#include -#include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderablePolygonCloud"; diff --git a/modules/base/rendering/pointcloud/renderablepolygoncloud.h b/modules/base/rendering/pointcloud/renderablepolygoncloud.h index 13cf5a8aa2..681b0b6635 100644 --- a/modules/base/rendering/pointcloud/renderablepolygoncloud.h +++ b/modules/base/rendering/pointcloud/renderablepolygoncloud.h @@ -27,17 +27,11 @@ #include -#include - -namespace ghoul::opengl { class Texture; } - namespace openspace { -namespace documentation { struct Documentation; } - /** * A billboarded point cloud, but with dynamically created uniform polygon shapes instead - * of a custom texture. Overwrites the sprite set in parent class, RenderablePointCloud + * of a custom texture. Overwrites the sprite set in parent class, RenderablePointCloud. */ class RenderablePolygonCloud : public RenderablePointCloud { public: diff --git a/modules/base/rendering/pointcloud/sizemappingcomponent.cpp b/modules/base/rendering/pointcloud/sizemappingcomponent.cpp index c5bf3ea1a9..1e965666dd 100644 --- a/modules/base/rendering/pointcloud/sizemappingcomponent.cpp +++ b/modules/base/rendering/pointcloud/sizemappingcomponent.cpp @@ -27,6 +27,10 @@ #include #include #include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "SizeMapping"; diff --git a/modules/base/rendering/pointcloud/sizemappingcomponent.h b/modules/base/rendering/pointcloud/sizemappingcomponent.h index 3da60e6620..0223dc6d1e 100644 --- a/modules/base/rendering/pointcloud/sizemappingcomponent.h +++ b/modules/base/rendering/pointcloud/sizemappingcomponent.h @@ -31,6 +31,8 @@ #include #include +namespace ghoul { class Dictionary; } + namespace openspace { namespace documentation { struct Documentation; } diff --git a/modules/base/rendering/renderablecartesianaxes.cpp b/modules/base/rendering/renderablecartesianaxes.cpp index 71fbc85bee..2eb30818d7 100644 --- a/modules/base/rendering/renderablecartesianaxes.cpp +++ b/modules/base/rendering/renderablecartesianaxes.cpp @@ -25,16 +25,17 @@ #include #include +#include #include #include -#include #include -#include #include #include +#include #include #include -#include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo XColorInfo = { diff --git a/modules/base/rendering/renderablecartesianaxes.h b/modules/base/rendering/renderablecartesianaxes.h index fadf761f03..89ebd158ac 100644 --- a/modules/base/rendering/renderablecartesianaxes.h +++ b/modules/base/rendering/renderablecartesianaxes.h @@ -27,17 +27,9 @@ #include -#include -#include -#include -#include #include #include -namespace ghoul::opengl { class ProgramObject; } - -namespace openspace::documentation { struct Documentation; } - namespace openspace { class RenderableCartesianAxes : public Renderable { diff --git a/modules/base/rendering/renderabledisc.cpp b/modules/base/rendering/renderabledisc.cpp index 97d521b8aa..40e16c5b24 100644 --- a/modules/base/rendering/renderabledisc.cpp +++ b/modules/base/rendering/renderabledisc.cpp @@ -25,15 +25,14 @@ #include #include -#include #include #include -#include #include #include -#include +#include #include #include +#include #include #include #include diff --git a/modules/base/rendering/renderabledisc.h b/modules/base/rendering/renderabledisc.h index 588c64cc69..dd8f88db19 100644 --- a/modules/base/rendering/renderabledisc.h +++ b/modules/base/rendering/renderabledisc.h @@ -32,15 +32,10 @@ #include #include #include -#include - -namespace ghoul::filesystem { class File; } -namespace ghoul::opengl { class ProgramObject; } +#include namespace openspace { -namespace documentation { struct Documentation; } - class RenderableDisc : public Renderable { public: explicit RenderableDisc(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rendering/renderabledistancelabel.cpp b/modules/base/rendering/renderabledistancelabel.cpp index 2a93a3a850..c14f45d75f 100644 --- a/modules/base/rendering/renderabledistancelabel.cpp +++ b/modules/base/rendering/renderabledistancelabel.cpp @@ -26,14 +26,13 @@ #include #include -#include #include #include #include #include +#include #include -#include -#include +#include namespace { constexpr std::string_view _loggerCat = "RenderableDistanceLabel"; diff --git a/modules/base/rendering/renderabledistancelabel.h b/modules/base/rendering/renderabledistancelabel.h index a79c85d527..2d525e2104 100644 --- a/modules/base/rendering/renderabledistancelabel.h +++ b/modules/base/rendering/renderabledistancelabel.h @@ -33,8 +33,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class RenderableDistanceLabel : public RenderableLabel { public: explicit RenderableDistanceLabel(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rendering/renderablelabel.cpp b/modules/base/rendering/renderablelabel.cpp index 2a56a59abb..15d24de5c6 100644 --- a/modules/base/rendering/renderablelabel.cpp +++ b/modules/base/rendering/renderablelabel.cpp @@ -24,28 +24,19 @@ #include -#include #include -#include #include #include -#include #include #include -#include #include #include -#include -#include -#include -#include +#include +#include #include -#include #include -#include -#include -#include -#include +#include +#include #include namespace { diff --git a/modules/base/rendering/renderablelabel.h b/modules/base/rendering/renderablelabel.h index c931d65b94..8dae1d00b9 100644 --- a/modules/base/rendering/renderablelabel.h +++ b/modules/base/rendering/renderablelabel.h @@ -34,26 +34,12 @@ #include #include #include +#include -#include -#include - -namespace ghoul::filesystem { class File; } namespace ghoul::fontrendering { class Font; } -namespace ghoul::opengl { - class ProgramObject; - class Texture; -} // namespace ghoul::opengl namespace openspace { -struct RenderData; -struct UpdateData; - -namespace documentation { struct Documentation; } - -struct LinePoint; - class RenderableLabel : public Renderable { public: explicit RenderableLabel(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index 1d805ff414..04985fd4ea 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -38,19 +37,28 @@ #include #include #include -#include #include +#include #include +#include #include #include -#include +#include +#include +#include #include #include #include #include #include +#include +#include +#include #include +#include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderableModel"; @@ -904,7 +912,7 @@ void RenderableModel::render(const RenderData& data, RendererTasks&) { _lightDirectionsViewSpaceBuffer[nLightSources] = lightSource->directionViewSpace(data); - ++nLightSources; + nLightSources++; } if (_uniformCache.performShading != -1) { diff --git a/modules/base/rendering/renderablemodel.h b/modules/base/rendering/renderablemodel.h index d29a841ce8..d144588986 100644 --- a/modules/base/rendering/renderablemodel.h +++ b/modules/base/rendering/renderablemodel.h @@ -29,34 +29,21 @@ #include #include -#include #include -#include #include +#include #include #include #include -#include -#include #include #include -#include - -namespace ghoul::opengl { - class ProgramObject; - class Texture; -} // namespace ghoul::opengl namespace ghoul::modelgeometry { class ModelGeometry; } namespace openspace { -struct RenderData; -struct UpdateData; class LightSource; -namespace documentation { struct Documentation; } - class RenderableModel : public Renderable, public Shadower { public: explicit RenderableModel(const ghoul::Dictionary& dictionary); @@ -122,12 +109,12 @@ private: std::filesystem::path _fragmentShaderPath; ghoul::opengl::ProgramObject* _program = nullptr; UniformCache(modelViewTransform, projectionTransform, normalTransform, meshTransform, - meshNormalTransform, ambientIntensity, diffuseIntensity, - specularIntensity, specularPower, performShading, use_forced_color, has_texture_diffuse, - has_texture_normal, has_texture_specular, has_color_specular, - texture_diffuse, texture_normal, texture_specular, color_diffuse, - color_specular, opacity, nLightSources, lightDirectionsViewSpace, - lightIntensities, performManualDepthTest, gBufferDepthTexture, resolution + meshNormalTransform, ambientIntensity, diffuseIntensity, specularIntensity, + specularPower, performShading, use_forced_color, has_texture_diffuse, + has_texture_normal, has_texture_specular, has_color_specular, texture_diffuse, + texture_normal, texture_specular, color_diffuse, color_specular, opacity, + nLightSources, lightDirectionsViewSpace, lightIntensities, performManualDepthTest, + gBufferDepthTexture, resolution ) _uniformCache; std::vector> _lightSources; diff --git a/modules/base/rendering/renderablenodearrow.cpp b/modules/base/rendering/renderablenodearrow.cpp index e66e2ef236..08728998cf 100644 --- a/modules/base/rendering/renderablenodearrow.cpp +++ b/modules/base/rendering/renderablenodearrow.cpp @@ -25,22 +25,23 @@ #include #include -#include +#include #include -#include -#include #include #include #include -#include -#include #include +#include #include +#include #include +#include #include #include -#include -#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderableNodeArrow"; diff --git a/modules/base/rendering/renderablenodearrow.h b/modules/base/rendering/renderablenodearrow.h index d08d6fcd32..94ead7aa3d 100644 --- a/modules/base/rendering/renderablenodearrow.h +++ b/modules/base/rendering/renderablenodearrow.h @@ -27,20 +27,15 @@ #include +#include #include #include #include #include -#include #include -namespace ghoul::opengl { class ProgramObject; } - namespace openspace { -namespace documentation { struct Documentation; } -class Translation; - /** * Generates an arrow shape that points from the start node to the end node. */ diff --git a/modules/base/rendering/renderablenodeline.cpp b/modules/base/rendering/renderablenodeline.cpp index 588434ec64..b0fd5a8133 100644 --- a/modules/base/rendering/renderablenodeline.cpp +++ b/modules/base/rendering/renderablenodeline.cpp @@ -25,18 +25,20 @@ #include #include -#include +#include #include #include #include #include #include -#include #include #include +#include #include +#include #include #include +#include namespace { constexpr std::string_view _loggerCat = "RenderableNodeLine"; diff --git a/modules/base/rendering/renderablenodeline.h b/modules/base/rendering/renderablenodeline.h index 71588fb168..8a6846e07d 100644 --- a/modules/base/rendering/renderablenodeline.h +++ b/modules/base/rendering/renderablenodeline.h @@ -27,21 +27,17 @@ #include +#include #include #include #include -#include #include - -namespace ghoul::opengl { class ProgramObject; } -namespace openspace::documentation { struct Documentation; } +#include namespace openspace { -class Translation; - /** - * This is a class for a line that is drawn between two nodes in OpenSpace. + * This is a class for a line that is drawn between two nodes. */ class RenderableNodeLine : public Renderable { public: diff --git a/modules/base/rendering/renderableplane.cpp b/modules/base/rendering/renderableplane.cpp index c3e5afe326..e583b24aad 100644 --- a/modules/base/rendering/renderableplane.cpp +++ b/modules/base/rendering/renderableplane.cpp @@ -26,19 +26,24 @@ #include #include -#include #include #include #include #include #include +#include #include #include #include #include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include #include namespace { @@ -169,7 +174,7 @@ namespace { std::optional mirrorBackside; // [[codegen::verbatim(SizeInfo.description)]] - std::variant size; + std::optional> size; // [[codegen::verbatim(AutoScaleInfo.description)]] std::optional autoScale; @@ -257,11 +262,13 @@ RenderablePlane::RenderablePlane(const ghoul::Dictionary& dictionary) }); addProperty(Fadeable::_opacity); - if (std::holds_alternative(p.size)) { - _size = glm::vec2(std::get(p.size)); - } - else { - _size = std::get(p.size); + if (p.size.has_value()) { + if (std::holds_alternative(*p.size)) { + _size = glm::vec2(std::get(*p.size)); + } + else { + _size = std::get(*p.size); + } } _size.setExponent(15.f); _size.onChange([this]() { _planeIsDirty = true; }); diff --git a/modules/base/rendering/renderableplane.h b/modules/base/rendering/renderableplane.h index 70e34f80ec..f6132e9903 100644 --- a/modules/base/rendering/renderableplane.h +++ b/modules/base/rendering/renderableplane.h @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -35,20 +36,8 @@ namespace ghoul::filesystem { class File; } -namespace ghoul::opengl { - class ProgramObject; - class Texture; -} // namespace ghoul::opengl - namespace openspace { -struct RenderData; -struct UpdateData; - -namespace documentation { struct Documentation; } - -struct LinePoint; - class RenderablePlane : public Renderable { public: explicit RenderablePlane(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rendering/renderableplaneimagelocal.cpp b/modules/base/rendering/renderableplaneimagelocal.cpp index e888be7d61..64242bdf1e 100644 --- a/modules/base/rendering/renderableplaneimagelocal.cpp +++ b/modules/base/rendering/renderableplaneimagelocal.cpp @@ -26,16 +26,18 @@ #include #include -#include #include #include +#include #include #include #include +#include #include #include -#include -#include +#include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo TextureInfo = { @@ -45,7 +47,7 @@ namespace { openspace::properties::Property::Visibility::User }; - // A RenderablePlaneImageLocal creates a textured 3D plane, where the texture is + // A `RenderablePlaneImageLocal` creates a textured 3D plane, where the texture is // provided by a local file on disk. struct [[codegen::Dictionary(RenderablePlaneImageLocal)]] Parameters { // [[codegen::verbatim(TextureInfo.description)]] diff --git a/modules/base/rendering/renderableplaneimagelocal.h b/modules/base/rendering/renderableplaneimagelocal.h index e41d2f61b6..7a27ffc571 100644 --- a/modules/base/rendering/renderableplaneimagelocal.h +++ b/modules/base/rendering/renderableplaneimagelocal.h @@ -27,16 +27,11 @@ #include -namespace ghoul::filesystem { class File; } -namespace ghoul::opengl { class Texture; } +#include +#include namespace openspace { -struct RenderData; -struct UpdateData; - -namespace documentation { struct Documentation; } - class RenderablePlaneImageLocal : public RenderablePlane { public: explicit RenderablePlaneImageLocal(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rendering/renderableplaneimageonline.cpp b/modules/base/rendering/renderableplaneimageonline.cpp index 3f2a3ba048..25b47be4b0 100644 --- a/modules/base/rendering/renderableplaneimageonline.cpp +++ b/modules/base/rendering/renderableplaneimageonline.cpp @@ -25,13 +25,16 @@ #include #include -#include #include -#include +#include #include #include +#include #include -#include +#include +#include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo TextureInfo = { @@ -43,7 +46,7 @@ namespace { openspace::properties::Property::Visibility::User }; - // A RenderablePlaneImageOnline creates a textured 3D plane, where the texture image + // A `RenderablePlaneImageOnline` creates a textured 3D plane, where the texture image // is loaded from the internet though a web URL. struct [[codegen::Dictionary(RenderablePlaneImageOnline)]] Parameters { // [[codegen::verbatim(TextureInfo.description)]] diff --git a/modules/base/rendering/renderableplaneimageonline.h b/modules/base/rendering/renderableplaneimageonline.h index 1f17977536..a94929e774 100644 --- a/modules/base/rendering/renderableplaneimageonline.h +++ b/modules/base/rendering/renderableplaneimageonline.h @@ -28,17 +28,12 @@ #include #include - -namespace ghoul::filesystem { class File; } -namespace ghoul::opengl { class Texture; } +#include +#include +#include namespace openspace { -struct RenderData; -struct UpdateData; - -namespace documentation { struct Documentation; } - class RenderablePlaneImageOnline : public RenderablePlane { public: explicit RenderablePlaneImageOnline(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rendering/renderableplanetimevaryingimage.cpp b/modules/base/rendering/renderableplanetimevaryingimage.cpp index 241a9d9d47..c32d04e770 100644 --- a/modules/base/rendering/renderableplanetimevaryingimage.cpp +++ b/modules/base/rendering/renderableplanetimevaryingimage.cpp @@ -26,16 +26,16 @@ #include #include -#include -#include -#include -#include -#include +#include #include #include +#include #include #include -#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderablePlaneTimeVaryingImage"; diff --git a/modules/base/rendering/renderableplanetimevaryingimage.h b/modules/base/rendering/renderableplanetimevaryingimage.h index dc1ca2001f..ed14a3474f 100644 --- a/modules/base/rendering/renderableplanetimevaryingimage.h +++ b/modules/base/rendering/renderableplanetimevaryingimage.h @@ -27,18 +27,13 @@ #include +#include #include - -namespace ghoul::filesystem { class File; } -namespace ghoul::opengl { class Texture; } +#include +#include namespace openspace { -struct RenderData; -struct UpdateData; - -namespace documentation { struct Documentation; } - class RenderablePlaneTimeVaryingImage : public RenderablePlane { public: explicit RenderablePlaneTimeVaryingImage(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rendering/renderableprism.cpp b/modules/base/rendering/renderableprism.cpp index 7d2c857b5e..47fd98d282 100644 --- a/modules/base/rendering/renderableprism.cpp +++ b/modules/base/rendering/renderableprism.cpp @@ -25,15 +25,17 @@ #include #include -#include #include #include #include #include #include -#include +#include +#include +#include #include #include +#include #include namespace { diff --git a/modules/base/rendering/renderableprism.h b/modules/base/rendering/renderableprism.h index 4005ea59d8..e26edfb9be 100644 --- a/modules/base/rendering/renderableprism.h +++ b/modules/base/rendering/renderableprism.h @@ -32,14 +32,11 @@ #include #include #include -#include - -namespace ghoul::opengl { class ProgramObject; } +#include +#include namespace openspace { -namespace documentation { struct Documentation; } - class RenderablePrism : public Renderable { public: explicit RenderablePrism(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp index 0af99514ce..1f09a62cff 100644 --- a/modules/base/rendering/renderablesphere.cpp +++ b/modules/base/rendering/renderablesphere.cpp @@ -26,17 +26,24 @@ #include #include -#include #include #include #include #include #include +#include #include #include +#include +#include +#include #include #include #include +#include +#include +#include +#include #include namespace { @@ -67,8 +74,8 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; - enum class Orientation : int { - Outside = 0, + enum class Orientation { + Outside, Inside, Both }; @@ -88,6 +95,20 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; + enum class TextureProjection { + Equirectangular, + AngularFisheye + }; + + constexpr openspace::properties::Property::PropertyInfo TextureProjectionInfo = { + "TextureProjection", + "Texture Projection", + "Specifies the projection mapping to use for any texture loaded onto the sphere " + "(assumes Equirectangular per default). Note that for \"Angular Fisheye\" only " + "half the sphere will be textured - the hemisphere centered around the z-axis.", + openspace::properties::Property::Visibility::AdvancedUser + }; + constexpr openspace::properties::Property::PropertyInfo DisableFadeInOutInfo = { "DisableFadeInOut", "Disable fade-in/fade-out effects", @@ -145,10 +166,11 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; - // This `Renderable` represents a simple sphere with an image. The image that is shown - // should be in an equirectangular projection/spherical panoramic image or else - // distortions will be introduced. The `Orientation` parameter determines whether the - // provided image is shown on the inside, outside, or both sides of the sphere. + // This `Renderable` represents a simple sphere with an image. Per default, the + // sphere uses an equirectangular projection for the image mapping. + // + // The `Orientation` parameter determines whether the provided image is shown on + // the inside, outside, or both sides of the sphere. struct [[codegen::Dictionary(RenderableSphere)]] Parameters { // [[codegen::verbatim(SizeInfo.description)]] std::optional size [[codegen::greater(0.f)]]; @@ -168,6 +190,14 @@ namespace { // [[codegen::verbatim(MirrorTextureInfo.description)]] std::optional mirrorTexture; + enum class [[codegen::map(TextureProjection)]] TextureProjection { + Equirectangular, + AngularFisheye [[codegen::key("Angular Fisheye")]] + }; + + // [[codegen::verbatim(TextureProjectionInfo.description)]] + std::optional textureProjection; + // [[codegen::verbatim(DisableFadeInOutInfo.description)]] std::optional disableFadeInOut; @@ -204,6 +234,7 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary) , _segments(SegmentsInfo, 16, 4, 1000) , _orientation(OrientationInfo) , _mirrorTexture(MirrorTextureInfo, false) + , _textureProjection(TextureProjectionInfo) , _disableFadeInDistance(DisableFadeInOutInfo, false) , _fadeInThreshold(FadeInThresholdInfo, 0.f, 0.f, 1.f, 0.001f) , _fadeOutThreshold(FadeOutThresholdInfo, 0.f, 0.f, 1.f, 0.001f) @@ -243,6 +274,15 @@ RenderableSphere::RenderableSphere(const ghoul::Dictionary& dictionary) _mirrorTexture = p.mirrorTexture.value_or(_mirrorTexture); addProperty(_mirrorTexture); + _textureProjection.addOptions({ + { static_cast(TextureProjection::Equirectangular), "Equirectangular" }, + { static_cast(TextureProjection::AngularFisheye), "Angular Fisheye" } + }); + _textureProjection = p.textureProjection.has_value() ? + static_cast(codegen::map(*p.textureProjection)) : + static_cast(TextureProjection::Equirectangular); + addProperty(_textureProjection); + _disableFadeInDistance = p.disableFadeInOut.value_or(_disableFadeInDistance); addProperty(_disableFadeInDistance); @@ -439,6 +479,8 @@ void RenderableSphere::render(const RenderData& data, RendererTasks&) { defer{ unbindTexture(); }; _shader->setUniform(_uniformCache.colorTexture, unit); + _shader->setUniform(_uniformCache.textureProjection, _textureProjection.value()); + // Setting these states should not be necessary, // since they are the default state in OpenSpace. glEnable(GL_CULL_FACE); diff --git a/modules/base/rendering/renderablesphere.h b/modules/base/rendering/renderablesphere.h index 9a6c835607..56a964e807 100644 --- a/modules/base/rendering/renderablesphere.h +++ b/modules/base/rendering/renderablesphere.h @@ -28,20 +28,17 @@ #include #include -#include +#include +#include +#include +#include #include +#include #include - -namespace ghoul::opengl { class ProgramObject; } +#include namespace openspace { -class Sphere; -struct RenderData; -struct UpdateData; - -namespace documentation { struct Documentation; } - class RenderableSphere : public Renderable { public: explicit RenderableSphere(const ghoul::Dictionary& dictionary); @@ -65,6 +62,7 @@ protected: properties::OptionProperty _orientation; properties::BoolProperty _mirrorTexture; + properties::OptionProperty _textureProjection; properties::BoolProperty _disableFadeInDistance; properties::FloatProperty _fadeInThreshold; @@ -84,7 +82,7 @@ private: std::unique_ptr _transferFunction; UniformCache(opacity, modelViewProjection, modelViewTransform, modelViewRotation, - colorTexture, mirrorTexture) _uniformCache; + colorTexture, mirrorTexture, textureProjection) _uniformCache; }; } // namespace openspace diff --git a/modules/base/rendering/renderablesphereimagelocal.cpp b/modules/base/rendering/renderablesphereimagelocal.cpp index 322b6e92d2..2f165a5817 100644 --- a/modules/base/rendering/renderablesphereimagelocal.cpp +++ b/modules/base/rendering/renderablesphereimagelocal.cpp @@ -25,12 +25,9 @@ #include #include -#include -#include -#include -#include +#include #include -#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo TextureInfo = { @@ -44,6 +41,10 @@ namespace { // This `Renderable` shows a sphere with an image provided by a local file on disk. To // show a sphere with an image from an online source, see // [RenderableSphereImageOnline](#base_screenspace_image_online). + // + // Per default, the sphere uses an equirectangular projection for the image mapping + // and hence expects an equirectangular image. However, it can also be used to show + // fisheye images by changing the `TextureProjection`. struct [[codegen::Dictionary(RenderableSphereImageLocal)]] Parameters { // [[codegen::verbatim(TextureInfo.description)]] std::filesystem::path texture; diff --git a/modules/base/rendering/renderablesphereimagelocal.h b/modules/base/rendering/renderablesphereimagelocal.h index 3117a54468..34b02da986 100644 --- a/modules/base/rendering/renderablesphereimagelocal.h +++ b/modules/base/rendering/renderablesphereimagelocal.h @@ -27,17 +27,11 @@ #include +#include #include -namespace ghoul::opengl { class Texture; } - namespace openspace { -struct RenderData; -struct UpdateData; - -namespace documentation { struct Documentation; } - class RenderableSphereImageLocal : public RenderableSphere { public: explicit RenderableSphereImageLocal(const ghoul::Dictionary& dictionary); @@ -56,7 +50,6 @@ protected: void bindTexture() override; private: - properties::StringProperty _texturePath; std::unique_ptr _texture; diff --git a/modules/base/rendering/renderablesphereimageonline.cpp b/modules/base/rendering/renderablesphereimageonline.cpp index ffb567cbf8..5620e59883 100644 --- a/modules/base/rendering/renderablesphereimageonline.cpp +++ b/modules/base/rendering/renderablesphereimageonline.cpp @@ -25,13 +25,14 @@ #include #include -#include +#include #include -#include -#include +#include #include #include +#include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo TextureInfo = { @@ -68,6 +69,10 @@ namespace { // will be downloaded when the `Renderable` is added to a scene graph node. To show a // sphere with an image from a local file, see // [RenderableSphereImageLocal](#base_screenspace_image_local). + // + // Per default, the sphere uses an equirectangular projection for the image mapping + // and hence expects an equirectangular image. However, it can also be used to show + // fisheye images by changing the `TextureProjection`. struct [[codegen::Dictionary(RenderableSphereImageOnline)]] Parameters { // [[codegen::verbatim(TextureInfo.description)]] std::string url [[codegen::key("URL")]]; diff --git a/modules/base/rendering/renderablesphereimageonline.h b/modules/base/rendering/renderablesphereimageonline.h index e2a6e4f7e0..c6bc4efabd 100644 --- a/modules/base/rendering/renderablesphereimageonline.h +++ b/modules/base/rendering/renderablesphereimageonline.h @@ -28,18 +28,13 @@ #include #include - -namespace ghoul::opengl { class Texture; } +#include +#include namespace openspace { -struct RenderData; -struct UpdateData; - -namespace documentation { struct Documentation; } - /** - * This class describes a sphere renderable that displays an image from an online source + * This class describes a sphere renderable that displays an image from an online source. */ class RenderableSphereImageOnline : public RenderableSphere { public: diff --git a/modules/base/rendering/renderableswitch.cpp b/modules/base/rendering/renderableswitch.cpp index dacf889e89..844bb14fc9 100644 --- a/modules/base/rendering/renderableswitch.cpp +++ b/modules/base/rendering/renderableswitch.cpp @@ -24,18 +24,11 @@ #include -#include #include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include namespace { diff --git a/modules/base/rendering/renderableswitch.h b/modules/base/rendering/renderableswitch.h index 48b8eda97d..e325e92b08 100644 --- a/modules/base/rendering/renderableswitch.h +++ b/modules/base/rendering/renderableswitch.h @@ -27,13 +27,10 @@ #include +#include + namespace openspace { -struct RenderData; -struct UpdateData; - -namespace documentation { struct Documentation; } - class RenderableSwitch : public Renderable { public: explicit RenderableSwitch(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rendering/renderabletimevaryingsphere.cpp b/modules/base/rendering/renderabletimevaryingsphere.cpp index 168c97de13..cd4e0060a7 100644 --- a/modules/base/rendering/renderabletimevaryingsphere.cpp +++ b/modules/base/rendering/renderabletimevaryingsphere.cpp @@ -25,13 +25,15 @@ #include #include -#include -#include +#include #include #include #include -#include #include +#include +#include +#include +#include namespace { // Extract J2000 time from file names diff --git a/modules/base/rendering/renderabletimevaryingsphere.h b/modules/base/rendering/renderabletimevaryingsphere.h index 5bb35a6d92..39f80d5329 100644 --- a/modules/base/rendering/renderabletimevaryingsphere.h +++ b/modules/base/rendering/renderabletimevaryingsphere.h @@ -27,17 +27,14 @@ #include +#include #include +#include namespace ghoul::opengl { class Texture; } namespace openspace { -struct RenderData; -struct UpdateData; - -namespace documentation { struct Documentation; } - class RenderableTimeVaryingSphere : public RenderableSphere { public: explicit RenderableTimeVaryingSphere(const ghoul::Dictionary& dictionary); @@ -59,10 +56,12 @@ private: double time; std::unique_ptr texture; }; + void loadTexture(); void extractMandatoryInfoFromSourceFolder(); void updateActiveTriggerTimeIndex(double currenttime); void computeSequenceEndTime(); + // If there's just one state it should never disappear! double _sequenceEndTime = std::numeric_limits::max(); std::vector _files; diff --git a/modules/base/rendering/renderabletrail.cpp b/modules/base/rendering/renderabletrail.cpp index 0216e9ddfa..daed2265b7 100644 --- a/modules/base/rendering/renderabletrail.cpp +++ b/modules/base/rendering/renderabletrail.cpp @@ -26,16 +26,21 @@ #include #include -#include #include #include #include +#include #include #include +#include +#include #include #include #include +#include +#include #include +#include #include namespace { diff --git a/modules/base/rendering/renderabletrail.h b/modules/base/rendering/renderabletrail.h index a9683b4c8b..cdc8eeaee5 100644 --- a/modules/base/rendering/renderabletrail.h +++ b/modules/base/rendering/renderabletrail.h @@ -28,26 +28,16 @@ #include #include -#include #include #include #include -#include #include -#include #include #include #include -namespace ghoul::opengl { - class ProgramObject; - class Texture; -} // namespace ghoul::opengl - namespace openspace { -namespace documentation { struct Documentation; } - class Translation; /** diff --git a/modules/base/rendering/renderabletrailorbit.cpp b/modules/base/rendering/renderabletrailorbit.cpp index 87f7e77aff..c8c99988f6 100644 --- a/modules/base/rendering/renderabletrailorbit.cpp +++ b/modules/base/rendering/renderabletrailorbit.cpp @@ -25,19 +25,17 @@ #include #include -#include #include #include -#include -#include -#include -#include -#include -#include - -#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include // This class is using a VBO ring buffer + a constantly updated point as follows: // Structure of the array with a _resolution of 16. FF denotes the floating position that @@ -408,7 +406,7 @@ RenderableTrailOrbit::UpdateReport RenderableTrailOrbit::updateTrails( else { // Move the current pointer fowards one step to be used as the new // floating - ++_primaryRenderInformation.first; + _primaryRenderInformation.first++; } } diff --git a/modules/base/rendering/renderabletrailorbit.h b/modules/base/rendering/renderabletrailorbit.h index 9864373f15..9996549079 100644 --- a/modules/base/rendering/renderabletrailorbit.h +++ b/modules/base/rendering/renderabletrailorbit.h @@ -32,8 +32,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - /** * This concrete implementation of a RenderableTrail renders an updated trail behind an * object that is likely to have an orbit-like path. However, this is not required and diff --git a/modules/base/rendering/renderabletrailtrajectory.cpp b/modules/base/rendering/renderabletrailtrajectory.cpp index ea1af54bf5..89efa6cb8b 100644 --- a/modules/base/rendering/renderabletrailtrajectory.cpp +++ b/modules/base/rendering/renderabletrailtrajectory.cpp @@ -25,11 +25,15 @@ #include #include -#include #include #include +#include #include #include +#include +#include +#include +#include #include // This class creates the entire trajectory at once and keeps it in memory the entire @@ -115,8 +119,8 @@ namespace { // [[codegen::verbatim(SampleIntervalInfo.description)]] // The final interval is calculated as SampleInterval/TimeStampSubsampleFactor. - // If SampleInterval is not specified, it will be automatically calculated to produce - // two samples per day between the 'StartTime' and 'EndTime'. + // If SampleInterval is not specified, it will be automatically calculated to + // produce two samples per day between the 'StartTime' and 'EndTime'. std::optional sampleInterval; // [[codegen::verbatim(TimeSubSampleInfo.description)]] diff --git a/modules/base/rendering/renderabletrailtrajectory.h b/modules/base/rendering/renderabletrailtrajectory.h index c23971c272..31adcbd265 100644 --- a/modules/base/rendering/renderabletrailtrajectory.h +++ b/modules/base/rendering/renderabletrailtrajectory.h @@ -31,12 +31,9 @@ #include #include #include -#include namespace openspace { -namespace documentation { struct Documentation; } - /** * This concrete implementation of a RenderableTrail renders a fixed trail, regardless of * its shape. The trail is sampled equitemporal (with an interval of _sampleInterval in diff --git a/modules/base/rendering/screenspacedashboard.cpp b/modules/base/rendering/screenspacedashboard.cpp index 2492f87fc4..2246d68038 100644 --- a/modules/base/rendering/screenspacedashboard.cpp +++ b/modules/base/rendering/screenspacedashboard.cpp @@ -25,16 +25,15 @@ #include #include -#include #include #include -#include #include #include -#include -#include -#include +#include +#include +#include #include +#include #include "screenspacedashboard_lua.inl" diff --git a/modules/base/rendering/screenspacedashboard.h b/modules/base/rendering/screenspacedashboard.h index 21579a4a54..f3920d3716 100644 --- a/modules/base/rendering/screenspacedashboard.h +++ b/modules/base/rendering/screenspacedashboard.h @@ -30,14 +30,8 @@ #include #include -namespace ghoul::fontrendering { - class Font; - class FontRenderer; -} // namespace ghoul::fontrendering - namespace openspace { -namespace documentation { struct Documentation; } namespace scripting { struct LuaLibrary; } class ScreenSpaceDashboard : public ScreenSpaceRenderableFramebuffer { diff --git a/modules/base/rendering/screenspacedashboard_lua.inl b/modules/base/rendering/screenspacedashboard_lua.inl index f448e740a7..fc4f80a705 100644 --- a/modules/base/rendering/screenspacedashboard_lua.inl +++ b/modules/base/rendering/screenspacedashboard_lua.inl @@ -23,6 +23,7 @@ ****************************************************************************************/ #include +#include namespace { diff --git a/modules/base/rendering/screenspacedate.cpp b/modules/base/rendering/screenspacedate.cpp index a4fd2aaf0e..70381151a8 100644 --- a/modules/base/rendering/screenspacedate.cpp +++ b/modules/base/rendering/screenspacedate.cpp @@ -24,12 +24,15 @@ #include +#include +#include #include #include #include +#include #include -#include -#include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo FormatStringInfo = { diff --git a/modules/base/rendering/screenspaceimagelocal.cpp b/modules/base/rendering/screenspaceimagelocal.cpp index c3807618b0..2cb3556d29 100644 --- a/modules/base/rendering/screenspaceimagelocal.cpp +++ b/modules/base/rendering/screenspaceimagelocal.cpp @@ -25,15 +25,15 @@ #include #include -#include #include +#include #include #include -#include +#include #include -#include #include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo TexturePathInfo = { diff --git a/modules/base/rendering/screenspaceimagelocal.h b/modules/base/rendering/screenspaceimagelocal.h index f829a0505f..d9bcd1619c 100644 --- a/modules/base/rendering/screenspaceimagelocal.h +++ b/modules/base/rendering/screenspaceimagelocal.h @@ -33,8 +33,6 @@ namespace ghoul::opengl { class Texture; } namespace openspace { -namespace documentation { struct Documentation; } - class ScreenSpaceImageLocal : public ScreenSpaceRenderable { public: explicit ScreenSpaceImageLocal(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rendering/screenspaceimageonline.cpp b/modules/base/rendering/screenspaceimageonline.cpp index 76eb5dd421..8b3058b03f 100644 --- a/modules/base/rendering/screenspaceimageonline.cpp +++ b/modules/base/rendering/screenspaceimageonline.cpp @@ -25,15 +25,15 @@ #include #include -#include #include #include -#include +#include #include #include #include -#include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "ScreenSpaceImageOnline"; diff --git a/modules/base/rendering/screenspaceimageonline.h b/modules/base/rendering/screenspaceimageonline.h index 23fd1a6f81..5a3f298dd4 100644 --- a/modules/base/rendering/screenspaceimageonline.h +++ b/modules/base/rendering/screenspaceimageonline.h @@ -29,13 +29,12 @@ #include #include +#include namespace ghoul::opengl { class Texture; } namespace openspace { -namespace documentation { struct Documentation; } - class ScreenSpaceImageOnline : public ScreenSpaceRenderable { public: explicit ScreenSpaceImageOnline(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rendering/screenspaceinsetblackout.cpp b/modules/base/rendering/screenspaceinsetblackout.cpp index bcf156a9bf..3a736eaca7 100644 --- a/modules/base/rendering/screenspaceinsetblackout.cpp +++ b/modules/base/rendering/screenspaceinsetblackout.cpp @@ -23,19 +23,25 @@ ****************************************************************************************/ #include -#include +#include #include -#include #include -#include -#include -#include #include #include +#include #include #include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include namespace { constexpr glm::uvec2 BlackoutTextureSize = glm::uvec2(3840, 2160); diff --git a/modules/base/rendering/screenspaceinsetblackout.h b/modules/base/rendering/screenspaceinsetblackout.h index 3ca71e64b8..c96e81b479 100644 --- a/modules/base/rendering/screenspaceinsetblackout.h +++ b/modules/base/rendering/screenspaceinsetblackout.h @@ -28,12 +28,15 @@ #include #include +#include +#include +#include #include +#include +#include namespace openspace { -namespace documentation { struct Documentation; } - class ScreenSpaceInsetBlackout : public ScreenSpaceRenderable { public: explicit ScreenSpaceInsetBlackout(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rendering/screenspacerenderablerenderable.cpp b/modules/base/rendering/screenspacerenderablerenderable.cpp index 48927938c9..434fef691a 100644 --- a/modules/base/rendering/screenspacerenderablerenderable.cpp +++ b/modules/base/rendering/screenspacerenderablerenderable.cpp @@ -25,11 +25,17 @@ #include #include +#include #include #include #include #include +#include #include +#include +#include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo TimeInfo = { diff --git a/modules/base/rendering/screenspacerenderablerenderable.h b/modules/base/rendering/screenspacerenderablerenderable.h index 7905eee1fe..2f39dda1cd 100644 --- a/modules/base/rendering/screenspacerenderablerenderable.h +++ b/modules/base/rendering/screenspacerenderablerenderable.h @@ -27,26 +27,20 @@ #include -#include #include #include #include +#include namespace openspace { -namespace properties { class PropertyOwner; } - class Renderable; class Rotation; class Scale; class Translation; -namespace documentation { struct Documentation; } - class ScreenSpaceRenderableRenderable : public ScreenSpaceRenderableFramebuffer { public: - using RenderFunction = std::function; - explicit ScreenSpaceRenderableRenderable(const ghoul::Dictionary& dictionary); virtual ~ScreenSpaceRenderableRenderable() override; diff --git a/modules/base/rendering/screenspacetext.cpp b/modules/base/rendering/screenspacetext.cpp index aa45a0461a..d0e4e382d7 100644 --- a/modules/base/rendering/screenspacetext.cpp +++ b/modules/base/rendering/screenspacetext.cpp @@ -24,8 +24,9 @@ #include -#include -#include +#include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo TextInfo = { diff --git a/modules/base/rendering/screenspacetimevaryingimageonline.cpp b/modules/base/rendering/screenspacetimevaryingimageonline.cpp index 7edf3b8504..49d88defbd 100644 --- a/modules/base/rendering/screenspacetimevaryingimageonline.cpp +++ b/modules/base/rendering/screenspacetimevaryingimageonline.cpp @@ -25,15 +25,20 @@ #include #include -#include #include #include +#include #include -#include +#include #include #include +#include +#include #include +#include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "ScreenSpaceTimeVaryingImageOnline"; diff --git a/modules/base/rendering/screenspacetimevaryingimageonline.h b/modules/base/rendering/screenspacetimevaryingimageonline.h index 335a8c442c..6fbf195c71 100644 --- a/modules/base/rendering/screenspacetimevaryingimageonline.h +++ b/modules/base/rendering/screenspacetimevaryingimageonline.h @@ -30,13 +30,12 @@ #include #include #include +#include namespace ghoul::opengl { class Texture; } namespace openspace { -namespace documentation { struct Documentation; } - class ScreenSpaceTimeVaryingImageOnline : public ScreenSpaceRenderable { public: explicit ScreenSpaceTimeVaryingImageOnline(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rotation/constantrotation.cpp b/modules/base/rotation/constantrotation.cpp index 92bbd751aa..85987edcc9 100644 --- a/modules/base/rotation/constantrotation.cpp +++ b/modules/base/rotation/constantrotation.cpp @@ -25,8 +25,8 @@ #include #include -#include #include +#include #include #include diff --git a/modules/base/rotation/constantrotation.h b/modules/base/rotation/constantrotation.h index 8ae5b7da4e..b6691f6b55 100644 --- a/modules/base/rotation/constantrotation.h +++ b/modules/base/rotation/constantrotation.h @@ -32,8 +32,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class ConstantRotation : public Rotation { public: explicit ConstantRotation(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rotation/fixedrotation.cpp b/modules/base/rotation/fixedrotation.cpp index 2ac5da5df2..9a9c294d3a 100644 --- a/modules/base/rotation/fixedrotation.cpp +++ b/modules/base/rotation/fixedrotation.cpp @@ -25,15 +25,14 @@ #include #include -#include #include #include #include #include #include +#include #include #include -#include #include namespace { diff --git a/modules/base/rotation/fixedrotation.h b/modules/base/rotation/fixedrotation.h index 9875fb4096..e88ce53c39 100644 --- a/modules/base/rotation/fixedrotation.h +++ b/modules/base/rotation/fixedrotation.h @@ -31,14 +31,11 @@ #include #include #include -#include namespace openspace { class SceneGraphNode; -namespace documentation { struct Documentation; } - class FixedRotation : public Rotation { public: explicit FixedRotation(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rotation/globerotation.cpp b/modules/base/rotation/globerotation.cpp index 9e76e2b98d..26a36d9447 100644 --- a/modules/base/rotation/globerotation.cpp +++ b/modules/base/rotation/globerotation.cpp @@ -25,16 +25,17 @@ #include #include -#include -#include -#include #include #include #include #include #include +#include #include +#include +#include #include +#include namespace { constexpr std::string_view _loggerCat = "GlobeRotation"; diff --git a/modules/base/rotation/luarotation.cpp b/modules/base/rotation/luarotation.cpp index 11ea70a306..08c6e21e53 100644 --- a/modules/base/rotation/luarotation.cpp +++ b/modules/base/rotation/luarotation.cpp @@ -25,16 +25,17 @@ #include #include -#include #include #include #include #include -#include +#include #include #include #include +#include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo ScriptInfo = { diff --git a/modules/base/rotation/luarotation.h b/modules/base/rotation/luarotation.h index 538603c8ac..fe1244d20b 100644 --- a/modules/base/rotation/luarotation.h +++ b/modules/base/rotation/luarotation.h @@ -28,15 +28,13 @@ #include #include - #include +#include namespace ghoul::filesystem { class File; } namespace openspace { -namespace documentation { struct Documentation; } - class LuaRotation : public Rotation { public: explicit LuaRotation(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rotation/multirotation.cpp b/modules/base/rotation/multirotation.cpp index b2c7e7374f..674a2ee4cb 100644 --- a/modules/base/rotation/multirotation.cpp +++ b/modules/base/rotation/multirotation.cpp @@ -25,10 +25,10 @@ #include #include -#include #include -#include -#include +#include +#include +#include namespace { // This Rotation type combines multiple individual rotations that are applied one diff --git a/modules/base/rotation/multirotation.h b/modules/base/rotation/multirotation.h index 8a03d7ce7d..f5438a1fb9 100644 --- a/modules/base/rotation/multirotation.h +++ b/modules/base/rotation/multirotation.h @@ -27,14 +27,8 @@ #include -#include - namespace openspace { -struct UpdateData; - -namespace documentation { struct Documentation; } - class MultiRotation : public Rotation { public: explicit MultiRotation(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rotation/staticrotation.cpp b/modules/base/rotation/staticrotation.cpp index 2106d11c24..c94da01a2e 100644 --- a/modules/base/rotation/staticrotation.cpp +++ b/modules/base/rotation/staticrotation.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo RotationInfo = { diff --git a/modules/base/rotation/staticrotation.h b/modules/base/rotation/staticrotation.h index 81574e22cf..e08330efe6 100644 --- a/modules/base/rotation/staticrotation.h +++ b/modules/base/rotation/staticrotation.h @@ -31,8 +31,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class StaticRotation : public Rotation { public: explicit StaticRotation(const ghoul::Dictionary& dictionary); diff --git a/modules/base/rotation/timelinerotation.cpp b/modules/base/rotation/timelinerotation.cpp index 139ea611bc..83f2cacf7c 100644 --- a/modules/base/rotation/timelinerotation.cpp +++ b/modules/base/rotation/timelinerotation.cpp @@ -25,11 +25,12 @@ #include #include -#include #include #include #include +#include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo ShouldInterpolateInfo = { diff --git a/modules/base/rotation/timelinerotation.h b/modules/base/rotation/timelinerotation.h index 6dc5ff9021..03e48eb30f 100644 --- a/modules/base/rotation/timelinerotation.h +++ b/modules/base/rotation/timelinerotation.h @@ -32,10 +32,6 @@ namespace openspace { -struct UpdateData; - -namespace documentation { struct Documentation; } - class TimelineRotation : public Rotation { public: explicit TimelineRotation(const ghoul::Dictionary& dictionary); diff --git a/modules/base/scale/luascale.cpp b/modules/base/scale/luascale.cpp index af64764303..9f80d47689 100644 --- a/modules/base/scale/luascale.cpp +++ b/modules/base/scale/luascale.cpp @@ -25,16 +25,17 @@ #include #include -#include #include #include #include #include -#include +#include #include #include #include +#include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo ScriptInfo = { diff --git a/modules/base/scale/luascale.h b/modules/base/scale/luascale.h index 84fb40bfcc..0898c5cf2e 100644 --- a/modules/base/scale/luascale.h +++ b/modules/base/scale/luascale.h @@ -29,13 +29,12 @@ #include #include +#include namespace ghoul::filesystem { class File; } namespace openspace { -namespace documentation { struct Documentation; } - class LuaScale : public Scale { public: explicit LuaScale(const ghoul::Dictionary& dictionary); diff --git a/modules/base/scale/multiscale.cpp b/modules/base/scale/multiscale.cpp index 9d683e4ac6..ea1cd2ec8a 100644 --- a/modules/base/scale/multiscale.cpp +++ b/modules/base/scale/multiscale.cpp @@ -25,10 +25,10 @@ #include #include -#include -#include #include -#include +#include +#include +#include namespace { // This Scale type combines multiple individual scale operations that are applied one diff --git a/modules/base/scale/multiscale.h b/modules/base/scale/multiscale.h index e1b6afec43..d418b1367c 100644 --- a/modules/base/scale/multiscale.h +++ b/modules/base/scale/multiscale.h @@ -29,8 +29,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class MultiScale : public Scale { public: explicit MultiScale(const ghoul::Dictionary& dictionary); diff --git a/modules/base/scale/nonuniformstaticscale.cpp b/modules/base/scale/nonuniformstaticscale.cpp index 22af0f24b5..73fc25f4ce 100644 --- a/modules/base/scale/nonuniformstaticscale.cpp +++ b/modules/base/scale/nonuniformstaticscale.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo ScaleInfo = { diff --git a/modules/base/scale/nonuniformstaticscale.h b/modules/base/scale/nonuniformstaticscale.h index 665126dad6..7cb5ab07c6 100644 --- a/modules/base/scale/nonuniformstaticscale.h +++ b/modules/base/scale/nonuniformstaticscale.h @@ -31,8 +31,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class NonUniformStaticScale : public Scale { public: explicit NonUniformStaticScale(const ghoul::Dictionary& dictionary); diff --git a/modules/base/scale/staticscale.cpp b/modules/base/scale/staticscale.cpp index baf2003c0f..df42fada0d 100644 --- a/modules/base/scale/staticscale.cpp +++ b/modules/base/scale/staticscale.cpp @@ -25,7 +25,6 @@ #include #include -#include namespace { constexpr openspace::properties::Property::PropertyInfo ScaleInfo = { diff --git a/modules/base/scale/staticscale.h b/modules/base/scale/staticscale.h index 3ce38c3241..a5fc5ce15c 100644 --- a/modules/base/scale/staticscale.h +++ b/modules/base/scale/staticscale.h @@ -31,8 +31,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class StaticScale : public Scale { public: explicit StaticScale(const ghoul::Dictionary& dictionary); diff --git a/modules/base/scale/timedependentscale.cpp b/modules/base/scale/timedependentscale.cpp index 3639b27da2..e640e39de7 100644 --- a/modules/base/scale/timedependentscale.cpp +++ b/modules/base/scale/timedependentscale.cpp @@ -25,9 +25,10 @@ #include #include -#include #include #include +#include +#include #include namespace { diff --git a/modules/base/scale/timedependentscale.h b/modules/base/scale/timedependentscale.h index 9c70a6243f..67f2ac0b73 100644 --- a/modules/base/scale/timedependentscale.h +++ b/modules/base/scale/timedependentscale.h @@ -33,8 +33,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class TimeDependentScale : public Scale { public: explicit TimeDependentScale(const ghoul::Dictionary& dictionary); diff --git a/modules/base/scale/timelinescale.cpp b/modules/base/scale/timelinescale.cpp index 091e61fdd7..d422f552d2 100644 --- a/modules/base/scale/timelinescale.cpp +++ b/modules/base/scale/timelinescale.cpp @@ -25,11 +25,12 @@ #include #include -#include #include #include #include +#include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo ShouldInterpolateInfo = { diff --git a/modules/base/scale/timelinescale.h b/modules/base/scale/timelinescale.h index a298627311..c46113a97c 100644 --- a/modules/base/scale/timelinescale.h +++ b/modules/base/scale/timelinescale.h @@ -29,14 +29,9 @@ #include #include -#include namespace openspace { -struct UpdateData; - -namespace documentation { struct Documentation; } - class TimelineScale : public Scale { public: explicit TimelineScale(const ghoul::Dictionary& dictionary); diff --git a/modules/base/shaders/sphere_fs.glsl b/modules/base/shaders/sphere_fs.glsl index 98ecb7ff62..20843e5497 100644 --- a/modules/base/shaders/sphere_fs.glsl +++ b/modules/base/shaders/sphere_fs.glsl @@ -38,9 +38,48 @@ uniform vec2 dataMinMaxValues; uniform float opacity; uniform bool mirrorTexture; +const int Equirectangular = 0; +const int AngularFisheye = 1; +uniform int textureProjection; + +const float M_PI = 3.14159265358979323846; + +// Remap equirectangular texture coordinates into angular fisheye +vec2 equiToAngularFisheye(vec2 textureCoords) { + vec2 pos2 = textureCoords * 2.0 - 1.0; // Map [0,1] tex coords to [-1,1] + + // 2D equi to 3D vector + float lat = pos2.y * 0.5 * M_PI; + float lon = pos2.x * M_PI; + + // Map to 3D position, with Z being the north pole + vec3 pos3 = vec3( + cos(lat) * cos(lon), + sin(lat), + cos(lat) * sin(lon) + ); + + float coverAngle = M_PI; // 180 degrees + + // 3D vector to normalized 2D fisheye [-1,1] + float r = 2.0 / coverAngle * atan(sqrt(dot(pos3.xz, pos3.xz)), pos3.y); + float theta = atan(pos3.z, pos3.x); + vec2 fisheye2D = vec2(r * cos(theta), r * sin(theta)); + + if (r > 1.0) { + discard; // Invalid coordinates (outside fisheye frame) + } + + // Remap to [0,1] + return 0.5 * fisheye2D + 0.5; +} Fragment getFragment() { - vec2 texCoord = vs_textureCoords; + vec2 texCoord = vs_textureCoords; // Equirectangular + + if (textureProjection == AngularFisheye) { + texCoord = equiToAngularFisheye(vs_textureCoords); + } Fragment frag; if (mirrorTexture) { diff --git a/modules/base/shaders/sphere_vs.glsl b/modules/base/shaders/sphere_vs.glsl index d55d09f701..2944ac6c10 100644 --- a/modules/base/shaders/sphere_vs.glsl +++ b/modules/base/shaders/sphere_vs.glsl @@ -36,11 +36,10 @@ uniform mat4 modelViewProjection; uniform mat4 modelViewTransform; uniform mat3 modelViewRotation; - void main() { - vs_normal = modelViewRotation * normalize(in_position.xyz); vs_textureCoords = in_textureCoords; + vs_normal = modelViewRotation * normalize(in_position.xyz); vec4 position = modelViewProjection * vec4(in_position.xyz, 1.0); vs_position = modelViewTransform * vec4(in_position.xyz, 1.0); diff --git a/modules/base/task/convertmodeltask.cpp b/modules/base/task/convertmodeltask.cpp index a39724d713..606495c086 100644 --- a/modules/base/task/convertmodeltask.cpp +++ b/modules/base/task/convertmodeltask.cpp @@ -24,8 +24,10 @@ #include +#include #include #include +#include namespace { // This task converts a 3D model format from a format that is natively supported both diff --git a/modules/base/task/convertmodeltask.h b/modules/base/task/convertmodeltask.h index d481b0e19d..226ffc1f35 100644 --- a/modules/base/task/convertmodeltask.h +++ b/modules/base/task/convertmodeltask.h @@ -28,7 +28,6 @@ #include #include -#include namespace openspace { diff --git a/modules/base/timeframe/timeframeinterval.cpp b/modules/base/timeframe/timeframeinterval.cpp index f2a0bf676d..91ff793e44 100644 --- a/modules/base/timeframe/timeframeinterval.cpp +++ b/modules/base/timeframe/timeframeinterval.cpp @@ -25,10 +25,12 @@ #include #include -#include #include #include +#include #include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo HasStartInfo = { diff --git a/modules/base/timeframe/timeframeinterval.h b/modules/base/timeframe/timeframeinterval.h index ab375a5b0c..98c798a668 100644 --- a/modules/base/timeframe/timeframeinterval.h +++ b/modules/base/timeframe/timeframeinterval.h @@ -27,15 +27,11 @@ #include -#include #include +#include namespace openspace { -class Time; - -namespace documentation { struct Documentation; } - class TimeFrameInterval : public TimeFrame { public: explicit TimeFrameInterval(const ghoul::Dictionary& dictionary); diff --git a/modules/base/timeframe/timeframeunion.cpp b/modules/base/timeframe/timeframeunion.cpp index 54c2f07088..56f585a36b 100644 --- a/modules/base/timeframe/timeframeunion.cpp +++ b/modules/base/timeframe/timeframeunion.cpp @@ -26,9 +26,11 @@ #include #include -#include -#include #include +#include +#include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo TimeFramesInfo = { diff --git a/modules/base/timeframe/timeframeunion.h b/modules/base/timeframe/timeframeunion.h index 260bcda265..ec9a610b83 100644 --- a/modules/base/timeframe/timeframeunion.h +++ b/modules/base/timeframe/timeframeunion.h @@ -29,10 +29,6 @@ namespace openspace { -class Time; - -namespace documentation { struct Documentation; } - class TimeFrameUnion : public TimeFrame { public: explicit TimeFrameUnion(const ghoul::Dictionary& dictionary); diff --git a/modules/base/translation/globetranslation.cpp b/modules/base/translation/globetranslation.cpp index 41e60d9433..93d70b8e80 100644 --- a/modules/base/translation/globetranslation.cpp +++ b/modules/base/translation/globetranslation.cpp @@ -24,17 +24,16 @@ #include -#include #include -#include -#include -#include #include #include #include #include #include +#include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "GlobeTranslation"; diff --git a/modules/base/translation/luatranslation.cpp b/modules/base/translation/luatranslation.cpp index 9af55740ca..faffd978b3 100644 --- a/modules/base/translation/luatranslation.cpp +++ b/modules/base/translation/luatranslation.cpp @@ -25,17 +25,17 @@ #include #include -#include #include #include #include #include -#include #include #include #include #include +#include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo ScriptInfo = { diff --git a/modules/base/translation/luatranslation.h b/modules/base/translation/luatranslation.h index e5cd7fc360..3530de2081 100644 --- a/modules/base/translation/luatranslation.h +++ b/modules/base/translation/luatranslation.h @@ -35,8 +35,6 @@ namespace ghoul::filesystem { class File; } namespace openspace { -namespace documentation { struct Documentation; } - class LuaTranslation : public Translation { public: explicit LuaTranslation(const ghoul::Dictionary& dictionary); diff --git a/modules/base/translation/multitranslation.cpp b/modules/base/translation/multitranslation.cpp index c368d915c8..bab4eb7c45 100644 --- a/modules/base/translation/multitranslation.cpp +++ b/modules/base/translation/multitranslation.cpp @@ -25,10 +25,10 @@ #include #include -#include #include -#include -#include +#include +#include +#include namespace { // This Translation type combines multiple translations that are applied one after the diff --git a/modules/base/translation/multitranslation.h b/modules/base/translation/multitranslation.h index 4a69d65d82..3fd1e78577 100644 --- a/modules/base/translation/multitranslation.h +++ b/modules/base/translation/multitranslation.h @@ -29,10 +29,6 @@ namespace openspace { -struct UpdateData; - -namespace documentation { struct Documentation; } - class MultiTranslation : public Translation { public: explicit MultiTranslation(const ghoul::Dictionary& dictionary); diff --git a/modules/base/translation/statictranslation.cpp b/modules/base/translation/statictranslation.cpp index a74fccb2e0..95a3614f32 100644 --- a/modules/base/translation/statictranslation.cpp +++ b/modules/base/translation/statictranslation.cpp @@ -25,7 +25,6 @@ #include #include -#include namespace { constexpr openspace::properties::Property::PropertyInfo PositionInfo = { diff --git a/modules/base/translation/statictranslation.h b/modules/base/translation/statictranslation.h index 81bff8cc33..d6991a010c 100644 --- a/modules/base/translation/statictranslation.h +++ b/modules/base/translation/statictranslation.h @@ -31,10 +31,6 @@ namespace openspace { -struct UpdateData; - -namespace documentation { struct Documentation; } - class StaticTranslation : public Translation { public: explicit StaticTranslation(const ghoul::Dictionary& dictionary); diff --git a/modules/base/translation/timelinetranslation.cpp b/modules/base/translation/timelinetranslation.cpp index 3899accd81..55d659082b 100644 --- a/modules/base/translation/timelinetranslation.cpp +++ b/modules/base/translation/timelinetranslation.cpp @@ -25,11 +25,12 @@ #include #include -#include #include #include #include +#include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo ShouldInterpolateInfo = { diff --git a/modules/base/translation/timelinetranslation.h b/modules/base/translation/timelinetranslation.h index 17059ddc30..839d61d1f6 100644 --- a/modules/base/translation/timelinetranslation.h +++ b/modules/base/translation/timelinetranslation.h @@ -29,14 +29,9 @@ #include #include -#include namespace openspace { -struct UpdateData; - -namespace documentation { struct Documentation; } - class TimelineTranslation : public Translation { public: explicit TimelineTranslation(const ghoul::Dictionary& dictionary); diff --git a/modules/cefwebgui/cefwebguimodule.cpp b/modules/cefwebgui/cefwebguimodule.cpp index d6ac7688cb..c3713bb680 100644 --- a/modules/cefwebgui/cefwebguimodule.cpp +++ b/modules/cefwebgui/cefwebguimodule.cpp @@ -37,6 +37,7 @@ #include #include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { diff --git a/modules/cefwebgui/cefwebguimodule.h b/modules/cefwebgui/cefwebguimodule.h index 6c171cf175..9843501015 100644 --- a/modules/cefwebgui/cefwebguimodule.h +++ b/modules/cefwebgui/cefwebguimodule.h @@ -32,6 +32,7 @@ #include #include #include +#include namespace openspace { diff --git a/modules/cefwebgui/include/guirenderhandler.h b/modules/cefwebgui/include/guirenderhandler.h index 7712c5b43e..1680e4e56e 100644 --- a/modules/cefwebgui/include/guirenderhandler.h +++ b/modules/cefwebgui/include/guirenderhandler.h @@ -27,7 +27,6 @@ #include -#include #include namespace ghoul::opengl { class ProgramObject; } diff --git a/modules/cefwebgui/src/guikeyboardhandler.cpp b/modules/cefwebgui/src/guikeyboardhandler.cpp index 109d856c97..d0c31d963c 100644 --- a/modules/cefwebgui/src/guikeyboardhandler.cpp +++ b/modules/cefwebgui/src/guikeyboardhandler.cpp @@ -25,6 +25,7 @@ #include #include +#include namespace openspace { diff --git a/modules/cefwebgui/src/guirenderhandler.cpp b/modules/cefwebgui/src/guirenderhandler.cpp index 9c61b81344..48e25a119d 100644 --- a/modules/cefwebgui/src/guirenderhandler.cpp +++ b/modules/cefwebgui/src/guirenderhandler.cpp @@ -24,11 +24,12 @@ #include -#include #include #include +#include #include #include +#include namespace { constexpr std::string_view _loggerCat = "WebGUI:RenderHandler"; diff --git a/modules/debugging/debuggingmodule.cpp b/modules/debugging/debuggingmodule.cpp index f6c381d316..253bc39e52 100644 --- a/modules/debugging/debuggingmodule.cpp +++ b/modules/debugging/debuggingmodule.cpp @@ -30,21 +30,16 @@ #include #include #include -#include -#include -#include -#include #include -#include -#include -#include #include #include #include #include #include -#include +#include #include +#include +#include #include #include "debuggingmodule_lua.inl" diff --git a/modules/debugging/debuggingmodule_lua.inl b/modules/debugging/debuggingmodule_lua.inl index 9d7af12c0a..acae63d9a6 100644 --- a/modules/debugging/debuggingmodule_lua.inl +++ b/modules/debugging/debuggingmodule_lua.inl @@ -24,6 +24,10 @@ #include #include +#include +#include +#include +#include namespace { diff --git a/modules/debugging/rendering/debugrenderer.cpp b/modules/debugging/rendering/debugrenderer.cpp index 322441c7c1..5f926cdce5 100644 --- a/modules/debugging/rendering/debugrenderer.cpp +++ b/modules/debugging/rendering/debugrenderer.cpp @@ -24,12 +24,17 @@ #include +#include #include #include +#include #include #include #include #include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "DebugRenderer"; diff --git a/modules/debugging/rendering/screenspacedebugplane.cpp b/modules/debugging/rendering/screenspacedebugplane.cpp index ec48a80a38..84b12d2d66 100644 --- a/modules/debugging/rendering/screenspacedebugplane.cpp +++ b/modules/debugging/rendering/screenspacedebugplane.cpp @@ -25,6 +25,8 @@ #include #include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo TextureInfo = { diff --git a/modules/debugging/scripts/axes.lua b/modules/debugging/scripts/axes.lua index 93ba88fbb6..6cbdf2594b 100644 --- a/modules/debugging/scripts/axes.lua +++ b/modules/debugging/scripts/axes.lua @@ -21,14 +21,14 @@ openspace.debugging.documentation = { current focus node is used instead. \\param scale An optional parameter that specifies the size of the coordinate axes, in meters. If not specified, the size is set to 2.5 times the - interaction sphere of the selected node. + bounding sphere of the selected node. ]] } } openspace.debugging.createCoordinateAxes = function (nodeIdentifier, scale) local node = nodeIdentifier or openspace.navigation.getNavigationState().Anchor - local sphere = openspace.propertyValue("Scene." .. node .. ".EvaluatedInteractionSphere") + local sphere = openspace.propertyValue("Scene." .. node .. ".EvaluatedBoundingSphere") if sphere == -1 then sphere = 1 end diff --git a/modules/digitaluniverse/digitaluniversemodule.cpp b/modules/digitaluniverse/digitaluniversemodule.cpp index 47fb5decdd..6803c91e0a 100644 --- a/modules/digitaluniverse/digitaluniversemodule.cpp +++ b/modules/digitaluniverse/digitaluniversemodule.cpp @@ -29,7 +29,10 @@ #include #include #include +#include +#include #include +#include namespace openspace { diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.cpp b/modules/digitaluniverse/rendering/renderabledumeshes.cpp index 992ff7f984..613de291e4 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.cpp +++ b/modules/digitaluniverse/rendering/renderabledumeshes.cpp @@ -26,28 +26,26 @@ #include #include -#include #include #include #include #include -#include #include #include #include -#include -#include -#include +#include +#include #include +#include +#include +#include #include #include -#include -#include -#include -#include -#include +#include +#include #include -#include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderableDUMeshes"; diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.h b/modules/digitaluniverse/rendering/renderabledumeshes.h index 8b678db611..5643d80efe 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.h +++ b/modules/digitaluniverse/rendering/renderabledumeshes.h @@ -29,7 +29,6 @@ #include #include -#include #include #include #include @@ -38,19 +37,13 @@ #include #include #include +#include #include -namespace ghoul::filesystem { class File; } namespace ghoul::fontrendering { class Font; } -namespace ghoul::opengl { - class ProgramObject; - class Texture; -} // namespace ghoul::opengl namespace openspace { -namespace documentation { struct Documentation; } - class RenderableDUMeshes : public Renderable { public: explicit RenderableDUMeshes(const ghoul::Dictionary& dictionary); diff --git a/modules/exoplanets/datastructure.cpp b/modules/exoplanets/datastructure.cpp index 9f9b0ceb92..3404678a7f 100644 --- a/modules/exoplanets/datastructure.cpp +++ b/modules/exoplanets/datastructure.cpp @@ -25,11 +25,16 @@ #include #include +#include #include #include #include -#include +#include #include +#include +#include +#include +#include #include namespace { diff --git a/modules/exoplanets/datastructure.h b/modules/exoplanets/datastructure.h index 4b592a0b48..8edabd6bb3 100644 --- a/modules/exoplanets/datastructure.h +++ b/modules/exoplanets/datastructure.h @@ -28,7 +28,7 @@ #include #include #include -#include +#include #include #include diff --git a/modules/exoplanets/exoplanetshelper.cpp b/modules/exoplanets/exoplanetshelper.cpp index 488f2ed910..a29e7d17c7 100644 --- a/modules/exoplanets/exoplanetshelper.cpp +++ b/modules/exoplanets/exoplanetshelper.cpp @@ -28,16 +28,18 @@ #include #include #include -#include #include #include #include #include -#include #include -#include +#include #include #include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "ExoplanetsModule"; diff --git a/modules/exoplanets/exoplanetshelper.h b/modules/exoplanets/exoplanetshelper.h index 7acaf2c471..34887dc22f 100644 --- a/modules/exoplanets/exoplanetshelper.h +++ b/modules/exoplanets/exoplanetshelper.h @@ -26,7 +26,6 @@ #define __OPENSPACE_MODULE_EXOPLANETS___EXOPLANETSHELPER___H__ #include -#include #include namespace openspace::exoplanets { diff --git a/modules/exoplanets/exoplanetsmodule.cpp b/modules/exoplanets/exoplanetsmodule.cpp index f758fdcb63..f12e960c9c 100644 --- a/modules/exoplanets/exoplanetsmodule.cpp +++ b/modules/exoplanets/exoplanetsmodule.cpp @@ -25,27 +25,18 @@ #include #include -#include #include #include -#include -#include -#include -#include -#include -#include -#include -#include +#include #include -#include -#include #include #include #include #include #include -#include -#include +#include +#include +#include #include #include "exoplanetsmodule_lua.inl" diff --git a/modules/exoplanets/exoplanetsmodule.h b/modules/exoplanets/exoplanetsmodule.h index 3fbe451075..2e28f14ad8 100644 --- a/modules/exoplanets/exoplanetsmodule.h +++ b/modules/exoplanets/exoplanetsmodule.h @@ -32,6 +32,7 @@ #include #include #include +#include #include namespace openspace { diff --git a/modules/exoplanets/exoplanetsmodule_lua.inl b/modules/exoplanets/exoplanetsmodule_lua.inl index ddfd048314..d13c4321fc 100644 --- a/modules/exoplanets/exoplanetsmodule_lua.inl +++ b/modules/exoplanets/exoplanetsmodule_lua.inl @@ -25,7 +25,10 @@ #include #include #include +#include +#include #include +#include #include #include #include @@ -130,7 +133,7 @@ std::vector hostStarsWithSufficientData() { // Read number of lines int nExoplanets = 0; while (ghoul::getline(lookupTableFile, line)) { - ++nExoplanets; + nExoplanets++; } lookupTableFile.clear(); lookupTableFile.seekg(0); diff --git a/modules/exoplanets/rendering/renderableorbitdisc.cpp b/modules/exoplanets/rendering/renderableorbitdisc.cpp index 786576054d..19ac3a7a9d 100644 --- a/modules/exoplanets/rendering/renderableorbitdisc.cpp +++ b/modules/exoplanets/rendering/renderableorbitdisc.cpp @@ -25,19 +25,16 @@ #include #include -#include #include #include -#include -#include -#include -#include +#include #include +#include #include #include +#include #include #include -#include namespace { constexpr openspace::properties::Property::PropertyInfo TextureInfo = { diff --git a/modules/exoplanets/rendering/renderableorbitdisc.h b/modules/exoplanets/rendering/renderableorbitdisc.h index f2676ef0f1..9a890764fe 100644 --- a/modules/exoplanets/rendering/renderableorbitdisc.h +++ b/modules/exoplanets/rendering/renderableorbitdisc.h @@ -33,16 +33,11 @@ #include #include #include -#include #include - -namespace ghoul::filesystem { class File; } -namespace ghoul::opengl { class ProgramObject; } // namespace ghoul::opengl +#include namespace openspace { -namespace documentation { struct Documentation; } - class RenderableOrbitDisc : public Renderable { public: explicit RenderableOrbitDisc(const ghoul::Dictionary& dictionary); diff --git a/modules/exoplanets/tasks/exoplanetsdatapreparationtask.cpp b/modules/exoplanets/tasks/exoplanetsdatapreparationtask.cpp index 89790c50f4..9701130322 100644 --- a/modules/exoplanets/tasks/exoplanetsdatapreparationtask.cpp +++ b/modules/exoplanets/tasks/exoplanetsdatapreparationtask.cpp @@ -24,9 +24,7 @@ #include -#include #include -#include #include #include #include @@ -35,8 +33,11 @@ #include #include #include -#include -#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "ExoplanetsDataPreparationTask"; @@ -148,7 +149,7 @@ void ExoplanetsDataPreparationTask::perform( int total = 0; std::string row; while (ghoul::getline(inputDataFile, row)) { - ++total; + total++; } inputDataFile.clear(); inputDataFile.seekg(0); @@ -161,7 +162,7 @@ void ExoplanetsDataPreparationTask::perform( int exoplanetCount = 0; while (ghoul::getline(inputDataFile, row)) { - ++exoplanetCount; + exoplanetCount++; progressCallback(static_cast(exoplanetCount) / static_cast(total)); PlanetData planetData = parseDataRow( diff --git a/modules/exoplanets/tasks/exoplanetsdatapreparationtask.h b/modules/exoplanets/tasks/exoplanetsdatapreparationtask.h index 5291c46481..a773873976 100644 --- a/modules/exoplanets/tasks/exoplanetsdatapreparationtask.h +++ b/modules/exoplanets/tasks/exoplanetsdatapreparationtask.h @@ -28,9 +28,8 @@ #include #include -#include #include -#include +#include namespace openspace::exoplanets { diff --git a/modules/fieldlines/fieldlinesmodule.cpp b/modules/fieldlines/fieldlinesmodule.cpp index 74957005e6..b48274d6aa 100644 --- a/modules/fieldlines/fieldlinesmodule.cpp +++ b/modules/fieldlines/fieldlinesmodule.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include namespace openspace { diff --git a/modules/fieldlines/rendering/renderablefieldlines.cpp b/modules/fieldlines/rendering/renderablefieldlines.cpp index 201a3e3a51..928a8c527d 100644 --- a/modules/fieldlines/rendering/renderablefieldlines.cpp +++ b/modules/fieldlines/rendering/renderablefieldlines.cpp @@ -29,13 +29,18 @@ #include #include #include -#include #include +#include #include #include +#include +#include #include #include +#include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderableFieldlines"; diff --git a/modules/fieldlines/rendering/renderablefieldlines.h b/modules/fieldlines/rendering/renderablefieldlines.h index d75c989fd2..561491ccf5 100644 --- a/modules/fieldlines/rendering/renderablefieldlines.h +++ b/modules/fieldlines/rendering/renderablefieldlines.h @@ -34,8 +34,7 @@ #include #include #include - -namespace ghoul::opengl { class ProgramObject; } +#include namespace openspace { @@ -54,7 +53,7 @@ public: void update(const UpdateData& data) override; private: - typedef std::vector Line; + using Line = std::vector; void initializeDefaultPropertyValues(); void loadSeedPoints(); diff --git a/modules/fieldlinessequence/fieldlinessequencemodule.cpp b/modules/fieldlinessequence/fieldlinessequencemodule.cpp index 6aef48fc51..a0edd4a4c2 100644 --- a/modules/fieldlinessequence/fieldlinessequencemodule.cpp +++ b/modules/fieldlinessequence/fieldlinessequencemodule.cpp @@ -30,8 +30,11 @@ #include #include #include +#include #include #include +#include +#include namespace { constexpr std::string_view DefaultTransferfunctionSource = diff --git a/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp b/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp index c40f9e1a17..ca2fd838fa 100644 --- a/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp +++ b/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp @@ -30,14 +30,24 @@ #include #include #include +#include +#include #include #include #include +#include +#include +#include +#include +#include #include #include #include -#include -#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderableFieldlinesSequence"; diff --git a/modules/fieldlinessequence/rendering/renderablefieldlinessequence.h b/modules/fieldlinessequence/rendering/renderablefieldlinessequence.h index 36c1a970da..d65ed7e2ec 100644 --- a/modules/fieldlinessequence/rendering/renderablefieldlinessequence.h +++ b/modules/fieldlinessequence/rendering/renderablefieldlinessequence.h @@ -27,16 +27,21 @@ #include +#include #include #include #include #include +#include +#include #include #include #include #include #include -#include +#include +#include +#include namespace openspace { diff --git a/modules/fieldlinessequence/tasks/kameleonvolumetofieldlinestask.cpp b/modules/fieldlinessequence/tasks/kameleonvolumetofieldlinestask.cpp index e40a6aa34b..a59a898020 100644 --- a/modules/fieldlinessequence/tasks/kameleonvolumetofieldlinestask.cpp +++ b/modules/fieldlinessequence/tasks/kameleonvolumetofieldlinestask.cpp @@ -26,13 +26,18 @@ #include #include -#include -#include -#include +#include +#include #include -#include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "KameleonVolumeToFieldlinesTask"; @@ -193,7 +198,7 @@ void KameleonVolumeToFieldlinesTask::perform( throw ghoul::MissingCaseException(); } } - ++fileNumber; + fileNumber++; } // Ideally, we would want to signal about progress earlier as well, but diff --git a/modules/fieldlinessequence/tasks/kameleonvolumetofieldlinestask.h b/modules/fieldlinessequence/tasks/kameleonvolumetofieldlinestask.h index f0dbd70a8c..123d2f4701 100644 --- a/modules/fieldlinessequence/tasks/kameleonvolumetofieldlinestask.h +++ b/modules/fieldlinessequence/tasks/kameleonvolumetofieldlinestask.h @@ -27,7 +27,7 @@ #include -#include +#include namespace openspace { diff --git a/modules/fieldlinessequence/util/fieldlinesstate.cpp b/modules/fieldlinessequence/util/fieldlinesstate.cpp index 8bbd3562d2..a5d569a4fe 100644 --- a/modules/fieldlinessequence/util/fieldlinesstate.cpp +++ b/modules/fieldlinessequence/util/fieldlinesstate.cpp @@ -28,9 +28,17 @@ #include #include #include +#include #include +#include +#include +#include #include #include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "FieldlinesState"; @@ -371,7 +379,7 @@ void FieldlinesState::saveStateToJson(const std::string& absPath) { size_t pointIndex = 0; for (size_t lineIndex = 0; lineIndex < nLines; lineIndex++) { json jData = json::array(); - for (GLsizei i = 0; i < _lineCount[lineIndex]; i++, ++pointIndex) { + for (GLsizei i = 0; i < _lineCount[lineIndex]; i++, pointIndex++) { const glm::vec3 pos = _vertexPositions[pointIndex]; json jDataElement = { pos.x, pos.y, pos.z }; diff --git a/modules/fieldlinessequence/util/kameleonfieldlinehelper.cpp b/modules/fieldlinessequence/util/kameleonfieldlinehelper.cpp index d592231b4a..78cddda56f 100644 --- a/modules/fieldlinessequence/util/kameleonfieldlinehelper.cpp +++ b/modules/fieldlinessequence/util/kameleonfieldlinehelper.cpp @@ -29,12 +29,20 @@ #include #include #include +#include #include +#include +#include #include #include +#include +#include +#include #ifdef OPENSPACE_MODULE_KAMELEON_ENABLED +#include + #ifdef _MSC_VER #pragma warning (push) // Boost throws #pragma warning: there is no warning number '4675' @@ -42,9 +50,10 @@ #endif // _MSC_VER #include +#include #include +#include #include -#include #ifdef _MSC_VER #pragma warning (pop) @@ -89,12 +98,12 @@ bool convertCdfToFieldlinesState(FieldlinesState& state, const std::string& cdfP return false; #else // OPENSPACE_MODULE_KAMELEON_ENABLED // Create Kameleon object and open CDF file! - std::unique_ptr kameleon = kameleonHelper::createKameleonObject( + std::unique_ptr kameleon = kameleonhelper::createKameleonObject( cdfPath ); state.setModel(fls::stringToModel(kameleon->getModelName())); - double cdfDoubleTime = kameleonHelper::getTime(kameleon.get(), manualTimeOffset); + double cdfDoubleTime = kameleonhelper::getTime(kameleon.get(), manualTimeOffset); state.setTriggerTime(cdfDoubleTime); // get time as string. @@ -176,7 +185,7 @@ extractSeedPointsFromFiles(std::filesystem::path path, size_t nth) outVec.push_back(std::move(point)); } } - ++linenumber; + linenumber++; } if (outVec.empty()) { diff --git a/modules/fieldlinessequence/util/kameleonfieldlinehelper.h b/modules/fieldlinessequence/util/kameleonfieldlinehelper.h index 330786c79c..02c0ff59d9 100644 --- a/modules/fieldlinessequence/util/kameleonfieldlinehelper.h +++ b/modules/fieldlinessequence/util/kameleonfieldlinehelper.h @@ -26,6 +26,7 @@ #define __OPENSPACE_MODULE_FIELDLINESSEQUENCE___KAMELEONFIELDLINEHELPER___H__ #include +#include #include #include #include diff --git a/modules/fitsfilereader/fitsfilereadermodule.cpp b/modules/fitsfilereader/fitsfilereadermodule.cpp index 78436d37c6..8433e0b998 100644 --- a/modules/fitsfilereader/fitsfilereadermodule.cpp +++ b/modules/fitsfilereader/fitsfilereadermodule.cpp @@ -27,6 +27,8 @@ #include #include #include +#include +#include #include namespace openspace { diff --git a/modules/fitsfilereader/include/fitsfilereader.h b/modules/fitsfilereader/include/fitsfilereader.h index 613bd900ca..defad123a0 100644 --- a/modules/fitsfilereader/include/fitsfilereader.h +++ b/modules/fitsfilereader/include/fitsfilereader.h @@ -39,18 +39,16 @@ namespace CCfits { class ExtHDU; } // namespace CCfits -namespace ghoul::opengl { class Texture; } - namespace openspace { -template +template struct ImageData { std::valarray contents; long int width; long int height; }; -template +template struct TableData { std::unordered_map> contents; int readRows; @@ -63,13 +61,13 @@ public: explicit FitsFileReader(bool verboseMode); ~FitsFileReader(); - template + template std::shared_ptr> readImage(const std::filesystem::path& path); - template + template std::shared_ptr> readHeader( std::vector& keywords); - template + template std::shared_ptr readHeaderValue(const std::string key); /** @@ -78,7 +76,7 @@ public: * longer if it's a big file. If no HDU index is given the current Extension HDU will * be read from. */ - template + template std::shared_ptr> readTable(const std::filesystem::path& path, const std::vector& columnNames, int startRow = 1, int endRow = 10, int hduIdx = 1, bool readAll = false); @@ -105,10 +103,10 @@ private: bool _verboseMode; bool isPrimaryHDU(); - template + template std::shared_ptr> readImageInternal(CCfits::PHDU& image); - template + template std::shared_ptr> readImageInternal(CCfits::ExtHDU& image); mutable std::mutex _mutex; diff --git a/modules/fitsfilereader/include/renderabletimevaryingfitssphere.h b/modules/fitsfilereader/include/renderabletimevaryingfitssphere.h index dbe899896a..e3eea39bf2 100644 --- a/modules/fitsfilereader/include/renderabletimevaryingfitssphere.h +++ b/modules/fitsfilereader/include/renderabletimevaryingfitssphere.h @@ -27,15 +27,18 @@ #include +#include #include +#include #include +#include +#include +#include +#include +#include namespace openspace { -struct RenderData; -struct UpdateData; -namespace documentation { struct Documentation; } - class RenderableTimeVaryingFitsSphere : public RenderableSphere { public: enum class LoadingType { diff --git a/modules/fitsfilereader/include/wsafitshelper.h b/modules/fitsfilereader/include/wsafitshelper.h index 6b49cbf379..d5117f2fec 100644 --- a/modules/fitsfilereader/include/wsafitshelper.h +++ b/modules/fitsfilereader/include/wsafitshelper.h @@ -25,19 +25,16 @@ #ifndef __OPENSPACE_MODULE_FITSFILEREADER___WSAFITSHELPER___H__ #define __OPENSPACE_MODULE_FITSFILEREADER___WSAFITSHELPER___H__ -#include -#include +#include +#include +#include #include -namespace CCfits { - class FITS; - class PHDU; - class ExtHDU; -} // namespace CCfits +namespace ghoul::opengl { class Texture; } namespace openspace { -template +template struct ImageData { std::valarray contents; int width; @@ -67,7 +64,7 @@ void readFitsHeader(const std::filesystem::path& path); */ int nLayers(const std::filesystem::path& path); -template +template std::shared_ptr> readImageInternal(U& image); } // namespace openspace diff --git a/modules/fitsfilereader/src/fitsfilereader.cpp b/modules/fitsfilereader/src/fitsfilereader.cpp index 94657c569d..c371d1ac39 100644 --- a/modules/fitsfilereader/src/fitsfilereader.cpp +++ b/modules/fitsfilereader/src/fitsfilereader.cpp @@ -27,9 +27,15 @@ #include #include #include -#include +#include #include +#include #include +#include +#include +#include +#include +#include #ifdef WIN32 #pragma warning (push) @@ -44,7 +50,6 @@ #pragma warning (pop) #endif // WIN32 - using namespace CCfits; namespace { @@ -138,7 +143,7 @@ std::shared_ptr FitsFileReader::readHeaderValue(const std::string key) { return nullptr; } -template +template std::shared_ptr> FitsFileReader::readTable(const std::filesystem::path& path, const std::vector& columnNames, int startRow, @@ -657,7 +662,7 @@ std::vector FitsFileReader::readSpeckFile(const std::filesystem::path& fi // This is pretty annoying, the read method is not derived from the HDU class // in CCfits - need to explicitly cast to the sub classes to access read -template +template std::shared_ptr> FitsFileReader::readImageInternal(ExtHDU& image) { try { std::valarray contents; @@ -675,7 +680,7 @@ std::shared_ptr> FitsFileReader::readImageInternal(ExtHDU& image) { return nullptr; } -template +template std::shared_ptr> FitsFileReader::readImageInternal(PHDU& image) { try { std::valarray contents; diff --git a/modules/fitsfilereader/src/renderabletimevaryingfitssphere.cpp b/modules/fitsfilereader/src/renderabletimevaryingfitssphere.cpp index de8fd9df63..4f322bb344 100644 --- a/modules/fitsfilereader/src/renderabletimevaryingfitssphere.cpp +++ b/modules/fitsfilereader/src/renderabletimevaryingfitssphere.cpp @@ -26,18 +26,22 @@ #include #include -#include #include #include -#include +#include #include #include -#include -#include -#include +#include +#include #include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderableTimeVaryingFitsSphere"; diff --git a/modules/fitsfilereader/src/wsafitshelper.cpp b/modules/fitsfilereader/src/wsafitshelper.cpp index 492484901d..b1bc053f61 100644 --- a/modules/fitsfilereader/src/wsafitshelper.cpp +++ b/modules/fitsfilereader/src/wsafitshelper.cpp @@ -23,11 +23,20 @@ ****************************************************************************************/ #include + +#include #include +#include #include #include +#include +#include +#include +#include -constexpr std::string_view _loggerCat = "RenderableTimeVaryingSphere"; +namespace { + constexpr std::string_view _loggerCat = "RenderableTimeVaryingSphere"; +} // namespace using namespace CCfits; @@ -89,7 +98,7 @@ std::unique_ptr loadTextureFromFits( // Create texture from imagedata auto texture = std::make_unique( imageData, - glm::size3_t(fitsValues->width, fitsValues->height, 1), + glm::uvec3(fitsValues->width, fitsValues->height, 1), GL_TEXTURE_2D, ghoul::opengl::Texture::Format::Red, GL_RED, @@ -140,7 +149,7 @@ int nLayers(const std::filesystem::path& path) { } } -template +template std::shared_ptr> readImageInternal(U& image) { try { std::valarray contents; diff --git a/modules/gaia/gaiamodule.cpp b/modules/gaia/gaiamodule.cpp index 73ef37aa9b..d962edaf29 100644 --- a/modules/gaia/gaiamodule.cpp +++ b/modules/gaia/gaiamodule.cpp @@ -32,8 +32,12 @@ #include #include #include +#include #include #include +#include +#include +#include namespace openspace { diff --git a/modules/gaia/gaiamodule.h b/modules/gaia/gaiamodule.h index 8962e068e7..81f84da7ba 100644 --- a/modules/gaia/gaiamodule.h +++ b/modules/gaia/gaiamodule.h @@ -27,8 +27,6 @@ #include -#include - namespace openspace { class GaiaModule : public OpenSpaceModule { diff --git a/modules/gaia/rendering/gaiaoptions.h b/modules/gaia/rendering/gaiaoptions.h index 4331e8b3c7..544412bbc3 100644 --- a/modules/gaia/rendering/gaiaoptions.h +++ b/modules/gaia/rendering/gaiaoptions.h @@ -29,24 +29,24 @@ namespace openspace::gaia { enum RenderMode { Static = 0, - Color = 1, - Motion = 2 + Color, + Motion }; enum FileReaderOption { Fits = 0, - Speck = 1, - BinaryRaw = 2, - BinaryOctree = 3, - StreamOctree = 4 + Speck, + BinaryRaw, + BinaryOctree, + StreamOctree }; enum ShaderOption { PointSSBO = 0, - PointVBO = 1, - BillboardSSBO = 2, - BillboardVBO = 3, - BillboardSSBONoFBO = 4 + PointVBO, + BillboardSSBO, + BillboardVBO, + BillboardSSBONoFBO }; } // namespace openspace::gaiamission diff --git a/modules/gaia/rendering/octreeculler.cpp b/modules/gaia/rendering/octreeculler.cpp index 728655c1c0..e7140f020c 100644 --- a/modules/gaia/rendering/octreeculler.cpp +++ b/modules/gaia/rendering/octreeculler.cpp @@ -25,7 +25,7 @@ #include #include -#include +#include namespace openspace { diff --git a/modules/gaia/rendering/octreeculler.h b/modules/gaia/rendering/octreeculler.h index f7b3378c85..62c280f048 100644 --- a/modules/gaia/rendering/octreeculler.h +++ b/modules/gaia/rendering/octreeculler.h @@ -40,7 +40,6 @@ namespace openspace { */ class OctreeCuller { public: - /** * \param viewFrustum This is the view space in normalized device coordinates space. * Hence it is an axis aligned bounding box and not a real frustum diff --git a/modules/gaia/rendering/octreemanager.cpp b/modules/gaia/rendering/octreemanager.cpp index 40714528e8..0a1349d86b 100644 --- a/modules/gaia/rendering/octreemanager.cpp +++ b/modules/gaia/rendering/octreemanager.cpp @@ -25,11 +25,13 @@ #include #include +#include #include #include -#include #include -#include +#include +#include +#include #include namespace { @@ -1022,7 +1024,7 @@ bool OctreeManager::insertInNode(OctreeNode& node, const std::vector& sta storeStarData(node, starValues); } - return insertInNode(*node.children[index], starValues, ++depth); + return insertInNode(*node.children[index], starValues, depth + 1); } void OctreeManager::sliceNodeLodCache(OctreeNode& node) { diff --git a/modules/gaia/rendering/octreemanager.h b/modules/gaia/rendering/octreemanager.h index bca9d93561..780d4acc49 100644 --- a/modules/gaia/rendering/octreemanager.h +++ b/modules/gaia/rendering/octreemanager.h @@ -26,14 +26,19 @@ #define __OPENSPACE_MODULE_GAIA___OCTREEMANAGER___H__ #include +#include #include -#include #include #include +#include #include +#include #include #include +#include #include +#include +#include #include namespace openspace { diff --git a/modules/gaia/rendering/renderablegaiastars.cpp b/modules/gaia/rendering/renderablegaiastars.cpp index 75affcf0e0..798a20fabd 100644 --- a/modules/gaia/rendering/renderablegaiastars.cpp +++ b/modules/gaia/rendering/renderablegaiastars.cpp @@ -26,19 +26,20 @@ #include #include -#include #include -#include #include -#include #include #include -#include +#include #include +#include #include #include #include -#include +#include +#include +#include +#include #include #include #include @@ -46,6 +47,11 @@ #include #include #include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderableGaiaStars"; diff --git a/modules/gaia/rendering/renderablegaiastars.h b/modules/gaia/rendering/renderablegaiastars.h index a5add6a272..a8a9b85c19 100644 --- a/modules/gaia/rendering/renderablegaiastars.h +++ b/modules/gaia/rendering/renderablegaiastars.h @@ -27,29 +27,27 @@ #include +#include #include #include #include #include -#include #include #include #include #include +#include #include #include #include +#include +#include +#include namespace ghoul::filesystem { class File; } -namespace ghoul::opengl { - class ProgramObject; - class Texture; -} // namespace ghoul::opengl namespace openspace { -namespace documentation { struct Documentation; } - class RenderableGaiaStars : public Renderable { public: explicit RenderableGaiaStars(const ghoul::Dictionary& dictionary); diff --git a/modules/gaia/tasks/constructoctreetask.cpp b/modules/gaia/tasks/constructoctreetask.cpp index 37cc857bc3..eb1d6604e1 100644 --- a/modules/gaia/tasks/constructoctreetask.cpp +++ b/modules/gaia/tasks/constructoctreetask.cpp @@ -25,14 +25,18 @@ #include #include -#include #include #include #include #include -#include +#include +#include #include +#include +#include +#include #include +#include namespace { constexpr std::string_view _loggerCat = "ConstructOctreeTask"; diff --git a/modules/gaia/tasks/constructoctreetask.h b/modules/gaia/tasks/constructoctreetask.h index cc6d8081b6..b902c977ef 100644 --- a/modules/gaia/tasks/constructoctreetask.h +++ b/modules/gaia/tasks/constructoctreetask.h @@ -27,14 +27,13 @@ #include -#include #include +#include #include +#include namespace openspace { -namespace documentation { struct Documentation; } - class ConstructOctreeTask : public Task { public: explicit ConstructOctreeTask(const ghoul::Dictionary& dictionary); diff --git a/modules/gaia/tasks/readfilejob.cpp b/modules/gaia/tasks/readfilejob.cpp index b3432e3be4..b81becda5d 100644 --- a/modules/gaia/tasks/readfilejob.cpp +++ b/modules/gaia/tasks/readfilejob.cpp @@ -24,10 +24,13 @@ #include -#include #include #include -#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "ReadFileJob"; diff --git a/modules/gaia/tasks/readfilejob.h b/modules/gaia/tasks/readfilejob.h index 1459f2f2e0..29737da027 100644 --- a/modules/gaia/tasks/readfilejob.h +++ b/modules/gaia/tasks/readfilejob.h @@ -25,10 +25,13 @@ #ifndef __OPENSPACE_MODULE_GAIA___READFILEJOB___H__ #define __OPENSPACE_MODULE_GAIA___READFILEJOB___H__ -#include +#include #include #include +#include +#include +#include namespace openspace::gaia { diff --git a/modules/gaia/tasks/readfitstask.cpp b/modules/gaia/tasks/readfitstask.cpp index 16ddcdb3b1..9a5f0637e7 100644 --- a/modules/gaia/tasks/readfitstask.cpp +++ b/modules/gaia/tasks/readfitstask.cpp @@ -24,18 +24,22 @@ #include +#include #include #include -#include - #include +#include +#include #include #include #include -#include +#include +#include #include -#include #include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "ReadFitsTask"; diff --git a/modules/gaia/tasks/readfitstask.h b/modules/gaia/tasks/readfitstask.h index 1bebeb2843..6aafab2f0c 100644 --- a/modules/gaia/tasks/readfitstask.h +++ b/modules/gaia/tasks/readfitstask.h @@ -27,15 +27,11 @@ #include -#include -#include -#include #include +#include namespace openspace { -namespace documentation { struct Documentation; } - class ReadFitsTask : public Task { public: explicit ReadFitsTask(const ghoul::Dictionary& dictionary); diff --git a/modules/gaia/tasks/readspecktask.cpp b/modules/gaia/tasks/readspecktask.cpp index 123f49a5f6..2bb2ae4a0e 100644 --- a/modules/gaia/tasks/readspecktask.cpp +++ b/modules/gaia/tasks/readspecktask.cpp @@ -26,12 +26,14 @@ #include #include -#include #include #include #include #include +#include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "ReadSpeckTask"; diff --git a/modules/gaia/tasks/readspecktask.h b/modules/gaia/tasks/readspecktask.h index 437141663c..70cf3c8f98 100644 --- a/modules/gaia/tasks/readspecktask.h +++ b/modules/gaia/tasks/readspecktask.h @@ -28,12 +28,9 @@ #include #include -#include namespace openspace { -namespace documentation { struct Documentation; } - class ReadSpeckTask : public Task { public: explicit ReadSpeckTask(const ghoul::Dictionary& dictionary); diff --git a/modules/galaxy/galaxymodule.cpp b/modules/galaxy/galaxymodule.cpp index 8de67e6678..42a738726e 100644 --- a/modules/galaxy/galaxymodule.cpp +++ b/modules/galaxy/galaxymodule.cpp @@ -30,8 +30,11 @@ #include #include #include +#include #include +#include #include +#include namespace openspace { diff --git a/modules/galaxy/rendering/galaxyraycaster.cpp b/modules/galaxy/rendering/galaxyraycaster.cpp index e1700a40d6..34b7c68d0b 100644 --- a/modules/galaxy/rendering/galaxyraycaster.cpp +++ b/modules/galaxy/rendering/galaxyraycaster.cpp @@ -24,14 +24,18 @@ #include -#include #include #include +#include #include #include #include #include #include +#include +#include +#include +#include namespace { constexpr std::string_view GlslRaycastPath = diff --git a/modules/galaxy/rendering/galaxyraycaster.h b/modules/galaxy/rendering/galaxyraycaster.h index ef0bc8d525..75006a65b8 100644 --- a/modules/galaxy/rendering/galaxyraycaster.h +++ b/modules/galaxy/rendering/galaxyraycaster.h @@ -28,21 +28,12 @@ #include #include -#include -#include #include -namespace ghoul::opengl { - class Texture; - class TextureUnit; - class ProgramObject; -} // namespace ghoul::opengl +namespace ghoul::opengl { class TextureUnit; } namespace openspace { -struct RenderData; -struct RaycastData; - class GalaxyRaycaster : public VolumeRaycaster { public: explicit GalaxyRaycaster(ghoul::opengl::Texture& texture, @@ -89,8 +80,7 @@ private: ghoul::opengl::Texture& _texture; std::unique_ptr _textureUnit; std::filesystem::path _raycastingShader; - -}; // GalaxyRaycaster +}; } // namespace openspace diff --git a/modules/galaxy/rendering/renderablegalaxy.cpp b/modules/galaxy/rendering/renderablegalaxy.cpp index 346edc1e57..9f38faec5a 100644 --- a/modules/galaxy/rendering/renderablegalaxy.cpp +++ b/modules/galaxy/rendering/renderablegalaxy.cpp @@ -32,27 +32,29 @@ #include #include #include -#include #include #include #include #include #include -#include #include #include +#include +#include #include #include -#include #include #include #include #include #include #include -#include +#include +#include +#include #include -#include +#include +#include namespace { constexpr int8_t CurrentCacheVersion = 1; diff --git a/modules/galaxy/rendering/renderablegalaxy.h b/modules/galaxy/rendering/renderablegalaxy.h index 75acb8c6dd..dedd6b7e83 100644 --- a/modules/galaxy/rendering/renderablegalaxy.h +++ b/modules/galaxy/rendering/renderablegalaxy.h @@ -30,18 +30,16 @@ #include #include #include +#include #include #include #include - -namespace ghoul::opengl { class ProgramObject; } +#include namespace openspace { namespace volume { template class RawVolume; } - class GalaxyRaycaster; -struct RenderData; class RenderableGalaxy : public Renderable { public: diff --git a/modules/galaxy/tasks/milkywayconversiontask.cpp b/modules/galaxy/tasks/milkywayconversiontask.cpp index d2d2b219c1..3145d2df90 100644 --- a/modules/galaxy/tasks/milkywayconversiontask.cpp +++ b/modules/galaxy/tasks/milkywayconversiontask.cpp @@ -29,6 +29,7 @@ #include #include #include +#include namespace { struct [[codegen::Dictionary(MilkywayConversionTask)]] Parameters { diff --git a/modules/galaxy/tasks/milkywayconversiontask.h b/modules/galaxy/tasks/milkywayconversiontask.h index 74384e8451..09e3a34ea9 100644 --- a/modules/galaxy/tasks/milkywayconversiontask.h +++ b/modules/galaxy/tasks/milkywayconversiontask.h @@ -28,12 +28,9 @@ #include #include -#include namespace openspace { -namespace documentation { struct Documentation; } - /** * Converts a set of exr image slices to a raw volume with floating point RGBA data (32 * bit per channel). @@ -42,6 +39,7 @@ class MilkywayConversionTask : public Task { public: explicit MilkywayConversionTask(const ghoul::Dictionary& dictionary); ~MilkywayConversionTask() override = default; + std::string description() override; void perform(const Task::ProgressCallback& onProgress) override; diff --git a/modules/galaxy/tasks/milkywaypointsconversiontask.cpp b/modules/galaxy/tasks/milkywaypointsconversiontask.cpp index 5043a444c7..bafe9b84ac 100644 --- a/modules/galaxy/tasks/milkywaypointsconversiontask.cpp +++ b/modules/galaxy/tasks/milkywaypointsconversiontask.cpp @@ -25,18 +25,22 @@ #include #include - +#include +#include #include #include #include namespace openspace { - -/*MilkywayPointsConversionTask::MilkywayPointsConversionTask( - const std::string& inFilename, - const std::string& outFilename) - : _inFilename(inFilename) - , _outFilename(outFilename) {}*/ + +documentation::Documentation MilkywayPointsConversionTask::Documentation() { + return { + "MilkywayPointsConversionTask", + "galaxy_milkywaypointsconversiontask", + "", + {} + }; +} MilkywayPointsConversionTask::MilkywayPointsConversionTask(const ghoul::Dictionary&) {} @@ -46,8 +50,8 @@ std::string MilkywayPointsConversionTask::description() { void MilkywayPointsConversionTask::perform(const Task::ProgressCallback& progressCallback) { - std::ifstream in(_inFilename, std::ios::in); - std::ofstream out(_outFilename, std::ios::out | std::ios::binary); + std::ifstream in = std::ifstream(_inFilename, std::ios::in); + std::ofstream out = std::ofstream(_outFilename, std::ios::out | std::ios::binary); std::string format; int64_t nPoints = 0; @@ -85,18 +89,6 @@ void MilkywayPointsConversionTask::perform(const Task::ProgressCallback& progres out.write(reinterpret_cast(&nPoints), sizeof(int64_t)); out.write(reinterpret_cast(pointData.data()), nFloats * sizeof(float)); - - in.close(); - out.close(); -} - -documentation::Documentation MilkywayPointsConversionTask::Documentation() { - return { - "MilkywayPointsConversionTask", - "galaxy_milkywaypointsconversiontask", - "", - {} - }; } } // namespace openspace diff --git a/modules/galaxy/tasks/milkywaypointsconversiontask.h b/modules/galaxy/tasks/milkywaypointsconversiontask.h index 346424984e..385c91c872 100644 --- a/modules/galaxy/tasks/milkywaypointsconversiontask.h +++ b/modules/galaxy/tasks/milkywaypointsconversiontask.h @@ -27,14 +27,10 @@ #include -#include - namespace openspace { -namespace documentation { struct Documentation; } - /** - * Converts ASCII based point data + * Converts ASCII based point data. * ``` * int64_t n * (float x, float y, float z, float r, float g, float b) * n diff --git a/modules/globebrowsing/globebrowsingmodule.cpp b/modules/globebrowsing/globebrowsingmodule.cpp index ff765103a2..6c77bf1d89 100644 --- a/modules/globebrowsing/globebrowsingmodule.cpp +++ b/modules/globebrowsing/globebrowsingmodule.cpp @@ -29,15 +29,15 @@ #include #include #include -#include #include #include #include #include -#include -#include #include #include +#include +#include +#include #include #include #include @@ -49,31 +49,32 @@ #include #include #include -#include -#include +#include #include #include -#include #include -#include #include -#include +#include #include -#include -#include #include #include #include #include -#include #include #include #include #include -#include +#include #include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include #include @@ -515,7 +516,9 @@ scripting::LuaLibrary GlobeBrowsingModule::luaLibrary() const { codegen::lua::CapabilitiesWMS, codegen::lua::AddGeoJson, codegen::lua::DeleteGeoJson, - codegen::lua::AddGeoJsonFromFile + codegen::lua::AddGeoJsonFromFile, + codegen::lua::Globes, + codegen::lua::UrlInfo }, .scripts = { absPath("${MODULE_GLOBEBROWSING}/scripts/layer_support.lua"), diff --git a/modules/globebrowsing/globebrowsingmodule.h b/modules/globebrowsing/globebrowsingmodule.h index bdfd7af503..836309ae55 100644 --- a/modules/globebrowsing/globebrowsingmodule.h +++ b/modules/globebrowsing/globebrowsingmodule.h @@ -30,24 +30,16 @@ #include #include #include -#include -#include +#include #include #include -#include - -namespace openspace::globebrowsing { - class RenderableGlobe; - struct TileIndex; - - namespace cache { class MemoryAwareTileCache; } -} // namespace openspace::globebrowsing namespace openspace { -class Camera; -struct Geodetic2; -struct Geodetic3; +namespace globebrowsing { + class RenderableGlobe; + namespace cache { class MemoryAwareTileCache; } +} // namespace globebrowsing class SceneGraphNode; class GlobeBrowsingModule : public OpenSpaceModule { diff --git a/modules/globebrowsing/globebrowsingmodule_lua.inl b/modules/globebrowsing/globebrowsingmodule_lua.inl index 1082128c8b..d8ee813d62 100644 --- a/modules/globebrowsing/globebrowsingmodule_lua.inl +++ b/modules/globebrowsing/globebrowsingmodule_lua.inl @@ -22,7 +22,13 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include +#include +#include +#include +#include +#include +#include #include #include @@ -533,6 +539,99 @@ namespace { globe->geoJsonManager().addGeoJsonLayer(d); } +/** + * Returns an object containing a list of all loaded `RenderableGlobe`s sorted first by + * the presence of WMS server info, then alphabetically. The index `firstIndexWithoutUrl` + * indicates the first item in the list that does not have WMS server info. + * + * \return Table containing a list of `renderableGlobe` identifiers, and an index + * indicating the first item in the list that does not have a WMS server + */ +[[codegen::luawrap]] ghoul::Dictionary globes() { + using namespace openspace; + using namespace globebrowsing; + GlobeBrowsingModule* module = global::moduleEngine->module(); + + std::vector nodes = + global::renderEngine->scene()->allSceneGraphNodes(); + + nodes.erase( + std::remove_if( + nodes.begin(), + nodes.end(), + [](const SceneGraphNode* n) { + const Renderable* r = n->renderable(); + const RenderableGlobe* rg = dynamic_cast(r); + return rg == nullptr; + } + ), + nodes.end() + ); + + // Sort the globes with respect to WMS server info followed by alphabetical order + std::sort( + nodes.begin(), + nodes.end(), + [module](const SceneGraphNode* lhs, const SceneGraphNode* rhs) { + const bool lhsHasUrl = module->hasUrlInfo(lhs->identifier()); + const bool rhsHasUrl = module->hasUrlInfo(rhs->identifier()); + + if (lhsHasUrl && !rhsHasUrl) { + return true; + } + if (!lhsHasUrl && rhsHasUrl) { + return false; + } + + return lhs->guiName() < rhs->guiName(); + } + ); + std::vector globeIdentifiers; + globeIdentifiers.reserve(nodes.size()); + for (const SceneGraphNode* node : nodes) { + globeIdentifiers.push_back(node->identifier()); + } + + auto firstWithoutUrl = std::find_if( + nodes.begin(), + nodes.end(), + [module](const SceneGraphNode* n) { + return !module->hasUrlInfo(n->identifier()); + } + ); + + int index = static_cast(firstWithoutUrl - nodes.begin()); + + ghoul::Dictionary e; + e.setValue("identifiers", globeIdentifiers); + e.setValue("firstIndexWithoutUrl", index); + return e; +} + +/** + * Return a list of all WMS servers associated with the `renderableGlobe` globe. + * + * \param globe The identifier of the `renderableGlobe` to fetch WMS servers for + * \return A list of WMS server info containing its name and URL + */ +[[codegen::luawrap]] std::vector urlInfo(std::string globe) { + using namespace openspace; + using namespace globebrowsing; + GlobeBrowsingModule* module = global::moduleEngine->module(); + std::vector info = module->urlInfo(globe); + + std::vector res; + for (const GlobeBrowsingModule::UrlInfo& i : info) { + ghoul::Dictionary e; + e.setValue("name", i.name); + e.setValue("url", i.url); + res.push_back(std::move(e)); + } + + return res; +} + #include "globebrowsingmodule_lua_codegen.cpp" } // namespace + diff --git a/modules/globebrowsing/src/asynctiledataprovider.cpp b/modules/globebrowsing/src/asynctiledataprovider.cpp index e833b4daab..b5fbaedc7a 100644 --- a/modules/globebrowsing/src/asynctiledataprovider.cpp +++ b/modules/globebrowsing/src/asynctiledataprovider.cpp @@ -24,14 +24,17 @@ #include -#include +#include +#include #include #include -#include -#include +#include #include #include -#include +#include +#include +#include +#include namespace openspace::globebrowsing { @@ -40,7 +43,7 @@ namespace { } // namespace AsyncTileDataProvider::AsyncTileDataProvider(std::string name, - std::unique_ptr rawTileDataReader) + std::unique_ptr rawTileDataReader) : _name(std::move(name)) , _rawTileDataReader(std::move(rawTileDataReader)) , _concurrentJobManager(LRUThreadPool(1, 10)) diff --git a/modules/globebrowsing/src/asynctiledataprovider.h b/modules/globebrowsing/src/asynctiledataprovider.h index 0d92d4cef8..49c8ef7258 100644 --- a/modules/globebrowsing/src/asynctiledataprovider.h +++ b/modules/globebrowsing/src/asynctiledataprovider.h @@ -29,9 +29,10 @@ #include #include #include -#include +#include #include #include +#include namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/basictypes.h b/modules/globebrowsing/src/basictypes.h index f72f01df3d..dce187f9b5 100644 --- a/modules/globebrowsing/src/basictypes.h +++ b/modules/globebrowsing/src/basictypes.h @@ -27,9 +27,9 @@ #include #include -#include +#include +#include #include -#include namespace ghoul::opengl { class Texture; } diff --git a/modules/globebrowsing/src/dashboarditemglobelocation.cpp b/modules/globebrowsing/src/dashboarditemglobelocation.cpp index 0fac6c869d..7799274e4c 100644 --- a/modules/globebrowsing/src/dashboarditemglobelocation.cpp +++ b/modules/globebrowsing/src/dashboarditemglobelocation.cpp @@ -24,22 +24,19 @@ #include -#include -#include -#include #include -#include #include -#include -#include -#include -#include #include -#include -#include +#include #include -#include +#include +#include #include +#include +#include +#include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo DisplayFormatInfo = { diff --git a/modules/globebrowsing/src/dashboarditemglobelocation.h b/modules/globebrowsing/src/dashboarditemglobelocation.h index 9a0b84bd5b..03f742184b 100644 --- a/modules/globebrowsing/src/dashboarditemglobelocation.h +++ b/modules/globebrowsing/src/dashboarditemglobelocation.h @@ -28,14 +28,10 @@ #include #include -#include -#include #include namespace openspace { -namespace documentation { struct Documentation; } - class DashboardItemGlobeLocation : public DashboardTextItem { public: explicit DashboardItemGlobeLocation(const ghoul::Dictionary& dictionary); diff --git a/modules/globebrowsing/src/gdalwrapper.cpp b/modules/globebrowsing/src/gdalwrapper.cpp index df1f08c932..4518246de6 100644 --- a/modules/globebrowsing/src/gdalwrapper.cpp +++ b/modules/globebrowsing/src/gdalwrapper.cpp @@ -26,14 +26,16 @@ #include #include -#include #include -#include +#include #include +#include #include #include #include +#include #include +#include namespace { constexpr std::string_view _loggerCat = "GdalWrapper"; diff --git a/modules/globebrowsing/src/gdalwrapper.h b/modules/globebrowsing/src/gdalwrapper.h index 31c20cc43a..18093e6f84 100644 --- a/modules/globebrowsing/src/gdalwrapper.h +++ b/modules/globebrowsing/src/gdalwrapper.h @@ -30,8 +30,6 @@ #include #include -#include - namespace openspace::globebrowsing { /** diff --git a/modules/globebrowsing/src/geodeticpatch.cpp b/modules/globebrowsing/src/geodeticpatch.cpp index 61b1392b31..9797370e93 100644 --- a/modules/globebrowsing/src/geodeticpatch.cpp +++ b/modules/globebrowsing/src/geodeticpatch.cpp @@ -26,6 +26,10 @@ #include #include +#include +#include +#include +#include namespace { // Normalizes the angle to the interval [center - pi, center + pi[ diff --git a/modules/globebrowsing/src/geodeticpatch.h b/modules/globebrowsing/src/geodeticpatch.h index 17e5ff7f9d..4cd75dcc92 100644 --- a/modules/globebrowsing/src/geodeticpatch.h +++ b/modules/globebrowsing/src/geodeticpatch.h @@ -68,7 +68,6 @@ public: */ bool contains(const Geodetic2& p) const; - /** * Clamps a point to the patch region. */ diff --git a/modules/globebrowsing/src/geojson/geojsoncomponent.cpp b/modules/globebrowsing/src/geojson/geojsoncomponent.cpp index ad4d39df13..9a7caa7902 100644 --- a/modules/globebrowsing/src/geojson/geojsoncomponent.cpp +++ b/modules/globebrowsing/src/geojson/geojsoncomponent.cpp @@ -24,27 +24,34 @@ #include -#include #include #include #include -#include -#include #include #include #include -#include #include +#include +#include #include #include #include #include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include -#include +#include +#include namespace geos_nlohmann = nlohmann; #include diff --git a/modules/globebrowsing/src/geojson/geojsoncomponent.h b/modules/globebrowsing/src/geojson/geojsoncomponent.h index 30a3183803..2efcfaf681 100644 --- a/modules/globebrowsing/src/geojson/geojsoncomponent.h +++ b/modules/globebrowsing/src/geojson/geojsoncomponent.h @@ -28,11 +28,9 @@ #include #include -#include #include #include #include -#include #include #include #include @@ -40,20 +38,22 @@ #include #include #include -#include -#include +#include #include -#include +namespace geos { + namespace geom { class Geometry; } + namespace io { class GeoJSONFeature; } +} // namespace geos +namespace ghoul { + namespace opengl { class ProgramObject; } + class Dictionary; +} // namespace ghoul namespace openspace { - struct RenderData; - class LightSource; namespace documentation { struct Documentation; } - namespace rendering::helper { struct VertexXYZNormal; } -} // namespace::openspace - -namespace ghoul::opengl { class ProgramObject; } -namespace geos::io { class GeoJSONFeature; } + class LightSource; + struct RenderData; +} // namespace openspace namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/geojson/geojsonmanager.cpp b/modules/globebrowsing/src/geojson/geojsonmanager.cpp index a615c3f71e..7e1db1578d 100644 --- a/modules/globebrowsing/src/geojson/geojsonmanager.cpp +++ b/modules/globebrowsing/src/geojson/geojsonmanager.cpp @@ -24,11 +24,17 @@ #include +#include #include -#include +#include #include +#include +#include +#include #include - +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "GeoJsonManager"; diff --git a/modules/globebrowsing/src/geojson/geojsonmanager.h b/modules/globebrowsing/src/geojson/geojsonmanager.h index c8b146d72d..d2a73b1ee7 100644 --- a/modules/globebrowsing/src/geojson/geojsonmanager.h +++ b/modules/globebrowsing/src/geojson/geojsonmanager.h @@ -28,14 +28,13 @@ #include #include - -#include #include -#include namespace ghoul { class Dictionary; } -namespace openspace { struct RenderData; } -namespace openspace::documentation { struct Documentation; } +namespace openspace { + namespace documentation { struct Documentation; } + struct RenderData; +} // namespace openspace namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/geojson/geojsonproperties.cpp b/modules/globebrowsing/src/geojson/geojsonproperties.cpp index b14cb77a70..af4c87d96a 100644 --- a/modules/globebrowsing/src/geojson/geojsonproperties.cpp +++ b/modules/globebrowsing/src/geojson/geojsonproperties.cpp @@ -28,10 +28,13 @@ #include #include #include +#include #include #include #include -#include +#include +#include +#include // Keys used to read properties from GeoJson files namespace geojson::propertykeys { diff --git a/modules/globebrowsing/src/geojson/geojsonproperties.h b/modules/globebrowsing/src/geojson/geojsonproperties.h index 98cfb6f25a..6a6253e51c 100644 --- a/modules/globebrowsing/src/geojson/geojsonproperties.h +++ b/modules/globebrowsing/src/geojson/geojsonproperties.h @@ -35,7 +35,6 @@ #include #include #include -#include namespace geos::io { class GeoJSONFeature; } diff --git a/modules/globebrowsing/src/geojson/globegeometryfeature.cpp b/modules/globebrowsing/src/geojson/globegeometryfeature.cpp index 7a73b52e40..2db740811c 100644 --- a/modules/globebrowsing/src/geojson/globegeometryfeature.cpp +++ b/modules/globebrowsing/src/geojson/globegeometryfeature.cpp @@ -27,27 +27,39 @@ #include #include #include -#include #include #include -#include #include -#include #include -#include #include #include +#include +#include #include #include +#include +#include #include #include #include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include #include -#include +#include +#include +#include +#include namespace { - constexpr const char* _loggerCat = "GlobeGeometryFeature"; + constexpr std::string_view _loggerCat = "GlobeGeometryFeature"; constexpr std::chrono::milliseconds HeightUpdateInterval(10000); } // namespace @@ -187,7 +199,7 @@ void GlobeGeometryFeature::createFromSingleGeosGeometry(const geos::geom::Geomet // Note that Constrained Delaunay triangulation supports polygons with // holes :) std::vector triCoords; - TriList triangles; + geos::triangulate::tri::TriList triangles; using geos::triangulate::polygon::ConstrainedDelaunayTriangulator; ConstrainedDelaunayTriangulator::triangulatePolygon(p, triangles); @@ -195,7 +207,7 @@ void GlobeGeometryFeature::createFromSingleGeosGeometry(const geos::geom::Geomet // Add three coordinates per triangle. Note flipped winding order // (want counter clockwise, but GEOS provides clockwise) - for (const Tri* t : triangles) { + for (const geos::triangulate::tri::Tri* t : triangles) { triCoords.push_back(t->getCoordinate(0)); triCoords.push_back(t->getCoordinate(2)); triCoords.push_back(t->getCoordinate(1)); @@ -205,7 +217,7 @@ void GlobeGeometryFeature::createFromSingleGeosGeometry(const geos::geom::Geomet // Boundaries / Lines // Normalize to make sure rings have correct orientation - std::unique_ptr pNormalized = p->clone(); + std::unique_ptr pNormalized = p->clone(); pNormalized->normalize(); const geos::geom::LinearRing* outerRing = pNormalized->getExteriorRing(); diff --git a/modules/globebrowsing/src/geojson/globegeometryfeature.h b/modules/globebrowsing/src/geojson/globegeometryfeature.h index 71aa18f951..f9e84738a0 100644 --- a/modules/globebrowsing/src/geojson/globegeometryfeature.h +++ b/modules/globebrowsing/src/geojson/globegeometryfeature.h @@ -25,25 +25,29 @@ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___GLOBEGEOMETRYFEATURE___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___GLOBEGEOMETRYFEATURE___H__ -#include - -#include #include #include #include #include #include #include +#include +#include #include -namespace openspace::documentation { struct Documentation; } +namespace geos::geom { class Geometry; } +namespace ghoul::opengl { class ProgramObject; } +namespace openspace { + namespace documentation { struct Documentation; } + struct Geodetic2; + struct Geodetic3; + struct RenderData; +} // namespace openspace namespace rendering::helper { struct LightSourceRenderData; struct VertexXYZNormal; } // namespace rendering::helper -namespace geos::geom { class Geometry; } - namespace openspace::globebrowsing { class RenderableGlobe; @@ -54,11 +58,12 @@ class RenderableGlobe; */ class GlobeGeometryFeature { public: + using Vertex = rendering::helper::VertexXYZNormal; + GlobeGeometryFeature(const RenderableGlobe& globe, GeoJsonProperties& defaultProperties, GeoJsonOverrideProperties& overrideProperties); - using Vertex = rendering::helper::VertexXYZNormal; // TODO: Use instead of numbers //enum class RenderPass { diff --git a/modules/globebrowsing/src/geojson/globegeometryhelper.cpp b/modules/globebrowsing/src/geojson/globegeometryhelper.cpp index d4e13d5490..b595d881ee 100644 --- a/modules/globebrowsing/src/geojson/globegeometryhelper.cpp +++ b/modules/globebrowsing/src/geojson/globegeometryhelper.cpp @@ -26,11 +26,23 @@ #include #include +#include +#include #include +#include #include +#include +#include #include +#include +#include #include #include +#include +#include +#include +#include +#include namespace openspace::globebrowsing::geometryhelper { @@ -245,7 +257,7 @@ subdivideTriangle(const glm::vec3& v0, const glm::vec3& v1, const glm::vec3& v2, vertices.reserve(maxSteps * maxSteps); // Add points inside the triangle - std::vector pointCoords; + std::vector pointCoords; pointCoords.reserve(3 * maxSteps + 1); const Ellipsoid& ellipsoid = globe.ellipsoid(); @@ -314,7 +326,7 @@ subdivideTriangle(const glm::vec3& v0, const glm::vec3& v1, const glm::vec3& v2, // time std::vector> geosPoints; geosPoints.reserve(pointCoords.size()); - for (const Coordinate& c : pointCoords) { + for (const geos::geom::Coordinate& c : pointCoords) { geosPoints.emplace_back(geometryFactory->createPoint(c)); } std::unique_ptr points = geometryFactory->createMultiPoint( @@ -326,13 +338,13 @@ subdivideTriangle(const glm::vec3& v0, const glm::vec3& v1, const glm::vec3& v2, // Returns a list of triangles, as geos polygons GeometryCollection* triangleGeoms = builder.getTriangles(*geometryFactory).release(); - std::vector triCoords; + std::vector triCoords; triangleGeoms->getCoordinates()->toVector(triCoords); vertices.reserve(vertices.size() + triCoords.size() + 1); int count = 0; - for (const Coordinate& coord : triCoords) { + for (const geos::geom::Coordinate& coord : triCoords) { count++; if (count == 4) { // Skip every 4th coord, as polygons have one extra coord per triangle. diff --git a/modules/globebrowsing/src/geojson/globegeometryhelper.h b/modules/globebrowsing/src/geojson/globegeometryhelper.h index 7d4782de5b..030f3a6641 100644 --- a/modules/globebrowsing/src/geojson/globegeometryhelper.h +++ b/modules/globebrowsing/src/geojson/globegeometryhelper.h @@ -29,13 +29,11 @@ #include namespace openspace { - struct Geodetic2; - struct Geodetic3; - namespace globebrowsing { class RenderableGlobe; } namespace rendering::helper { struct VertexXYZNormal; } + struct Geodetic2; + struct Geodetic3; } // namespace openspace - namespace geos::geom { class Coordinate; class Geometry; diff --git a/modules/globebrowsing/src/globelabelscomponent.cpp b/modules/globebrowsing/src/globelabelscomponent.cpp index 576e0c0a88..e2ad9f3473 100644 --- a/modules/globebrowsing/src/globelabelscomponent.cpp +++ b/modules/globebrowsing/src/globelabelscomponent.cpp @@ -27,26 +27,28 @@ #include #include #include -#include -#include #include -#include -#include +#include +#include #include #include #include #include #include +#include #include #include #include #include -#include -#include +#include +#include +#include +#include #include #include -#include +#include #include +#include namespace { constexpr std::string_view _loggerCat = "GlobeLabels"; diff --git a/modules/globebrowsing/src/globelabelscomponent.h b/modules/globebrowsing/src/globelabelscomponent.h index 0036635327..b61bdefc53 100644 --- a/modules/globebrowsing/src/globelabelscomponent.h +++ b/modules/globebrowsing/src/globelabelscomponent.h @@ -31,22 +31,24 @@ #include #include #include -#include #include #include #include -#include #include +#include +#include +#include -namespace ghoul { class Dictionary; } -namespace ghoul::opengl { class ProgramObject; } +namespace ghoul { + namespace opengl { class ProgramObject; } + class Dictionary; +} // namespace ghoul namespace openspace { -struct RenderData; - namespace documentation { struct Documentation; } namespace globebrowsing { class RenderableGlobe; } +struct RenderData; class GlobeLabelsComponent : public properties::PropertyOwner, public Fadeable { public: diff --git a/modules/globebrowsing/src/gpulayergroup.cpp b/modules/globebrowsing/src/gpulayergroup.cpp index 6906dcf42d..4528592abf 100644 --- a/modules/globebrowsing/src/gpulayergroup.cpp +++ b/modules/globebrowsing/src/gpulayergroup.cpp @@ -24,11 +24,18 @@ #include +#include #include #include -#include +#include +#include +#include +#include #include +#include #include +#include +#include namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/gpulayergroup.h b/modules/globebrowsing/src/gpulayergroup.h index ec7ae4ec84..6ac2904c99 100644 --- a/modules/globebrowsing/src/gpulayergroup.h +++ b/modules/globebrowsing/src/gpulayergroup.h @@ -27,20 +27,12 @@ #include #include -#include -#include #include namespace ghoul::opengl { class ProgramObject; } namespace openspace::globebrowsing { -struct ChunkTile; -class Layer; -class GPULayer; -struct TileDepthTransform; -struct TileUvTransform; - struct LayerGroup; struct TileIndex; diff --git a/modules/globebrowsing/src/layer.cpp b/modules/globebrowsing/src/layer.cpp index 301089affa..681647c46b 100644 --- a/modules/globebrowsing/src/layer.cpp +++ b/modules/globebrowsing/src/layer.cpp @@ -24,18 +24,17 @@ #include -#include -#include -#include -#include #include -#include #include -#include +#include +#include #include #include - -namespace openspace::globebrowsing { +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "Layer"; @@ -175,6 +174,8 @@ namespace { #include "layer_codegen.cpp" } // namespace +namespace openspace::globebrowsing { + documentation::Documentation Layer::Documentation() { return codegen::doc("globebrowsing_layer"); } diff --git a/modules/globebrowsing/src/layer.h b/modules/globebrowsing/src/layer.h index 3843d45543..c31e682bb3 100644 --- a/modules/globebrowsing/src/layer.h +++ b/modules/globebrowsing/src/layer.h @@ -30,11 +30,17 @@ #include #include +#include #include -#include #include +#include +#include #include +#include +#include +#include +namespace ghoul { class Dictionary; } namespace openspace::documentation { struct Documentation; } namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/layeradjustment.cpp b/modules/globebrowsing/src/layeradjustment.cpp index c30e895cd3..58ba3756f5 100644 --- a/modules/globebrowsing/src/layeradjustment.cpp +++ b/modules/globebrowsing/src/layeradjustment.cpp @@ -25,8 +25,9 @@ #include #include -#include +#include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo ChromaKeyColorInfo = { diff --git a/modules/globebrowsing/src/layeradjustment.h b/modules/globebrowsing/src/layeradjustment.h index d1c1869cdf..07a7751a59 100644 --- a/modules/globebrowsing/src/layeradjustment.h +++ b/modules/globebrowsing/src/layeradjustment.h @@ -31,7 +31,9 @@ #include #include #include +#include +namespace ghoul { class Dictionary; } namespace openspace::documentation { struct Documentation; } namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/layergroup.cpp b/modules/globebrowsing/src/layergroup.cpp index e6c32fd28b..520d928822 100644 --- a/modules/globebrowsing/src/layergroup.cpp +++ b/modules/globebrowsing/src/layergroup.cpp @@ -31,8 +31,14 @@ #include #include #include +#include #include +#include +#include #include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "LayerGroup"; diff --git a/modules/globebrowsing/src/layergroup.h b/modules/globebrowsing/src/layergroup.h index e4dc07f9b9..5f27191c46 100644 --- a/modules/globebrowsing/src/layergroup.h +++ b/modules/globebrowsing/src/layergroup.h @@ -29,11 +29,13 @@ #include #include +#include + +namespace ghoul { class Dictionary; } namespace openspace::globebrowsing { class Layer; -struct TileProvider; /** * Convenience class for dealing with multiple `Layer`s. diff --git a/modules/globebrowsing/src/layergroupid.cpp b/modules/globebrowsing/src/layergroupid.cpp index 9c349e8d4c..887c0161e2 100644 --- a/modules/globebrowsing/src/layergroupid.cpp +++ b/modules/globebrowsing/src/layergroupid.cpp @@ -24,6 +24,8 @@ #include +#include + namespace openspace::globebrowsing::layers { // The order and values of these enums are implicitly used in many places in the code and diff --git a/modules/globebrowsing/src/layergroupid.h b/modules/globebrowsing/src/layergroupid.h index 71e94beaf7..2c3b8bede6 100644 --- a/modules/globebrowsing/src/layergroupid.h +++ b/modules/globebrowsing/src/layergroupid.h @@ -25,9 +25,11 @@ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___LAYERGROUPID___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___LAYERGROUPID___H__ -#include +#include +#include +#include #include -#include +#include namespace openspace::globebrowsing::layers { diff --git a/modules/globebrowsing/src/layermanager.cpp b/modules/globebrowsing/src/layermanager.cpp index f555e4002c..9f6a02a80d 100644 --- a/modules/globebrowsing/src/layermanager.cpp +++ b/modules/globebrowsing/src/layermanager.cpp @@ -27,11 +27,13 @@ #include #include #include -#include #include -#include #include #include +#include +#include +#include +#include namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/layermanager.h b/modules/globebrowsing/src/layermanager.h index 06042ca9b0..4427ac5afd 100644 --- a/modules/globebrowsing/src/layermanager.h +++ b/modules/globebrowsing/src/layermanager.h @@ -28,20 +28,17 @@ #include #include -#include #include #include #include namespace ghoul { class Dictionary; } - namespace openspace::documentation { struct Documentation; } namespace openspace::globebrowsing { class Layer; struct LayerGroup; -class TileTextureInitData; /** * Manages multiple LayerGroups. diff --git a/modules/globebrowsing/src/layerrendersettings.cpp b/modules/globebrowsing/src/layerrendersettings.cpp index e7f6d8c4b9..c8e5372fa3 100644 --- a/modules/globebrowsing/src/layerrendersettings.cpp +++ b/modules/globebrowsing/src/layerrendersettings.cpp @@ -24,6 +24,10 @@ #include +#include +#include +#include + namespace { constexpr openspace::properties::Property::PropertyInfo SetDefaultInfo = { "SetDefault", diff --git a/modules/globebrowsing/src/layerrendersettings.h b/modules/globebrowsing/src/layerrendersettings.h index 111fcbc195..d1f0fa048e 100644 --- a/modules/globebrowsing/src/layerrendersettings.h +++ b/modules/globebrowsing/src/layerrendersettings.h @@ -29,6 +29,7 @@ #include #include +#include namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/lrucache.h b/modules/globebrowsing/src/lrucache.h index d9dd2770ba..aa56d20dc8 100644 --- a/modules/globebrowsing/src/lrucache.h +++ b/modules/globebrowsing/src/lrucache.h @@ -27,6 +27,7 @@ #include #include +#include #include namespace openspace::globebrowsing::cache { diff --git a/modules/globebrowsing/src/lrucache.inl b/modules/globebrowsing/src/lrucache.inl index 4dc774fb1c..99c8c6103a 100644 --- a/modules/globebrowsing/src/lrucache.inl +++ b/modules/globebrowsing/src/lrucache.inl @@ -27,24 +27,24 @@ namespace openspace::globebrowsing::cache { -template +template LRUCache::LRUCache(size_t size) : _maximumCacheSize(size) {} -template +template void LRUCache::clear() { _itemList.clear(); _itemMap.clear(); } -template +template void LRUCache::put(KeyType key, ValueType value) { putWithoutCleaning(std::move(key), std::move(value)); clean(); } -template +template std::vector> LRUCache::putAndFetchPopped(KeyType key, ValueType value) { @@ -52,12 +52,12 @@ LRUCache::putAndFetchPopped(KeyType key, ValueTy return cleanAndFetchPopped(); } -template +template bool LRUCache::exist(const KeyType& key) const { return (_itemMap.count(key) > 0); } -template +template bool LRUCache::touch(const KeyType& key) { ZoneScoped; @@ -84,12 +84,12 @@ bool LRUCache::touch(const KeyType& key) { } } -template +template bool LRUCache::isEmpty() const { return (_itemMap.size() == 0); } -template +template ValueType LRUCache::get(const KeyType& key) { const auto it = _itemMap.find(key); // Move list iterator pointing to value @@ -98,7 +98,7 @@ ValueType LRUCache::get(const KeyType& key) { return res; } -template +template std::pair LRUCache::popMRU() { ghoul_assert(!_itemList.empty(), "Cannot pop LRU cache. Ensure cache is not empty"); @@ -109,7 +109,7 @@ std::pair LRUCache::popMRU() return toReturn; } -template +template std::pair LRUCache::popLRU() { ghoul_assert(!_itemList.empty(), "Cannot pop LRU cache. Ensure cache is not empty"); @@ -121,17 +121,17 @@ std::pair LRUCache::popLRU() return toReturn; } -template +template size_t LRUCache::size() const { return _itemMap.size(); } -template +template size_t LRUCache::maximumCacheSize() const { return _maximumCacheSize; } -template +template void LRUCache::putWithoutCleaning(KeyType key, ValueType value) { @@ -144,7 +144,7 @@ void LRUCache::putWithoutCleaning(KeyType key, _itemMap.emplace(std::move(key), _itemList.begin()); } -template +template void LRUCache::clean() { while (_itemMap.size() > _maximumCacheSize) { auto lastIt = _itemList.end(); @@ -154,7 +154,7 @@ void LRUCache::clean() { } } -template +template std::vector> LRUCache::cleanAndFetchPopped() { diff --git a/modules/globebrowsing/src/lruthreadpool.h b/modules/globebrowsing/src/lruthreadpool.h index 6c40f07790..d5b1004bfe 100644 --- a/modules/globebrowsing/src/lruthreadpool.h +++ b/modules/globebrowsing/src/lruthreadpool.h @@ -36,9 +36,9 @@ namespace openspace::globebrowsing { -template class LRUThreadPool; +template class LRUThreadPool; -template +template class LRUThreadPoolWorker { public: explicit LRUThreadPoolWorker(LRUThreadPool& pool); @@ -58,7 +58,7 @@ private: * same key will simply be bumped and prioritised before other enqueued tasks. The given * task will be ignored. */ -template +template class LRUThreadPool { public: LRUThreadPool(size_t numThreads, size_t queueSize); diff --git a/modules/globebrowsing/src/lruthreadpool.inl b/modules/globebrowsing/src/lruthreadpool.inl index e1fcce40f8..c7dca2ba3e 100644 --- a/modules/globebrowsing/src/lruthreadpool.inl +++ b/modules/globebrowsing/src/lruthreadpool.inl @@ -22,14 +22,17 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include +#include + namespace openspace::globebrowsing { -template +template LRUThreadPoolWorker::LRUThreadPoolWorker(LRUThreadPool& pool) : _pool(pool) {} -template +template void LRUThreadPoolWorker::operator()() { std::function task; while (true) { @@ -57,7 +60,7 @@ void LRUThreadPoolWorker::operator()() { } } -template +template LRUThreadPool::LRUThreadPool(size_t numThreads, size_t queueSize) : _queuedTasks(queueSize) { @@ -66,13 +69,13 @@ LRUThreadPool::LRUThreadPool(size_t numThreads, size_t queueSize) } } -template +template LRUThreadPool::LRUThreadPool(const LRUThreadPool& toCopy) : LRUThreadPool(toCopy._workers.size(), toCopy._queuedTasks.maximumCacheSize()) {} // the destructor joins all threads -template +template LRUThreadPool::~LRUThreadPool() { { std::unique_lock lock(_queueMutex); @@ -87,7 +90,7 @@ LRUThreadPool::~LRUThreadPool() { } // add new work item to the pool -template +template void LRUThreadPool::enqueue(std::function f, KeyType key) { { std::unique_lock lock(_queueMutex); @@ -107,13 +110,13 @@ void LRUThreadPool::enqueue(std::function f, KeyType key) { _condition.notify_one(); } -template +template bool LRUThreadPool::touch(KeyType key) { std::unique_lock lock(_queueMutex); return _queuedTasks.touch(key); } -template +template std::vector LRUThreadPool::getUnqueuedTasksKeys() { std::vector toReturn = _unqueuedTasks; { @@ -123,7 +126,7 @@ std::vector LRUThreadPool::getUnqueuedTasksKeys() { return toReturn; } -template +template std::vector LRUThreadPool::getQueuedTasksKeys() { std::vector queuedTasks; { @@ -135,7 +138,7 @@ std::vector LRUThreadPool::getQueuedTasksKeys() { return queuedTasks; } -template +template void LRUThreadPool::clearEnqueuedTasks() { std::unique_lock lock(_queueMutex); _queuedTasks.clear(); diff --git a/modules/globebrowsing/src/memoryawaretilecache.cpp b/modules/globebrowsing/src/memoryawaretilecache.cpp index 2c4f56936d..509a294ace 100644 --- a/modules/globebrowsing/src/memoryawaretilecache.cpp +++ b/modules/globebrowsing/src/memoryawaretilecache.cpp @@ -25,12 +25,18 @@ #include #include -#include +#include #include +#include #include +#include +#include #include #include +#include +#include #include +#include namespace { constexpr std::string_view _loggerCat = "MemoryAwareTileCache"; diff --git a/modules/globebrowsing/src/memoryawaretilecache.h b/modules/globebrowsing/src/memoryawaretilecache.h index 9f9144a8b7..d75bd291e3 100644 --- a/modules/globebrowsing/src/memoryawaretilecache.h +++ b/modules/globebrowsing/src/memoryawaretilecache.h @@ -22,18 +22,20 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___MEMORY_AWARE_TILE_CACHE___H__ -#define __OPENSPACE_MODULE_GLOBEBROWSING___MEMORY_AWARE_TILE_CACHE___H__ +#ifndef __OPENSPACE_MODULE_GLOBEBROWSING___MEMORYAWARETILECACHE___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___MEMORYAWARETILECACHE___H__ #include #include #include #include #include -#include #include +#include +#include #include #include +#include #include namespace openspace::globebrowsing { @@ -167,4 +169,4 @@ private: } // namespace openspace::globebrowsing::cache -#endif // __OPENSPACE_MODULE_GLOBEBROWSING___MEMORY_AWARE_TILE_CACHE___H__ +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___MEMORYAWARETILECACHE___H__ diff --git a/modules/globebrowsing/src/prioritizingconcurrentjobmanager.h b/modules/globebrowsing/src/prioritizingconcurrentjobmanager.h index 0cbdf76f27..77742644f7 100644 --- a/modules/globebrowsing/src/prioritizingconcurrentjobmanager.h +++ b/modules/globebrowsing/src/prioritizingconcurrentjobmanager.h @@ -27,7 +27,9 @@ #include #include +#include #include +#include namespace openspace { template struct Job; } @@ -39,7 +41,7 @@ namespace openspace::globebrowsing { * which is used to identify jobs. In case a job need to be explicitly ended. It can be * identified using its key. */ -template +template class PrioritizingConcurrentJobManager { public: explicit PrioritizingConcurrentJobManager(LRUThreadPool pool); diff --git a/modules/globebrowsing/src/prioritizingconcurrentjobmanager.inl b/modules/globebrowsing/src/prioritizingconcurrentjobmanager.inl index b9ddd8f4ff..93e434cd28 100644 --- a/modules/globebrowsing/src/prioritizingconcurrentjobmanager.inl +++ b/modules/globebrowsing/src/prioritizingconcurrentjobmanager.inl @@ -23,6 +23,7 @@ ****************************************************************************************/ #include +#include namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/rawtile.h b/modules/globebrowsing/src/rawtile.h index 4152c57e37..d610b04f58 100644 --- a/modules/globebrowsing/src/rawtile.h +++ b/modules/globebrowsing/src/rawtile.h @@ -28,7 +28,6 @@ #include #include #include -#include #include #include #include @@ -36,8 +35,6 @@ namespace openspace::globebrowsing { -class TileTextureInitData; - struct RawTile { enum class ReadError { None = 0, // = CE_None diff --git a/modules/globebrowsing/src/rawtiledatareader.cpp b/modules/globebrowsing/src/rawtiledatareader.cpp index fee3dfea1c..180a746ae0 100644 --- a/modules/globebrowsing/src/rawtiledatareader.cpp +++ b/modules/globebrowsing/src/rawtiledatareader.cpp @@ -28,12 +28,28 @@ #include #include #include -#include +#include #include #include #include +#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef _MSC_VER #pragma warning (push) @@ -42,182 +58,176 @@ #endif // _MSC_VER #include -#include -#include - #include #ifdef _MSC_VER #pragma warning (pop) #endif // _MSC_VER -#include -#include -#include -#include - namespace openspace::globebrowsing { namespace { constexpr std::string_view _loggerCat = "RawTileDataReader"; -enum class Side { - Left = 0, - Top, - Right, - Bottom -}; - -float interpretFloat(GLenum glType, const std::byte* src) { - switch (glType) { - case GL_UNSIGNED_BYTE: - return static_cast(*reinterpret_cast(src)); - case GL_UNSIGNED_SHORT: - return static_cast(*reinterpret_cast(src)); - case GL_SHORT: - return static_cast(*reinterpret_cast(src)); - case GL_UNSIGNED_INT: - return static_cast(*reinterpret_cast(src)); - case GL_INT: - return static_cast(*reinterpret_cast(src)); - case GL_HALF_FLOAT: - return static_cast(*reinterpret_cast(src)); - case GL_FLOAT: - return static_cast(*reinterpret_cast(src)); - case GL_DOUBLE: - return static_cast(*reinterpret_cast(src)); - default: - throw ghoul::MissingCaseException(); - } -} - -GDALDataType toGDALDataType(GLenum glType) { - switch (glType) { - case GL_UNSIGNED_BYTE: - return GDT_Byte; - case GL_UNSIGNED_SHORT: - return GDT_UInt16; - case GL_SHORT: - return GDT_Int16; - case GL_UNSIGNED_INT: - return GDT_UInt32; - case GL_INT: - return GDT_Int32; - case GL_FLOAT: - return GDT_Float32; - case GL_DOUBLE: - return GDT_Float64; - default: - LERRORC( - "GDALRawTileDataReader", - std::format( - "OpenGL data type unknown to GDAL: {}", static_cast(glType) - ) - ); - throw ghoul::MissingCaseException(); - } -} - -bool isInside(const PixelRegion& lhs, const PixelRegion& rhs) { - const glm::ivec2 e = lhs.start + lhs.numPixels; - const glm::ivec2 re = rhs.start + rhs.numPixels; - return rhs.start.x <= lhs.start.x && e.x <= re.x && - rhs.start.y <= lhs.start.y && e.y <= re.y; -} - -/** - * Returns the geo transform from raster space to projection coordinates as defined - * by GDAL. - */ -std::array geoTransform(int rasterX, int rasterY) { - const GeodeticPatch cov( - Geodetic2{ 0.0, 0.0 }, - Geodetic2{ glm::half_pi(), glm::pi() } - ); - return { - glm::degrees(cov.corner(Quad::NORTH_WEST).lon), - glm::degrees(cov.size().lon) / rasterX, - 0.0, - glm::degrees(cov.corner(Quad::NORTH_WEST).lat), - 0.0, - glm::degrees(-cov.size().lat) / rasterY + enum class Side { + Left = 0, + Top, + Right, + Bottom }; -} -/** - * Get the pixel corresponding to a specific position on the globe defined by the - * Geodetic2 coordinate \p geo. If the dataset has overviews the function returns the - * pixel at the lowest overview (highest resolution). - * - * \param geo The position on the globe to convert to pixel space. - * \return a pixel coordinate in the dataset. - */ -glm::ivec2 geodeticToPixel(const Geodetic2& geo, - const std::array& transform) -{ - const std::array& t = transform; - - const double Y = glm::degrees(geo.lat); - const double X = glm::degrees(geo.lon); - - const double divisor = t[2] * t[4] - t[1] * t[5]; - ghoul_assert(divisor != 0.0, "Division by zero"); - - const double P = (t[0] * t[5] - t[2] * t[3] + t[2] * Y - t[5] * X) / divisor; - const double L = (-t[0] * t[4] + t[1] * t[3] - t[1] * Y + t[4] * X) / divisor; - // ref: https://www.wolframalpha.com/input/?i=X+%3D+a0+%2B+a1P+%2B+a2L, - // +Y+%3D+b0+%2B+b1P+%2B+b2L,+solve+for+P+and+L - - [[maybe_unused]] const double Xp = t[0] + P * t[1] + L * t[2]; - [[maybe_unused]] const double Yp = t[3] + P * t[4] + L * t[5]; - ghoul_assert(std::abs(X - Xp) < 1e-10, "inverse should yield X as before"); - ghoul_assert(std::abs(Y - Yp) < 1e-10, "inverse should yield Y as before"); - - return glm::ivec2(glm::round(P), glm::round(L)); -} - -/** - * Get a pixel region corresponding to the given GeodeticPatch. If the dataset has - * overviews the function returns the pixel region at the lowest overview (highest - * resolution). - * - * \param \p geodeticPatch is a patch covering an area in geodetic coordinates - * \return A PixelRegion covering the given geodetic patch at highest resolution. - */ -PixelRegion highestResPixelRegion(const GeodeticPatch& geodeticPatch, - const std::array& transform) -{ - const Geodetic2 nwCorner = geodeticPatch.corner(Quad::NORTH_WEST); - const Geodetic2 swCorner = geodeticPatch.corner(Quad::SOUTH_EAST); - const glm::ivec2 pixelStart = geodeticToPixel(nwCorner, transform); - const glm::ivec2 pixelEnd = geodeticToPixel(swCorner, transform); - PixelRegion region; - region.start = pixelStart; - region.numPixels = pixelEnd - pixelStart; - return region; -} - -RawTile::ReadError postProcessErrorCheck(const RawTile& rawTile, - [[maybe_unused]] size_t nRasters, - float noDataValue) -{ - ghoul_assert(nRasters == rawTile.tileMetaData.nValues, "Wrong numbers of max values"); - - const bool hasMissingData = std::any_of( - rawTile.tileMetaData.maxValues.begin(), - rawTile.tileMetaData.maxValues.begin() + rawTile.tileMetaData.nValues, - [noDataValue](float v) { return v == noDataValue; } - ); - - const bool onHighLevel = rawTile.tileIndex.level > 6; - if (hasMissingData && onHighLevel) { - return RawTile::ReadError::Fatal; + float interpretFloat(GLenum glType, const std::byte* src) { + switch (glType) { + case GL_UNSIGNED_BYTE: + return static_cast(*reinterpret_cast(src)); + case GL_UNSIGNED_SHORT: + return static_cast(*reinterpret_cast(src)); + case GL_SHORT: + return static_cast(*reinterpret_cast(src)); + case GL_UNSIGNED_INT: + return static_cast(*reinterpret_cast(src)); + case GL_INT: + return static_cast(*reinterpret_cast(src)); + case GL_HALF_FLOAT: + return static_cast(*reinterpret_cast(src)); + case GL_FLOAT: + return static_cast(*reinterpret_cast(src)); + case GL_DOUBLE: + return static_cast(*reinterpret_cast(src)); + default: + throw ghoul::MissingCaseException(); + } } - else { - return RawTile::ReadError::None; - } -} + GDALDataType toGDALDataType(GLenum glType) { + switch (glType) { + case GL_UNSIGNED_BYTE: + return GDT_Byte; + case GL_UNSIGNED_SHORT: + return GDT_UInt16; + case GL_SHORT: + return GDT_Int16; + case GL_UNSIGNED_INT: + return GDT_UInt32; + case GL_INT: + return GDT_Int32; + case GL_FLOAT: + return GDT_Float32; + case GL_DOUBLE: + return GDT_Float64; + default: + LERRORC( + "GDALRawTileDataReader", + std::format( + "OpenGL data type unknown to GDAL: {}", static_cast(glType) + ) + ); + throw ghoul::MissingCaseException(); + } + } + + bool isInside(const PixelRegion& lhs, const PixelRegion& rhs) { + const glm::ivec2 e = lhs.start + lhs.numPixels; + const glm::ivec2 re = rhs.start + rhs.numPixels; + return rhs.start.x <= lhs.start.x && e.x <= re.x && + rhs.start.y <= lhs.start.y && e.y <= re.y; + } + + /** + * Returns the geo transform from raster space to projection coordinates as defined + * by GDAL. + */ + std::array geoTransform(int rasterX, int rasterY) { + const GeodeticPatch cov( + Geodetic2{ 0.0, 0.0 }, + Geodetic2{ glm::half_pi(), glm::pi() } + ); + return { + glm::degrees(cov.corner(Quad::NORTH_WEST).lon), + glm::degrees(cov.size().lon) / rasterX, + 0.0, + glm::degrees(cov.corner(Quad::NORTH_WEST).lat), + 0.0, + glm::degrees(-cov.size().lat) / rasterY + }; + } + + /** + * Get the pixel corresponding to a specific position on the globe defined by the + * Geodetic2 coordinate \p geo. If the dataset has overviews the function returns the + * pixel at the lowest overview (highest resolution). + * + * \param geo The position on the globe to convert to pixel space. + * \return a pixel coordinate in the dataset. + */ + glm::ivec2 geodeticToPixel(const Geodetic2& geo, + const std::array& transform) + { + const std::array& t = transform; + + const double Y = glm::degrees(geo.lat); + const double X = glm::degrees(geo.lon); + + const double divisor = t[2] * t[4] - t[1] * t[5]; + ghoul_assert(divisor != 0.0, "Division by zero"); + + const double P = (t[0] * t[5] - t[2] * t[3] + t[2] * Y - t[5] * X) / divisor; + const double L = (-t[0] * t[4] + t[1] * t[3] - t[1] * Y + t[4] * X) / divisor; + // ref: https://www.wolframalpha.com/input/?i=X+%3D+a0+%2B+a1P+%2B+a2L, + // +Y+%3D+b0+%2B+b1P+%2B+b2L,+solve+for+P+and+L + + [[maybe_unused]] const double Xp = t[0] + P * t[1] + L * t[2]; + [[maybe_unused]] const double Yp = t[3] + P * t[4] + L * t[5]; + ghoul_assert(std::abs(X - Xp) < 1e-10, "inverse should yield X as before"); + ghoul_assert(std::abs(Y - Yp) < 1e-10, "inverse should yield Y as before"); + + return glm::ivec2(glm::round(P), glm::round(L)); + } + + /** + * Get a pixel region corresponding to the given GeodeticPatch. If the dataset has + * overviews the function returns the pixel region at the lowest overview (highest + * resolution). + * + * \param \p geodeticPatch is a patch covering an area in geodetic coordinates + * \return A PixelRegion covering the given geodetic patch at highest resolution. + */ + PixelRegion highestResPixelRegion(const GeodeticPatch& geodeticPatch, + const std::array& transform) + { + const Geodetic2 nwCorner = geodeticPatch.corner(Quad::NORTH_WEST); + const Geodetic2 swCorner = geodeticPatch.corner(Quad::SOUTH_EAST); + const glm::ivec2 pixelStart = geodeticToPixel(nwCorner, transform); + const glm::ivec2 pixelEnd = geodeticToPixel(swCorner, transform); + PixelRegion region; + region.start = pixelStart; + region.numPixels = pixelEnd - pixelStart; + return region; + } + + RawTile::ReadError postProcessErrorCheck(const RawTile& rawTile, + [[maybe_unused]] size_t nRasters, + float noDataValue) + { + ghoul_assert( + nRasters == rawTile.tileMetaData.nValues, + "Wrong numbers of max values" + ); + + const bool hasMissingData = std::any_of( + rawTile.tileMetaData.maxValues.begin(), + rawTile.tileMetaData.maxValues.begin() + rawTile.tileMetaData.nValues, + [noDataValue](float v) { return v == noDataValue; } + ); + + const bool onHighLevel = rawTile.tileIndex.level > 6; + if (hasMissingData && onHighLevel) { + return RawTile::ReadError::Fatal; + } + else { + return RawTile::ReadError::None; + } + } } // namespace RawTileDataReader::RawTileDataReader(std::string filePath, TileTextureInitData initData, @@ -413,7 +423,18 @@ void RawTileDataReader::initialize() { _padfTransform = geoTransform(_rasterXSize, _rasterYSize); } - _maxChunkLevel = _dataset->GetRasterBand(1)->GetOverviewCount(); + + + const int nOverviews = _dataset->GetRasterBand(1)->GetOverviewCount(); + if (nOverviews > 0) { + _maxChunkLevel = nOverviews; + } + else { + const int sizeLevel0 = _dataset->GetRasterBand(1)->GetXSize(); + const double diff = log2(sizeLevel0) - log2(_initData.dimensions.x); + const double intdiff = diff >= 0 ? ceil(diff) : floor(diff); + _maxChunkLevel = intdiff; + } } void RawTileDataReader::reset() { diff --git a/modules/globebrowsing/src/rawtiledatareader.h b/modules/globebrowsing/src/rawtiledatareader.h index 37ef58407b..fc2bab4f35 100644 --- a/modules/globebrowsing/src/rawtiledatareader.h +++ b/modules/globebrowsing/src/rawtiledatareader.h @@ -27,20 +27,21 @@ #include #include -#include #include +#include +#include +#include #include -#include -#include #include +#include +#include +#include +#include class GDALDataset; -class GDALRasterBand; namespace openspace::globebrowsing { -class GeodeticPatch; - class RawTileDataReader { public: BooleanType(PerformPreprocessing); @@ -49,11 +50,11 @@ public: * Opens a GDALDataset in readonly mode and calculates meta data required for * reading tile using a TileIndex. * - * \param filePath the path to a specific file GDAL can read - * \param initData information about the textures that will be creatd by this reader - * \param cacheProperties contains settings about whether the reader should + * \param filePath The path to a specific file GDAL can read + * \param initData Information about the textures that will be creatd by this reader + * \param cacheProperties Contains settings about whether the reader should * utilize cache - * \param preprocess whether the loaded data should be calculate meta data about the + * \param preprocess Whether the loaded data should be calculate meta data about the * dataset */ RawTileDataReader(std::string filePath, TileTextureInitData initData, diff --git a/modules/globebrowsing/src/renderableglobe.cpp b/modules/globebrowsing/src/renderableglobe.cpp index a699b22705..3c714a2d96 100644 --- a/modules/globebrowsing/src/renderableglobe.cpp +++ b/modules/globebrowsing/src/renderableglobe.cpp @@ -30,9 +30,10 @@ #include #include #include +#include +#include #include #include -#include #include #include #include @@ -41,12 +42,16 @@ #include #include #include +#include #include #include #include #include #include +#include #include +#include +#include #include #include #include @@ -55,18 +60,13 @@ #include #include #include +#include +#include +#include #include -#include -#include - -#if defined(__APPLE__) || (defined(__linux__) && defined(__clang__)) -#include -namespace std { - using namespace experimental; -} // namespace std -#else -#include -#endif +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderableGlobe"; @@ -1542,7 +1542,10 @@ void RenderableGlobe::renderChunkGlobally(const Chunk& chunk, const RenderData& if (_ringsComponent->textureTransparency()) { ringTextureTransparencyUnit.activate(); _ringsComponent->textureTransparency()->bind(); - program.setUniform("ringTextureTransparency", ringTextureTransparencyUnit); + program.setUniform( + "ringTextureTransparency", + ringTextureTransparencyUnit + ); } program.setUniform("textureOffset", _ringsComponent->textureOffset()); @@ -1661,7 +1664,7 @@ void RenderableGlobe::renderChunkLocally(const Chunk& chunk, const RenderData& d if (_eclipseShadowsEnabled && !_ellipsoid.shadowConfigurationArray().empty()) { calculateEclipseShadows(program, data, ShadowCompType::LOCAL_SHADOW); } - + // Shadow Mapping if (_shadowMappingProperties.shadowMapping) { // Bind ring textures for direct projection when rings component is available @@ -1678,7 +1681,10 @@ void RenderableGlobe::renderChunkLocally(const Chunk& chunk, const RenderData& d if (_ringsComponent->textureTransparency()) { ringTextureTransparencyUnit.activate(); _ringsComponent->textureTransparency()->bind(); - program.setUniform("ringTextureTransparency", ringTextureTransparencyUnit); + program.setUniform( + "ringTextureTransparency", + ringTextureTransparencyUnit + ); } program.setUniform("textureOffset", _ringsComponent->textureOffset()); @@ -1883,9 +1889,11 @@ void RenderableGlobe::recompileShaders() { std::to_string(_shadowMappingProperties.shadowMapping && _shadowComponent) ); pairs.emplace_back( - "useRingShadows", - std::to_string(_shadowMappingProperties.shadowMapping&& _ringsComponent && - _ringsComponent->isEnabled()) + "useRingShadows", + std::to_string( + _shadowMappingProperties.shadowMapping && _ringsComponent && + _ringsComponent->isEnabled() + ) ); pairs.emplace_back("showChunkEdges", std::to_string(_debugProperties.showChunkEdges)); pairs.emplace_back("showHeightResolution", "0"); @@ -2697,24 +2705,6 @@ void RenderableGlobe::freeChunkNode(Chunk* n) { n->children.fill(nullptr); } -std::vector RenderableGlobe::getShadowers(const SceneGraphNode* node) { - std::vector shadowers; - - if (node) { - const RenderableModel* model = dynamic_cast(node->renderable()); - if (model && model->isCastingShadow()) { - shadowers.push_back(model); - } - - for (const SceneGraphNode* child : node->children()) { - std::vector res = getShadowers(child); - shadowers.insert(shadowers.end(), res.begin(), res.end()); - } - } - - return shadowers; -} - void RenderableGlobe::mergeChunkNode(Chunk& cn) { ZoneScoped; diff --git a/modules/globebrowsing/src/renderableglobe.h b/modules/globebrowsing/src/renderableglobe.h index b1f474a6a7..ecdf8da6a3 100644 --- a/modules/globebrowsing/src/renderableglobe.h +++ b/modules/globebrowsing/src/renderableglobe.h @@ -38,23 +38,22 @@ #include #include #include +#include #include #include #include #include +#include #include +#include #include -#include +#include +#include #include -namespace openspace { class RenderableModel; } -namespace openspace::documentation { struct Documentation; } - namespace openspace::globebrowsing { -class GPULayerGroup; -class RenderableGlobe; -struct TileIndex; +class Layer; struct BoundingHeights { float min; @@ -63,9 +62,6 @@ struct BoundingHeights { bool tileOK; }; -namespace chunklevelevaluator { class Evaluator; } -namespace culling { class ChunkCuller; } - struct Chunk { enum class Status : uint8_t { DoNothing, @@ -107,9 +103,9 @@ public: void deinitializeGL() override; bool isReady() const override; + void update(const UpdateData& data) override; void render(const RenderData& data, RendererTasks& rendererTask) override; void renderSecondary(const RenderData& data, RendererTasks&) override; - void update(const UpdateData& data) override; SurfacePositionHandle calculateSurfacePositionHandle( const glm::dvec3& targetModelSpace) const override; @@ -229,8 +225,6 @@ private: void updateChunk(Chunk& chunk, const RenderData& data, const glm::dmat4& mvp) const; void freeChunkNode(Chunk* n); - std::vector getShadowers(const SceneGraphNode* node); - properties::BoolProperty _performShading; properties::BoolProperty _useAccurateNormals; properties::FloatProperty _ambientIntensity; diff --git a/modules/globebrowsing/src/ringscomponent.cpp b/modules/globebrowsing/src/ringscomponent.cpp index f5ae517e7d..54bbee522f 100644 --- a/modules/globebrowsing/src/ringscomponent.cpp +++ b/modules/globebrowsing/src/ringscomponent.cpp @@ -25,30 +25,29 @@ #include #include -#include #include -#include #include -#include -#include #include #include +#include #include #include -#include -#include +#include #include #include +#include #include #include #include #include #include #include +#include +#include #include -#include -#include -#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "RingsComponent"; @@ -351,7 +350,7 @@ void RingsComponent::initializeGL() { glGenBuffers(1, &_vertexPositionBuffer); createPlane(); - + // Check if readiness state has changed after shader compilation checkAndNotifyReadinessChange(); } @@ -487,9 +486,9 @@ void RingsComponent::draw(const RenderData& data, _shader->setUniform(_uniformCache.colorFilterValue, _colorFilter); _shader->setUniform(_uniformCache.nightFactor, _nightFactor); _shader->setUniform(_uniformCache.sunPosition, _sunPosition); - + _shader->setUniform(_uniformCache.sunPositionObj, sunPositionObjectSpace); - + _shader->setUniform( _uniformCache.modelViewProjectionMatrix, modelViewProjectionTransform @@ -679,7 +678,7 @@ void RingsComponent::loadTexture() { "Loaded transparency texture from '{}'", absPath(_textureTransparencyPath) )); _textureTransparency = std::move(textureTransparency); - + _textureTransparency->uploadTexture(); _textureTransparency->setFilter(Texture::FilterMode::AnisotropicMipMap); @@ -691,7 +690,7 @@ void RingsComponent::loadTexture() { } _isAdvancedTextureEnabled = _textureForwards && _textureBackwards && _textureUnlit; - + // Check if readiness state has changed after loading textures checkAndNotifyReadinessChange(); } @@ -784,7 +783,7 @@ void RingsComponent::compileShadowShader() { catch (const ghoul::RuntimeError& e) { LERROR(e.message); } - + // Check if readiness state has changed after shader compilation checkAndNotifyReadinessChange(); } diff --git a/modules/globebrowsing/src/ringscomponent.h b/modules/globebrowsing/src/ringscomponent.h index 288beb3277..850ee89b14 100644 --- a/modules/globebrowsing/src/ringscomponent.h +++ b/modules/globebrowsing/src/ringscomponent.h @@ -34,20 +34,21 @@ #include #include #include -#include +#include #include +#include +#include #include #include +#include -namespace ghoul { class Dictionary; } -namespace ghoul::filesystem { class File; } namespace ghoul::opengl { class ProgramObject; } namespace openspace { - struct RenderData; - struct UpdateData; namespace documentation { struct Documentation; } +struct RenderData; +struct UpdateData; class RingsComponent : public properties::PropertyOwner, public Fadeable { public: diff --git a/modules/globebrowsing/src/shadowcomponent.cpp b/modules/globebrowsing/src/shadowcomponent.cpp index ae0e14e74f..9d22d7bc2e 100644 --- a/modules/globebrowsing/src/shadowcomponent.cpp +++ b/modules/globebrowsing/src/shadowcomponent.cpp @@ -25,31 +25,20 @@ #include #include -#include -#include #include -#include #include -#include -#include #include #include +#include #include -#include +#include #include -#include #include #include #include -#include -#include -#include -#include -#include -#include #include -#include -#include +#include +#include namespace { constexpr std::string_view _loggerCat = "ShadowComponent"; diff --git a/modules/globebrowsing/src/shadowcomponent.h b/modules/globebrowsing/src/shadowcomponent.h index 167761bf18..1300c7df19 100644 --- a/modules/globebrowsing/src/shadowcomponent.h +++ b/modules/globebrowsing/src/shadowcomponent.h @@ -28,28 +28,24 @@ #include #include -#include #include #include -#include #include -#include -#include #include -#include -#include -#include -#include +#include +#include -namespace ghoul { class Dictionary; } -namespace ghoul::filesystem { class File; } -namespace ghoul::opengl { class ProgramObject; } +namespace ghoul { + namespace filesystem { class File; } + namespace opengl { class ProgramObject; } + class Dictionary; +} // namespace ghoul namespace openspace { - struct RenderData; - struct UpdateData; namespace documentation { struct Documentation; } +struct RenderData; +struct UpdateData; class ShadowComponent : public properties::PropertyOwner { public: @@ -120,8 +116,6 @@ private: glm::dvec3 _cameraFocus = glm::dvec3(0.0); glm::dquat _cameraRotation = glm::dquat(1.0, 0.0, 0.0, 0.0); - std::stringstream _serializedCamera; - std::unique_ptr _lightCamera; // DEBUG diff --git a/modules/globebrowsing/src/skirtedgrid.cpp b/modules/globebrowsing/src/skirtedgrid.cpp index a5d32707c6..a49119e696 100644 --- a/modules/globebrowsing/src/skirtedgrid.cpp +++ b/modules/globebrowsing/src/skirtedgrid.cpp @@ -24,8 +24,11 @@ #include -#include #include +#include +#include +#include +#include namespace { size_t numElements(int xSegments, int ySegments) { diff --git a/modules/globebrowsing/src/skirtedgrid.h b/modules/globebrowsing/src/skirtedgrid.h index 022d14cbea..84eb8a9f0c 100644 --- a/modules/globebrowsing/src/skirtedgrid.h +++ b/modules/globebrowsing/src/skirtedgrid.h @@ -25,9 +25,7 @@ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___SKIRTEDGRID___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___SKIRTEDGRID___H__ -#include #include -#include namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/tileindex.cpp b/modules/globebrowsing/src/tileindex.cpp index 8b9e3c35d1..7890686889 100644 --- a/modules/globebrowsing/src/tileindex.cpp +++ b/modules/globebrowsing/src/tileindex.cpp @@ -24,6 +24,8 @@ #include +#include + namespace openspace::globebrowsing { bool operator==(const TileIndex& lhs, const TileIndex& rhs) { diff --git a/modules/globebrowsing/src/tileindex.h b/modules/globebrowsing/src/tileindex.h index 83469d76c2..3768de81b3 100644 --- a/modules/globebrowsing/src/tileindex.h +++ b/modules/globebrowsing/src/tileindex.h @@ -27,7 +27,7 @@ #include #include -#include +#include namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/tileloadjob.cpp b/modules/globebrowsing/src/tileloadjob.cpp index 15257ac386..ca077d3d75 100644 --- a/modules/globebrowsing/src/tileloadjob.cpp +++ b/modules/globebrowsing/src/tileloadjob.cpp @@ -25,6 +25,7 @@ #include #include +#include namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/tileloadjob.h b/modules/globebrowsing/src/tileloadjob.h index 326876e58d..5ff93fa58c 100644 --- a/modules/globebrowsing/src/tileloadjob.h +++ b/modules/globebrowsing/src/tileloadjob.h @@ -26,8 +26,8 @@ #define __OPENSPACE_MODULE_GLOBEBROWSING___TILELOADJOB___H__ #include - #include + #include namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/tileprovider/defaulttileprovider.cpp b/modules/globebrowsing/src/tileprovider/defaulttileprovider.cpp index b1d99ae53d..18c3cc9634 100644 --- a/modules/globebrowsing/src/tileprovider/defaulttileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/defaulttileprovider.cpp @@ -29,7 +29,16 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo FilePathInfo = { diff --git a/modules/globebrowsing/src/tileprovider/defaulttileprovider.h b/modules/globebrowsing/src/tileprovider/defaulttileprovider.h index de1b514fc8..f297355b25 100644 --- a/modules/globebrowsing/src/tileprovider/defaulttileprovider.h +++ b/modules/globebrowsing/src/tileprovider/defaulttileprovider.h @@ -26,9 +26,13 @@ #define __OPENSPACE_MODULE_GLOBEBROWSING___TILEPROVIDER__DEFAULTTILEPROVIDER___H__ #include -#include + #include -#include +#include +#include +#include +#include +#include namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/tileprovider/imagesequencetileprovider.cpp b/modules/globebrowsing/src/tileprovider/imagesequencetileprovider.cpp index e3128d3d77..cbee800bcb 100644 --- a/modules/globebrowsing/src/tileprovider/imagesequencetileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/imagesequencetileprovider.cpp @@ -24,8 +24,13 @@ #include +#include #include #include +#include +#include +#include +#include #include namespace { diff --git a/modules/globebrowsing/src/tileprovider/imagesequencetileprovider.h b/modules/globebrowsing/src/tileprovider/imagesequencetileprovider.h index ab26c8389a..89634287a8 100644 --- a/modules/globebrowsing/src/tileprovider/imagesequencetileprovider.h +++ b/modules/globebrowsing/src/tileprovider/imagesequencetileprovider.h @@ -28,6 +28,9 @@ #include #include +#include +#include +#include namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/tileprovider/singleimagetileprovider.cpp b/modules/globebrowsing/src/tileprovider/singleimagetileprovider.cpp index eb8c324d4f..e72e6f93cb 100644 --- a/modules/globebrowsing/src/tileprovider/singleimagetileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/singleimagetileprovider.cpp @@ -25,7 +25,14 @@ #include #include +#include #include +#include +#include +#include +#include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo FilePathInfo = { diff --git a/modules/globebrowsing/src/tileprovider/singleimagetileprovider.h b/modules/globebrowsing/src/tileprovider/singleimagetileprovider.h index eed769ac3a..ea48cb0e83 100644 --- a/modules/globebrowsing/src/tileprovider/singleimagetileprovider.h +++ b/modules/globebrowsing/src/tileprovider/singleimagetileprovider.h @@ -27,7 +27,8 @@ #include -namespace openspace { struct Documentation; } +#include +#include namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.cpp b/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.cpp index 2ebe0e231b..67a413705d 100644 --- a/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.cpp @@ -25,10 +25,16 @@ #include #include +#include +#include #include #include #include -#include +#include +#include +#include +#include +#include #include #include diff --git a/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.h b/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.h index 622301f8f7..02d6642df3 100644 --- a/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.h +++ b/modules/globebrowsing/src/tileprovider/sizereferencetileprovider.h @@ -27,6 +27,8 @@ #include +#include + namespace openspace::globebrowsing { class SizeReferenceTileProvider : public TextTileProvider { diff --git a/modules/globebrowsing/src/tileprovider/spoutimageprovider.cpp b/modules/globebrowsing/src/tileprovider/spoutimageprovider.cpp index f0080b81f6..626da0fc05 100644 --- a/modules/globebrowsing/src/tileprovider/spoutimageprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/spoutimageprovider.cpp @@ -24,7 +24,12 @@ #include +#include #include +#include +#include +#include +#include #ifdef OPENSPACE_HAS_SPOUT #ifndef WIN32_LEAN_AND_MEAN @@ -175,7 +180,7 @@ void SpoutImageProvider::internalDeinitialize() { Tile SpoutImageProvider::tile(const TileIndex& tileIndex) { ZoneScoped; - spoutUpdate = true; + _spoutUpdate = true; return tiles[tileIndex.x]; } @@ -189,7 +194,7 @@ TileDepthTransform SpoutImageProvider::depthTransform() { void SpoutImageProvider::update() { #ifdef OPENSPACE_HAS_SPOUT - if (!spoutUpdate) { + if (!_spoutUpdate) { return; } diff --git a/modules/globebrowsing/src/tileprovider/spoutimageprovider.h b/modules/globebrowsing/src/tileprovider/spoutimageprovider.h index 31b185c83f..5feeb42408 100644 --- a/modules/globebrowsing/src/tileprovider/spoutimageprovider.h +++ b/modules/globebrowsing/src/tileprovider/spoutimageprovider.h @@ -27,7 +27,13 @@ #include +#include +#include +#include + +#ifdef OPENSPACE_HAS_SPOUT namespace openspace::spout { class SpoutReceiverPropertyProxy; } +#endif // OPENSPACE_HAS_SPOUT namespace openspace::globebrowsing { @@ -57,7 +63,7 @@ private: std::unique_ptr spoutReceiver; #endif // OPENSPACE_HAS_SPOUT - bool spoutUpdate = false; + bool _spoutUpdate = false; }; } // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/src/tileprovider/temporaltileprovider.cpp b/modules/globebrowsing/src/tileprovider/temporaltileprovider.cpp index 29432982e5..344020049d 100644 --- a/modules/globebrowsing/src/tileprovider/temporaltileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/temporaltileprovider.cpp @@ -26,22 +26,35 @@ #include #include +#include #include +#include #include #include #include #include #include #include +#include #include #include +#include #include #include +#include +#include +#include +#include #include +#include #include +#include +#include +#include #include #include -#include +#include +#include #include namespace { diff --git a/modules/globebrowsing/src/tileprovider/temporaltileprovider.h b/modules/globebrowsing/src/tileprovider/temporaltileprovider.h index cdb064b6ab..4a9fda77e7 100644 --- a/modules/globebrowsing/src/tileprovider/temporaltileprovider.h +++ b/modules/globebrowsing/src/tileprovider/temporaltileprovider.h @@ -28,7 +28,20 @@ #include #include -#include +#include +#include +#include +#include +#include +#include +#include + +namespace ghoul::opengl { + class ProgramObject; + class Texture; +} // namespace ghoul::opengl + +namespace openspace { class Time; } namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/tileprovider/texttileprovider.cpp b/modules/globebrowsing/src/tileprovider/texttileprovider.cpp index ef94b8565a..4277af1d61 100644 --- a/modules/globebrowsing/src/tileprovider/texttileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/texttileprovider.cpp @@ -26,12 +26,18 @@ #include #include +#include +#include #include #include #include #include #include #include +#include +#include +#include +#include namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/tileprovider/texttileprovider.h b/modules/globebrowsing/src/tileprovider/texttileprovider.h index 0f2acbf2f8..ae9483502c 100644 --- a/modules/globebrowsing/src/tileprovider/texttileprovider.h +++ b/modules/globebrowsing/src/tileprovider/texttileprovider.h @@ -27,8 +27,18 @@ #include +#include +#include + +namespace ghoul::fontrendering { + class Font; + class FontRenderer; +} // namespace ghoul::fontrendering + namespace openspace::globebrowsing { +namespace cache { class MemoryAwareTileCache; } + class TextTileProvider : public TileProvider { public: explicit TextTileProvider(TileTextureInitData initData_, size_t fontSize_ = 48); diff --git a/modules/globebrowsing/src/tileprovider/tileindextileprovider.cpp b/modules/globebrowsing/src/tileprovider/tileindextileprovider.cpp index aa50fbfb04..527c961ef2 100644 --- a/modules/globebrowsing/src/tileprovider/tileindextileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/tileindextileprovider.cpp @@ -25,6 +25,13 @@ #include #include +#include +#include +#include +#include +#include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo UniqueBackgroundColors = { diff --git a/modules/globebrowsing/src/tileprovider/tileprovider.cpp b/modules/globebrowsing/src/tileprovider/tileprovider.cpp index 057ce06a29..1bc8794397 100644 --- a/modules/globebrowsing/src/tileprovider/tileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/tileprovider.cpp @@ -24,39 +24,12 @@ #include -#include #include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include -#include #include #include -#include -#include #include -#include -#include "cpl_minixml.h" namespace { std::unique_ptr DefaultTileTexture; diff --git a/modules/globebrowsing/src/tileprovider/tileprovider.h b/modules/globebrowsing/src/tileprovider/tileprovider.h index 08522ebc21..ab8f69fb15 100644 --- a/modules/globebrowsing/src/tileprovider/tileprovider.h +++ b/modules/globebrowsing/src/tileprovider/tileprovider.h @@ -28,34 +28,18 @@ #include #include -#include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +namespace ghoul { class Dictionary; } +namespace openspace { struct Documentation; } struct CPLXMLNode; -namespace ghoul::fontrendering { - class Font; - class FontRenderer; -} // namespace ghoul::fontrendering - -namespace openspace { class PixelBuffer; } - namespace openspace::globebrowsing { - class AsyncTileDataProvider; - struct RawTile; - struct TileIndex; - namespace cache { class MemoryAwareTileCache; } -} // namespace openspace::globebrowsing -namespace openspace::globebrowsing { +struct TileIndex; // If you add a new type, also add it to shaders/texturetilemapping.glsl enum class Type { @@ -131,14 +115,11 @@ struct TileProvider : public properties::PropertyOwner { */ virtual float noDataValueAsFloat() = 0; - virtual ChunkTile chunkTile(TileIndex tileIndex, int parents = 0, int maxParents = 1337); ChunkTilePile chunkTilePile(TileIndex tileIndex, int pileSize); - std::string name; - uint16_t uniqueIdentifier = 0; bool isInitialized = false; diff --git a/modules/globebrowsing/src/tileprovider/tileproviderbydate.cpp b/modules/globebrowsing/src/tileprovider/tileproviderbydate.cpp index e7d943f04a..05656d3457 100644 --- a/modules/globebrowsing/src/tileprovider/tileproviderbydate.cpp +++ b/modules/globebrowsing/src/tileprovider/tileproviderbydate.cpp @@ -28,7 +28,12 @@ #include #include #include -#include +#include +#include +#include +#include +#include +#include namespace { struct [[codegen::Dictionary(TileProviderByDate)]] Parameters { diff --git a/modules/globebrowsing/src/tileprovider/tileproviderbydate.h b/modules/globebrowsing/src/tileprovider/tileproviderbydate.h index 89c2f90a5c..17794f186d 100644 --- a/modules/globebrowsing/src/tileprovider/tileproviderbydate.h +++ b/modules/globebrowsing/src/tileprovider/tileproviderbydate.h @@ -27,8 +27,6 @@ #include -#include - namespace openspace::globebrowsing { class TileProviderByDate : public TileProvider { diff --git a/modules/globebrowsing/src/tileprovider/tileproviderbyindex.cpp b/modules/globebrowsing/src/tileprovider/tileproviderbyindex.cpp index e2cd4f918a..6be9b39213 100644 --- a/modules/globebrowsing/src/tileprovider/tileproviderbyindex.cpp +++ b/modules/globebrowsing/src/tileprovider/tileproviderbyindex.cpp @@ -25,6 +25,13 @@ #include #include +#include +#include +#include +#include +#include +#include +#include namespace { // This TileProvider provides the ability to override the contents for tiles at diff --git a/modules/globebrowsing/src/tileprovider/tileproviderbyindex.h b/modules/globebrowsing/src/tileprovider/tileproviderbyindex.h index 5519d41df8..69c4b929f1 100644 --- a/modules/globebrowsing/src/tileprovider/tileproviderbyindex.h +++ b/modules/globebrowsing/src/tileprovider/tileproviderbyindex.h @@ -27,6 +27,9 @@ #include +#include +#include + namespace openspace::globebrowsing { class TileProviderByIndex : public TileProvider { diff --git a/modules/globebrowsing/src/tileprovider/tileproviderbylevel.cpp b/modules/globebrowsing/src/tileprovider/tileproviderbylevel.cpp index df59938b58..9d4df09e52 100644 --- a/modules/globebrowsing/src/tileprovider/tileproviderbylevel.cpp +++ b/modules/globebrowsing/src/tileprovider/tileproviderbylevel.cpp @@ -24,7 +24,13 @@ #include +#include #include +#include +#include +#include +#include +#include namespace { // This tile provider will switch between different tile providers specified within diff --git a/modules/globebrowsing/src/tiletextureinitdata.cpp b/modules/globebrowsing/src/tiletextureinitdata.cpp index 68c69993b1..ed8485829f 100644 --- a/modules/globebrowsing/src/tiletextureinitdata.cpp +++ b/modules/globebrowsing/src/tiletextureinitdata.cpp @@ -24,77 +24,79 @@ #include +#include +#include + namespace { -size_t numberOfRasters(ghoul::opengl::Texture::Format format) { - switch (format) { - case ghoul::opengl::Texture::Format::Red: - return 1; - case ghoul::opengl::Texture::Format::RG: - return 2; - case ghoul::opengl::Texture::Format::RGB: - case ghoul::opengl::Texture::Format::BGR: - return 3; - case ghoul::opengl::Texture::Format::RGBA: - case ghoul::opengl::Texture::Format::BGRA: - return 4; - default: - throw ghoul::MissingCaseException(); + size_t numberOfRasters(ghoul::opengl::Texture::Format format) { + switch (format) { + case ghoul::opengl::Texture::Format::Red: + return 1; + case ghoul::opengl::Texture::Format::RG: + return 2; + case ghoul::opengl::Texture::Format::RGB: + case ghoul::opengl::Texture::Format::BGR: + return 3; + case ghoul::opengl::Texture::Format::RGBA: + case ghoul::opengl::Texture::Format::BGRA: + return 4; + default: + throw ghoul::MissingCaseException(); + } } -} -size_t numberOfBytes(GLenum glType) { - switch (glType) { - case GL_UNSIGNED_BYTE: return sizeof(GLubyte); - case GL_BYTE: return sizeof(GLbyte); - case GL_UNSIGNED_SHORT: return sizeof(GLushort); - case GL_SHORT: return sizeof(GLshort); - case GL_UNSIGNED_INT: return sizeof(GLuint); - case GL_INT: return sizeof(GLint); - case GL_HALF_FLOAT: return sizeof(GLhalf); - case GL_FLOAT: return sizeof(GLfloat); - case GL_DOUBLE: return sizeof(GLdouble); - default: - throw ghoul::MissingCaseException(); + size_t numberOfBytes(GLenum glType) { + switch (glType) { + case GL_UNSIGNED_BYTE: return sizeof(GLubyte); + case GL_BYTE: return sizeof(GLbyte); + case GL_UNSIGNED_SHORT: return sizeof(GLushort); + case GL_SHORT: return sizeof(GLshort); + case GL_UNSIGNED_INT: return sizeof(GLuint); + case GL_INT: return sizeof(GLint); + case GL_HALF_FLOAT: return sizeof(GLhalf); + case GL_FLOAT: return sizeof(GLfloat); + case GL_DOUBLE: return sizeof(GLdouble); + default: + throw ghoul::MissingCaseException(); + } } -} -unsigned int uniqueIdForTextureFormat(ghoul::opengl::Texture::Format textureFormat) { - switch (textureFormat) { - case ghoul::opengl::Texture::Format::Red: return 0; - case ghoul::opengl::Texture::Format::RG: return 1; - case ghoul::opengl::Texture::Format::RGB: return 2; - case ghoul::opengl::Texture::Format::BGR: return 3; - case ghoul::opengl::Texture::Format::RGBA: return 4; - case ghoul::opengl::Texture::Format::BGRA: return 5; - case ghoul::opengl::Texture::Format::DepthComponent: return 6; - default: throw ghoul::MissingCaseException(); + unsigned int uniqueIdForTextureFormat(ghoul::opengl::Texture::Format textureFormat) { + switch (textureFormat) { + case ghoul::opengl::Texture::Format::Red: return 0; + case ghoul::opengl::Texture::Format::RG: return 1; + case ghoul::opengl::Texture::Format::RGB: return 2; + case ghoul::opengl::Texture::Format::BGR: return 3; + case ghoul::opengl::Texture::Format::RGBA: return 4; + case ghoul::opengl::Texture::Format::BGRA: return 5; + case ghoul::opengl::Texture::Format::DepthComponent: return 6; + default: throw ghoul::MissingCaseException(); + } } -} -openspace::globebrowsing::TileTextureInitData::HashKey calculateHashKey( + openspace::globebrowsing::TileTextureInitData::HashKey calculateHashKey( const glm::ivec3& dimensions, const ghoul::opengl::Texture::Format& format, const GLenum& glType) -{ - ghoul_assert(dimensions.x > 0, "Incorrect dimension"); - ghoul_assert(dimensions.y > 0, "Incorrect dimension"); - ghoul_assert(dimensions.x <= 1024, "Incorrect dimension"); - ghoul_assert(dimensions.y <= 1024, "Incorrect dimension"); - ghoul_assert(dimensions.z == 1, "Incorrect dimension"); - const unsigned int formatId = uniqueIdForTextureFormat(format); - ghoul_assert(formatId < 256, "Incorrect format"); + { + ghoul_assert(dimensions.x > 0, "Incorrect dimension"); + ghoul_assert(dimensions.y > 0, "Incorrect dimension"); + ghoul_assert(dimensions.x <= 1024, "Incorrect dimension"); + ghoul_assert(dimensions.y <= 1024, "Incorrect dimension"); + ghoul_assert(dimensions.z == 1, "Incorrect dimension"); + const unsigned int formatId = uniqueIdForTextureFormat(format); + ghoul_assert(formatId < 256, "Incorrect format"); - openspace::globebrowsing::TileTextureInitData::HashKey res = 0ULL; + openspace::globebrowsing::TileTextureInitData::HashKey res = 0ULL; - res |= dimensions.x; - res |= dimensions.y << 10; - res |= static_cast>(glType) << (10 + 16); - res |= formatId << (10 + 16 + 4); - - return res; -} + res |= dimensions.x; + res |= dimensions.y << 10; + res |= static_cast>(glType) << (10 + 16); + res |= formatId << (10 + 16 + 4); + return res; + } } // namespace namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/tiletextureinitdata.h b/modules/globebrowsing/src/tiletextureinitdata.h index 6ce5aec05c..38321acc5d 100644 --- a/modules/globebrowsing/src/tiletextureinitdata.h +++ b/modules/globebrowsing/src/tiletextureinitdata.h @@ -30,6 +30,7 @@ #include #include #include +#include namespace openspace::globebrowsing { diff --git a/modules/globebrowsing/src/timequantizer.cpp b/modules/globebrowsing/src/timequantizer.cpp index 40a2a0f1bf..9e2d6806c1 100644 --- a/modules/globebrowsing/src/timequantizer.cpp +++ b/modules/globebrowsing/src/timequantizer.cpp @@ -34,8 +34,10 @@ #include #include #include -#include -#include +#include +#include +#include +#include // @TODO (abock, 2020-08-07) All of the time handling in this class should be cleaned up // a bit. There are lots of conversions between ISO strings for time and Time diff --git a/modules/globebrowsing/src/timequantizer.h b/modules/globebrowsing/src/timequantizer.h index 62f59f63d2..0dd1727309 100644 --- a/modules/globebrowsing/src/timequantizer.h +++ b/modules/globebrowsing/src/timequantizer.h @@ -25,8 +25,8 @@ #ifndef __OPENSPACE_MODULE_GLOBEBROWSING___TIMEQUANTIZER___H__ #define __OPENSPACE_MODULE_GLOBEBROWSING___TIMEQUANTIZER___H__ -#include #include +#include #include namespace openspace { class Time; } diff --git a/modules/imgui/imguimodule.cpp b/modules/imgui/imguimodule.cpp index 1ee6d88ad1..01cf5bea36 100644 --- a/modules/imgui/imguimodule.cpp +++ b/modules/imgui/imguimodule.cpp @@ -37,9 +37,24 @@ #include #include #include +#include #include #include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include // #define SHOW_IMGUI_HELPERS diff --git a/modules/imgui/imguimodule.h b/modules/imgui/imguimodule.h index 338201994f..033095a233 100644 --- a/modules/imgui/imguimodule.h +++ b/modules/imgui/imguimodule.h @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -49,6 +50,8 @@ #include #include #include +#include +#include struct ImGuiContext; diff --git a/modules/imgui/include/guicomponent.h b/modules/imgui/include/guicomponent.h index e4511d836a..ce25e65af3 100644 --- a/modules/imgui/include/guicomponent.h +++ b/modules/imgui/include/guicomponent.h @@ -26,6 +26,7 @@ #define __OPENSPACE_MODULE_IMGUI___GUICOMPONENT___H__ #include + #include namespace openspace::gui { diff --git a/modules/imgui/include/guigibscomponent.h b/modules/imgui/include/guigibscomponent.h index e3a55b4649..4d7d3d4d6a 100644 --- a/modules/imgui/include/guigibscomponent.h +++ b/modules/imgui/include/guigibscomponent.h @@ -27,8 +27,6 @@ #include -#include - namespace openspace::gui { class GuiGIBSComponent : public GuiComponent { diff --git a/modules/imgui/include/guiglobebrowsingcomponent.h b/modules/imgui/include/guiglobebrowsingcomponent.h index eb609dcbf2..9eb0687c37 100644 --- a/modules/imgui/include/guiglobebrowsingcomponent.h +++ b/modules/imgui/include/guiglobebrowsingcomponent.h @@ -27,8 +27,6 @@ #include -#include - namespace openspace::gui { class GuiGlobeBrowsingComponent : public GuiPropertyComponent { diff --git a/modules/imgui/include/guipropertycomponent.h b/modules/imgui/include/guipropertycomponent.h index 3783fd053a..c6df30088d 100644 --- a/modules/imgui/include/guipropertycomponent.h +++ b/modules/imgui/include/guipropertycomponent.h @@ -27,12 +27,9 @@ #include -#include #include #include #include -#include -#include namespace openspace::properties { class Property; diff --git a/modules/imgui/include/guiscenecomponent.h b/modules/imgui/include/guiscenecomponent.h index 7318a0b105..d4232ca226 100644 --- a/modules/imgui/include/guiscenecomponent.h +++ b/modules/imgui/include/guiscenecomponent.h @@ -27,8 +27,6 @@ #include -namespace openspace { class SceneGraphNode; } - namespace openspace::gui { class GuiSceneComponent : public GuiComponent { diff --git a/modules/imgui/include/guispacetimecomponent.h b/modules/imgui/include/guispacetimecomponent.h index e194c5174b..862ece3a3f 100644 --- a/modules/imgui/include/guispacetimecomponent.h +++ b/modules/imgui/include/guispacetimecomponent.h @@ -26,6 +26,7 @@ #define __OPENSPACE_MODULE_IMGUI___GUISPACETIMECOMPONENT___H__ #include + #include namespace openspace::gui { diff --git a/modules/imgui/include/renderproperties.h b/modules/imgui/include/renderproperties.h index e717dc9724..0b6dd5447e 100644 --- a/modules/imgui/include/renderproperties.h +++ b/modules/imgui/include/renderproperties.h @@ -26,85 +26,82 @@ #define __OPENSPACE_MODULE_IMGUI___RENDERPROPERTIES___H__ #include - #include -namespace openspace::properties { class Property; } - namespace openspace { +namespace properties { class Property; } + BooleanType(ShowToolTip); -void executeSetPropertyScript(const std::string& id, const std::string& value); - void renderBoolProperty(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderOptionProperty(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderSelectionProperty(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderStringProperty(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderIntListProperty(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderDoubleListProperty(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderStringListProperty(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderDoubleProperty(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderIntProperty(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderIVec2Property(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderIVec3Property(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderIVec4Property(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderFloatProperty(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderVec2Property(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderVec3Property(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderVec4Property(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderDVec2Property(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderDVec3Property(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderDVec4Property(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderDMat2Property(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderDMat3Property(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderDMat4Property(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); void renderTriggerProperty(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip = ShowToolTip::Yes, double tooltipDelay = 1.0); + ShowToolTip showTooltip = ShowToolTip::Yes, float tooltipDelay = 1.f); } // namespace openspace diff --git a/modules/imgui/src/guiactioncomponent.cpp b/modules/imgui/src/guiactioncomponent.cpp index 80b5307bab..46549f2b6b 100644 --- a/modules/imgui/src/guiactioncomponent.cpp +++ b/modules/imgui/src/guiactioncomponent.cpp @@ -27,10 +27,14 @@ #include #include #include +#include #include #include #include +#include +#include #include +#include namespace openspace::gui { diff --git a/modules/imgui/src/guicomponent.cpp b/modules/imgui/src/guicomponent.cpp index 2daeac8a5f..23201b9ee2 100644 --- a/modules/imgui/src/guicomponent.cpp +++ b/modules/imgui/src/guicomponent.cpp @@ -24,6 +24,8 @@ #include +#include + namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { "Enabled", diff --git a/modules/imgui/src/guigibscomponent.cpp b/modules/imgui/src/guigibscomponent.cpp index 0f2ff65a05..1ea06f26c2 100644 --- a/modules/imgui/src/guigibscomponent.cpp +++ b/modules/imgui/src/guigibscomponent.cpp @@ -27,7 +27,9 @@ #include #include #include +#include #include +#include namespace { const ImVec2 WindowSize = ImVec2(350, 500); diff --git a/modules/imgui/src/guiglobebrowsingcomponent.cpp b/modules/imgui/src/guiglobebrowsingcomponent.cpp index 5ef2dc2072..fe22014708 100644 --- a/modules/imgui/src/guiglobebrowsingcomponent.cpp +++ b/modules/imgui/src/guiglobebrowsingcomponent.cpp @@ -33,9 +33,20 @@ #include #include #include +#include #include #include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace { const ImVec2 WindowSize = ImVec2(350, 500); diff --git a/modules/imgui/src/guimemorycomponent.cpp b/modules/imgui/src/guimemorycomponent.cpp index 9cba11e5a7..17feca9224 100644 --- a/modules/imgui/src/guimemorycomponent.cpp +++ b/modules/imgui/src/guimemorycomponent.cpp @@ -28,6 +28,7 @@ #include #include #include +#include namespace { const ImVec2 Size = ImVec2(350, 500); diff --git a/modules/imgui/src/guimissioncomponent.cpp b/modules/imgui/src/guimissioncomponent.cpp index 9bb9ba7373..82abcfd4cf 100644 --- a/modules/imgui/src/guimissioncomponent.cpp +++ b/modules/imgui/src/guimissioncomponent.cpp @@ -29,7 +29,9 @@ #include #include #include +#include #include +#include namespace { const ImVec2 Size = ImVec2(350, 500); diff --git a/modules/imgui/src/guiparallelcomponent.cpp b/modules/imgui/src/guiparallelcomponent.cpp index 6588e85827..f68cbc2f9e 100644 --- a/modules/imgui/src/guiparallelcomponent.cpp +++ b/modules/imgui/src/guiparallelcomponent.cpp @@ -28,12 +28,10 @@ #include #include #include +#include #include -#include #include #include -#include -#include namespace { void renderHost() { diff --git a/modules/imgui/src/guipropertycomponent.cpp b/modules/imgui/src/guipropertycomponent.cpp index 130d04ffe3..73a63adc84 100644 --- a/modules/imgui/src/guipropertycomponent.cpp +++ b/modules/imgui/src/guipropertycomponent.cpp @@ -29,8 +29,12 @@ #include #include #include +#include #include #include +#include +#include +#include //#define Debugging_ImGui_TreeNode_Indices diff --git a/modules/imgui/src/guiscenecomponent.cpp b/modules/imgui/src/guiscenecomponent.cpp index 4c9d6068d6..fbbee82137 100644 --- a/modules/imgui/src/guiscenecomponent.cpp +++ b/modules/imgui/src/guiscenecomponent.cpp @@ -31,9 +31,9 @@ #include #include #include +#include #include -#include -#include +#include namespace { const ImVec2 Size = ImVec2(350, 500); diff --git a/modules/imgui/src/guispacetimecomponent.cpp b/modules/imgui/src/guispacetimecomponent.cpp index 60300e5dab..6c1907515d 100644 --- a/modules/imgui/src/guispacetimecomponent.cpp +++ b/modules/imgui/src/guispacetimecomponent.cpp @@ -32,9 +32,18 @@ #include #include #include +#include #include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace { const ImVec2 Size = ImVec2(350, 500); diff --git a/modules/imgui/src/renderproperties.cpp b/modules/imgui/src/renderproperties.cpp index edc0317262..41e3f44b5a 100644 --- a/modules/imgui/src/renderproperties.cpp +++ b/modules/imgui/src/renderproperties.cpp @@ -35,9 +35,11 @@ #include #include #include +#include #include #include #include +#include #include #include #include @@ -48,35 +50,46 @@ #include #include #include -#include -#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace { + void renderTooltip(openspace::properties::Property* prop, float delay) { + if (ImGui::IsItemHovered() && (GImGui->HoveredIdTimer > delay)) { + ImGui::BeginTooltip(); + if (!prop->description().empty()) { + ImGui::TextWrapped("%s", prop->description().c_str()); + ImGui::Spacing(); + } + std::string t = std::format("Identifier: {}", prop->uri()); + ImGui::Text("%s", t.c_str()); + ImGui::EndTooltip(); + } + } + + void executeSetPropertyScript(std::string_view id, const std::string& value) { + openspace::global::scriptEngine->queueScript( + std::format("openspace.setPropertyValueSingle('{}', {});", id, value) + ); + } +} // namespace namespace openspace { using namespace properties; -void renderTooltip(Property* prop, double delay) { - if (ImGui::IsItemHovered() && (GImGui->HoveredIdTimer > delay)) { - ImGui::BeginTooltip(); - if (!prop->description().empty()) { - ImGui::TextWrapped("%s", prop->description().c_str()); - ImGui::Spacing(); - } - std::string t = std::format("Identifier: {}", prop->uri()); - ImGui::Text("%s", t.c_str()); - ImGui::EndTooltip(); - } -} - -void executeSetPropertyScript(std::string_view id, const std::string& value) { - global::scriptEngine->queueScript( - std::format("openspace.setPropertyValueSingle('{}', {});", id, value) - ); -} - void renderBoolProperty(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); @@ -97,7 +110,7 @@ void renderBoolProperty(Property* prop, const std::string& ownerName, } void renderOptionProperty(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); @@ -142,7 +155,7 @@ void renderOptionProperty(Property* prop, const std::string& ownerName, } void renderSelectionProperty(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); SelectionProperty* p = static_cast(prop); @@ -186,7 +199,7 @@ void renderSelectionProperty(Property* prop, const std::string& ownerName, } void renderStringProperty(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); StringProperty* p = static_cast(prop); @@ -248,7 +261,7 @@ void renderListProperty(const std::string& name, std::string_view fullIdentifier } void renderDoubleListProperty(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); DoubleListProperty* p = static_cast(prop); @@ -266,7 +279,7 @@ void renderDoubleListProperty(Property* prop, const std::string& ownerName, } void renderIntListProperty(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); IntListProperty* p = static_cast(prop); @@ -284,7 +297,7 @@ void renderIntListProperty(Property* prop, const std::string& ownerName, } void renderStringListProperty(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); StringListProperty* p = static_cast(prop); @@ -302,7 +315,7 @@ void renderStringListProperty(Property* prop, const std::string& ownerName, } void renderDoubleProperty(properties::Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); DoubleProperty* p = static_cast(prop); @@ -338,7 +351,7 @@ void renderDoubleProperty(properties::Property* prop, const std::string& ownerNa } void renderIntProperty(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); IntProperty* p = static_cast(prop); @@ -362,7 +375,7 @@ void renderIntProperty(Property* prop, const std::string& ownerName, } void renderIVec2Property(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); IVec2Property* p = static_cast(prop); @@ -391,7 +404,7 @@ void renderIVec2Property(Property* prop, const std::string& ownerName, } void renderIVec3Property(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); IVec3Property* p = static_cast(prop); @@ -419,7 +432,7 @@ void renderIVec3Property(Property* prop, const std::string& ownerName, } void renderIVec4Property(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); IVec4Property* p = static_cast(prop); @@ -447,7 +460,7 @@ void renderIVec4Property(Property* prop, const std::string& ownerName, } void renderFloatProperty(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); FloatProperty* p = static_cast(prop); @@ -477,7 +490,7 @@ void renderFloatProperty(Property* prop, const std::string& ownerName, } void renderVec2Property(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); Vec2Property* p = static_cast(prop); @@ -513,7 +526,7 @@ void renderVec2Property(Property* prop, const std::string& ownerName, } void renderVec3Property(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); Vec3Property* p = static_cast(prop); @@ -555,7 +568,7 @@ void renderVec3Property(Property* prop, const std::string& ownerName, } void renderVec4Property(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); Vec4Property* p = static_cast(prop); @@ -597,7 +610,7 @@ void renderVec4Property(Property* prop, const std::string& ownerName, } void renderDVec2Property(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); DVec2Property* p = static_cast(prop); @@ -633,7 +646,7 @@ void renderDVec2Property(Property* prop, const std::string& ownerName, } void renderDVec3Property(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); DVec3Property* p = static_cast(prop); @@ -669,7 +682,7 @@ void renderDVec3Property(Property* prop, const std::string& ownerName, } void renderDVec4Property(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); DVec4Property* p = static_cast(prop); @@ -705,7 +718,7 @@ void renderDVec4Property(Property* prop, const std::string& ownerName, } void renderDMat2Property(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); DMat2Property* p = static_cast(prop); @@ -763,7 +776,7 @@ void renderDMat2Property(Property* prop, const std::string& ownerName, } void renderDMat3Property(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); DMat3Property* p = static_cast(prop); @@ -831,7 +844,7 @@ void renderDMat3Property(Property* prop, const std::string& ownerName, } void renderDMat4Property(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); DMat4Property* p = static_cast(prop); @@ -909,7 +922,7 @@ void renderDMat4Property(Property* prop, const std::string& ownerName, } void renderTriggerProperty(Property* prop, const std::string& ownerName, - ShowToolTip showTooltip, double tooltipDelay) + ShowToolTip showTooltip, float tooltipDelay) { ghoul_assert(prop, "prop must not be nullptr"); const std::string& name = prop->guiName(); diff --git a/modules/iswa/iswamodule.cpp b/modules/iswa/iswamodule.cpp index 7c62ab78ff..6e9b114580 100644 --- a/modules/iswa/iswamodule.cpp +++ b/modules/iswa/iswamodule.cpp @@ -32,12 +32,12 @@ #include #include #include -#include #include #include #include #include #include +#include #include #include diff --git a/modules/iswa/iswamodule.h b/modules/iswa/iswamodule.h index b99e35fef4..ca6d2c335c 100644 --- a/modules/iswa/iswamodule.h +++ b/modules/iswa/iswamodule.h @@ -22,12 +22,12 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ - #ifndef __OPENSPACE_MODULE_ISWA___ISWAMODULE___H__ - #define __OPENSPACE_MODULE_ISWA___ISWAMODULE___H__ +#ifndef __OPENSPACE_MODULE_ISWA___ISWAMODULE___H__ +#define __OPENSPACE_MODULE_ISWA___ISWAMODULE___H__ - #include +#include - namespace openspace { +namespace openspace { class IswaModule : public OpenSpaceModule { public: diff --git a/modules/iswa/rendering/iswabasegroup.cpp b/modules/iswa/rendering/iswabasegroup.cpp index c3edc9ddde..5a6a94bd1b 100644 --- a/modules/iswa/rendering/iswabasegroup.cpp +++ b/modules/iswa/rendering/iswabasegroup.cpp @@ -24,12 +24,12 @@ #include -#include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "IswaBaseGroup"; - using json = nlohmann::json; constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { "Enabled", diff --git a/modules/iswa/rendering/iswabasegroup.h b/modules/iswa/rendering/iswabasegroup.h index da9f5e5cd7..d3e1c2f6e1 100644 --- a/modules/iswa/rendering/iswabasegroup.h +++ b/modules/iswa/rendering/iswabasegroup.h @@ -31,16 +31,19 @@ #include #include #include +#include + +namespace ghoul { class Dictionary; } namespace openspace { class DataProcessor; -class IswaCygnet; class IswaBaseGroup : public properties::PropertyOwner { public: IswaBaseGroup(std::string name, std::string type); ~IswaBaseGroup(); + bool isType(const std::string& type) const; void updateGroup(); @@ -61,6 +64,7 @@ protected: std::shared_ptr _dataProcessor; bool _registered = false; + private: std::string _iswaType; }; diff --git a/modules/iswa/rendering/iswadatagroup.cpp b/modules/iswa/rendering/iswadatagroup.cpp index 02da3afb02..65736093a4 100644 --- a/modules/iswa/rendering/iswadatagroup.cpp +++ b/modules/iswa/rendering/iswadatagroup.cpp @@ -31,12 +31,11 @@ #include #include #include -#include #include +#include namespace { constexpr std::string_view _loggerCat = "IswaDataGroup"; - using json = nlohmann::json; constexpr openspace::properties::Property::PropertyInfo UseLogInfo = { "UseLog", diff --git a/modules/iswa/rendering/iswadatagroup.h b/modules/iswa/rendering/iswadatagroup.h index b38c2d8502..357060b442 100644 --- a/modules/iswa/rendering/iswadatagroup.h +++ b/modules/iswa/rendering/iswadatagroup.h @@ -29,7 +29,9 @@ #include #include +#include #include +#include namespace openspace { diff --git a/modules/iswa/rendering/iswakameleongroup.cpp b/modules/iswa/rendering/iswakameleongroup.cpp index 2651117299..9940835a1d 100644 --- a/modules/iswa/rendering/iswakameleongroup.cpp +++ b/modules/iswa/rendering/iswakameleongroup.cpp @@ -28,13 +28,17 @@ #include #include #include +#include #include +#include #include +#include +#include #include +#include namespace { constexpr std::string_view _loggerCat = "IswaDataGroup"; - using json = nlohmann::json; constexpr openspace::properties::Property::PropertyInfo ResolutionInfo = { "Resolution", @@ -117,10 +121,13 @@ void IswaKameleonGroup::readFieldlinePaths(const std::filesystem::path& indexFil try { //Parse and add each fieldline as an selection - json fieldlines = json::parse(fileContent); + nlohmann::json fieldlines = nlohmann::json::parse(fileContent); int i = 0; - for (json::iterator it = fieldlines.begin(); it != fieldlines.end(); it++) { + for (nlohmann::json::iterator it = fieldlines.begin(); + it != fieldlines.end(); + it++) + { _fieldlines.addOption(it.key()); _fieldlineState[i] = std::make_tuple( identifier() + "/" + it.key(), @@ -130,7 +137,8 @@ void IswaKameleonGroup::readFieldlinePaths(const std::filesystem::path& indexFil i++; } - } catch (const std::exception& e) { + } + catch (const std::exception& e) { LERROR( "Error when reading json file with paths to seedpoints: " + std::string(e.what()) diff --git a/modules/iswa/rendering/iswakameleongroup.h b/modules/iswa/rendering/iswakameleongroup.h index b23f2b5451..4ed891de2e 100644 --- a/modules/iswa/rendering/iswakameleongroup.h +++ b/modules/iswa/rendering/iswakameleongroup.h @@ -27,6 +27,11 @@ #include +#include +#include +#include +#include + namespace openspace { class IswaKameleonGroup : public IswaDataGroup { diff --git a/modules/iswa/rendering/renderabledatacygnet.cpp b/modules/iswa/rendering/renderabledatacygnet.cpp index 4dfa83ba21..0e4983ff35 100644 --- a/modules/iswa/rendering/renderabledatacygnet.cpp +++ b/modules/iswa/rendering/renderabledatacygnet.cpp @@ -28,14 +28,22 @@ #include #include #include +#include #include +#include #include #include +#include +#include #include #include #include #include +#include #include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "DataCygnet"; diff --git a/modules/iswa/rendering/renderabledatacygnet.h b/modules/iswa/rendering/renderabledatacygnet.h index 1214625676..25ba8434d9 100644 --- a/modules/iswa/rendering/renderabledatacygnet.h +++ b/modules/iswa/rendering/renderabledatacygnet.h @@ -29,13 +29,13 @@ #include #include +#include #include #include namespace openspace { class DataProcessor; -namespace documentation { struct Documentation; } /** * This class abstracts away the the loading of data and creation of textures for all data diff --git a/modules/iswa/rendering/renderabledataplane.h b/modules/iswa/rendering/renderabledataplane.h index 5bb94df7a8..4cac4d0aa7 100644 --- a/modules/iswa/rendering/renderabledataplane.h +++ b/modules/iswa/rendering/renderabledataplane.h @@ -31,8 +31,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - /** * DataPlane is a concrete IswaCygnet with data files as its input source. The class * handles creation, destruction and rendering of a plane geometry. It also specifies what @@ -50,9 +48,6 @@ public: static documentation::Documentation Documentation(); private: - /** - * Creates a plane geometry. - */ bool createGeometry() override; bool destroyGeometry() override; void renderGeometry() const override; diff --git a/modules/iswa/rendering/renderabledatasphere.cpp b/modules/iswa/rendering/renderabledatasphere.cpp index 615ff5aa8c..e2a14e64da 100644 --- a/modules/iswa/rendering/renderabledatasphere.cpp +++ b/modules/iswa/rendering/renderabledatasphere.cpp @@ -31,8 +31,10 @@ #include #include #include -#include #include +#include +#include +#include namespace { struct [[codegen::Dictionary(RenderableDataSphere)]] Parameters { diff --git a/modules/iswa/rendering/renderabledatasphere.h b/modules/iswa/rendering/renderabledatasphere.h index d4b7f2fcdb..fb622898f4 100644 --- a/modules/iswa/rendering/renderabledatasphere.h +++ b/modules/iswa/rendering/renderabledatasphere.h @@ -30,7 +30,6 @@ namespace openspace { class Sphere; -namespace documentation { struct Documentation; } /** * DataSphere is a concrete IswaCygnet with data files as its input source. The class @@ -48,9 +47,6 @@ public: static documentation::Documentation Documentation(); protected: - /** - * Creates a sphere geometry. - */ bool createGeometry() override; bool destroyGeometry() override; void renderGeometry() const override; diff --git a/modules/iswa/rendering/renderableiswacygnet.cpp b/modules/iswa/rendering/renderableiswacygnet.cpp index d71eac0b57..9f7a08050e 100644 --- a/modules/iswa/rendering/renderableiswacygnet.cpp +++ b/modules/iswa/rendering/renderableiswacygnet.cpp @@ -29,16 +29,20 @@ #include #include #include +#include #include #include #include #include #include #include -#include +#include #include #include -#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "IswaCygnet"; diff --git a/modules/iswa/rendering/renderableiswacygnet.h b/modules/iswa/rendering/renderableiswacygnet.h index 86a006ce00..f82f58cc44 100644 --- a/modules/iswa/rendering/renderableiswacygnet.h +++ b/modules/iswa/rendering/renderableiswacygnet.h @@ -29,19 +29,18 @@ #include #include -#include +#include #include +#include #include #include -#include +#include namespace openspace { class IswaBaseGroup; class TransferFunction; -namespace documentation { struct Documentation; } - class RenderableIswaCygnet : public Renderable { public: explicit RenderableIswaCygnet(const ghoul::Dictionary& dictionary); diff --git a/modules/iswa/rendering/renderablekameleonplane.cpp b/modules/iswa/rendering/renderablekameleonplane.cpp index fc2caeaa12..4072e62c2a 100644 --- a/modules/iswa/rendering/renderablekameleonplane.cpp +++ b/modules/iswa/rendering/renderablekameleonplane.cpp @@ -33,15 +33,23 @@ #include #include #include +#include #include +#include #include +#include #include +#include #include #include +#include +#include +#include #include +#include +#include namespace { - using json = nlohmann::json; constexpr std::string_view _loggerCat = "KameleonPlane"; constexpr openspace::properties::Property::PropertyInfo FieldLineSeedsInfo = { @@ -357,11 +365,14 @@ void RenderableKameleonPlane::readFieldlinePaths(const std::filesystem::path& in else { try { //Parse and add each fieldline as an selection - json fieldlines = json::parse(seedFile); + nlohmann::json fieldlines = nlohmann::json::parse(seedFile); int i = 0; const std::string& fullName = identifier(); std::string partName = fullName.substr(0,fullName.find_last_of("-")); - for (json::iterator it = fieldlines.begin(); it != fieldlines.end(); it++) { + for (nlohmann::json::iterator it = fieldlines.begin(); + it != fieldlines.end(); + it++) + { _fieldlines.addOption(it.key()); _fieldlineState[i] = std::make_tuple( partName + "/" + it.key(), diff --git a/modules/iswa/rendering/renderablekameleonplane.h b/modules/iswa/rendering/renderablekameleonplane.h index 6b51f7c8f8..6ee72bc68b 100644 --- a/modules/iswa/rendering/renderablekameleonplane.h +++ b/modules/iswa/rendering/renderablekameleonplane.h @@ -28,7 +28,10 @@ #include #include +#include #include +#include +#include namespace openspace { @@ -50,9 +53,6 @@ public: static documentation::Documentation Documentation(); private: - /** - * Creates a plane geometry. - */ bool createGeometry() override; bool destroyGeometry() override; bool updateTextureResource() override; @@ -78,7 +78,6 @@ private: void subscribeToGroup(); void changeKwPath(std::string path); - static int id(); properties::SelectionProperty _fieldlines; properties::FloatProperty _resolution; diff --git a/modules/iswa/rendering/renderabletexturecygnet.cpp b/modules/iswa/rendering/renderabletexturecygnet.cpp index 818f23727f..97d9b40af4 100644 --- a/modules/iswa/rendering/renderabletexturecygnet.cpp +++ b/modules/iswa/rendering/renderabletexturecygnet.cpp @@ -26,9 +26,14 @@ #include #include +#include #include #include #include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "TextureCygnet"; diff --git a/modules/iswa/rendering/renderabletexturecygnet.h b/modules/iswa/rendering/renderabletexturecygnet.h index ba53897829..3d5df7245c 100644 --- a/modules/iswa/rendering/renderabletexturecygnet.h +++ b/modules/iswa/rendering/renderabletexturecygnet.h @@ -27,9 +27,9 @@ #include -namespace openspace { +#include -namespace documentation { struct Documentation; } +namespace openspace { /** * This class exist to abstract away the loading of images from iSWA and updating of the diff --git a/modules/iswa/rendering/renderabletextureplane.cpp b/modules/iswa/rendering/renderabletextureplane.cpp index bb110acccc..672589f314 100644 --- a/modules/iswa/rendering/renderabletextureplane.cpp +++ b/modules/iswa/rendering/renderabletextureplane.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include #include #include diff --git a/modules/iswa/rendering/renderabletextureplane.h b/modules/iswa/rendering/renderabletextureplane.h index c56f061137..c20d8e1fff 100644 --- a/modules/iswa/rendering/renderabletextureplane.h +++ b/modules/iswa/rendering/renderabletextureplane.h @@ -31,8 +31,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - /** * TexturePlane is a "concrete" IswaCygnet with texture as its input source. It handles * the creation, destruction and rendering of a plane geometry. It also specifies which diff --git a/modules/iswa/rendering/screenspacecygnet.cpp b/modules/iswa/rendering/screenspacecygnet.cpp index 2a12dfca1b..6fc581a931 100644 --- a/modules/iswa/rendering/screenspacecygnet.cpp +++ b/modules/iswa/rendering/screenspacecygnet.cpp @@ -25,9 +25,13 @@ #include #include +#include #include #include #include +#include +#include +#include namespace { struct [[codegen::Dictionary(ScreenSpaceCygnet)]] Parameters { diff --git a/modules/iswa/rendering/screenspacecygnet.h b/modules/iswa/rendering/screenspacecygnet.h index 72b7bc0e14..cc64bcdcbc 100644 --- a/modules/iswa/rendering/screenspacecygnet.h +++ b/modules/iswa/rendering/screenspacecygnet.h @@ -27,13 +27,10 @@ #include -#include #include namespace openspace { -namespace documentation { struct Documentation; } - class ScreenSpaceCygnet : public ScreenSpaceImageOnline { public: explicit ScreenSpaceCygnet(const ghoul::Dictionary& dictionary); diff --git a/modules/iswa/util/dataprocessor.cpp b/modules/iswa/util/dataprocessor.cpp index 580eaba557..501d836047 100644 --- a/modules/iswa/util/dataprocessor.cpp +++ b/modules/iswa/util/dataprocessor.cpp @@ -26,8 +26,10 @@ #include #include -#include #include +#include +#include +#include namespace openspace { diff --git a/modules/iswa/util/dataprocessor.h b/modules/iswa/util/dataprocessor.h index 3fc5942621..d0cc76bac4 100644 --- a/modules/iswa/util/dataprocessor.h +++ b/modules/iswa/util/dataprocessor.h @@ -25,6 +25,7 @@ #ifndef __OPENSPACE_MODULE_ISWA___DATAPROCESSOR___H__ #define __OPENSPACE_MODULE_ISWA___DATAPROCESSOR___H__ +#include #include #include #include @@ -36,8 +37,6 @@ namespace openspace { namespace properties { class SelectionProperty; } -class Histogram; - class DataProcessor { public: DataProcessor() = default; diff --git a/modules/iswa/util/dataprocessorjson.cpp b/modules/iswa/util/dataprocessorjson.cpp index 27892dfe21..8a89ce1467 100644 --- a/modules/iswa/util/dataprocessorjson.cpp +++ b/modules/iswa/util/dataprocessorjson.cpp @@ -26,9 +26,10 @@ #include #include -#include - -using json = nlohmann::json; +#include +#include +#include +#include namespace openspace { @@ -41,14 +42,17 @@ std::vector DataProcessorJson::readMetadata(const std::string& data { std::vector options = std::vector(); if (!data.empty()) { - const json& j = json::parse(data); - json variables = j["variables"]; + const nlohmann::json& j = nlohmann::json::parse(data); + nlohmann::json variables = j["variables"]; - for (json::iterator it = variables.begin(); it != variables.end(); it++) { + for (nlohmann::json::iterator it = variables.begin(); + it != variables.end(); + it++) + { std::string option = it.key(); if (option == "ep") { - const json& row = it.value(); - const json& col = row.at(0); + const nlohmann::json& row = it.value(); + const nlohmann::json& col = row.at(0); dimensions = glm::size3_t(col.size(), row.size(), 1); } @@ -68,19 +72,19 @@ void DataProcessorJson::addDataValues(const std::string& data, initializeVectors(numOptions); if (!data.empty()) { - const json& j = json::parse(data); - json variables = j["variables"]; + const nlohmann::json& j = nlohmann::json::parse(data); + nlohmann::json variables = j["variables"]; std::vector sum(numOptions, 0.f); std::vector> optionValues(numOptions, std::vector()); const std::vector& options = dataOptions.options(); for (int i = 0; i < numOptions; i++) { - const json& row = variables[options[i]]; + const nlohmann::json& row = variables[options[i]]; // int rowsize = row.size(); for (size_t y = 0; y < row.size(); y++) { - const json& col = row.at(y); + const nlohmann::json& col = row.at(y); const int colsize = static_cast(col.size()); for (int x = 0; x < colsize; x++) { @@ -104,8 +108,8 @@ std::vector DataProcessorJson::processData(const std::string& data, if (data.empty()) { return std::vector(); } - const json& j = json::parse(data); - json variables = j["variables"]; + const nlohmann::json& j = nlohmann::json::parse(data); + nlohmann::json variables = j["variables"]; const std::set& selectedOptions = optionProp; const std::vector& options = optionProp.options(); @@ -123,11 +127,11 @@ std::vector DataProcessorJson::processData(const std::string& data, // other mechanism (std::vector most likely) dataOptions[option] = new float[dimensions.x * dimensions.y] { 0.f }; - json row = variables[options[option]]; + nlohmann::json row = variables[options[option]]; const int rowsize = static_cast(row.size()); for (int y = 0; y < rowsize; y++) { - json col = row.at(y); + nlohmann::json col = row.at(y); const int colsize = static_cast(col.size()); for (int x = 0; x < colsize; x++) { diff --git a/modules/iswa/util/dataprocessorjson.h b/modules/iswa/util/dataprocessorjson.h index 1adc708c32..10f84c45b6 100644 --- a/modules/iswa/util/dataprocessorjson.h +++ b/modules/iswa/util/dataprocessorjson.h @@ -29,6 +29,8 @@ namespace openspace { +namespace properties { class SelectionProperty; } + class DataProcessorJson : public DataProcessor { public: DataProcessorJson(); diff --git a/modules/iswa/util/dataprocessorkameleon.cpp b/modules/iswa/util/dataprocessorkameleon.cpp index 2bdba7c69b..093d17d297 100644 --- a/modules/iswa/util/dataprocessorkameleon.cpp +++ b/modules/iswa/util/dataprocessorkameleon.cpp @@ -26,12 +26,14 @@ #include #include -#include -#include -#include #include +#include +#include #include #include +#include +#include +#include namespace openspace { diff --git a/modules/iswa/util/dataprocessorkameleon.h b/modules/iswa/util/dataprocessorkameleon.h index 366caeff39..32f4c75624 100644 --- a/modules/iswa/util/dataprocessorkameleon.h +++ b/modules/iswa/util/dataprocessorkameleon.h @@ -29,6 +29,7 @@ namespace openspace { +namespace properties { class SelectionProperty; } class KameleonWrapper; class DataProcessorKameleon : public DataProcessor { diff --git a/modules/iswa/util/dataprocessortext.cpp b/modules/iswa/util/dataprocessortext.cpp index 06b451548f..84152e340f 100644 --- a/modules/iswa/util/dataprocessortext.cpp +++ b/modules/iswa/util/dataprocessortext.cpp @@ -25,9 +25,12 @@ #include #include -#include +#include #include #include +#include +#include +#include #include namespace openspace { diff --git a/modules/iswa/util/dataprocessortext.h b/modules/iswa/util/dataprocessortext.h index 80a6c52c19..b73d1bf746 100644 --- a/modules/iswa/util/dataprocessortext.h +++ b/modules/iswa/util/dataprocessortext.h @@ -29,6 +29,8 @@ namespace openspace { +namespace properties { class SelectionProperty; } + class DataProcessorText : public DataProcessor { public: DataProcessorText(); diff --git a/modules/iswa/util/iswamanager.cpp b/modules/iswa/util/iswamanager.cpp index 67e1c37dd4..88dbb1e1a6 100644 --- a/modules/iswa/util/iswamanager.cpp +++ b/modules/iswa/util/iswamanager.cpp @@ -29,24 +29,30 @@ #include #include #include -#include #include #include #include #include #include #include -#include #include +#include #include #include -#include +#include #include +#include #include -#include +#include +#include #include -#include +#include +#include +#include #include +#include +#include +#include #include "iswamanager_lua.inl" diff --git a/modules/iswa/util/iswamanager.h b/modules/iswa/util/iswamanager.h index b07beda666..3645d5da31 100644 --- a/modules/iswa/util/iswamanager.h +++ b/modules/iswa/util/iswamanager.h @@ -29,9 +29,9 @@ #include #include +#include #include #include -#include namespace ccmc { class Kameleon; } @@ -40,7 +40,6 @@ namespace openspace { namespace scripting { struct LuaLibrary; } class IswaBaseGroup; -class IswaCygnet; struct CdfInfo { std::string name; diff --git a/modules/iswa/util/iswamanager_lua.inl b/modules/iswa/util/iswamanager_lua.inl index 63df455293..fd394cf578 100644 --- a/modules/iswa/util/iswamanager_lua.inl +++ b/modules/iswa/util/iswamanager_lua.inl @@ -22,7 +22,14 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include +#include +#include +#include #include +#include +#include +#include namespace { diff --git a/modules/kameleon/include/kameleonhelper.h b/modules/kameleon/include/kameleonhelper.h index 00c11d06ac..7b14cc2412 100644 --- a/modules/kameleon/include/kameleonhelper.h +++ b/modules/kameleon/include/kameleonhelper.h @@ -30,7 +30,7 @@ namespace ccmc { class Kameleon; } -namespace openspace::kameleonHelper { +namespace openspace::kameleonhelper { /** * Opens a ccmc::Kameleon object from the provided path to a .cdf file. Path should be @@ -41,6 +41,6 @@ namespace openspace::kameleonHelper { std::unique_ptr createKameleonObject(const std::string& cdfFilePath); double getTime(ccmc::Kameleon* kameleon, double manualOffset); -} //namespace openspace::kameleonHelper +} //namespace openspace::kameleonhelper #endif // __OPENSPACE_MODULE_KAMELEON___KAMELEONHELPER___H__ diff --git a/modules/kameleon/include/kameleonwrapper.h b/modules/kameleon/include/kameleonwrapper.h index 3d83151e82..665ce2a445 100644 --- a/modules/kameleon/include/kameleonwrapper.h +++ b/modules/kameleon/include/kameleonwrapper.h @@ -62,7 +62,7 @@ public: enum class TraceDirection { FORWARD = 1, - BACK = -1 + BACK = -1 }; enum class FieldlineEnd { diff --git a/modules/kameleon/src/kameleonhelper.cpp b/modules/kameleon/src/kameleonhelper.cpp index b621710f8c..a83e325a7e 100644 --- a/modules/kameleon/src/kameleonhelper.cpp +++ b/modules/kameleon/src/kameleonhelper.cpp @@ -27,6 +27,7 @@ #include #include #include +#include #ifdef _MSC_VER #pragma warning (push) @@ -34,6 +35,7 @@ #pragma warning (disable : 4619) #endif // _MSC_VER +#include #include #include @@ -46,7 +48,7 @@ namespace { constexpr std::string_view _loggerCat = "KameleonHelper"; } // namespace -namespace openspace::kameleonHelper { +namespace openspace::kameleonhelper { std::unique_ptr createKameleonObject(const std::string& cdfFilePath) { auto kameleon = std::make_unique(); @@ -167,4 +169,4 @@ double getTime(ccmc::Kameleon* kameleon, double manualOffset) { return seqStartDbl + stateStartOffset + manualOffset; } -} // namespace openspace::kameleonHelper { +} // namespace openspace::kameleonhelper { diff --git a/modules/kameleon/src/kameleonwrapper.cpp b/modules/kameleon/src/kameleonwrapper.cpp index 08c0d3046f..c0334cfada 100644 --- a/modules/kameleon/src/kameleonwrapper.cpp +++ b/modules/kameleon/src/kameleonwrapper.cpp @@ -24,14 +24,20 @@ #include -#include -#include #include #include #include #include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef WIN32 #pragma warning (push) @@ -837,7 +843,7 @@ KameleonWrapper::TraceLine KameleonWrapper::traceCartesianFieldline( pos = pos + (step / 6.f) * (k1 + 2.f * k2 + 2.f * k3 + k4); - ++numSteps; + numSteps++; if (numSteps > MaxSteps) { LDEBUG(std::format("Max number of steps taken ({})", MaxSteps)); break; @@ -951,7 +957,7 @@ KameleonWrapper::TraceLine KameleonWrapper::traceLorentzTrajectory( v0 = v0 + step / 6.f * (k1 + 2.f * k2 + 2.f * k3 + k4); - ++numSteps; + numSteps++; if (numSteps > MaxSteps) { LDEBUG(std::format("Max number of steps taken ({})", MaxSteps)); break; diff --git a/modules/kameleonvolume/kameleonvolumemodule.cpp b/modules/kameleonvolume/kameleonvolumemodule.cpp index e797f10b0a..9cbb3e1d65 100644 --- a/modules/kameleonvolume/kameleonvolumemodule.cpp +++ b/modules/kameleonvolume/kameleonvolumemodule.cpp @@ -30,7 +30,9 @@ #include #include #include +#include #include +#include #include namespace openspace { diff --git a/modules/kameleonvolume/kameleonvolumemodule.h b/modules/kameleonvolume/kameleonvolumemodule.h index 62bca23d0e..b0c78ff2c0 100644 --- a/modules/kameleonvolume/kameleonvolumemodule.h +++ b/modules/kameleonvolume/kameleonvolumemodule.h @@ -27,12 +27,8 @@ #include -#include - namespace openspace { -namespace documentation { struct Documentation; } - class KameleonVolumeModule : public OpenSpaceModule { public: constexpr static const char* Name = "KameleonVolume"; diff --git a/modules/kameleonvolume/kameleonvolumereader.cpp b/modules/kameleonvolume/kameleonvolumereader.cpp index 4e2b6d64f8..035b3ea244 100644 --- a/modules/kameleonvolume/kameleonvolumereader.cpp +++ b/modules/kameleonvolume/kameleonvolumereader.cpp @@ -27,12 +27,12 @@ #include #include #include -#include -#include #include -#include #include +#include #include +#include +#include #ifdef WIN32 #pragma warning (push) @@ -81,7 +81,7 @@ KameleonVolumeReader::KameleonVolumeReader(std::filesystem::path path) if (!std::filesystem::is_regular_file(_path)) { throw ghoul::FileNotFoundError(_path); } - _kameleon = kameleonHelper::createKameleonObject(_path.string()); + _kameleon = kameleonhelper::createKameleonObject(_path.string()); const long status = _kameleon->open(_path.string()); if (status != ccmc::FileReader::OK) { throw ghoul::RuntimeError(std::format( diff --git a/modules/kameleonvolume/kameleonvolumereader.h b/modules/kameleonvolume/kameleonvolumereader.h index 2a555e2952..e0149e6825 100644 --- a/modules/kameleonvolume/kameleonvolumereader.h +++ b/modules/kameleonvolume/kameleonvolumereader.h @@ -26,6 +26,7 @@ #define __OPENSPACE_MODULE_KAMELEONVOLUME___KAMELEONVOLUMEREADER___H__ #include +#include #include #include #include @@ -35,8 +36,7 @@ namespace ccmc { class Attribute; class Interpolator; class Kameleon; -} // namespce ccmc - +} // namespace ccmc namespace ghoul { class Dictionary; } namespace openspace::volume { template class RawVolume; } diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index d09a3b5fe1..3fe19a1621 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -26,27 +26,25 @@ #include #include -#include -#include #include #include #include -#include #include -#include #include -#include #include -#include +#include #include #include #include #include -#include #include +#include #include +#include #include +#include #include +#include namespace { constexpr std::string_view _loggerCat = "RenderableKameleonVolume"; diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.h b/modules/kameleonvolume/rendering/renderablekameleonvolume.h index 818f0e3387..f22c82e771 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.h +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.h @@ -29,19 +29,19 @@ #include #include +#include +#include #include #include #include +#include +#include -namespace openspace { - struct RenderData; - class TransferFunction; -} // namespace openspace +namespace openspace { class TransferFunction; } namespace openspace::volume { class BasicVolumeRaycaster; template class RawVolume; - class TransferFunctionHandler; class VolumeClipPlanes; } // openspace::volume @@ -97,7 +97,7 @@ private: std::unique_ptr _raycaster; std::shared_ptr _volumeTexture; - std::shared_ptr _transferFunction; + std::shared_ptr _transferFunction; }; } // namespace openspace::kameleonvolume diff --git a/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp b/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp index 6afa3f12dd..62be18356b 100644 --- a/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp +++ b/modules/kameleonvolume/tasks/kameleondocumentationtask.cpp @@ -26,11 +26,17 @@ #include #include -#include +#include +#include #include +#include +#include #include -#include +#include #include +#include +#include +#include namespace { constexpr std::string_view MainTemplateFilename = diff --git a/modules/kameleonvolume/tasks/kameleondocumentationtask.h b/modules/kameleonvolume/tasks/kameleondocumentationtask.h index 218b0dd684..c4822a06a6 100644 --- a/modules/kameleonvolume/tasks/kameleondocumentationtask.h +++ b/modules/kameleonvolume/tasks/kameleondocumentationtask.h @@ -28,7 +28,6 @@ #include #include -#include namespace openspace::kameleonvolume { diff --git a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp index a13af5ce2d..3cd155dc25 100644 --- a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp +++ b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.cpp @@ -25,12 +25,14 @@ #include #include -#include +#include +#include #include #include +#include #include -#include #include +#include namespace { struct [[codegen::Dictionary(KameleonMetadataToJsonTask)]] Parameters { diff --git a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h index b82aafa668..59c6b58d15 100644 --- a/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h +++ b/modules/kameleonvolume/tasks/kameleonmetadatatojsontask.h @@ -28,7 +28,6 @@ #include #include -#include namespace openspace::kameleonvolume { diff --git a/modules/kameleonvolume/tasks/kameleonvolumetorawtask.cpp b/modules/kameleonvolume/tasks/kameleonvolumetorawtask.cpp index ca5f226fb5..fc0c0575f3 100644 --- a/modules/kameleonvolume/tasks/kameleonvolumetorawtask.cpp +++ b/modules/kameleonvolume/tasks/kameleonvolumetorawtask.cpp @@ -25,14 +25,16 @@ #include #include +#include #include -#include +#include #include #include +#include #include #include -#include #include +#include namespace { struct [[codegen::Dictionary(KameleonVolumeToRawTask)]] Parameters { diff --git a/modules/kameleonvolume/tasks/kameleonvolumetorawtask.h b/modules/kameleonvolume/tasks/kameleonvolumetorawtask.h index c91b9e6901..9ce1b708cf 100644 --- a/modules/kameleonvolume/tasks/kameleonvolumetorawtask.h +++ b/modules/kameleonvolume/tasks/kameleonvolumetorawtask.h @@ -29,7 +29,6 @@ #include #include -#include namespace openspace::kameleonvolume { diff --git a/modules/multiresvolume/CMakeLists.txt b/modules/multiresvolume/CMakeLists.txt index b7bc7a1027..0517e3016d 100644 --- a/modules/multiresvolume/CMakeLists.txt +++ b/modules/multiresvolume/CMakeLists.txt @@ -47,6 +47,7 @@ set(SOURCE_FILES rendering/atlasmanager.cpp rendering/brickcover.cpp rendering/brickmanager.cpp + rendering/brickselector.cpp rendering/brickselection.cpp rendering/multiresvolumeraycaster.cpp rendering/shenbrickselector.cpp diff --git a/modules/multiresvolume/multiresvolumemodule.cpp b/modules/multiresvolume/multiresvolumemodule.cpp index 8df8828ae7..a7a76972cc 100644 --- a/modules/multiresvolume/multiresvolumemodule.cpp +++ b/modules/multiresvolume/multiresvolumemodule.cpp @@ -28,6 +28,7 @@ #include #include #include +#include #include namespace openspace { diff --git a/modules/multiresvolume/rendering/atlasmanager.cpp b/modules/multiresvolume/rendering/atlasmanager.cpp index 247c0dcfae..f3bab577c1 100644 --- a/modules/multiresvolume/rendering/atlasmanager.cpp +++ b/modules/multiresvolume/rendering/atlasmanager.cpp @@ -26,7 +26,10 @@ #include #include +#include #include +#include +#include #include namespace openspace { diff --git a/modules/multiresvolume/rendering/atlasmanager.h b/modules/multiresvolume/rendering/atlasmanager.h index e68de45c4e..91bf11902a 100644 --- a/modules/multiresvolume/rendering/atlasmanager.h +++ b/modules/multiresvolume/rendering/atlasmanager.h @@ -25,11 +25,10 @@ #ifndef __OPENSPACE_MODULE_MULTIRESVOLUME___ATLASMANAGER___H__ #define __OPENSPACE_MODULE_MULTIRESVOLUME___ATLASMANAGER___H__ -#include #include +#include #include #include -#include #include namespace ghoul::opengl { class Texture; } diff --git a/modules/multiresvolume/rendering/brickmanager.cpp b/modules/multiresvolume/rendering/brickmanager.cpp index d44182bb55..a94cea8cd6 100644 --- a/modules/multiresvolume/rendering/brickmanager.cpp +++ b/modules/multiresvolume/rendering/brickmanager.cpp @@ -29,6 +29,10 @@ #include #include #include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "BrickManager"; @@ -157,8 +161,7 @@ bool BrickManager::initialize() { return true; } -bool BrickManager::buildBrickList(BUFFER_INDEX bufferIndex, - std::vector &brickRequest) +bool BrickManager::buildBrickList(BufferIndex bufferIndex, std::vector& brickRequest) { // Keep track of number bricks used and number of bricks cached // (for benchmarking) @@ -281,7 +284,7 @@ void BrickManager::coordinatesFromLinear(int idx, int& x, int& y, int& z) { z = idx; } -bool BrickManager::diskToPBO(BUFFER_INDEX pboIndex) { +bool BrickManager::diskToPBO(BufferIndex pboIndex) { // Map PBO glBindBuffer(GL_PIXEL_UNPACK_BUFFER, _pboHandle[pboIndex]); glBufferData(GL_PIXEL_UNPACK_BUFFER, _volumeSize, nullptr, GL_STREAM_DRAW); @@ -406,8 +409,8 @@ bool BrickManager::diskToPBO(BUFFER_INDEX pboIndex) { return true; } -bool BrickManager::pboToAtlas(BUFFER_INDEX _pboIndex) { - glBindBuffer(GL_PIXEL_UNPACK_BUFFER, _pboHandle[_pboIndex]); +bool BrickManager::pboToAtlas(BufferIndex pboIndex) { + glBindBuffer(GL_PIXEL_UNPACK_BUFFER, _pboHandle[pboIndex]); glm::size3_t dim = _textureAtlas->dimensions(); glBindTexture(GL_TEXTURE_3D, *_textureAtlas); glTexSubImage3D( @@ -433,11 +436,11 @@ ghoul::opengl::Texture* BrickManager::textureAtlas() { return _textureAtlas; } -unsigned int BrickManager::pbo(BUFFER_INDEX pboIndex) const { +unsigned int BrickManager::pbo(BufferIndex pboIndex) const { return _pboHandle[pboIndex]; } -const std::vector& BrickManager::brickList(BUFFER_INDEX index) const { +const std::vector& BrickManager::brickList(BufferIndex index) const { return _brickLists.at(index); } diff --git a/modules/multiresvolume/rendering/brickmanager.h b/modules/multiresvolume/rendering/brickmanager.h index 8269f46495..8acab7bd71 100644 --- a/modules/multiresvolume/rendering/brickmanager.h +++ b/modules/multiresvolume/rendering/brickmanager.h @@ -26,7 +26,6 @@ #define __OPENSPACE_MODULE_MULTIRESVOLUME___BRICKMANAGER___H__ #include - #include namespace ghoul::opengl { class Texture; } @@ -35,7 +34,7 @@ namespace openspace { class BrickManager { public: - enum BUFFER_INDEX { EVEN = 0, ODD = 1 }; + enum BufferIndex { EVEN = 0, ODD = 1 }; explicit BrickManager(TSP* tsp); ~BrickManager(); @@ -44,16 +43,16 @@ public: bool initialize(); - bool buildBrickList(BUFFER_INDEX bufferIndex, std::vector& brickRequest); + bool buildBrickList(BufferIndex bufferIndex, std::vector& brickRequest); bool fillVolume(float* in, float* out, unsigned int x, unsigned int y, unsigned int z); - bool diskToPBO(BUFFER_INDEX pboIndex); - bool pboToAtlas(BUFFER_INDEX pboIndex); + bool diskToPBO(BufferIndex pboIndex); + bool pboToAtlas(BufferIndex pboIndex); ghoul::opengl::Texture* textureAtlas(); - unsigned int pbo(BUFFER_INDEX pboIndex) const; - const std::vector& brickList(BUFFER_INDEX index) const; + unsigned int pbo(BufferIndex pboIndex) const; + const std::vector& brickList(BufferIndex index) const; private: void incrementCoordinates(); diff --git a/modules/multiresvolume/rendering/brickselection.h b/modules/multiresvolume/rendering/brickselection.h index 41db300770..38ea33cf9c 100644 --- a/modules/multiresvolume/rendering/brickselection.h +++ b/modules/multiresvolume/rendering/brickselection.h @@ -32,8 +32,8 @@ namespace openspace { struct BrickSelection { enum SplitType { None = 0, - Temporal = 1, - Spatial = 2 + Temporal, + Spatial }; BrickSelection(); diff --git a/modules/multiresvolume/rendering/brickselector.cpp b/modules/multiresvolume/rendering/brickselector.cpp new file mode 100644 index 0000000000..426202d362 --- /dev/null +++ b/modules/multiresvolume/rendering/brickselector.cpp @@ -0,0 +1,33 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2025 * + * * + * 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. * + ****************************************************************************************/ + +#include + +namespace openspace { + +BrickSelector::~BrickSelector() {} + +bool BrickSelector::initialize() { return true; } + +} // namespace openspace diff --git a/modules/multiresvolume/rendering/brickselector.h b/modules/multiresvolume/rendering/brickselector.h index df7b31a7cf..6d9c94d864 100644 --- a/modules/multiresvolume/rendering/brickselector.h +++ b/modules/multiresvolume/rendering/brickselector.h @@ -31,8 +31,8 @@ namespace openspace { class BrickSelector { public: - virtual ~BrickSelector() {} - virtual bool initialize() { return true; } + virtual ~BrickSelector(); + virtual bool initialize(); virtual void selectBricks(int timestep, std::vector& bricks) = 0; }; diff --git a/modules/multiresvolume/rendering/errorhistogrammanager.cpp b/modules/multiresvolume/rendering/errorhistogrammanager.cpp index 2017365154..aeb8ded73b 100644 --- a/modules/multiresvolume/rendering/errorhistogrammanager.cpp +++ b/modules/multiresvolume/rendering/errorhistogrammanager.cpp @@ -25,9 +25,14 @@ #include #include +#include #include -#include #include +#include +#include +#include +#include +#include namespace openspace { @@ -44,9 +49,9 @@ bool ErrorHistogramManager::buildHistograms(int numBins) { _maxBin = 1.f; // Should be calculated from tsp file as (maxValue - minValue) unsigned int numOtLevels = _tsp->numOTLevels(); - unsigned int numOtLeaves = static_cast(pow(8, numOtLevels - 1)); + unsigned int numOtLeaves = static_cast(std::pow(8, numOtLevels - 1)); unsigned int numBstLeaves = static_cast( - pow(2, _tsp->numBSTLevels() - 1) + std::pow(2, _tsp->numBSTLevels() - 1) ); _numInnerNodes = _tsp->numTotalNodes() - numOtLeaves * numBstLeaves; @@ -58,7 +63,7 @@ bool ErrorHistogramManager::buildHistograms(int numBins) { // All TSP Leaves int numOtNodes = _tsp->numOTNodes(); - int otOffset = static_cast((pow(8, numOtLevels - 1) - 1) / 7); + int otOffset = static_cast((std::pow(8, numOtLevels - 1) - 1) / 7); int numBstNodes = _tsp->numBSTNodes(); int bstOffset = numBstNodes / 2; @@ -73,7 +78,8 @@ bool ErrorHistogramManager::buildHistograms(int numBins) { if (!success) { return false; } - pb.print(++processedLeaves); + processedLeaves++; + pb.print(processedLeaves); } } @@ -122,7 +128,7 @@ bool ErrorHistogramManager::buildFromLeaf(unsigned int bstOffset, ancestorVoxels = it->second; } - float voxelScale = static_cast(pow(2.f, octreeLevel)); + float voxelScale = static_cast(std::pow(2.f, octreeLevel)); float invVoxelScale = 1.f / voxelScale; // Calculate leaf offset in ancestor sized voxels @@ -161,7 +167,7 @@ bool ErrorHistogramManager::buildFromLeaf(unsigned int bstOffset, octreeLastOnly &= octreeChild == 7; octreeNode = parentOffset(octreeNode, 8); - int childSize = static_cast(pow(2, octreeLevel) * brickDim); + int childSize = static_cast(std::pow(2, octreeLevel) * brickDim); leafOffset.x += (octreeChild % 2) * childSize; leafOffset.y += ((octreeChild / 2) % 2) * childSize; leafOffset.z += (octreeChild / 4) * childSize; @@ -180,7 +186,7 @@ bool ErrorHistogramManager::buildFromLeaf(unsigned int bstOffset, } bool ErrorHistogramManager::loadFromFile(const std::filesystem::path& filename) { - std::ifstream file(filename, std::ios::in | std::ios::binary); + std::ifstream file = std::ifstream(filename, std::ios::in | std::ios::binary); if (!file.is_open()) { return false; } @@ -205,13 +211,12 @@ bool ErrorHistogramManager::loadFromFile(const std::filesystem::path& filename) delete[] histogramData; // No need to deallocate histogram data, since histograms take ownership. - file.close(); return true; } bool ErrorHistogramManager::saveToFile(const std::filesystem::path& filename) { - std::ofstream file(filename, std::ios::out | std::ios::binary); + std::ofstream file = std::ofstream(filename, std::ios::out | std::ios::binary); if (!file.is_open()) { return false; } @@ -232,7 +237,6 @@ bool ErrorHistogramManager::saveToFile(const std::filesystem::path& filename) { file.write(reinterpret_cast(histogramData), sizeof(float) * nFloats); delete[] histogramData; - file.close(); return true; } @@ -301,14 +305,14 @@ int ErrorHistogramManager::parentOffset(int offset, int base) const { return -1; } const int depth = static_cast( - floor(log1p(((base - 1) * offset)) / log(base)) + std::floor(std::log1p(((base - 1) * offset)) / std::log(base)) ); - const int firstInLevel = static_cast((pow(base, depth) - 1) / (base - 1)); + const int firstInLevel = static_cast((std::pow(base, depth) - 1) / (base - 1)); const int inLevelOffset = offset - firstInLevel; const int parentDepth = depth - 1; const int firstInParentLevel = static_cast( - (pow(base, parentDepth) - 1) / (base - 1) + (std::pow(base, parentDepth) - 1) / (base - 1) ); const int parentInLevelOffset = inLevelOffset / base; @@ -338,14 +342,14 @@ unsigned int ErrorHistogramManager::brickToInnerNodeIndex(unsigned int brickInde const unsigned int numBstLevels = _tsp->numBSTLevels(); const unsigned int numInnerBstNodes = static_cast( - (pow(2, numBstLevels - 1) - 1) * numOtNodes + (std::pow(2, numBstLevels - 1) - 1) * numOtNodes ); if (brickIndex < numInnerBstNodes) { return brickIndex; } const unsigned int numOtLeaves = static_cast( - pow(8, _tsp->numOTLevels() - 1) + std::pow(8, _tsp->numOTLevels() - 1) ); const unsigned int numOtInnerNodes = (numOtNodes - numOtLeaves); @@ -374,14 +378,14 @@ unsigned int ErrorHistogramManager::innerNodeToBrickIndex( const unsigned int numBstLevels = _tsp->numBSTLevels(); const unsigned int numInnerBstNodes = static_cast( - (pow(2, numBstLevels - 1) - 1) * numOtNodes + (std::pow(2, numBstLevels - 1) - 1) * numOtNodes ); if (innerNodeIndex < numInnerBstNodes) { return innerNodeIndex; } const unsigned int numOtLeaves = static_cast( - pow(8, _tsp->numOTLevels() - 1) + std::pow(8, _tsp->numOTLevels() - 1) ); const unsigned int numOtInnerNodes = (numOtNodes - numOtLeaves); diff --git a/modules/multiresvolume/rendering/errorhistogrammanager.h b/modules/multiresvolume/rendering/errorhistogrammanager.h index 50d69f9f89..1d1f0d6f33 100644 --- a/modules/multiresvolume/rendering/errorhistogrammanager.h +++ b/modules/multiresvolume/rendering/errorhistogrammanager.h @@ -28,8 +28,9 @@ #include #include #include -#include +#include #include +#include namespace openspace { @@ -47,17 +48,6 @@ public: bool saveToFile(const std::filesystem::path& filename); private: - TSP* _tsp; - std::ifstream* _file; - - std::vector _histograms; - unsigned int _numInnerNodes; - float _minBin; - float _maxBin; - int _numBins; - - std::map> _voxelCache; - bool buildFromLeaf(unsigned int bstOffset, unsigned int octreeOffset); std::vector readValues(unsigned int brickIndex) const; @@ -71,6 +61,17 @@ private: float interpolate(const glm::vec3& samplePoint, const std::vector& voxels) const; + + TSP* _tsp; + std::ifstream* _file; + + std::vector _histograms; + unsigned int _numInnerNodes; + float _minBin; + float _maxBin; + int _numBins; + + std::map> _voxelCache; }; } // namespace openspace diff --git a/modules/multiresvolume/rendering/histogrammanager.cpp b/modules/multiresvolume/rendering/histogrammanager.cpp index 10c9783b64..e406b59be3 100644 --- a/modules/multiresvolume/rendering/histogrammanager.cpp +++ b/modules/multiresvolume/rendering/histogrammanager.cpp @@ -25,8 +25,10 @@ #include #include +#include #include -#include +#include +#include namespace openspace { @@ -52,7 +54,7 @@ Histogram* HistogramManager::histogram(unsigned int brickIndex) { } bool HistogramManager::buildHistogram(TSP* tsp, unsigned int brickIndex) { - Histogram histogram(_minBin, _maxBin, _numBins); + Histogram histogram = Histogram(_minBin, _maxBin, _numBins); const bool isBstLeaf = tsp->isBstLeaf(brickIndex); const bool isOctreeLeaf = tsp->isOctreeLeaf(brickIndex); @@ -122,7 +124,7 @@ std::vector HistogramManager::readValues(TSP* tsp, unsigned int brickInde } bool HistogramManager::loadFromFile(const std::filesystem::path& filename) { - std::ifstream file(filename, std::ios::in | std::ios::binary); + std::ifstream file = std::ifstream(filename, std::ios::in | std::ios::binary); if (!file.is_open()) { return false; } @@ -147,12 +149,11 @@ bool HistogramManager::loadFromFile(const std::filesystem::path& filename) { _histograms[i] = Histogram(_minBin, _maxBin, _numBins, data); } - file.close(); return true; } bool HistogramManager::saveToFile(const std::filesystem::path& filename) { - std::ofstream file(filename, std::ios::out | std::ios::binary); + std::ofstream file = std::ofstream(filename, std::ios::out | std::ios::binary); if (!file.is_open()) { return false; } @@ -173,7 +174,6 @@ bool HistogramManager::saveToFile(const std::filesystem::path& filename) { file.write(reinterpret_cast(histogramData.data()), sizeof(float) * nFloats); - file.close(); return true; } diff --git a/modules/multiresvolume/rendering/histogrammanager.h b/modules/multiresvolume/rendering/histogrammanager.h index e6843fac31..019f65d986 100644 --- a/modules/multiresvolume/rendering/histogrammanager.h +++ b/modules/multiresvolume/rendering/histogrammanager.h @@ -27,6 +27,7 @@ #include #include +#include namespace openspace { diff --git a/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp b/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp index bab44421e4..aed3fc0532 100644 --- a/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp +++ b/modules/multiresvolume/rendering/localerrorhistogrammanager.cpp @@ -25,9 +25,16 @@ #include #include +#include #include -#include #include +#include +#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "LocalErrorHistogramManager"; diff --git a/modules/multiresvolume/rendering/localerrorhistogrammanager.h b/modules/multiresvolume/rendering/localerrorhistogrammanager.h index df0235e37b..0373dbd1cb 100644 --- a/modules/multiresvolume/rendering/localerrorhistogrammanager.h +++ b/modules/multiresvolume/rendering/localerrorhistogrammanager.h @@ -28,8 +28,9 @@ #include #include #include -#include +#include #include +#include namespace openspace { @@ -47,16 +48,6 @@ public: bool saveToFile(const std::filesystem::path& filename); private: - TSP* _tsp = nullptr; - std::ifstream* _file; - - std::vector _spatialHistograms; - std::vector _temporalHistograms; - unsigned int _numInnerNodes = 0; - float _minBin = 0.f; - float _maxBin = 0.f; - int _numBins = 0; - std::map> _voxelCache; bool buildFromOctreeChild(unsigned int bstOffset, unsigned int octreeOffset); @@ -73,6 +64,16 @@ private: unsigned int linearCoords(glm::ivec3 coords) const; float interpolate(glm::vec3 samplePoint, const std::vector& voxels) const; + + TSP* _tsp = nullptr; + std::ifstream* _file; + + std::vector _spatialHistograms; + std::vector _temporalHistograms; + unsigned int _numInnerNodes = 0; + float _minBin = 0.f; + float _maxBin = 0.f; + int _numBins = 0; }; } // namespace openspace diff --git a/modules/multiresvolume/rendering/localtfbrickselector.cpp b/modules/multiresvolume/rendering/localtfbrickselector.cpp index 1265978247..481114df14 100644 --- a/modules/multiresvolume/rendering/localtfbrickselector.cpp +++ b/modules/multiresvolume/rendering/localtfbrickselector.cpp @@ -24,11 +24,14 @@ #include -#include +#include #include +#include #include +#include #include #include +#include namespace { bool compareSplitPoints(const openspace::BrickSelection& a, diff --git a/modules/multiresvolume/rendering/localtfbrickselector.h b/modules/multiresvolume/rendering/localtfbrickselector.h index ce1a03226b..797d22b0b9 100644 --- a/modules/multiresvolume/rendering/localtfbrickselector.h +++ b/modules/multiresvolume/rendering/localtfbrickselector.h @@ -55,11 +55,6 @@ public: bool calculateBrickErrors(); private: - TSP* _tsp; - LocalErrorHistogramManager* _histogramManager; - TransferFunction* _transferFunction; - std::vector _brickErrors; - float spatialSplitPoints(unsigned int brickIndex) const; float temporalSplitPoints(unsigned int brickIndex) const; float splitPoints(unsigned int brickIndex, BrickSelection::SplitType& splitType); @@ -67,6 +62,10 @@ private: int linearCoordinates(int x, int y, int z) const; void writeSelection(BrickSelection coveredBricks, std::vector& bricks); + TSP* _tsp; + LocalErrorHistogramManager* _histogramManager; + TransferFunction* _transferFunction; + std::vector _brickErrors; int _memoryBudget; int _streamingBudget; }; diff --git a/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp b/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp index 7ddb2c86aa..37e882346c 100644 --- a/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp +++ b/modules/multiresvolume/rendering/multiresvolumeraycaster.cpp @@ -26,12 +26,15 @@ #include #include -#include #include #include #include +#include #include #include +#include +#include +#include namespace { constexpr std::string_view GlslRaycastPath = diff --git a/modules/multiresvolume/rendering/multiresvolumeraycaster.h b/modules/multiresvolume/rendering/multiresvolumeraycaster.h index e394fe0002..b9e21b6607 100644 --- a/modules/multiresvolume/rendering/multiresvolumeraycaster.h +++ b/modules/multiresvolume/rendering/multiresvolumeraycaster.h @@ -31,20 +31,13 @@ #include #include #include -#include - -namespace ghoul::opengl { - class Texture; - class ProgramObject; -} // namespace ghoul::opengl +#include namespace openspace { class AtlasManager; -struct RenderData; -struct RaycastData; -class TSP; class TransferFunction; +class TSP; class MultiresVolumeRaycaster : public VolumeRaycaster { public: @@ -72,7 +65,6 @@ public: std::filesystem::path helperPath() const override; void setModelTransform(glm::mat4 transform); - //void setTime(double time); void setStepSizeCoefficient(float coefficient); private: @@ -89,8 +81,7 @@ private: std::unique_ptr< ghoul::opengl::BufferBinding > _atlasMapBinding; - -}; // MultiresVolumeRaycaster +}; } // namespace openspace diff --git a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp index f26746f1b6..fb3217f2d3 100644 --- a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp +++ b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp @@ -24,20 +24,17 @@ #include -#include #include #include #include #include #include #include -#include #include #include #include #include #include -#include #include #include #include @@ -48,16 +45,15 @@ #include #include #include -#include +#include #include -#include -#include -#include +#include #include #include #include #include -#include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderableMultiresVolume"; diff --git a/modules/multiresvolume/rendering/renderablemultiresvolume.h b/modules/multiresvolume/rendering/renderablemultiresvolume.h index 61f9b9b6e7..f1e93028f6 100644 --- a/modules/multiresvolume/rendering/renderablemultiresvolume.h +++ b/modules/multiresvolume/rendering/renderablemultiresvolume.h @@ -34,18 +34,11 @@ #include #include #include - -namespace ghoul { class Dictionary; } -namespace ghoul::filesystem { class File; } -namespace ghoul::opengl { - class ProgramObject; - class Texture; -} // namespace ghoul::opengl +#include namespace openspace { class AtlasManager; -class BrickSelector; class ErrorHistogramManager; class HistogramManager; class LocalErrorHistogramManager; @@ -78,12 +71,6 @@ public: virtual void update(const UpdateData& data) override; virtual void render(const RenderData& data, RendererTasks& tasks) override; - //virtual void preResolve(ghoul::opengl::ProgramObject* program) override; - //virtual std::string getHeaderPath() override; - //virtual std::string getHelperPath() override; - //virtual std::vector getTextures() override; - //virtual std::vector getBuffers() override; - private: properties::BoolProperty _useGlobalTime; properties::BoolProperty _loop; @@ -104,7 +91,6 @@ private: double _startTime; double _endTime; - // Stats timers std::string _statsFileName; bool _gatheringStats = false; diff --git a/modules/multiresvolume/rendering/shenbrickselector.h b/modules/multiresvolume/rendering/shenbrickselector.h index 6b323c8d62..961b68a330 100644 --- a/modules/multiresvolume/rendering/shenbrickselector.h +++ b/modules/multiresvolume/rendering/shenbrickselector.h @@ -28,7 +28,6 @@ #include #include -#include namespace openspace { @@ -43,10 +42,6 @@ public: void selectBricks(int timestep, std::vector& bricks) override; private: - TSP* _tsp; - float _spatialTolerance; - float _temporalTolerance; - void traverseOT(int timestep, unsigned int brickIndex, BrickCover coveredBricks, std::vector& bricks); @@ -62,6 +57,10 @@ private: void selectCover(BrickCover coveredBricks, unsigned int brickIndex, std::vector& bricks) const; + + TSP* _tsp; + float _spatialTolerance; + float _temporalTolerance; }; } // namespace openspace diff --git a/modules/multiresvolume/rendering/simpletfbrickselector.cpp b/modules/multiresvolume/rendering/simpletfbrickselector.cpp index 245e8d4052..bc4365701a 100644 --- a/modules/multiresvolume/rendering/simpletfbrickselector.cpp +++ b/modules/multiresvolume/rendering/simpletfbrickselector.cpp @@ -24,12 +24,15 @@ #include -#include +#include #include +#include #include #include #include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "SimpleTfBrickSelector"; diff --git a/modules/multiresvolume/rendering/simpletfbrickselector.h b/modules/multiresvolume/rendering/simpletfbrickselector.h index 7da6e9ba7f..441544d341 100644 --- a/modules/multiresvolume/rendering/simpletfbrickselector.h +++ b/modules/multiresvolume/rendering/simpletfbrickselector.h @@ -28,7 +28,6 @@ #include #include -#include namespace openspace { diff --git a/modules/multiresvolume/rendering/tfbrickselector.cpp b/modules/multiresvolume/rendering/tfbrickselector.cpp index 22c2f3bcd8..70e179ef85 100644 --- a/modules/multiresvolume/rendering/tfbrickselector.cpp +++ b/modules/multiresvolume/rendering/tfbrickselector.cpp @@ -24,12 +24,14 @@ #include +#include #include #include #include #include #include #include +#include namespace { bool compareSplitPoints(const openspace::BrickSelection& a, diff --git a/modules/multiresvolume/rendering/tfbrickselector.h b/modules/multiresvolume/rendering/tfbrickselector.h index 2e4fa43da1..19606dcec0 100644 --- a/modules/multiresvolume/rendering/tfbrickselector.h +++ b/modules/multiresvolume/rendering/tfbrickselector.h @@ -28,13 +28,12 @@ #include #include -#include namespace openspace { -class TSP; class ErrorHistogramManager; class TransferFunction; +class TSP; class TfBrickSelector : public BrickSelector { public: @@ -50,11 +49,6 @@ public: bool calculateBrickErrors(); private: - TSP* _tsp; - ErrorHistogramManager* _histogramManager; - TransferFunction* _transferFunction; - std::vector _brickErrors; - float spatialSplitPoints(unsigned int brickIndex); float temporalSplitPoints(unsigned int brickIndex); float splitPoints(unsigned int brickIndex, BrickSelection::SplitType& splitType); @@ -62,6 +56,11 @@ private: int linearCoords(int x, int y, int z) const; void writeSelection(BrickSelection coveredBricks, std::vector& bricks) const; + TSP* _tsp; + ErrorHistogramManager* _histogramManager; + TransferFunction* _transferFunction; + std::vector _brickErrors; + int _memoryBudget; int _streamingBudget; }; diff --git a/modules/multiresvolume/rendering/tsp.cpp b/modules/multiresvolume/rendering/tsp.cpp index 0c995f587f..7bf2546d0c 100644 --- a/modules/multiresvolume/rendering/tsp.cpp +++ b/modules/multiresvolume/rendering/tsp.cpp @@ -24,15 +24,18 @@ #include -#include #include #include #include #include #include +#include +#include #include +#include #include #include +#include namespace { constexpr std::string_view _loggerCat = "TSP"; diff --git a/modules/multiresvolume/rendering/tsp.h b/modules/multiresvolume/rendering/tsp.h index 0cd2e247ed..291db8853f 100644 --- a/modules/multiresvolume/rendering/tsp.h +++ b/modules/multiresvolume/rendering/tsp.h @@ -28,8 +28,8 @@ #include #include #include +#include #include -#include #include namespace openspace { @@ -109,11 +109,6 @@ private: */ std::list coveredBSTLeafBricks(unsigned int brickIndex) const; - /** - * Return a list of eight children brick incices given a brick index. - */ - std::list childBricks(unsigned int brickIndex); - std::filesystem::path _filename; std::ifstream _file; std::streampos _dataOffset; diff --git a/modules/opensoundcontrol/CMakeLists.txt b/modules/opensoundcontrol/CMakeLists.txt index e797a2f522..3074e31731 100644 --- a/modules/opensoundcontrol/CMakeLists.txt +++ b/modules/opensoundcontrol/CMakeLists.txt @@ -53,6 +53,6 @@ else () target_compile_options(oscpack PRIVATE "-w") endif () -target_include_directories(openspace-module-opensoundcontrol SYSTEM PRIVATE ext/oscpack) -target_link_libraries(openspace-module-opensoundcontrol PRIVATE oscpack) +target_include_directories(openspace-module-opensoundcontrol SYSTEM PUBLIC ext/oscpack) +target_link_libraries(openspace-module-opensoundcontrol PUBLIC oscpack) end_dependency("oscpack") diff --git a/modules/opensoundcontrol/include/opensoundcontrolconnection.h b/modules/opensoundcontrol/include/opensoundcontrolconnection.h index c2a76ae6fa..28758f4008 100644 --- a/modules/opensoundcontrol/include/opensoundcontrolconnection.h +++ b/modules/opensoundcontrol/include/opensoundcontrolconnection.h @@ -25,8 +25,9 @@ #ifndef __OPENSPACE_MODULE_OPENSOUNDCONTROL___OPENSOUNDCONTROLCONNECTION___H__ #define __OPENSPACE_MODULE_OPENSOUNDCONTROL___OPENSOUNDCONTROLCONNECTION___H__ -#include -#include +#include +#include +#include #include #include #include @@ -42,6 +43,7 @@ public: void send(const std::string& label, const std::vector& data); + private: UdpTransmitSocket _socket; char* _buffer = nullptr; diff --git a/modules/opensoundcontrol/opensoundcontrolmodule.cpp b/modules/opensoundcontrol/opensoundcontrolmodule.cpp index b67e2c454e..68a84469fb 100644 --- a/modules/opensoundcontrol/opensoundcontrolmodule.cpp +++ b/modules/opensoundcontrol/opensoundcontrolmodule.cpp @@ -24,7 +24,6 @@ #include - namespace openspace { OpenSoundControlModule::OpenSoundControlModule() : OpenSpaceModule("OpenSoundControl") {} diff --git a/modules/opensoundcontrol/opensoundcontrolmodule.h b/modules/opensoundcontrol/opensoundcontrolmodule.h index f420dad013..ce5ed442ab 100644 --- a/modules/opensoundcontrol/opensoundcontrolmodule.h +++ b/modules/opensoundcontrol/opensoundcontrolmodule.h @@ -25,7 +25,7 @@ #ifndef __OPENSPACE_MODULE_OPENSOUNDCONTROL___OPENSOUNDCONTROLMODULE___H__ #define __OPENSPACE_MODULE_OPENSOUNDCONTROL___OPENSOUNDCONTROLMODULE___H__ -#include "openspace/util/openspacemodule.h" +#include namespace openspace { diff --git a/modules/opensoundcontrol/src/opensoundcontrolconnection.cpp b/modules/opensoundcontrol/src/opensoundcontrolconnection.cpp index d3a7e0665d..2c959e5886 100644 --- a/modules/opensoundcontrol/src/opensoundcontrolconnection.cpp +++ b/modules/opensoundcontrol/src/opensoundcontrolconnection.cpp @@ -25,6 +25,8 @@ #include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "OpenSoundControlConnection"; diff --git a/modules/server/CMakeLists.txt b/modules/server/CMakeLists.txt index b10475ebf8..d422eda160 100644 --- a/modules/server/CMakeLists.txt +++ b/modules/server/CMakeLists.txt @@ -38,6 +38,7 @@ set(HEADER_FILES include/topics/camerapathtopic.h include/topics/cameratopic.h include/topics/documentationtopic.h + include/topics/downloadeventtopic.h include/topics/enginemodetopic.h include/topics/errorlogtopic.h include/topics/eventtopic.h @@ -70,6 +71,7 @@ set(SOURCE_FILES src/topics/camerapathtopic.cpp src/topics/cameratopic.cpp src/topics/documentationtopic.cpp + src/topics/downloadeventtopic.cpp src/topics/enginemodetopic.cpp src/topics/errorlogtopic.cpp src/topics/eventtopic.cpp diff --git a/modules/server/include/connection.h b/modules/server/include/connection.h index 5e6e2db9c7..da2b3c4b3a 100644 --- a/modules/server/include/connection.h +++ b/modules/server/include/connection.h @@ -27,7 +27,9 @@ #include #include +#include #include +#include #include #include @@ -71,11 +73,10 @@ private: std::map> _topics; std::unique_ptr _socket; std::thread _thread; + std::mutex _mutex; std::string _address; bool _isAuthorized = false; - std::map _messageQueue; - std::map _sentMessages; }; } // namespace openspace diff --git a/modules/server/include/connectionpool.h b/modules/server/include/connectionpool.h index 605152ecdc..46d50ac623 100644 --- a/modules/server/include/connectionpool.h +++ b/modules/server/include/connectionpool.h @@ -51,10 +51,10 @@ public: private: void disconnectAllConnections(); - std::mutex _connectionMutex; void removeDisconnectedSockets(); void acceptNewSockets(); + std::mutex _connectionMutex; SocketHandleFunc _handleSocket; std::vector> _socketServers; std::vector> _sockets; diff --git a/modules/server/include/jsonconverters.h b/modules/server/include/jsonconverters.h index b35e4075ed..dc7bdfaa66 100644 --- a/modules/server/include/jsonconverters.h +++ b/modules/server/include/jsonconverters.h @@ -27,7 +27,6 @@ #include #include -#include namespace openspace::properties { @@ -63,6 +62,8 @@ void to_json(nlohmann::json& j, const Renderable* pR); namespace ghoul { +class Dictionary; + void to_json(nlohmann::json& j, const Dictionary& d); void to_json(nlohmann::json& j, const Dictionary* d); diff --git a/modules/server/include/logging/notificationlog.h b/modules/server/include/logging/notificationlog.h index 09a369fe47..75ef89e915 100644 --- a/modules/server/include/logging/notificationlog.h +++ b/modules/server/include/logging/notificationlog.h @@ -29,6 +29,7 @@ #include #include +#include namespace openspace { diff --git a/modules/server/include/serverinterface.h b/modules/server/include/serverinterface.h index 03ec0a0cf2..d02ef53372 100644 --- a/modules/server/include/serverinterface.h +++ b/modules/server/include/serverinterface.h @@ -26,13 +26,16 @@ #define __OPENSPACE_MODULE_SERVER___SERVERINTERFACE___H__ #include + #include #include #include #include #include +#include +#include -namespace ghoul::io { class SocketServer; } +namespace ghoul { class Dictionary; } namespace openspace { diff --git a/modules/server/include/topics/bouncetopic.h b/modules/server/include/topics/bouncetopic.h index 2b7107e36c..1c25b5c566 100644 --- a/modules/server/include/topics/bouncetopic.h +++ b/modules/server/include/topics/bouncetopic.h @@ -29,8 +29,6 @@ namespace openspace { -class Connection; - class BounceTopic : public Topic { public: BounceTopic() = default; diff --git a/modules/server/include/topics/camerapathtopic.h b/modules/server/include/topics/camerapathtopic.h index 855ac14741..ed383c2c51 100644 --- a/modules/server/include/topics/camerapathtopic.h +++ b/modules/server/include/topics/camerapathtopic.h @@ -26,6 +26,7 @@ #define __OPENSPACE_MODULE_SERVER___CAMERAPATHTOPIC___H__ #include + #include namespace openspace { diff --git a/modules/server/include/topics/cameratopic.h b/modules/server/include/topics/cameratopic.h index 058f98f602..fa30ed11fa 100644 --- a/modules/server/include/topics/cameratopic.h +++ b/modules/server/include/topics/cameratopic.h @@ -26,6 +26,8 @@ #define __OPENSPACE_MODULE_SERVER___CAMERATOPIC___H__ #include + +#include #include namespace openspace { diff --git a/modules/server/include/topics/downloadeventtopic.h b/modules/server/include/topics/downloadeventtopic.h new file mode 100644 index 0000000000..5ed4cf9268 --- /dev/null +++ b/modules/server/include/topics/downloadeventtopic.h @@ -0,0 +1,50 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2025 * + * * + * 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_MODULE_SERVER___DOWNLOADEVENT_TOPIC___H__ +#define __OPENSPACE_MODULE_SERVER___DOWNLOADEVENT_TOPIC___H__ + +#include + +#include +#include + +namespace openspace { + +class DownloadEventTopic : public Topic { +public: + ~DownloadEventTopic() override; + + void handleJson(const nlohmann::json& json) override; + bool isDone() const override; + +private: + bool _isSubscribedTo = false; + int _subscriptionID = -1; + std::unordered_map _lastCallback; +}; + +} // namespace openspace + +#endif // __OPENSPACE_MODULE_SERVER___DOWNLOADEVENT_TOPIC___H__ diff --git a/modules/server/include/topics/errorlogtopic.h b/modules/server/include/topics/errorlogtopic.h index 163df34f2e..dc383d0d6d 100644 --- a/modules/server/include/topics/errorlogtopic.h +++ b/modules/server/include/topics/errorlogtopic.h @@ -26,7 +26,10 @@ #define __OPENSPACE_MODULE_SERVER___ERRORLOGTOPIC____H__ #include -#include + +#include + +namespace ghoul::logging { class Log; } namespace openspace { @@ -46,7 +49,8 @@ private: void createLog(ghoul::logging::LogLevel logLevel); bool _isSubscribedTo = false; - // Non owning but we remove the log from LogManager on destruction + + // Non-owning but we remove the log from LogManager on destruction ghoul::logging::Log* _log = nullptr; }; diff --git a/modules/server/include/topics/eventtopic.h b/modules/server/include/topics/eventtopic.h index bfb589c231..2e203e56e3 100644 --- a/modules/server/include/topics/eventtopic.h +++ b/modules/server/include/topics/eventtopic.h @@ -28,6 +28,7 @@ #include #include +#include namespace openspace::properties { class Property; } diff --git a/modules/server/include/topics/flightcontrollertopic.h b/modules/server/include/topics/flightcontrollertopic.h index 6d6d84ed33..20aef6424f 100644 --- a/modules/server/include/topics/flightcontrollertopic.h +++ b/modules/server/include/topics/flightcontrollertopic.h @@ -29,11 +29,6 @@ #include -namespace openspace::interaction { - struct WebsocketInputStates; - struct WebsocketInputState; -} // namespace openspace::interaction - namespace openspace { class FlightControllerTopic : public Topic { @@ -49,16 +44,6 @@ public: void handleAutopilot(const nlohmann::json &json); private: - bool _isDone = false; - bool _autopilotEngaged; - nlohmann::json _payload; - nlohmann::json _focusNodes; - nlohmann::json _allNodes; - nlohmann::json _interestingTimes; - - openspace::interaction::WebsocketInputStates _inputStates; - openspace::interaction::WebsocketInputState _inputState; - void connect(); void disconnect(); void processInputState(const nlohmann::json& json); @@ -70,6 +55,16 @@ private: void setFriction(const nlohmann::json& json) const; void setFriction(bool roll, bool rotation, bool zoom) const; void setFriction(bool all) const; + + bool _isDone = false; + bool _autopilotEngaged; + nlohmann::json _payload; + nlohmann::json _focusNodes; + nlohmann::json _allNodes; + nlohmann::json _interestingTimes; + + openspace::interaction::WebsocketInputStates _inputStates; + openspace::interaction::WebsocketInputState _inputState; }; } // namespace openspace diff --git a/modules/server/include/topics/missiontopic.h b/modules/server/include/topics/missiontopic.h index 40610daf51..4ac2a87d2e 100644 --- a/modules/server/include/topics/missiontopic.h +++ b/modules/server/include/topics/missiontopic.h @@ -27,12 +27,10 @@ #include -#include - -using nlohmann::json; - namespace openspace { +class MissionPhase; + class MissionTopic : public Topic { public: MissionTopic() = default; diff --git a/modules/server/include/topics/profiletopic.h b/modules/server/include/topics/profiletopic.h index fe932a9abb..b8c085a055 100644 --- a/modules/server/include/topics/profiletopic.h +++ b/modules/server/include/topics/profiletopic.h @@ -27,8 +27,6 @@ #include -using nlohmann::json; - namespace openspace { class ProfileTopic : public Topic { diff --git a/modules/server/include/topics/skybrowsertopic.h b/modules/server/include/topics/skybrowsertopic.h index 12d542465f..9c43584bf9 100644 --- a/modules/server/include/topics/skybrowsertopic.h +++ b/modules/server/include/topics/skybrowsertopic.h @@ -26,6 +26,7 @@ #define __OPENSPACE_MODULE_SERVER___SKY_BROWSER_TOPIC___H__ #include + #include namespace openspace { diff --git a/modules/server/include/topics/subscriptiontopic.h b/modules/server/include/topics/subscriptiontopic.h index 1e4da57f73..a39ad5f809 100644 --- a/modules/server/include/topics/subscriptiontopic.h +++ b/modules/server/include/topics/subscriptiontopic.h @@ -27,10 +27,10 @@ #include -namespace openspace::properties { class Property; } - namespace openspace { +namespace properties { class Property; } + class SubscriptionTopic : public Topic { public: SubscriptionTopic() = default; diff --git a/modules/server/include/topics/timetopic.h b/modules/server/include/topics/timetopic.h index ff2c20aff7..fb465f5b43 100644 --- a/modules/server/include/topics/timetopic.h +++ b/modules/server/include/topics/timetopic.h @@ -26,7 +26,9 @@ #define __OPENSPACE_MODULE_SERVER___TIME_TOPIC___H__ #include + #include +#include namespace openspace { diff --git a/modules/server/include/topics/topic.h b/modules/server/include/topics/topic.h index 9099845f52..8eb9db814f 100644 --- a/modules/server/include/topics/topic.h +++ b/modules/server/include/topics/topic.h @@ -26,6 +26,8 @@ #define __OPENSPACE_MODULE_SERVER___TOPIC___H__ #include +#include +#include namespace openspace { diff --git a/modules/server/servermodule.cpp b/modules/server/servermodule.cpp index 50eca6d3d1..ab14054f27 100644 --- a/modules/server/servermodule.cpp +++ b/modules/server/servermodule.cpp @@ -24,22 +24,21 @@ #include -#include #include #include -#include #include #include -#include -#include #include #include -#include +#include #include -#include -#include +#include +#include #include -#include +#include +#include +#include +#include namespace { struct [[codegen::Dictionary(ServerModule)]] Parameters { @@ -58,7 +57,7 @@ documentation::Documentation ServerModule::Documentation() { ServerModule::ServerModule() : OpenSpaceModule(ServerModule::Name) - , _interfaceOwner({"Interfaces", "Interfaces", "Server Interfaces"}) + , _interfaceOwner({ "Interfaces", "Interfaces", "Server Interfaces" }) { addPropertySubOwner(_interfaceOwner); diff --git a/modules/server/servermodule.h b/modules/server/servermodule.h index aa46637ced..8e241f7689 100644 --- a/modules/server/servermodule.h +++ b/modules/server/servermodule.h @@ -28,10 +28,11 @@ #include #include - #include +#include #include #include +#include namespace openspace { @@ -41,11 +42,6 @@ constexpr int SOCKET_API_VERSION_PATCH = 0; class Connection; -struct Message { - std::weak_ptr connection; - std::string messageString; -}; - class ServerModule : public OpenSpaceModule { public: static constexpr const char* Name = "Server"; @@ -68,6 +64,11 @@ protected: void internalInitialize(const ghoul::Dictionary& configuration) override; private: + struct Message { + std::weak_ptr connection; + std::string messageString; + }; + struct ConnectionData { std::shared_ptr connection; bool isMarkedForRemoval = false; diff --git a/modules/server/src/connection.cpp b/modules/server/src/connection.cpp index 6dfc99363b..ed3f9ea3f5 100644 --- a/modules/server/src/connection.cpp +++ b/modules/server/src/connection.cpp @@ -24,11 +24,13 @@ #include +#include #include #include #include #include #include +#include #include #include #include @@ -36,24 +38,28 @@ #include #include #include +#include #include #include -#include #include #include #include #include #include #include -#include -#include #include #include #include -#include -#include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "ServerModule: Connection"; @@ -61,7 +67,6 @@ namespace { constexpr std::string_view MessageKeyType = "type"; constexpr std::string_view MessageKeyPayload = "payload"; constexpr std::string_view MessageKeyTopic = "topic"; - } // namespace namespace openspace { @@ -91,6 +96,7 @@ Connection::Connection(std::unique_ptr s, std::string address _topicFactory.registerClass("camera"); _topicFactory.registerClass("cameraPath"); _topicFactory.registerClass("documentation"); + _topicFactory.registerClass("downloadEvent"); _topicFactory.registerClass("engineMode"); _topicFactory.registerClass("errorLog"); _topicFactory.registerClass("event"); @@ -214,6 +220,7 @@ void Connection::handleJson(const nlohmann::json& json) { void Connection::sendMessage(const std::string& message) { ZoneScoped; + std::lock_guard lock(_mutex); _socket->putMessage(message); } diff --git a/modules/server/src/connectionpool.cpp b/modules/server/src/connectionpool.cpp index 52da146c18..91e26d4e06 100644 --- a/modules/server/src/connectionpool.cpp +++ b/modules/server/src/connectionpool.cpp @@ -27,6 +27,7 @@ #include #include #include +#include namespace openspace { diff --git a/modules/server/src/jsonconverters.cpp b/modules/server/src/jsonconverters.cpp index 69805ab5b9..59fbf9702b 100644 --- a/modules/server/src/jsonconverters.cpp +++ b/modules/server/src/jsonconverters.cpp @@ -26,9 +26,12 @@ #include #include +#include #include #include -#include +#include +#include +#include using json = nlohmann::json; diff --git a/modules/server/src/logging/notificationlog.cpp b/modules/server/src/logging/notificationlog.cpp index 028700408e..822fb23e6f 100644 --- a/modules/server/src/logging/notificationlog.cpp +++ b/modules/server/src/logging/notificationlog.cpp @@ -24,6 +24,8 @@ #include +#include + namespace openspace { NotificationLog::NotificationLog(CallbackFunction callbackFunction, diff --git a/modules/server/src/serverinterface.cpp b/modules/server/src/serverinterface.cpp index 1654ec89f4..dff25afd82 100644 --- a/modules/server/src/serverinterface.cpp +++ b/modules/server/src/serverinterface.cpp @@ -25,10 +25,11 @@ #include #include +#include #include #include #include -#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { diff --git a/modules/server/src/topics/actionkeybindtopic.cpp b/modules/server/src/topics/actionkeybindtopic.cpp index 8021a9fead..05ec121e78 100644 --- a/modules/server/src/topics/actionkeybindtopic.cpp +++ b/modules/server/src/topics/actionkeybindtopic.cpp @@ -29,12 +29,29 @@ #include #include #include -#include +#include +#include +#include +#include +#include +#include +#include using nlohmann::json; namespace openspace { +void ActionKeybindTopic::handleJson(const nlohmann::json& input) { + const std::string& event = input.at("event").get(); + if (event == "get_all") { + sendData(allActionsKeybinds()); + } + else if (event == "get_action") { + const std::string& identifier = input.at("identifier").get(); + sendData(action(identifier)); + } +} + bool ActionKeybindTopic::isDone() const { return true; } @@ -116,15 +133,4 @@ void ActionKeybindTopic::sendData(nlohmann::json data) const { _connection->sendJson(std::move(payload)); } -void ActionKeybindTopic::handleJson(const nlohmann::json& input) { - const std::string& event = input.at("event").get(); - if (event == "get_all") { - sendData(allActionsKeybinds()); - } - else if (event == "get_action") { - const std::string& identifier = input.at("identifier").get(); - sendData(action(identifier)); - } -} - } // namespace openspace diff --git a/modules/server/src/topics/authorizationtopic.cpp b/modules/server/src/topics/authorizationtopic.cpp index 75451cb6e2..c797dde96a 100644 --- a/modules/server/src/topics/authorizationtopic.cpp +++ b/modules/server/src/topics/authorizationtopic.cpp @@ -25,9 +25,10 @@ #include #include -#include -#include #include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "AuthorizationTopic"; diff --git a/modules/server/src/topics/camerapathtopic.cpp b/modules/server/src/topics/camerapathtopic.cpp index c5a565e95d..68f817d700 100644 --- a/modules/server/src/topics/camerapathtopic.cpp +++ b/modules/server/src/topics/camerapathtopic.cpp @@ -32,7 +32,10 @@ #include #include #include -#include +#include +#include +#include +#include namespace { constexpr std::string_view SubscribeEvent = "start_subscription"; @@ -55,10 +58,6 @@ CameraPathTopic::~CameraPathTopic() { } } -bool CameraPathTopic::isDone() const { - return _isDone; -} - void CameraPathTopic::handleJson(const nlohmann::json& json) { const std::string event = json.at("event").get(); @@ -82,6 +81,10 @@ void CameraPathTopic::handleJson(const nlohmann::json& json) { ); } +bool CameraPathTopic::isDone() const { + return _isDone; +} + void CameraPathTopic::sendCameraPathData() { const interaction::PathNavigator& pathNavigator = global::navigationHandler->pathNavigator(); diff --git a/modules/server/src/topics/cameratopic.cpp b/modules/server/src/topics/cameratopic.cpp index 27c9622179..8075d548ec 100644 --- a/modules/server/src/topics/cameratopic.cpp +++ b/modules/server/src/topics/cameratopic.cpp @@ -24,24 +24,19 @@ #include -#ifdef OPENSPACE_MODULE_SPACE_ENABLED -#include -#endif // OPENSPACE_MODULE_SPACE_ENABLED #include #include #include #include -#include #include #include -#include +#include +#include namespace { constexpr std::string_view SubscribeEvent = "start_subscription"; } // namespace -using nlohmann::json; - namespace openspace { CameraTopic::CameraTopic() diff --git a/modules/server/src/topics/documentationtopic.cpp b/modules/server/src/topics/documentationtopic.cpp index d813f9971c..cf4ef83f2d 100644 --- a/modules/server/src/topics/documentationtopic.cpp +++ b/modules/server/src/topics/documentationtopic.cpp @@ -25,15 +25,8 @@ #include #include -#include #include -#include #include -#include -#include -#include - -using nlohmann::json; namespace openspace { diff --git a/modules/server/src/topics/downloadeventtopic.cpp b/modules/server/src/topics/downloadeventtopic.cpp new file mode 100644 index 0000000000..f594b56acb --- /dev/null +++ b/modules/server/src/topics/downloadeventtopic.cpp @@ -0,0 +1,90 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2025 * + * * + * 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. * + ****************************************************************************************/ + +#include + +#include +#include +#include +#include + +namespace { + constexpr std::string_view StartSubscription = "start_subscription"; + constexpr std::string_view StopSubscription = "stop_subscription"; + constexpr std::chrono::milliseconds CallbackUpdateInterval(250); +} // namespace + +namespace openspace { + +DownloadEventTopic::~DownloadEventTopic() { + if (_isSubscribedTo) { + global::downloadEventEngine->unsubscribe(_subscriptionID); + _isSubscribedTo = false; + } +} + +void DownloadEventTopic::handleJson(const nlohmann::json& json) { + const std::string& event = json.at("event").get(); + + if (event == StartSubscription) { + _isSubscribedTo = true; + + auto callback = [this](const DownloadEventEngine::DownloadEvent& event) { + // Limit how often we send data to frontend to reduce traffic + if (event.type == DownloadEventEngine::DownloadEvent::Type::Progress) { + const auto now = std::chrono::steady_clock::now(); + auto& last = _lastCallback[event.id]; + + if (now - last >= CallbackUpdateInterval) { + last = now; + } + else { + return; + } + } + + nlohmann::json payload; + payload["type"] = event.type; + payload["id"] = event.id; + payload["downloadedBytes"] = event.downloadedBytes; + if (event.totalBytes.has_value()) { + payload["totalBytes"] = event.totalBytes.value(); + } + + _connection->sendJson(wrappedPayload(payload)); + }; + _subscriptionID = global::downloadEventEngine->subscribe(callback); + } + + else if (event == StopSubscription) { + global::downloadEventEngine->unsubscribe(_subscriptionID); + _isSubscribedTo = false; + } +} + +bool DownloadEventTopic::isDone() const { + return !_isSubscribedTo; +} + +} // namespace openspace diff --git a/modules/server/src/topics/enginemodetopic.cpp b/modules/server/src/topics/enginemodetopic.cpp index 744200c342..6fccc7f305 100644 --- a/modules/server/src/topics/enginemodetopic.cpp +++ b/modules/server/src/topics/enginemodetopic.cpp @@ -26,8 +26,8 @@ #include #include -#include #include +#include namespace { constexpr std::string_view _loggerCat = "EngineModeTopic"; @@ -51,10 +51,6 @@ EngineModeTopic::~EngineModeTopic() { } } -bool EngineModeTopic::isDone() const { - return _isDone; -} - void EngineModeTopic::handleJson(const nlohmann::json& json) { const std::string event = json.at("event").get(); if (event != SubscribeEvent && event != UnsubscribeEvent && @@ -85,6 +81,10 @@ void EngineModeTopic::handleJson(const nlohmann::json& json) { } } +bool EngineModeTopic::isDone() const { + return _isDone; +} + void EngineModeTopic::sendJsonData() { const OpenSpaceEngine::Mode mode = global::openSpaceEngine->currentMode(); std::string modeString; diff --git a/modules/server/src/topics/errorlogtopic.cpp b/modules/server/src/topics/errorlogtopic.cpp index c6d0790004..7a225f34fa 100644 --- a/modules/server/src/topics/errorlogtopic.cpp +++ b/modules/server/src/topics/errorlogtopic.cpp @@ -25,7 +25,11 @@ #include #include +#include #include +#include +#include +#include namespace { constexpr std::string_view StartSubscription = "start_subscription"; diff --git a/modules/server/src/topics/eventtopic.cpp b/modules/server/src/topics/eventtopic.cpp index 9c3f5c2f9e..9af3580809 100644 --- a/modules/server/src/topics/eventtopic.cpp +++ b/modules/server/src/topics/eventtopic.cpp @@ -31,6 +31,11 @@ #include #include #include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "EventTopic"; @@ -43,10 +48,6 @@ using nlohmann::json; namespace openspace { -bool EventTopic::isDone() const { - return !isSubscribed(); -} - void EventTopic::handleJson(const nlohmann::json& json) { std::vector events; @@ -106,6 +107,10 @@ void EventTopic::handleJson(const nlohmann::json& json) { } } +bool EventTopic::isDone() const { + return !isSubscribed(); +} + bool EventTopic::isSubscribed() const { if (_subscribedEvents.empty()) { return false; diff --git a/modules/server/src/topics/flightcontrollertopic.cpp b/modules/server/src/topics/flightcontrollertopic.cpp index 1c2c364e6c..683409178b 100644 --- a/modules/server/src/topics/flightcontrollertopic.cpp +++ b/modules/server/src/topics/flightcontrollertopic.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -36,14 +35,15 @@ #include #include #include -#include -#include -#include #include #include #include #include #include +#include +#include +#include +#include namespace { enum class Command { diff --git a/modules/server/src/topics/luascripttopic.cpp b/modules/server/src/topics/luascripttopic.cpp index a5f31b41bd..dbf7ad96dd 100644 --- a/modules/server/src/topics/luascripttopic.cpp +++ b/modules/server/src/topics/luascripttopic.cpp @@ -24,14 +24,17 @@ #include -#include #include -#include +#include #include #include +#include #include #include #include +#include +#include +#include namespace { constexpr std::string_view KeyScript = "script"; diff --git a/modules/server/src/topics/missiontopic.cpp b/modules/server/src/topics/missiontopic.cpp index 6011bdf496..34ef9b09c0 100644 --- a/modules/server/src/topics/missiontopic.cpp +++ b/modules/server/src/topics/missiontopic.cpp @@ -25,18 +25,22 @@ #include #include -#include #include #include +#include #include #include #include #include - -using nlohmann::json; +#include namespace openspace { +void MissionTopic::handleJson(const nlohmann::json&) { + const nlohmann::json data = { {"missions", missionJson()} }; + _connection->sendJson(wrappedPayload(data)); +} + bool MissionTopic::isDone() const { return true; } @@ -56,7 +60,7 @@ nlohmann::json MissionTopic::missionJson() const { ); captureTimesString[i] = std::move(str); } - json json; + nlohmann::json json; for (auto const& [identifier, mission] : missions) { nlohmann::json missionJson = createPhaseJson(mission); missionJson["capturetimes"] = captureTimesString; @@ -66,16 +70,16 @@ nlohmann::json MissionTopic::missionJson() const { } nlohmann::json MissionTopic::createPhaseJson(const MissionPhase& phase) const { - json phases = json::array(); + nlohmann::json phases = nlohmann::json::array(); for (const MissionPhase& missionPhase : phase.phases()) { - json subphaseJson = createPhaseJson(missionPhase); + nlohmann::json subphaseJson = createPhaseJson(missionPhase); phases.push_back(std::move(subphaseJson)); } - json milestones = json::array(); + nlohmann::json milestones = nlohmann::json::array(); const std::vector& dates = phase.milestones(); for (const Milestone& date : dates) { - json jsonDate = { + nlohmann::json jsonDate = { { "date", std::string(date.date.ISO8601()) }, { "name", date.name } }; @@ -115,9 +119,4 @@ nlohmann::json MissionTopic::createPhaseJson(const MissionPhase& phase) const { return phaseJson; } -void MissionTopic::handleJson(const nlohmann::json&) { - const nlohmann::json data = { {"missions", missionJson()} }; - _connection->sendJson(wrappedPayload(data)); -} - } // namespace openspace diff --git a/modules/server/src/topics/profiletopic.cpp b/modules/server/src/topics/profiletopic.cpp index 3cf8b9d370..47b8df17bb 100644 --- a/modules/server/src/topics/profiletopic.cpp +++ b/modules/server/src/topics/profiletopic.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include @@ -33,10 +32,6 @@ namespace openspace { -bool ProfileTopic::isDone() const { - return true; -} - void ProfileTopic::handleJson(const nlohmann::json&) { // @TODO (2025-04-30, emmbr) If we expose the json converters from profile.cpp, we // could use those here instead and minimize the risk of getting the serialization of @@ -65,4 +60,8 @@ void ProfileTopic::handleJson(const nlohmann::json&) { _connection->sendJson(wrappedPayload(data)); } +bool ProfileTopic::isDone() const { + return true; +} + } // namespace openspace diff --git a/modules/server/src/topics/sessionrecordingtopic.cpp b/modules/server/src/topics/sessionrecordingtopic.cpp index 0b95bf9082..93f745fcda 100644 --- a/modules/server/src/topics/sessionrecordingtopic.cpp +++ b/modules/server/src/topics/sessionrecordingtopic.cpp @@ -26,8 +26,8 @@ #include #include -#include #include +#include namespace { constexpr std::string_view _loggerCat = "SessionRecordingTopic"; @@ -41,8 +41,6 @@ namespace { constexpr const char* StateKey = "state"; } // namespace -using nlohmann::json; - namespace openspace { SessionRecordingTopic::SessionRecordingTopic() { @@ -55,10 +53,6 @@ SessionRecordingTopic::~SessionRecordingTopic() { } } -bool SessionRecordingTopic::isDone() const { - return _isDone; -} - void SessionRecordingTopic::handleJson(const nlohmann::json& json) { const std::string event = json.at("event").get(); if (event != SubscribeEvent && event != UnsubscribeEvent && @@ -112,8 +106,12 @@ void SessionRecordingTopic::handleJson(const nlohmann::json& json) { } } +bool SessionRecordingTopic::isDone() const { + return _isDone; +} + void SessionRecordingTopic::sendJsonData() { - json stateJson; + nlohmann::json stateJson; using SessionRecordingHandler = interaction::SessionRecordingHandler; if (_sendState) { std::string stateString; diff --git a/modules/server/src/topics/setpropertytopic.cpp b/modules/server/src/topics/setpropertytopic.cpp index 94e39d55b6..6a7efa66ba 100644 --- a/modules/server/src/topics/setpropertytopic.cpp +++ b/modules/server/src/topics/setpropertytopic.cpp @@ -24,14 +24,15 @@ #include -#include #include #include -#include #include #include #include #include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "SetPropertyTopic"; diff --git a/modules/server/src/topics/skybrowsertopic.cpp b/modules/server/src/topics/skybrowsertopic.cpp index 4afc27f17b..4ae66ea919 100644 --- a/modules/server/src/topics/skybrowsertopic.cpp +++ b/modules/server/src/topics/skybrowsertopic.cpp @@ -30,10 +30,11 @@ #include #include #include -#include -#include -#include -#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view SubscribeEvent = "start_subscription"; @@ -62,10 +63,6 @@ SkyBrowserTopic::~SkyBrowserTopic() { } } -bool SkyBrowserTopic::isDone() const { - return _isDone; -} - void SkyBrowserTopic::handleJson(const nlohmann::json& json) { const std::string event = json.at("event").get(); if (event == UnsubscribeEvent) { @@ -90,6 +87,10 @@ void SkyBrowserTopic::handleJson(const nlohmann::json& json) { ); } +bool SkyBrowserTopic::isDone() const { + return _isDone; +} + void SkyBrowserTopic::sendBrowserData() { using namespace openspace; diff --git a/modules/server/src/topics/subscriptiontopic.cpp b/modules/server/src/topics/subscriptiontopic.cpp index d6e011bbda..2fa1b4f059 100644 --- a/modules/server/src/topics/subscriptiontopic.cpp +++ b/modules/server/src/topics/subscriptiontopic.cpp @@ -25,12 +25,11 @@ #include #include -#include #include #include -#include #include #include +#include namespace { constexpr std::string_view _loggerCat = "SubscriptionTopic"; @@ -47,28 +46,6 @@ SubscriptionTopic::~SubscriptionTopic() { resetCallbacks(); } -bool SubscriptionTopic::isDone() const { - return !_requestedResourceIsSubscribable || !_isSubscribedTo; -} - -void SubscriptionTopic::resetCallbacks() { - if (!_prop) { - return; - } - if (_onChangeHandle != UnsetCallbackHandle) { - _prop->removeOnChange(_onChangeHandle); - _onChangeHandle = UnsetCallbackHandle; - } - if (_onMetaDataChangeHandle != UnsetCallbackHandle) { - _prop->removeOnMetaDataChange(_onMetaDataChangeHandle); - _onMetaDataChangeHandle = UnsetCallbackHandle; - } - if (_onDeleteHandle != UnsetCallbackHandle) { - _prop->removeOnDelete(_onDeleteHandle); - _onDeleteHandle = UnsetCallbackHandle; - } -} - void SubscriptionTopic::handleJson(const nlohmann::json& json) { const std::string& event = json.at("event").get(); @@ -117,4 +94,26 @@ void SubscriptionTopic::handleJson(const nlohmann::json& json) { } } +bool SubscriptionTopic::isDone() const { + return !_requestedResourceIsSubscribable || !_isSubscribedTo; +} + +void SubscriptionTopic::resetCallbacks() { + if (!_prop) { + return; + } + if (_onChangeHandle != UnsetCallbackHandle) { + _prop->removeOnChange(_onChangeHandle); + _onChangeHandle = UnsetCallbackHandle; + } + if (_onMetaDataChangeHandle != UnsetCallbackHandle) { + _prop->removeOnMetaDataChange(_onMetaDataChangeHandle); + _onMetaDataChangeHandle = UnsetCallbackHandle; + } + if (_onDeleteHandle != UnsetCallbackHandle) { + _prop->removeOnDelete(_onDeleteHandle); + _onDeleteHandle = UnsetCallbackHandle; + } +} + } // namespace openspace diff --git a/modules/server/src/topics/timetopic.cpp b/modules/server/src/topics/timetopic.cpp index 6ffc50fdd5..ae5d546c45 100644 --- a/modules/server/src/topics/timetopic.cpp +++ b/modules/server/src/topics/timetopic.cpp @@ -26,10 +26,11 @@ #include #include -#include -#include #include -#include +#include +#include +#include +#include namespace { constexpr std::string_view SubscribeEvent = "start_subscription"; @@ -59,10 +60,6 @@ TimeTopic::~TimeTopic() { } } -bool TimeTopic::isDone() const { - return _isDone; -} - void TimeTopic::handleJson(const nlohmann::json& json) { const std::string event = json.at("event").get(); if (event == UnsubscribeEvent) { @@ -110,6 +107,10 @@ void TimeTopic::handleJson(const nlohmann::json& json) { ); } +bool TimeTopic::isDone() const { + return _isDone; +} + json TimeTopic::getNextPrevDeltaTimeStepJson() { const std::optional nextStep = global::timeManager->nextDeltaTimeStep(); const std::optional prevStep = global::timeManager->previousDeltaTimeStep(); diff --git a/modules/server/src/topics/topic.cpp b/modules/server/src/topics/topic.cpp index eebed65e5a..0a3b36d785 100644 --- a/modules/server/src/topics/topic.cpp +++ b/modules/server/src/topics/topic.cpp @@ -24,9 +24,10 @@ #include -#include +#include #include #include +#include namespace openspace { diff --git a/modules/server/src/topics/triggerpropertytopic.cpp b/modules/server/src/topics/triggerpropertytopic.cpp index 40aa9a362b..f2bcaf048c 100644 --- a/modules/server/src/topics/triggerpropertytopic.cpp +++ b/modules/server/src/topics/triggerpropertytopic.cpp @@ -24,12 +24,13 @@ #include -#include -#include -#include -#include #include #include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "TriggerPropertyTopic"; diff --git a/modules/server/src/topics/versiontopic.cpp b/modules/server/src/topics/versiontopic.cpp index 598d2cb285..5ee1a55b9e 100644 --- a/modules/server/src/topics/versiontopic.cpp +++ b/modules/server/src/topics/versiontopic.cpp @@ -32,10 +32,6 @@ namespace openspace { -bool VersionTopic::isDone() const { - return true; -} - void VersionTopic::handleJson(const nlohmann::json&) { nlohmann::json versionJson = { { @@ -70,4 +66,8 @@ void VersionTopic::handleJson(const nlohmann::json&) { _connection->sendJson(wrappedPayload(versionJson)); } +bool VersionTopic::isDone() const { + return true; +} + } // namespace openspace diff --git a/modules/skybrowser/include/renderableskytarget.h b/modules/skybrowser/include/renderableskytarget.h index ef2147a114..c1f9729151 100644 --- a/modules/skybrowser/include/renderableskytarget.h +++ b/modules/skybrowser/include/renderableskytarget.h @@ -27,15 +27,13 @@ #include -#include +#include +#include #include - -namespace openspace::documentation { struct Documentation; } +#include namespace openspace { -class ScreenSpaceSkyBrowser; - class RenderableSkyTarget : public RenderablePlane { public: explicit RenderableSkyTarget(const ghoul::Dictionary& dictionary); diff --git a/modules/skybrowser/include/screenspaceskybrowser.h b/modules/skybrowser/include/screenspaceskybrowser.h index bf15beae2e..fcbb3a8298 100644 --- a/modules/skybrowser/include/screenspaceskybrowser.h +++ b/modules/skybrowser/include/screenspaceskybrowser.h @@ -26,12 +26,13 @@ #define __OPENSPACE_MODULE_SKYBROWSER___SCREENSPACESKYBROWSER___H__ #include -#include -#include +#include #include -#include +#include #include +#include +#include namespace openspace { @@ -84,7 +85,8 @@ public: static documentation::Documentation Documentation(); private: - static constexpr int RadiusTimeOut = 25; + static constexpr int RadiusTimeout = 25; + properties::BoolProperty _isHidden; properties::BoolProperty _isPointingSpacecraft; properties::BoolProperty _updateDuringTargetAnimation; diff --git a/modules/skybrowser/include/targetbrowserpair.h b/modules/skybrowser/include/targetbrowserpair.h index b5956d07de..215329b0c0 100644 --- a/modules/skybrowser/include/targetbrowserpair.h +++ b/modules/skybrowser/include/targetbrowserpair.h @@ -26,16 +26,19 @@ #define __OPENSPACE_MODULE_SKYBROWSER___TARGETBROWSERPAIR___H__ #include +#include +#include +#include +#include namespace ghoul { class Dictionary; } namespace openspace { struct ImageData; +class RenderableSkyTarget; class SceneGraphNode; class ScreenSpaceSkyBrowser; -class RenderableSkyTarget; -class ScreenSpaceRenderable; class TargetBrowserPair { public: @@ -105,6 +108,7 @@ public: void loadImageCollection(const std::string& collection); void setImageOpacity(const std::string& imageUrl, float opacity); void hideChromeInterface(); + private: // Target and browser RenderableSkyTarget* _targetRenderable = nullptr; diff --git a/modules/skybrowser/include/utility.h b/modules/skybrowser/include/utility.h index 38fcf78926..b50371d838 100644 --- a/modules/skybrowser/include/utility.h +++ b/modules/skybrowser/include/utility.h @@ -25,10 +25,12 @@ #ifndef __OPENSPACE_MODULE_SKYBROWSER___UTILITY___H__ #define __OPENSPACE_MODULE_SKYBROWSER___UTILITY___H__ -#include #include +#include #include #include +#include +#include namespace openspace::skybrowser { diff --git a/modules/skybrowser/include/wwtcommunicator.h b/modules/skybrowser/include/wwtcommunicator.h index 2495ea56bc..daef9b7815 100644 --- a/modules/skybrowser/include/wwtcommunicator.h +++ b/modules/skybrowser/include/wwtcommunicator.h @@ -25,13 +25,17 @@ #ifndef __OPENSPACE_MODULE_SKYBROWSER___WWTCOMMUNICATOR___H__ #define __OPENSPACE_MODULE_SKYBROWSER___WWTCOMMUNICATOR___H__ -#include -#include - +#include #include +#include +#include +#include + +namespace ghoul { class Dictionary; } namespace openspace { -using SelectedImageDeque = std::deque>; + +class BrowserInstance; class WwtCommunicator { public: @@ -58,15 +62,15 @@ public: void setBorderRadius(double radius); void setIdInBrowser(const std::string& id) const; - SelectedImageDeque::iterator findSelectedImage(const std::string& imageUrl); + std::deque>::iterator findSelectedImage( + const std::string& imageUrl); private: void executeJavascript(const std::string& script) const; void sendMessageToWwt(const ghoul::Dictionary& msg) const; bool _isImageCollectionLoaded = false; - SelectedImageDeque _selectedImages; - + std::deque> _selectedImages; BrowserInstance* _browserInstance = nullptr; }; diff --git a/modules/skybrowser/include/wwtdatahandler.h b/modules/skybrowser/include/wwtdatahandler.h index c3d13e7007..992891d155 100644 --- a/modules/skybrowser/include/wwtdatahandler.h +++ b/modules/skybrowser/include/wwtdatahandler.h @@ -25,16 +25,16 @@ #ifndef __OPENSPACE_MODULE_SKYBROWSER___WWTDATAHANDLER___H__ #define __OPENSPACE_MODULE_SKYBROWSER___WWTDATAHANDLER___H__ +#include #include -#include +#include #include +#include namespace tinyxml2 { class XMLElement; } namespace openspace { -namespace documentation { struct Documentation; } - struct ImageData { std::string name; std::string thumbnailUrl; diff --git a/modules/skybrowser/skybrowsermodule.cpp b/modules/skybrowser/skybrowsermodule.cpp index 10786f8837..25c7417ba6 100644 --- a/modules/skybrowser/skybrowsermodule.cpp +++ b/modules/skybrowser/skybrowsermodule.cpp @@ -27,19 +27,32 @@ #include #include #include -#include #include +#include +#include #include -#include #include +#include #include #include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "skybrowsermodule_lua.inl" namespace { - constexpr openspace::properties::Property::PropertyInfo AllowRotationInfo = { "AllowCameraRotation", "Allow camera rotation", @@ -108,7 +121,6 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; - struct [[codegen::Dictionary(SkyBrowserModule)]] Parameters { // [[codegen::verbatim(AllowRotationInfo.description)]] std::optional allowCameraRotation; diff --git a/modules/skybrowser/skybrowsermodule.h b/modules/skybrowser/skybrowsermodule.h index 035cc4a0fb..7f40ab0e01 100644 --- a/modules/skybrowser/skybrowsermodule.h +++ b/modules/skybrowser/skybrowsermodule.h @@ -32,13 +32,12 @@ #include #include #include +#include #include namespace openspace { -struct ImageData; class SceneGraphNode; -class ScreenSpaceImageLocal; class TargetBrowserPair; class SkyBrowserModule : public OpenSpaceModule { diff --git a/modules/skybrowser/skybrowsermodule_lua.inl b/modules/skybrowser/skybrowsermodule_lua.inl index 0c2e31df03..72f8bb1a05 100644 --- a/modules/skybrowser/skybrowsermodule_lua.inl +++ b/modules/skybrowser/skybrowsermodule_lua.inl @@ -24,17 +24,13 @@ #include -#include #include -#include #include -#include #include #include #include #include #include -#include #include #include diff --git a/modules/skybrowser/src/renderableskytarget.cpp b/modules/skybrowser/src/renderableskytarget.cpp index 795059ddb2..b23451a152 100644 --- a/modules/skybrowser/src/renderableskytarget.cpp +++ b/modules/skybrowser/src/renderableskytarget.cpp @@ -24,22 +24,20 @@ #include -#include -#include #include #include +#include #include -#include #include -#include #include -#include -#include #include #include +#include +#include #include -#include -#include +#include +#include +#include namespace { enum BlendMode { diff --git a/modules/skybrowser/src/screenspaceskybrowser.cpp b/modules/skybrowser/src/screenspaceskybrowser.cpp index 42ac08d865..ac0c44584b 100644 --- a/modules/skybrowser/src/screenspaceskybrowser.cpp +++ b/modules/skybrowser/src/screenspaceskybrowser.cpp @@ -25,17 +25,19 @@ #include #include -#include #include +#include +#include #include #include #include -#include -#include -#include -#include -#include +#include +#include #include +#include +#include +#include +#include #include namespace { @@ -462,7 +464,7 @@ void ScreenSpaceSkyBrowser::update() { } // After the texture has been updated, wait a little bit before updating the border // radius so the browser has time to update its size - if (_radiusIsDirty && _isInitialized && _borderRadiusTimer > RadiusTimeOut) { + if (_radiusIsDirty && _isInitialized && _borderRadiusTimer > RadiusTimeout) { _wwtCommunicator.setBorderRadius(_borderRadius); _radiusIsDirty = false; _borderRadiusTimer = -1; diff --git a/modules/skybrowser/src/targetbrowserpair.cpp b/modules/skybrowser/src/targetbrowserpair.cpp index d6b2e1e390..53c933023a 100644 --- a/modules/skybrowser/src/targetbrowserpair.cpp +++ b/modules/skybrowser/src/targetbrowserpair.cpp @@ -34,11 +34,15 @@ #include #include #include +#include #include +#include #include -#include -#include +#include +#include #include +#include +#include namespace { void aimTargetGalactic(std::string_view id, const glm::dvec3& direction) { diff --git a/modules/skybrowser/src/utility.cpp b/modules/skybrowser/src/utility.cpp index eff7639ab4..460837f63c 100644 --- a/modules/skybrowser/src/utility.cpp +++ b/modules/skybrowser/src/utility.cpp @@ -29,7 +29,9 @@ #include #include #include +#include #include +#include namespace { // Galactic coordinates are projected onto the celestial sphere diff --git a/modules/skybrowser/src/wwtcommunicator.cpp b/modules/skybrowser/src/wwtcommunicator.cpp index 8cdb886433..b3e5c71280 100644 --- a/modules/skybrowser/src/wwtcommunicator.cpp +++ b/modules/skybrowser/src/wwtcommunicator.cpp @@ -24,13 +24,12 @@ #include -#include -#include -#include -#include -#include +#include +#include #include -#include +#include +#include +#include namespace { // WWT messages @@ -197,7 +196,7 @@ bool WwtCommunicator::isImageCollectionLoaded() const { return _isImageCollectionLoaded; } -SelectedImageDeque::iterator WwtCommunicator::findSelectedImage( +std::deque>::iterator WwtCommunicator::findSelectedImage( const std::string& imageUrl) { auto it = std::find_if( diff --git a/modules/skybrowser/src/wwtdatahandler.cpp b/modules/skybrowser/src/wwtdatahandler.cpp index 25d2c41deb..f8b57715e6 100644 --- a/modules/skybrowser/src/wwtdatahandler.cpp +++ b/modules/skybrowser/src/wwtdatahandler.cpp @@ -27,8 +27,17 @@ #include #include #include -#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "WwtDataHandler"; diff --git a/modules/space/horizonsfile.cpp b/modules/space/horizonsfile.cpp index 8f174f436d..4f576297ca 100644 --- a/modules/space/horizonsfile.cpp +++ b/modules/space/horizonsfile.cpp @@ -27,14 +27,15 @@ #include #include #include -#include #include #include #include -#include +#include #include - -using json = nlohmann::json; +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "HorizonsFile"; @@ -116,7 +117,9 @@ std::string constructHorizonsUrl(HorizonsType type, const std::string& target, return url; } -json sendHorizonsRequest(const std::string& url, const std::filesystem::path& filePath) { +nlohmann::json sendHorizonsRequest(const std::string& url, + const std::filesystem::path& filePath) +{ // Set up HTTP request and download result const auto download = std::make_unique( url, @@ -155,10 +158,10 @@ nlohmann::json convertHorizonsDownloadToJson(const std::filesystem::path& filePa answer.append(buf, 0, stream.gcount()); // convert to a json object - return json::parse(answer); + return nlohmann::json::parse(answer); } -HorizonsResultCode isValidHorizonsAnswer(const json& answer) { +HorizonsResultCode isValidHorizonsAnswer(const nlohmann::json& answer) { // Signature, source and version if (auto signature = answer.find("signature"); signature != answer.end()) { if (auto source = signature->find("source"); source != signature->end()) { diff --git a/modules/space/horizonsfile.h b/modules/space/horizonsfile.h index 9cc9d20ca9..b46a0a737d 100644 --- a/modules/space/horizonsfile.h +++ b/modules/space/horizonsfile.h @@ -30,13 +30,14 @@ #include #include #include +#include namespace openspace { /** * A Horizons file is a text file generated from NASA JPL HORIZONS Website - * (https://ssd.jpl.nasa.gov/horizons.cgi). The implementation supports both Vector - * and Observer as Horizons data table. + * (https://ssd.jpl.nasa.gov/horizons.cgi). The implementation supports both Vector and + * Observer as Horizons data table. * * In case of Vector table data the implementation expects a file with format: * TIME(JulianDayNumber = A.D. YYYY-MM-DD HH:MM:SS TDB) @@ -126,8 +127,7 @@ private: // Free functions std::string constructHorizonsUrl(HorizonsType type, const std::string& target, const std::string& observer, const std::string& startTime, - const std::string& stopTime, const std::string& stepSize, - const std::string& unit); + const std::string& stopTime, const std::string& stepSize, const std::string& unit); nlohmann::json sendHorizonsRequest(const std::string& url, const std::filesystem::path& filePath); nlohmann::json convertHorizonsDownloadToJson(const std::filesystem::path& filePath); diff --git a/modules/space/kepler.h b/modules/space/kepler.h index f79ff64fcf..2d8f4f4994 100644 --- a/modules/space/kepler.h +++ b/modules/space/kepler.h @@ -106,6 +106,7 @@ enum class Format { SBDB, ///< Small-Body Database MPC ///< Minor Planet Center }; + /** * Reads the object information from the provided file. * diff --git a/modules/space/rendering/renderableconstellationbounds.cpp b/modules/space/rendering/renderableconstellationbounds.cpp index 0ddd6127ac..f69e7bb363 100644 --- a/modules/space/rendering/renderableconstellationbounds.cpp +++ b/modules/space/rendering/renderableconstellationbounds.cpp @@ -29,12 +29,21 @@ #include #include #include +#include #include +#include +#include #include #include +#include "SpiceUsr.h" +#include +#include +#include #include #include -#include "SpiceUsr.h" +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderableConstellationBounds"; @@ -340,7 +349,7 @@ bool RenderableConstellationBounds::loadVertexFile() { static_cast(rectangularValues[1]), static_cast(rectangularValues[2]) }); - ++currentLineNumber; + currentLineNumber++; } // Due to the way we read the file, the first (empty) constellation bounds will not diff --git a/modules/space/rendering/renderableconstellationbounds.h b/modules/space/rendering/renderableconstellationbounds.h index 7e6dea4a7e..efeac1ea1c 100644 --- a/modules/space/rendering/renderableconstellationbounds.h +++ b/modules/space/rendering/renderableconstellationbounds.h @@ -27,14 +27,13 @@ #include +#include +#include +#include #include -namespace ghoul::opengl { class ProgramObject; } - namespace openspace { -namespace documentation { struct Documentation; } - /** * This class renders the constellation bounds as defined in * http://cdsarc.u-strasbg.fr/viz-bin/Cat?cat=VI%2F49. It contains the bounds on the diff --git a/modules/space/rendering/renderableconstellationlines.cpp b/modules/space/rendering/renderableconstellationlines.cpp index fc5e4e2be5..50c7a448c8 100644 --- a/modules/space/rendering/renderableconstellationlines.cpp +++ b/modules/space/rendering/renderableconstellationlines.cpp @@ -24,21 +24,29 @@ #include +#include #include #include #include #include #include +#include #include #include +#include +#include #include #include #include #include -#include +#include #include #include #include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderableConstellationLines"; diff --git a/modules/space/rendering/renderableconstellationlines.h b/modules/space/rendering/renderableconstellationlines.h index 4910cb75c3..2edd08bc97 100644 --- a/modules/space/rendering/renderableconstellationlines.h +++ b/modules/space/rendering/renderableconstellationlines.h @@ -27,20 +27,15 @@ #include +#include +#include +#include +#include #include #include -namespace ghoul::filesystem { class File; } -namespace ghoul::fontrendering { class Font; } -namespace ghoul::opengl { - class ProgramObject; - class Texture; -} // namespace ghoul::opengl - namespace openspace { -namespace documentation { struct Documentation; } - class RenderableConstellationLines : public RenderableConstellationsBase { public: explicit RenderableConstellationLines(const ghoul::Dictionary& dictionary); diff --git a/modules/space/rendering/renderableconstellationsbase.cpp b/modules/space/rendering/renderableconstellationsbase.cpp index 0a594d8a1e..0523742caf 100644 --- a/modules/space/rendering/renderableconstellationsbase.cpp +++ b/modules/space/rendering/renderableconstellationsbase.cpp @@ -24,18 +24,20 @@ #include +#include #include -#include -#include -#include #include -#include +#include #include #include #include -#include +#include +#include +#include #include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderableConstellationsBase"; diff --git a/modules/space/rendering/renderableconstellationsbase.h b/modules/space/rendering/renderableconstellationsbase.h index 63e69d40ab..e55575503c 100644 --- a/modules/space/rendering/renderableconstellationsbase.h +++ b/modules/space/rendering/renderableconstellationsbase.h @@ -27,23 +27,14 @@ #include -#include #include -#include -#include +#include +#include #include -#include -#include -#include -#include -#include - -namespace ghoul::opengl { class ProgramObject; } +#include namespace openspace { -namespace documentation { struct Documentation; } - /** * This is a base class for constellation lines and bounds. */ diff --git a/modules/space/rendering/renderableeclipsecone.cpp b/modules/space/rendering/renderableeclipsecone.cpp index 60924dd83a..c0beb2fbde 100644 --- a/modules/space/rendering/renderableeclipsecone.cpp +++ b/modules/space/rendering/renderableeclipsecone.cpp @@ -26,12 +26,17 @@ #include #include -#include #include #include #include #include #include +#include +#include +#include +#include +#include +#include namespace { struct VBOLayout { diff --git a/modules/space/rendering/renderableeclipsecone.h b/modules/space/rendering/renderableeclipsecone.h index df0afdd74c..cef5d9549e 100644 --- a/modules/space/rendering/renderableeclipsecone.h +++ b/modules/space/rendering/renderableeclipsecone.h @@ -27,23 +27,16 @@ #include -#include #include -#include +#include #include +#include #include #include #include -namespace ghoul::opengl { class ProgramObject; } - namespace openspace { -namespace documentation { struct Documentation; } - -struct RenderData; -struct UpdateData; - class RenderableEclipseCone : public Renderable { public: explicit RenderableEclipseCone(const ghoul::Dictionary& dictionary); diff --git a/modules/space/rendering/renderablefluxnodes.cpp b/modules/space/rendering/renderablefluxnodes.cpp index 39a8f76ee0..a199258340 100644 --- a/modules/space/rendering/renderablefluxnodes.cpp +++ b/modules/space/rendering/renderablefluxnodes.cpp @@ -24,27 +24,32 @@ #include +#include #include #include -#include -#include #include -#include -#include +#include +#include +#include #include #include #include +#include #include -#include -#include +#include +#include #include #include #include +#include +#include +#include +#include #include -#include +#include +#include #include -#include -#include +#include namespace { constexpr std::string_view _loggerCat = "RenderableFluxNodes"; @@ -624,7 +629,7 @@ void RenderableFluxNodes::populateStartTimes() { std::string columnName; // loops through the names/columns in first line/header while (s >> columnName) { - ++nColumns; + nColumns++; } while (ghoul::getline(tfs, line)) { // for each line of data std::istringstream iss(line); diff --git a/modules/space/rendering/renderablefluxnodes.h b/modules/space/rendering/renderablefluxnodes.h index 26b9fff32e..01cd61bf15 100644 --- a/modules/space/rendering/renderablefluxnodes.h +++ b/modules/space/rendering/renderablefluxnodes.h @@ -29,14 +29,17 @@ #include #include -#include +#include +#include #include #include #include #include +#include #include -#include +#include #include +#include namespace openspace { @@ -69,33 +72,38 @@ private: std::vector _lineCount; std::vector _lineStart; + // Used to determine if lines should be colored UNIFORMLY or by Flux Value enum class ColorMethod { ByFluxValue = 0, - Uniform = 1 + Uniform }; + enum class GoesEnergyBins { Emin01 = 0, - Emin03 = 1 + Emin03 }; + enum class ScalingMethod { Flux = 0, - RFlux = 1, - R2Flux = 2, - Log10RFlux = 3, - LnRFlux = 4 + RFlux, + R2Flux, + Log10RFlux, + LnRFlux }; + enum class NodeSkipMethod { Uniform = 0, - Flux = 1, - Radius = 2, - Streamnumber = 3 + Flux, + Radius, + Streamnumber }; + enum class EnhanceMethod { SizeScaling = 0, - ColorTables = 1, - SizeAndColor = 2, - Illuminance = 3, + ColorTables, + SizeAndColor, + Illuminance }; UniformCache(streamColor, nodeSize, proximityNodesSize, diff --git a/modules/space/rendering/renderablehabitablezone.cpp b/modules/space/rendering/renderablehabitablezone.cpp index c09aac4a60..489fa2b49c 100644 --- a/modules/space/rendering/renderablehabitablezone.cpp +++ b/modules/space/rendering/renderablehabitablezone.cpp @@ -25,18 +25,17 @@ #include #include -#include #include #include -#include -#include #include #include -#include #include +#include #include #include #include +#include +#include #include namespace { diff --git a/modules/space/rendering/renderablehabitablezone.h b/modules/space/rendering/renderablehabitablezone.h index 01c5091bb1..9b8164e67d 100644 --- a/modules/space/rendering/renderablehabitablezone.h +++ b/modules/space/rendering/renderablehabitablezone.h @@ -26,14 +26,14 @@ #define __OPENSPACE_MODULE_SPACE___RENDERABLEHABITABLEZONE___H__ #include + #include #include #include +#include namespace openspace { -namespace documentation { struct Documentation; } - class RenderableHabitableZone : public RenderableDisc { public: explicit RenderableHabitableZone(const ghoul::Dictionary& dictionary); diff --git a/modules/space/rendering/renderableorbitalkepler.cpp b/modules/space/rendering/renderableorbitalkepler.cpp index 1e5ad024d1..a72e759cc4 100644 --- a/modules/space/rendering/renderableorbitalkepler.cpp +++ b/modules/space/rendering/renderableorbitalkepler.cpp @@ -26,32 +26,49 @@ #include #include -#include #include #include #include -#include #include #include #include -#include -#include #include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include #include -#include +#include namespace { // The possible values for the _renderingModes property - enum RenderingMode { + enum class RenderMode { RenderingModeTrail = 0, RenderingModePoint, RenderingModePointTrail }; + enum class PointRenderingMode { + ViewDirection = 0, + PositionNormal + }; + constexpr openspace::properties::Property::PropertyInfo PathInfo = { "Path", "Path", @@ -59,6 +76,17 @@ namespace { openspace::properties::Property::Visibility::AdvancedUser }; + constexpr openspace::properties::Property::PropertyInfo PointRenderingModeInfo = { + "PointRenderingMode", + "Point Rendering Mode", + "Controls how the points will be oriented. \"Camera View Direction\" rotates the " + "points so that they are orthogonal to the viewing direction of the camera " + "(useful for planar displays), and \"Camera Position Normal\" rotates the points " + "towards the position of the camera (useful for spherical displays, like dome " + "theaters).", + openspace::properties::Property::Visibility::AdvancedUser + }; + constexpr openspace::properties::Property::PropertyInfo SegmentQualityInfo = { "SegmentQuality", "Segment quality", @@ -193,6 +221,13 @@ namespace { // The file format that is contained in the file. Format format; + enum class [[codegen::map(PointRenderingMode)]] PointRenderingMode { + ViewDirection [[codegen::key("Camera View Direction")]], + PositionNormal [[codegen::key("Camera Position Normal")]] + }; + // [[codegen::verbatim(PointRenderingModeInfo.description)]] + std::optional pointRenderingMode; + // [[codegen::verbatim(SegmentQualityInfo.description)]] int segmentQuality; @@ -261,22 +296,24 @@ RenderableOrbitalKepler::Appearance::Appearance() , enableMaxSize(EnableMaxSizeInfo, true) , maxSize(MaxSizeInfo, 5.f, 0.f, 45.f) , renderingModes(RenderingModeInfo) + , pointRenderOption(PointRenderingModeInfo) , trailFade(TrailFadeInfo, 20.f, 0.f, 30.f) , enableOutline(EnableOutlineInfo, true) , outlineColor(OutlineColorInfo, glm::vec3(0.f), glm::vec3(0.f), glm::vec3(1.f)) , outlineWidth(OutlineWidthInfo, 0.2f, 0.f, 1.f) { renderingModes.addOptions({ - { RenderingModeTrail, "Trails" }, - { RenderingModePoint, "Points" }, - { RenderingModePointTrail , "Points and Trails" } + { static_cast(RenderMode::RenderingModeTrail), "Trails" }, + { static_cast(RenderMode::RenderingModePoint), "Points"}, + { static_cast(RenderMode::RenderingModePointTrail) , "Points and Trails" } }); + renderingModes.onChange([this]() { isRenderTypeDirty = true; }); addProperty(renderingModes); - color.setViewOption(properties::Property::ViewOptions::Color); addProperty(color); addProperty(trailWidth); addProperty(trailFade); + addProperty(pointRenderOption); addProperty(pointSizeExponent); addProperty(enableMaxSize); addProperty(maxSize); @@ -288,6 +325,7 @@ RenderableOrbitalKepler::Appearance::Appearance() RenderableOrbitalKepler::RenderableOrbitalKepler(const ghoul::Dictionary& dict) : Renderable(dict) + , _nThreads(std::max(1u, std::thread::hardware_concurrency() / 2u)) , _segmentQuality(SegmentQualityInfo, 2, 1, 10) , _startRenderIdx(StartRenderIdxInfo, 0, 0, 1) , _sizeRender(RenderSizeInfo, 1, 1, 2) @@ -299,11 +337,12 @@ RenderableOrbitalKepler::RenderableOrbitalKepler(const ghoul::Dictionary& dict) addProperty(Fadeable::_opacity); _segmentQuality = static_cast(p.segmentQuality); - _segmentQuality.onChange([this]() { updateBuffers(); }); + _segmentQuality.onChange([this]() { _updateDataBuffersAtNextRender = true; }); addProperty(_segmentQuality); _appearance.color = p.color; _appearance.trailFade = p.trailFade.value_or(_appearance.trailFade); + _appearance.trailFade.onChange([this]() { _forceUpdate = true; }); _appearance.trailWidth = p.trailWidth.value_or(_appearance.trailWidth); _appearance.enableMaxSize = p.enableMaxSize.value_or(_appearance.enableMaxSize); _appearance.maxSize = p.maxSize.value_or(_appearance.maxSize); @@ -313,21 +352,49 @@ RenderableOrbitalKepler::RenderableOrbitalKepler(const ghoul::Dictionary& dict) _appearance.pointSizeExponent = p.pointSizeExponent.value_or(_appearance.pointSizeExponent); - if (p.renderingMode.has_value()) { - switch (*p.renderingMode) { - case Parameters::RenderingMode::Trail: - _appearance.renderingModes = RenderingModeTrail; + _appearance.pointRenderOption.addOption( + static_cast(PointRenderingMode::ViewDirection), + "Camera View Direction" + ); + _appearance.pointRenderOption.addOption( + static_cast(PointRenderingMode::PositionNormal), + "Camera Position Normal" + ); + if (p.pointRenderingMode.has_value()) { + switch (*p.pointRenderingMode) { + case Parameters::PointRenderingMode::ViewDirection: + _appearance.pointRenderOption = + static_cast(PointRenderingMode::ViewDirection); break; - case Parameters::RenderingMode::Point: - _appearance.renderingModes = RenderingModePoint; - break; - case Parameters::RenderingMode::PointsTrails: - _appearance.renderingModes = RenderingModePointTrail; + case Parameters::PointRenderingMode::PositionNormal: + _appearance.pointRenderOption = + static_cast(PointRenderingMode::PositionNormal); break; } } else { - _appearance.renderingModes = RenderingModeTrail; + _appearance.pointRenderOption = + static_cast(PointRenderingMode::ViewDirection); + } + + if (p.renderingMode.has_value()) { + switch (*p.renderingMode) { + case Parameters::RenderingMode::Trail: + _appearance.renderingModes = + static_cast(RenderMode::RenderingModeTrail); + break; + case Parameters::RenderingMode::Point: + _appearance.renderingModes = + static_cast(RenderMode::RenderingModePoint); + break; + case Parameters::RenderingMode::PointsTrails: + _appearance.renderingModes = + static_cast(RenderMode::RenderingModePointTrail); + break; + } + } + else { + _appearance.renderingModes = static_cast(RenderMode::RenderingModeTrail); } addPropertySubOwner(_appearance); @@ -336,8 +403,8 @@ RenderableOrbitalKepler::RenderableOrbitalKepler(const ghoul::Dictionary& dict) _startRenderIdx = p.startRenderIdx.value_or(0); _startRenderIdx.onChange([this]() { if (_contiguousMode) { - if ((_numObjects - _startRenderIdx) < _sizeRender) { - _sizeRender = static_cast(_numObjects - _startRenderIdx); + if ((_nOrbits - _startRenderIdx) < _sizeRender) { + _sizeRender = static_cast(_nOrbits - _startRenderIdx); } _updateDataBuffersAtNextRender = true; } @@ -347,8 +414,8 @@ RenderableOrbitalKepler::RenderableOrbitalKepler(const ghoul::Dictionary& dict) _sizeRender = p.renderSize.value_or(0u); _sizeRender.onChange([this]() { if (_contiguousMode) { - if (_sizeRender > (_numObjects - _startRenderIdx)) { - _startRenderIdx = static_cast(_numObjects - _sizeRender); + if (_sizeRender > (_nOrbits - _startRenderIdx)) { + _startRenderIdx = static_cast(_nOrbits - _sizeRender); } } _updateDataBuffersAtNextRender = true; @@ -360,7 +427,7 @@ RenderableOrbitalKepler::RenderableOrbitalKepler(const ghoul::Dictionary& dict) addProperty(_contiguousMode); _path = p.path.string(); - _path.onChange([this]() { updateBuffers(); }); + _path.onChange([this]() { _updateDataBuffersAtNextRender = true; }); addProperty(_path); } @@ -398,7 +465,7 @@ void RenderableOrbitalKepler::initializeGL() { ghoul::opengl::updateUniformLocations(*_trailProgram, _uniformTrailCache); ghoul::opengl::updateUniformLocations(*_pointProgram, _uniformPointCache); - updateBuffers(); + _updateDataBuffersAtNextRender = true; } void RenderableOrbitalKepler::deinitializeGL() { @@ -427,11 +494,32 @@ bool RenderableOrbitalKepler::isReady() const { return _pointProgram != nullptr && _trailProgram != nullptr; } -void RenderableOrbitalKepler::update(const UpdateData&) { +void RenderableOrbitalKepler::update(const UpdateData& data) { if (_updateDataBuffersAtNextRender) { - _updateDataBuffersAtNextRender = false; updateBuffers(); + _forceUpdate = true; } + + if (_appearance.isRenderTypeDirty) { + _forceUpdate = true; + } + + bool isPaused = data.time.j2000Seconds() == data.previousFrameTime.j2000Seconds(); + if (!isPaused || _forceUpdate) { + std::for_each( + std::execution::par_unseq, + _threadIds.begin(), + _threadIds.end(), + [&](int threadId) { + threadedSegmentCalculations(threadId, data); + } + ); + } + + _lineDrawCount = static_cast(_segmentsPerOrbit.size() * 2); + _updateDataBuffersAtNextRender = false; + _appearance.isRenderTypeDirty = false; + _forceUpdate = false; } void RenderableOrbitalKepler::render(const RenderData& data, RendererTasks&) { @@ -439,18 +527,25 @@ void RenderableOrbitalKepler::render(const RenderData& data, RendererTasks&) { return; } - const int selection = _appearance.renderingModes; - const bool renderPoints = ( - selection == RenderingModePoint || - selection == RenderingModePointTrail - ); - const bool renderTrails = ( - selection == RenderingModeTrail || - selection == RenderingModePointTrail - ); - - if (renderPoints) { - calculateSegmentsForPoints(data); + if (_renderPoints) { + glm::vec3 cameraViewDirectionWorld = -data.camera.viewDirectionWorldSpace(); + glm::vec3 cameraUpDirectionWorld = data.camera.lookUpVectorWorldSpace(); + glm::vec3 orthoRight = glm::normalize( + glm::cross(cameraUpDirectionWorld, cameraViewDirectionWorld) + ); + if (orthoRight == glm::vec3(0.f)) { + glm::vec3 otherVector = glm::vec3( + cameraUpDirectionWorld.y, + cameraUpDirectionWorld.x, + cameraUpDirectionWorld.z + ); + orthoRight = glm::normalize( + glm::cross(otherVector, cameraViewDirectionWorld) + ); + } + glm::vec3 orthoUp = glm::normalize( + glm::cross(cameraViewDirectionWorld, orthoRight) + ); _pointProgram->activate(); _pointProgram->setUniform( @@ -465,6 +560,18 @@ void RenderableOrbitalKepler::render(const RenderData& data, RendererTasks&) { _uniformPointCache.projectionTransform, data.camera.projectionMatrix() ); + _pointProgram->setUniform( + _uniformPointCache.renderOption, + _appearance.pointRenderOption + ); + _pointProgram->setUniform( + _uniformPointCache.cameraViewDirectionUp, + orthoUp + ); + _pointProgram->setUniform( + _uniformPointCache.cameraViewDirectionRight, + orthoRight + ); _pointProgram->setUniform( _uniformPointCache.cameraPositionWorld, data.camera.positionVec3() @@ -513,9 +620,7 @@ void RenderableOrbitalKepler::render(const RenderData& data, RendererTasks&) { _pointProgram->deactivate(); } - if (renderTrails) { - calculateSegmentsForTrails(data); - + if (_renderTrails) { _trailProgram->activate(); _trailProgram->setUniform(_uniformTrailCache.opacity, opacity()); _trailProgram->setUniform(_uniformTrailCache.color, _appearance.color); @@ -562,32 +667,31 @@ void RenderableOrbitalKepler::render(const RenderData& data, RendererTasks&) { void RenderableOrbitalKepler::updateBuffers() { _parameters = kepler::readFile(_path.value(), _format); + _nOrbits = static_cast(_parameters.size()); - _numObjects = _parameters.size(); - - if (_startRenderIdx >= _numObjects) { + if (_startRenderIdx >= _nOrbits) { throw ghoul::RuntimeError(std::format( - "Start index {} out of range [0, {}]", _startRenderIdx.value(), _numObjects + "Start index {} out of range [0, {}]", _startRenderIdx.value(), _nOrbits )); } long long endElement = _startRenderIdx + _sizeRender - 1; - endElement = (endElement >= _numObjects) ? _numObjects - 1 : endElement; - if (endElement < 0 || endElement >= _numObjects) { + endElement = (endElement >= _nOrbits) ? _nOrbits - 1 : endElement; + if (endElement < 0 || endElement >= _nOrbits) { throw ghoul::RuntimeError(std::format( - "End index {} out of range [0, {}]", endElement, _numObjects + "End index {} out of range [0, {}]", endElement, _nOrbits )); } - _startRenderIdx.setMaxValue(static_cast(_numObjects - 1)); - _sizeRender.setMaxValue(static_cast(_numObjects)); + _startRenderIdx.setMaxValue(static_cast(_nOrbits - 1)); + _sizeRender.setMaxValue(static_cast(_nOrbits)); if (_sizeRender == 0u) { - _sizeRender = static_cast(_numObjects); + _sizeRender = static_cast(_nOrbits); } if (_contiguousMode) { if (_startRenderIdx >= _parameters.size() || - (_startRenderIdx + _sizeRender) >= _parameters.size()) + (_startRenderIdx + _sizeRender) > _parameters.size()) { throw ghoul::RuntimeError(std::format( "Tried to load {} objects but only {} are available", @@ -613,64 +717,112 @@ void RenderableOrbitalKepler::updateBuffers() { ); } + _threadIds.clear(); + _orbitsPerThread.clear(); + _updateHelper.clear(); _startIndexPoints.clear(); _segmentSizePoints.clear(); + _vertexBufferOffset.clear(); _startIndexTrails.clear(); _segmentSizeTrails.clear(); - _segmentSizeRaw.clear(); + _segmentsPerOrbit.clear(); + + _updateHelper.resize(_sizeRender); + _startIndexPoints.resize(_sizeRender); + _segmentSizePoints.resize(_sizeRender); + _vertexBufferOffset.resize(_sizeRender); + _segmentsPerOrbit.resize(_sizeRender); + + // Trail vectors needs double length as it may use two trails per orbit + _startIndexTrails.resize(_sizeRender * 2); + _segmentSizeTrails.resize(_sizeRender * 2); + + double maxSemiMajorAxis = 0.0; size_t nVerticesTotal = 0; - const int numOrbits = static_cast(_parameters.size()); - for (int i = 0; i < numOrbits; i++) { + for (unsigned int i = 0; i < _sizeRender; i++) { // For points rendering as they are always two vertices long - _segmentSizePoints.push_back(2); + _segmentSizePoints[i] = 2; const double scale = static_cast(_segmentQuality) * 10.0; const kepler::Parameters& p = _parameters[i]; - _segmentSizeRaw.push_back( - static_cast(scale + (scale / std::pow(1.0 - p.eccentricity, 1.2))) + _segmentsPerOrbit[i] = static_cast( + scale + (scale / std::pow(1.0 - p.eccentricity, 1.2)) ); - nVerticesTotal += _segmentSizeRaw[i]; + _vertexBufferOffset[i] = static_cast(nVerticesTotal); + nVerticesTotal += _segmentsPerOrbit[i]; + + // Find largest value for bounding sphere + if (p.semiMajorAxis > maxSemiMajorAxis) { + maxSemiMajorAxis = p.semiMajorAxis; + } } - _startIndexPoints.resize(numOrbits); - _startIndexTrails.resize(numOrbits*2); - _segmentSizeTrails.resize(numOrbits*2); + setBoundingSphere(maxSemiMajorAxis * 1000); _vertexBufferData.resize(nVerticesTotal); - size_t vertexBufIdx = 0; - for (int orbitIdx = 0; orbitIdx < numOrbits; orbitIdx++) { - const kepler::Parameters& orbit = _parameters[orbitIdx]; + std::vector orbitIdHolder; + orbitIdHolder.resize(_sizeRender); + std::iota(orbitIdHolder.begin(), orbitIdHolder.end(), 0); - ghoul::Dictionary d; - d.setValue("Type", std::string("KeplerTranslation")); - d.setValue("Eccentricity", orbit.eccentricity); - d.setValue("SemiMajorAxis", orbit.semiMajorAxis); - d.setValue("Inclination", orbit.inclination); - d.setValue("AscendingNode", orbit.ascendingNode); - d.setValue("ArgumentOfPeriapsis", orbit.argumentOfPeriapsis); - d.setValue("MeanAnomaly", orbit.meanAnomaly); - d.setValue("Period", orbit.period); - d.setValue("Epoch", orbit.epoch); - KeplerTranslation keplerTranslator = KeplerTranslation(d); + std::for_each( + std::execution::par_unseq, + orbitIdHolder.begin(), + orbitIdHolder.end(), + [&](int index) { + ZoneScoped; - const int nSegments = _segmentSizeRaw[orbitIdx]; - for (GLint j = 0 ; j < nSegments; j++) { - const double timeOffset = orbit.period * - static_cast(j) / static_cast(nSegments - 1); + const kepler::Parameters& orbit = _parameters[index]; - const glm::dvec3 position = keplerTranslator.position({ - {}, - Time(timeOffset + orbit.epoch), - Time(0.0) - }); + const KeplerCalculator calc = KeplerCalculator( + orbit.eccentricity, + orbit.semiMajorAxis, + orbit.inclination, + orbit.ascendingNode, + orbit.argumentOfPeriapsis, + orbit.meanAnomaly, + orbit.period, + orbit.epoch + ); - _vertexBufferData[vertexBufIdx + j].x = static_cast(position.x); - _vertexBufferData[vertexBufIdx + j].y = static_cast(position.y); - _vertexBufferData[vertexBufIdx + j].z = static_cast(position.z); - _vertexBufferData[vertexBufIdx + j].time = static_cast(timeOffset); - _vertexBufferData[vertexBufIdx + j].epoch = orbit.epoch; - _vertexBufferData[vertexBufIdx + j].period = orbit.period; + const int nVerts = _segmentsPerOrbit[index]; + const int offset = _vertexBufferOffset[index]; + const int nSegments = nVerts - 1; + for (GLint j = 0; j < nVerts; j++) { + const double timeOffset = orbit.period * + static_cast(j) / static_cast(nSegments); + + const glm::dvec3 position = calc.position(timeOffset + orbit.epoch); + + _vertexBufferData[offset + j].x = static_cast(position.x); + _vertexBufferData[offset + j].y = static_cast(position.y); + _vertexBufferData[offset + j].z = static_cast(position.z); + _vertexBufferData[offset + j].time = timeOffset; + _vertexBufferData[offset + j].epoch = orbit.epoch; + _vertexBufferData[offset + j].period = orbit.period; + } + + _updateHelper[index].timePerStep = orbit.period / nSegments; } - vertexBufIdx += nSegments; + ); + + // Calculate how many orbits we calculate per thread + // 1000 per thread (arbitrary) to not create threads that do little to no work + unsigned int orbitsPerThread = std::max( + 1000, + static_cast(std::ceil(static_cast(_sizeRender) / _nThreads)) + ); + + // Vector that maps thread index to number of orbits to render + int threadId = 0; + unsigned int remainingOrbits = _sizeRender; + while (remainingOrbits >= orbitsPerThread) { + _threadIds.push_back(threadId); + _orbitsPerThread.push_back(orbitsPerThread); + remainingOrbits -= orbitsPerThread; + threadId++; + } + if (remainingOrbits > 0) { + _threadIds.push_back(threadId); + _orbitsPerThread.push_back(remainingOrbits); } glBindVertexArray(_vertexArray); @@ -684,120 +836,145 @@ void RenderableOrbitalKepler::updateBuffers() { ); glEnableVertexAttribArray(0); - glVertexAttribPointer(0, 4, GL_FLOAT, GL_FALSE, sizeof(TrailVBOLayout), nullptr); + glVertexAttribPointer(0, 3, GL_FLOAT, GL_FALSE, sizeof(TrailVBOLayout), nullptr); glEnableVertexAttribArray(1); glVertexAttribLPointer( 1, - 2, + 3, GL_DOUBLE, sizeof(TrailVBOLayout), - reinterpret_cast(4 * sizeof(GL_FLOAT)) + reinterpret_cast(offsetof(TrailVBOLayout, time)) ); glBindVertexArray(0); - - double maxSemiMajorAxis = 0.0; - for (const kepler::Parameters& kp : _parameters) { - if (kp.semiMajorAxis > maxSemiMajorAxis) { - maxSemiMajorAxis = kp.semiMajorAxis; - } - } - setBoundingSphere(maxSemiMajorAxis * 1000); } -void RenderableOrbitalKepler::calculateSegmentsForPoints(const RenderData& data) { - int startVertexIndex = 0; - for (size_t i = 0; i < _segmentSizeRaw.size(); i++) { - // Check how far along the trail we are - const kepler::Parameters& orbit = _parameters[i]; - const double nRevs = (data.time.j2000Seconds() - orbit.epoch) / orbit.period; - float frac = static_cast(nRevs - std::trunc(nRevs)); - frac += (frac < 0.f) ? 1.f: 0.f; +void RenderableOrbitalKepler::threadedSegmentCalculations(int threadId, + const UpdateData& data) +{ + ZoneScoped; - // Get the closest vertex before that point - const int nSegments = _segmentSizeRaw[i] - 1; - const int offset = static_cast(std::floor(frac * nSegments)); + const int selection = _appearance.renderingModes; + _renderPoints = ( + selection == static_cast(RenderMode::RenderingModePoint) || + selection == static_cast(RenderMode::RenderingModePointTrail) + ); + _renderTrails = ( + selection == static_cast(RenderMode::RenderingModeTrail) || + selection == static_cast(RenderMode::RenderingModePointTrail) + ); - // Set start vertex ID in buffer - _startIndexPoints[i] = startVertexIndex + offset; - startVertexIndex += _segmentSizeRaw[i]; - } -} - -void RenderableOrbitalKepler::calculateSegmentsForTrails(const RenderData& data) { const float fade = std::pow( _appearance.trailFade.maxValue() - _appearance.trailFade, 2.f ); const float threshold = 1.f - std::pow(0.05f, 1.f / fade); - int nTotalTrailParts = 0; - int startVertexIndex = 0; - for (size_t i = 0; i < _segmentSizeRaw.size(); i++) { - // Check how far along the trail we are - const kepler::Parameters& orbit = _parameters[i]; - const double nRevs = (data.time.j2000Seconds() - orbit.epoch) / orbit.period; - float frac = static_cast(nRevs - std::trunc(nRevs)); - frac += (frac < 0.f) ? 1.f : 0.f; + int offset = std::accumulate( + _orbitsPerThread.begin(), + _orbitsPerThread.begin() + threadId, + 0 + ); + const int cutoff = offset + _orbitsPerThread[threadId]; - int p0Start = 0; - int p0Length = 0; - int p1Start = 0; - int p1Length = 0; + const double now = data.time.j2000Seconds(); + int startVertexIndex = _vertexBufferOffset[offset]; + for (int i = offset; i < cutoff; i++) { + UpdateInfo* helper = &_updateHelper[i]; + double upper = helper->timestamp + (helper->timePerStep); + double lower = helper->timestamp - (helper->timePerStep); + const bool shouldUpdate = (now >= upper || now <= lower); - const int nVerts = _segmentSizeRaw[i]; - const int nSegments = nVerts - 1; - const int trailLength = static_cast(std::ceil(threshold * nSegments)); - if (trailLength == nSegments) { - // Whole trail should be visible - p0Start = startVertexIndex; - p0Length = nVerts; - } - else { - const int headOffset = static_cast(std::ceil(frac * nSegments)); - const int headVertexIndex = startVertexIndex + headOffset; - const int correctTrailLength = trailLength + 2; + const int nVerts = _segmentsPerOrbit[i]; + if (shouldUpdate || _forceUpdate) { + // Check how far along the trail we are + const kepler::Parameters& orbit = _parameters[i]; + const double nRevs = (data.time.j2000Seconds() - orbit.epoch) / orbit.period; + double frac = static_cast(nRevs - std::trunc(nRevs)); + frac += (frac < 0.0) ? 1.0 : 0.0; - int correctVertexIndex = headVertexIndex - correctTrailLength + 1; + const int nSegments = nVerts - 1; + const int pointHead = static_cast(std::floor(frac * nSegments)); - // If the start of the trail should be at the end of the orbit - if (correctVertexIndex < startVertexIndex) { - correctVertexIndex += nVerts; + // We can always do this since it has no cost + _startIndexPoints[i] = startVertexIndex + pointHead; + + // There is a lot of what seems to be "magic numbers" in this section. + // They will most likely disappear when we change our method of determining + // the trail fade amount is changed. + if (_renderTrails) { + // When rendering a trail we don't know if the trail will pass over + // the starting point of the orbit or not. If the trail passes over the + // starting point of the orbit, then we can't draw the entire trail as + // line strip. Instead we need to divide the line strip into two parts, + // where p0 and p1 denotes the respctive line strips (parts). + int p0Start = -1; + int p0Length = -1; + int p1Start = -1; + int p1Length = -1; + + const int trailLength = + static_cast(std::ceil(threshold * nSegments)); + if (trailLength == nSegments) { + // Whole trail should be visible + p0Start = startVertexIndex; + p0Length = nVerts; + p1Start = 0; + p1Length = 0; + } + else { + const int trailHead = static_cast(std::ceil(frac * nSegments)); + const int headVertexIndex = startVertexIndex + trailHead + 1; + const int correctTrailLength = trailLength + 3; + + // Need to do this due to order of vertex data in the vertex buffer + int correctVertexIndex = headVertexIndex - correctTrailLength; + + // If the start of the trail should be at the end of the orbit + if (correctVertexIndex < startVertexIndex) { + correctVertexIndex += nVerts; + } + + // If the trail is length passes over the last point of the orbit + const int lastVertexIndex = startVertexIndex + nVerts; + if (correctVertexIndex + correctTrailLength > lastVertexIndex) { + p0Start = startVertexIndex; + p1Start = correctVertexIndex; + + // Special check to make sure we don't end up with segment + // sections 1 vertex length. A segment must contain at least 2 + // vertices or more. + if (lastVertexIndex - correctVertexIndex == 1) { + p1Length = 0; + p0Length = correctTrailLength - 1; + } + else { + p1Length = lastVertexIndex - correctVertexIndex; + p0Length = correctTrailLength - p1Length; + } + } + else { + // If the entire trail is within the bounds of the orbit + p0Start = correctVertexIndex; + p0Length = correctTrailLength; + p1Start = 0; + p1Length = 0; + } + } + _startIndexTrails[i * 2] = p0Start; + _segmentSizeTrails[i * 2] = p0Length; + _startIndexTrails[i * 2 + 1] = p1Start; + _segmentSizeTrails[i * 2 + 1] = p1Length; } - // If the trail is length passes over the last point of the orbit - const int lastVertexIndex = startVertexIndex + nVerts; - if (correctVertexIndex + correctTrailLength > lastVertexIndex) { - p1Start = correctVertexIndex - 1; - p1Length = lastVertexIndex - correctVertexIndex + 1; - p0Start = startVertexIndex; - p0Length = correctTrailLength - p1Length + 1; - } - else { - // If the entire trail is within the bounds of the orbit - p0Start = correctVertexIndex; - p0Length = correctTrailLength; - } - } - - int newTrailParts = 0; - if (p0Length > 1) { - _startIndexTrails[nTotalTrailParts] = p0Start; - _segmentSizeTrails[nTotalTrailParts] = p0Length; - newTrailParts += 1; - } - - if (p1Length > 1) { - _startIndexTrails[nTotalTrailParts + newTrailParts] = p1Start; - _segmentSizeTrails[nTotalTrailParts + newTrailParts] = p1Length; - newTrailParts += 1; + _updateHelper[i].timestamp = orbit.epoch + + (std::floor(frac * nSegments) * _updateHelper[i].timePerStep) + + (std::floor(nRevs) * orbit.period); } startVertexIndex += nVerts; - nTotalTrailParts += newTrailParts; } - _lineDrawCount = static_cast(nTotalTrailParts); } } // namespace openspace diff --git a/modules/space/rendering/renderableorbitalkepler.h b/modules/space/rendering/renderableorbitalkepler.h index c729f5ab81..3e8651adcb 100644 --- a/modules/space/rendering/renderableorbitalkepler.h +++ b/modules/space/rendering/renderableorbitalkepler.h @@ -27,19 +27,18 @@ #include -#include #include -#include +#include #include +#include +#include #include -#include -#include +#include #include +#include namespace openspace { -namespace documentation { struct Documentation; } - class RenderableOrbitalKepler : public Renderable { public: explicit RenderableOrbitalKepler(const ghoul::Dictionary& dictionary); @@ -56,6 +55,7 @@ public: private: struct Appearance : properties::PropertyOwner { Appearance(); + /// Specifies the base color of the line/point properties::Vec3Property color; /// Line width for the line rendering part @@ -68,6 +68,8 @@ private: properties::FloatProperty maxSize; /// Max angular size between vector cameraToPoint and edge of the point properties::OptionProperty renderingModes; + /// Specifies rendering orientation when rendering points + properties::OptionProperty pointRenderOption; /// Specifies a multiplicative factor that fades out the trail line properties::FloatProperty trailFade; /// Specifies if the point outline should be enabled @@ -76,59 +78,73 @@ private: properties::Vec3Property outlineColor; /// Specifies how much if the point should be covered by the outline properties::FloatProperty outlineWidth; + + bool isRenderTypeDirty = false; }; void updateBuffers(); - void calculateSegmentsForPoints(const RenderData& data); - void calculateSegmentsForTrails(const RenderData& data); + void threadedSegmentCalculations(int threadId, const UpdateData& data); + const int _nThreads = 0; + std::vector _threadIds; + std::vector _orbitsPerThread; + std::vector _vertexBufferOffset; + + bool _renderTrails = false; + bool _renderPoints = false; + bool _forceUpdate = false; bool _updateDataBuffersAtNextRender = false; - long long _numObjects = 0; + + unsigned int _nOrbits = 0; GLsizei _lineDrawCount = 0; - properties::UIntProperty _segmentQuality; - properties::UIntProperty _startRenderIdx; - properties::UIntProperty _sizeRender; - std::vector _segmentSizeRaw; + std::vector _segmentsPerOrbit; std::vector _startIndexPoints; std::vector _segmentSizePoints; std::vector _startIndexTrails; std::vector _segmentSizeTrails; std::vector _parameters; + /// Extra data for more efficient updating of vectors + struct UpdateInfo { + double timestamp = std::numeric_limits::min(); + double timePerStep = 0.0; + }; + std::vector _updateHelper; + /// The layout of the VBOs struct TrailVBOLayout { float x = 0.f; float y = 0.f; float z = 0.f; - float time = 0.f; + double time = 0.0; double epoch = 0.0; double period = 0.0; }; - /// The backend storage for the vertex buffer object containing all points std::vector _vertexBufferData; - GLuint _vertexArray = 0; - GLuint _vertexBuffer = 0; - ghoul::opengl::ProgramObject* _trailProgram = nullptr; ghoul::opengl::ProgramObject* _pointProgram = nullptr; + properties::UIntProperty _segmentQuality; + properties::UIntProperty _startRenderIdx; + properties::UIntProperty _sizeRender; properties::StringProperty _path; properties::BoolProperty _contiguousMode; kepler::Format _format; RenderableOrbitalKepler::Appearance _appearance; + GLuint _vertexArray = 0; + GLuint _vertexBuffer = 0; + // Line cache UniformCache(modelViewTransform, projectionTransform, trailFadeExponent, - colorFadeCutoffValue, inGameTime, color, opacity) - _uniformTrailCache; + colorFadeCutoffValue, inGameTime, color, opacity) _uniformTrailCache; // Point cache - UniformCache(modelTransform, viewTransform, projectionTransform, - cameraPositionWorld, cameraUpWorld, inGameTime, color, - pointSizeExponent, enableMaxSize, maxSize, enableOutline, - outlineColor, outlineWeight, opacity) - _uniformPointCache; + UniformCache(modelTransform, viewTransform, projectionTransform, renderOption, + cameraViewDirectionUp, cameraViewDirectionRight, cameraPositionWorld, + cameraUpWorld, inGameTime, color, pointSizeExponent, enableMaxSize, maxSize, + enableOutline, outlineColor, outlineWeight, opacity) _uniformPointCache; }; } // namespace openspace diff --git a/modules/space/rendering/renderablerings.cpp b/modules/space/rendering/renderablerings.cpp index eab49a5090..725d66b5f8 100644 --- a/modules/space/rendering/renderablerings.cpp +++ b/modules/space/rendering/renderablerings.cpp @@ -25,18 +25,24 @@ #include #include -#include #include #include #include +#include #include #include +#include #include #include +#include #include #include #include +#include +#include +#include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo TextureInfo = { diff --git a/modules/space/rendering/renderablerings.h b/modules/space/rendering/renderablerings.h index 2baebf077d..2593129956 100644 --- a/modules/space/rendering/renderablerings.h +++ b/modules/space/rendering/renderablerings.h @@ -30,20 +30,15 @@ #include #include #include - -#include +#include #include +#include +#include namespace ghoul::filesystem { class File; } -namespace ghoul::opengl { - class ProgramObject; - class Texture; -} // namespace ghoul::opengl namespace openspace { -namespace documentation { struct Documentation; } - class RenderableRings : public Renderable { public: explicit RenderableRings(const ghoul::Dictionary& dictionary); diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index f11ac7fca8..7ecd2a6c16 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -25,27 +25,27 @@ #include #include -#include #include #include -#include #include #include #include #include -#include #include #include #include #include #include +#include +#include +#include +#include +#include #include -#include +#include #include -#include -#include #include -#include +#include namespace { constexpr std::string_view _loggerCat = "RenderableStars"; diff --git a/modules/space/rendering/renderablestars.h b/modules/space/rendering/renderablestars.h index 8b6f67f81f..af44e687bb 100644 --- a/modules/space/rendering/renderablestars.h +++ b/modules/space/rendering/renderablestars.h @@ -28,26 +28,22 @@ #include #include -#include #include +#include #include +#include +#include #include #include #include #include #include -#include +#include namespace ghoul::filesystem { class File; } -namespace ghoul::opengl { - class ProgramObject; - class Texture; -} // namespace ghoul::opengl namespace openspace { -namespace documentation { struct Documentation; } - class RenderableStars : public Renderable { public: explicit RenderableStars(const ghoul::Dictionary& dictionary); diff --git a/modules/space/rendering/renderabletravelspeed.cpp b/modules/space/rendering/renderabletravelspeed.cpp index 6ec09ddd69..7227090742 100644 --- a/modules/space/rendering/renderabletravelspeed.cpp +++ b/modules/space/rendering/renderabletravelspeed.cpp @@ -34,6 +34,11 @@ #include #include #include +#include +#include +#include +#include +#include #include namespace { diff --git a/modules/space/rendering/renderabletravelspeed.h b/modules/space/rendering/renderabletravelspeed.h index 89a3cd3725..421d85d58e 100644 --- a/modules/space/rendering/renderabletravelspeed.h +++ b/modules/space/rendering/renderabletravelspeed.h @@ -27,7 +27,8 @@ #include -#include +#include +#include #include #include #include @@ -36,8 +37,6 @@ namespace openspace { class SceneGraphNode; -namespace documentation { struct Documentation; } - class RenderableTravelSpeed : public Renderable { public: explicit RenderableTravelSpeed(const ghoul::Dictionary& dictionary); @@ -57,6 +56,7 @@ private: void calculateDirectionVector(); void updateVertexData(); void reinitiateTravel(); + UniformCache(lineColor, opacity) _uniformCache; properties::StringProperty _targetName; diff --git a/modules/space/rotation/spicerotation.cpp b/modules/space/rotation/spicerotation.cpp index 4d963ce1e0..64b85466fa 100644 --- a/modules/space/rotation/spicerotation.cpp +++ b/modules/space/rotation/spicerotation.cpp @@ -25,11 +25,10 @@ #include #include -#include #include #include #include -#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo SourceInfo = { diff --git a/modules/space/rotation/spicerotation.h b/modules/space/rotation/spicerotation.h index 2728c9089e..eb2554713d 100644 --- a/modules/space/rotation/spicerotation.h +++ b/modules/space/rotation/spicerotation.h @@ -33,8 +33,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class SpiceRotation : public Rotation { public: explicit SpiceRotation(const ghoul::Dictionary& dictionary); diff --git a/modules/space/shaders/keplerpoints_gs.glsl b/modules/space/shaders/keplerpoints_gs.glsl index e78f746c5d..e9ba006f2c 100644 --- a/modules/space/shaders/keplerpoints_gs.glsl +++ b/modules/space/shaders/keplerpoints_gs.glsl @@ -33,17 +33,27 @@ flat in float vertexRevolutionFraction[]; uniform dmat4 modelTransform; uniform dmat4 viewTransform; uniform mat4 projectionTransform; -uniform dvec3 cameraPositionWorld; -uniform vec3 cameraUpWorld; uniform float pointSizeExponent; uniform bool enableMaxSize; uniform float maxSize; +uniform int renderOption; + +// Camera View Direction +uniform vec3 cameraViewDirectionUp; +uniform vec3 cameraViewDirectionRight; + +// Camera Normal +uniform dvec3 cameraPositionWorld; +uniform vec3 cameraUpWorld; layout(triangle_strip, max_vertices = 4) out; out float projectionViewDepth; out vec4 viewSpace; out vec2 texCoord; +const int RenderOptionCameraViewDirection = 0; +const int RenderOptionCameraPositionNormal = 1; + void main() { // cFrac is how far along the trail orbit the head of the trail is. // v0Frac and v1Frac are how far the two vertices that creates the current line strip @@ -65,12 +75,21 @@ void main() { // Calculate current vertex position to world space dvec4 vertPosWorldSpace = modelTransform * pos; - - // Calculate new axis for plane vec3 camPosToVertPos = vec3(cameraPositionWorld - vertPosWorldSpace.xyz); - vec3 normal = normalize(camPosToVertPos); - vec3 right = normalize(cross(cameraUpWorld, normal)); - vec3 up = normalize(cross(normal, right)); + + vec3 up; + vec3 right; + // Calculate new axis for plane + if (renderOption == RenderOptionCameraViewDirection) { + up = cameraViewDirectionUp; + right = cameraViewDirectionRight; + } + else { + // Camera Position Normal + vec3 normal = normalize(camPosToVertPos); + right = normalize(cross(cameraUpWorld, normal)); + up = normalize(cross(normal, right)); + } // Calculate size of points float initialSize = pow(10.0, pointSizeExponent); diff --git a/modules/space/shaders/keplerpoints_vs.glsl b/modules/space/shaders/keplerpoints_vs.glsl index 9b79e8fee3..76e54e43cf 100644 --- a/modules/space/shaders/keplerpoints_vs.glsl +++ b/modules/space/shaders/keplerpoints_vs.glsl @@ -24,8 +24,8 @@ #version __CONTEXT__ -layout (location = 0) in vec4 vertexData; // 1: x, 2: y, 3: z, 4: timeOffset, -layout (location = 1) in dvec2 orbitData; // 1: epoch, 2: period +layout (location = 0) in vec3 vertexData; // 1: x, 2: y, 3: z +layout (location = 1) in dvec3 orbitData; // 1: timeOffset, 2: epoch, 3: period uniform double inGameTime; @@ -33,8 +33,9 @@ flat out float currentRevolutionFraction; flat out float vertexRevolutionFraction; void main() { - double epoch = orbitData.x; - double period = orbitData.y; + double timeOffset = orbitData.x; + double epoch = orbitData.y; + double period = orbitData.z; // calculate nr of periods, get fractional part to know where the vertex closest to the // debris part is right now @@ -45,7 +46,7 @@ void main() { } // Same procedure for the current vertex - vertexRevolutionFraction = float(vertexData.w / period); + vertexRevolutionFraction = float(timeOffset / period); gl_Position = vec4(vertexData.xyz, 1.0); } diff --git a/modules/space/shaders/keplertrails_fs.glsl b/modules/space/shaders/keplertrails_fs.glsl index 1563af91db..dec9c9ba5d 100644 --- a/modules/space/shaders/keplertrails_fs.glsl +++ b/modules/space/shaders/keplertrails_fs.glsl @@ -51,7 +51,7 @@ Fragment getFragment() { vertexDistance += 1.0; } - float invert = pow((1.0 - vertexDistance), trailFadeExponent); + float invert = pow(1.0 - vertexDistance, trailFadeExponent); float fade = clamp(invert, 0.0, 1.0); // Currently even fully transparent lines can occlude other lines, thus we discard these diff --git a/modules/space/shaders/keplertrails_vs.glsl b/modules/space/shaders/keplertrails_vs.glsl index dbcdccb176..52fcf4ffa6 100644 --- a/modules/space/shaders/keplertrails_vs.glsl +++ b/modules/space/shaders/keplertrails_vs.glsl @@ -26,8 +26,8 @@ #include "PowerScaling/powerScalingMath.hglsl" -layout (location = 0) in vec4 vertexData; // 1: x, 2: y, 3: z, 4: timeOffset, -layout (location = 1) in dvec2 orbitData; // 1: epoch, 2: period +layout (location = 0) in vec3 vertexData; // 1: x, 2: y, 3: z +layout (location = 1) in dvec3 orbitData; // 1: timeOffset, 2: epoch, 3: period out vec4 viewSpacePosition; out float viewSpaceDepth; @@ -48,8 +48,9 @@ void main() { // offsetPeriods is calculated to know how much to fade that specific fragment. // If orbit_data is doubles, cast to float first - double epoch = orbitData.x; - double period = orbitData.y; + double timeOffset = orbitData.x; + double epoch = orbitData.y; + double period = orbitData.z; // Calculate nr of periods, get fractional part to know where the vertex closest to the // debris part is right now @@ -61,7 +62,7 @@ void main() { } // Same procedure for the current vertex - offsetPeriods = vertexData.w / float(period); + offsetPeriods = float(timeOffset / period); viewSpacePosition = vec4(modelViewTransform * dvec4(vertexData.xyz, 1)); vec4 vs_position = z_normalization(projectionTransform * viewSpacePosition); diff --git a/modules/space/spacemodule.cpp b/modules/space/spacemodule.cpp index ec5591d8e7..273d9ca661 100644 --- a/modules/space/spacemodule.cpp +++ b/modules/space/spacemodule.cpp @@ -41,14 +41,19 @@ #include #include #include -#include +#include +#include +#include #include -#include #include #include #include #include +#include +#include #include +#include +#include #include "spacemodule_lua.inl" diff --git a/modules/space/spacemodule_lua.inl b/modules/space/spacemodule_lua.inl index f0b9538790..be1fc64a6f 100644 --- a/modules/space/spacemodule_lua.inl +++ b/modules/space/spacemodule_lua.inl @@ -23,6 +23,7 @@ ****************************************************************************************/ #include +#include #include namespace { diff --git a/modules/space/timeframe/timeframekernel.cpp b/modules/space/timeframe/timeframekernel.cpp index 7b6d69ad25..4b12e485bb 100644 --- a/modules/space/timeframe/timeframekernel.cpp +++ b/modules/space/timeframe/timeframekernel.cpp @@ -24,10 +24,20 @@ #include +#include #include #include #include +#include +#include +#include #include "SpiceUsr.h" +#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "TimeFrameKernel"; @@ -424,7 +434,6 @@ bool TimeFrameKernel::initialize() { ); } - // Extract the SPK file/files if they were specified if (p.spk.has_value()) { std::vector kernels; diff --git a/modules/space/timeframe/timeframekernel.h b/modules/space/timeframe/timeframekernel.h index 0bbc04c9ed..f4c884befc 100644 --- a/modules/space/timeframe/timeframekernel.h +++ b/modules/space/timeframe/timeframekernel.h @@ -28,6 +28,7 @@ #include #include +#include namespace openspace { diff --git a/modules/space/translation/gptranslation.cpp b/modules/space/translation/gptranslation.cpp index a03b0dac0b..4d43dd3ea6 100644 --- a/modules/space/translation/gptranslation.cpp +++ b/modules/space/translation/gptranslation.cpp @@ -25,7 +25,10 @@ #include #include -#include +#include +#include +#include +#include #include #include diff --git a/modules/space/translation/horizonstranslation.cpp b/modules/space/translation/horizonstranslation.cpp index cf01698403..434af051bb 100644 --- a/modules/space/translation/horizonstranslation.cpp +++ b/modules/space/translation/horizonstranslation.cpp @@ -24,8 +24,8 @@ #include +#include #include -#include #include #include #include @@ -33,9 +33,17 @@ #include #include #include -#include +#include +#include +#include +#include +#include +#include #include +#include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "HorizonsTranslation"; diff --git a/modules/space/translation/horizonstranslation.h b/modules/space/translation/horizonstranslation.h index a0f755a57f..56079ace64 100644 --- a/modules/space/translation/horizonstranslation.h +++ b/modules/space/translation/horizonstranslation.h @@ -29,20 +29,18 @@ #include #include -#include #include -#include -#include +#include +#include namespace openspace { -namespace documentation { struct Documentation; } - +class HorizonsFile; /** * The HorizonsTranslation is based on text files generated from NASA JPL HORIZONS Website - * (https://ssd.jpl.nasa.gov/horizons.cgi). The implementation supports both Vector - * and Observer as Horizons data table. + * (https://ssd.jpl.nasa.gov/horizons.cgi). The implementation supports both Vector and + * Observer as Horizons data table. * * In case of Vector table data the implementation expects a file with format: * TIME(JulianDayNumber = A.D. YYYY-MM-DD HH:MM:SS TDB) diff --git a/modules/space/translation/keplertranslation.cpp b/modules/space/translation/keplertranslation.cpp index 2e3ddeb0b9..e843b72382 100644 --- a/modules/space/translation/keplertranslation.cpp +++ b/modules/space/translation/keplertranslation.cpp @@ -24,11 +24,18 @@ #include -#include +#include #include #include +#include #include +#include +#include +#include #include +#include +#include +#include namespace { struct RangeError final : public ghoul::RuntimeError { @@ -217,38 +224,38 @@ KeplerTranslation::KeplerTranslation(const ghoul::Dictionary& dictionary) ); } -double KeplerTranslation::eccentricAnomaly(double meanAnomaly) const { +double KeplerTranslation::eccentricAnomaly(double meanAnomaly, double eccentricity) { // Compute the eccentric anomaly (the location of the spacecraft taking the // eccentricity of the orbit into account) using different solves for the regimes in // which they are most efficient - if (_eccentricity == 0.0) { + if (eccentricity == 0.0) { // In a circular orbit, the eccentric anomaly = mean anomaly return meanAnomaly; } - else if (_eccentricity < 0.2) { - auto solver = [this, &meanAnomaly](double x) -> double { + else if (eccentricity < 0.2) { + auto solver = [&](double x) -> double { // For low eccentricity, using a first order solver sufficient - return meanAnomaly + _eccentricity * std::sin(x); + return meanAnomaly + eccentricity * std::sin(x); }; return solveIteration(solver, meanAnomaly, 0.0, 5); } - else if (_eccentricity < 0.9) { - auto solver = [this, &meanAnomaly](double x) -> double { - const double e = _eccentricity; + else if (eccentricity < 0.9) { + auto solver = [&](double x) -> double { + const double e = eccentricity; return x + (meanAnomaly + e * std::sin(x) - x) / (1.0 - e * std::cos(x)); }; return solveIteration(solver, meanAnomaly, 0.0, 6); } - else if (_eccentricity < 1.0) { + else if (eccentricity < 1.0) { auto sign = [](double val) -> double { return val > 0.0 ? 1.0 : ((val < 0.0) ? -1.0 : 0.0); }; - const double e = meanAnomaly + 0.85 * _eccentricity * sign(std::sin(meanAnomaly)); + const double e = meanAnomaly + 0.85 * eccentricity * sign(std::sin(meanAnomaly)); - auto solver = [this, &meanAnomaly, &sign](double x) -> double { - const double s = _eccentricity * std::sin(x); - const double c = _eccentricity * std::cos(x); + auto solver = [&](double x) -> double { + const double s = eccentricity * std::sin(x); + const double c = eccentricity * std::cos(x); const double f = x - s - meanAnomaly; const double f1 = 1 - c; const double f2 = s; @@ -266,14 +273,19 @@ double KeplerTranslation::eccentricAnomaly(double meanAnomaly) const { glm::dvec3 KeplerTranslation::position(const UpdateData& data) const { if (_orbitPlaneDirty) { - computeOrbitPlane(); + _orbitPlaneRotation = computeOrbitPlane( + _ascendingNode, + _inclination, + _argumentOfPeriapsis + ); + notifyObservers(); _orbitPlaneDirty = false; } const double t = data.time.j2000Seconds() - _epoch; const double meanMotion = glm::two_pi() / _period; const double meanAnomaly = glm::radians(_meanAnomalyAtEpoch.value()) + t * meanMotion; - const double e = eccentricAnomaly(meanAnomaly); + const double e = eccentricAnomaly(meanAnomaly, _eccentricity); // Use the eccentric anomaly to compute the actual location const glm::dvec3 p = glm::dvec3( @@ -284,7 +296,9 @@ glm::dvec3 KeplerTranslation::position(const UpdateData& data) const { return _orbitPlaneRotation * p * 1000.0; } -void KeplerTranslation::computeOrbitPlane() const { +glm::dmat3 KeplerTranslation::computeOrbitPlane(double ascendingNode, double inclination, + double argumentOfPeriapsis) +{ // We assume the following coordinate system: // z = axis of rotation // x = pointing towards the first point of Aries @@ -300,16 +314,13 @@ void KeplerTranslation::computeOrbitPlane() const { const glm::dvec3 inclinationAxisRot = glm::dvec3(1.f, 0.f, 0.f); const glm::dvec3 argPeriapsisAxisRot = glm::dvec3(0.f, 0.f, 1.f); - const double asc = glm::radians(_ascendingNode.value()); - const double inc = glm::radians(_inclination.value()); - const double per = glm::radians(_argumentOfPeriapsis.value()); + const double asc = glm::radians(ascendingNode); + const double inc = glm::radians(inclination); + const double per = glm::radians(argumentOfPeriapsis); - _orbitPlaneRotation = glm::rotate(asc, ascendingNodeAxisRot) * - glm::rotate(inc, inclinationAxisRot) * - glm::rotate(per, argPeriapsisAxisRot); - - notifyObservers(); - _orbitPlaneDirty = false; + return glm::rotate(asc, ascendingNodeAxisRot) * + glm::rotate(inc, inclinationAxisRot) * + glm::rotate(per, argPeriapsisAxisRot); } void KeplerTranslation::setKeplerElements(double eccentricity, double semiMajorAxis, @@ -378,7 +389,47 @@ void KeplerTranslation::setKeplerElements(double eccentricity, double semiMajorA _period = orbitalPeriod; _epoch = epoch; - computeOrbitPlane(); + _orbitPlaneRotation = computeOrbitPlane( + _ascendingNode, + _inclination, + _argumentOfPeriapsis + ); + notifyObservers(); + _orbitPlaneDirty = false; +} + +KeplerCalculator::KeplerCalculator(double eccentricity, double semiMajorAxis, + double inclination, double ascendingNode, + double argumentOfPeriapsis, double meanAnomalyAtEpoch, + double orbitalPeriod, double epoch) + : _eccentricity(eccentricity) + , _semiMajorAxis(semiMajorAxis) + , _inclination(inclination) + , _ascendingNode(ascendingNode) + , _argumentOfPeriapsis(argumentOfPeriapsis) + , _meanAnomalyAtEpoch(meanAnomalyAtEpoch) + , _orbitalPeriod(orbitalPeriod) + , _epoch(epoch) + , _orbitPlaneRotation(KeplerTranslation::computeOrbitPlane( + ascendingNode, + inclination, + argumentOfPeriapsis + )) +{} + +glm::dvec3 KeplerCalculator::position(double time) const { + const double t = time - _epoch; + const double meanMotion = glm::two_pi() / _orbitalPeriod; + const double meanAnomaly = glm::radians(_meanAnomalyAtEpoch) + t * meanMotion; + const double e = KeplerTranslation::eccentricAnomaly(meanAnomaly, _eccentricity); + + // Use the eccentric anomaly to compute the actual location + const glm::dvec3 p = glm::dvec3( + _semiMajorAxis * (std::cos(e) - _eccentricity), + _semiMajorAxis * std::sin(e) * std::sqrt(1.0 - _eccentricity * _eccentricity), + 0.0 + ); + return _orbitPlaneRotation * p * 1000.0; } } // namespace openspace diff --git a/modules/space/translation/keplertranslation.h b/modules/space/translation/keplertranslation.h index 213d99e288..c12376bb65 100644 --- a/modules/space/translation/keplertranslation.h +++ b/modules/space/translation/keplertranslation.h @@ -28,10 +28,7 @@ #include #include -#include #include -#include -#include namespace openspace { @@ -58,10 +55,10 @@ public: ~KeplerTranslation() override = default; /** - * Method returning the translation vector at a given time. - * - * \param data Provides information from the engine about, for example, the time - */ + * Method returning the translation vector at a given time. + * + * \param data Provides information from the engine about, for example, the time + */ glm::dvec3 position(const UpdateData& data) const override; /** @@ -118,9 +115,9 @@ public: /** * Recombutes the rotation matrix used in the update method. */ - void computeOrbitPlane() const; + static glm::dmat3 computeOrbitPlane(double ascendingNode, double inclination, + double argumentOfPeriapsis); -private: /** * This method computes the eccentric anomaly (location of the space craft taking the * eccentricity into acount) based on the mean anomaly (location of the space craft @@ -128,10 +125,13 @@ private: * * \param meanAnomaly The mean anomaly for which the eccentric anomaly shall be * computed + * \param eccentricity The eccentricity for which the eccentric anomaly shall be + * computed * \return The eccentric anomaly for the provided \p meanAnomaly */ - double eccentricAnomaly(double meanAnomaly) const; + static double eccentricAnomaly(double meanAnomaly, double eccentricity); +private: /// The eccentricity of the orbit in [0, 1) properties::DoubleProperty _eccentricity; /// The semi-major axis in km @@ -159,6 +159,27 @@ private: glm::dvec3 _position = glm::dvec3(0.0); }; +class KeplerCalculator { +public: + KeplerCalculator(double eccentricity, double semiMajorAxis, double inclination, + double ascendingNode, double argumentOfPeriapsis, double meanAnomalyAtEpoch, + double orbitalPeriod, double epoch); + + glm::dvec3 position(double time) const; + +private: + const double _eccentricity; + const double _semiMajorAxis; + const double _inclination; + const double _ascendingNode; + const double _argumentOfPeriapsis; + const double _meanAnomalyAtEpoch; + const double _orbitalPeriod; + const double _epoch; + + const glm::dmat3 _orbitPlaneRotation; +}; + } // namespace openspace #endif // __OPENSPACE_MODULE_SPACE___KEPLERTRANSLATION___H__ diff --git a/modules/space/translation/spicetranslation.cpp b/modules/space/translation/spicetranslation.cpp index 3ecd7d5815..15a24d3d31 100644 --- a/modules/space/translation/spicetranslation.cpp +++ b/modules/space/translation/spicetranslation.cpp @@ -25,14 +25,10 @@ #include #include -#include #include #include #include -#include -#include -#include -#include +#include #include #include #include diff --git a/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp b/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp index 471ef64331..fcafd0fc7c 100644 --- a/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp +++ b/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp @@ -26,17 +26,19 @@ #include #include -#include #include -#include #include #include #include #include -#include #include +#include +#include #include +#include #include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo ActiveColorInfo = { diff --git a/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.h b/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.h index 748838170c..12adab943c 100644 --- a/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.h +++ b/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.h @@ -27,8 +27,6 @@ #include -#include -#include #include namespace openspace { diff --git a/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp b/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp index 1e49f32af6..d8faf928c5 100644 --- a/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp +++ b/modules/spacecraftinstruments/rendering/renderablecrawlingline.cpp @@ -26,13 +26,16 @@ #include #include -#include #include #include #include #include #include #include +#include +#include +#include +#include namespace { struct VBOData { diff --git a/modules/spacecraftinstruments/rendering/renderablecrawlingline.h b/modules/spacecraftinstruments/rendering/renderablecrawlingline.h index 7bd61247f1..cfd33d6745 100644 --- a/modules/spacecraftinstruments/rendering/renderablecrawlingline.h +++ b/modules/spacecraftinstruments/rendering/renderablecrawlingline.h @@ -29,11 +29,10 @@ #include #include +#include namespace openspace { -namespace documentation { struct Documentation; } - class RenderableCrawlingLine : public Renderable { public: explicit RenderableCrawlingLine(const ghoul::Dictionary& dictionary); diff --git a/modules/spacecraftinstruments/rendering/renderablefov.cpp b/modules/spacecraftinstruments/rendering/renderablefov.cpp index 0e8d614d5c..200d6c1215 100644 --- a/modules/spacecraftinstruments/rendering/renderablefov.cpp +++ b/modules/spacecraftinstruments/rendering/renderablefov.cpp @@ -27,15 +27,25 @@ #include #include #include -#include #include #include #include #include #include +#include #include +#include +#include +#include +#include +#include #include #include +#include +#include +#include +#include +#include namespace { constexpr int InterpolationSteps = 5; @@ -205,28 +215,48 @@ RenderableFov::RenderableFov(const ghoul::Dictionary& dictionary) , _alwaysDrawFov(AlwaysDrawFovInfo, false) , _colors({ properties::PropertyOwner({"Colors", "Colors"}), - { DefaultStartColorInfo, glm::vec3(0.4f), glm::vec3(0.f), glm::vec3(1.f) }, - { ColorDefaultEndInfo, glm::vec3(0.85f), glm::vec3(0.f), glm::vec3(1.f) }, - { ColorActiveInfo, glm::vec3(0.f, 1.f, 0.f), glm::vec3(0.f), glm::vec3(1.f) }, - { + properties::Vec3Property( + DefaultStartColorInfo, + glm::vec3(0.4f), + glm::vec3(0.f), + glm::vec3(1.f) + ), + properties::Vec3Property( + ColorDefaultEndInfo, + glm::vec3(0.85f), + glm::vec3(0.f), + glm::vec3(1.f) + ), + properties::Vec3Property( + ColorActiveInfo, + glm::vec3(0.f, 1.f, 0.f), + glm::vec3(0.f), + glm::vec3(1.f) + ), + properties::Vec3Property( ColorTargetInFovInfo, glm::vec3(0.f, 0.5f, 0.7f), glm::vec3(0.f), glm::vec3(1.f) - }, - { + ), + properties::Vec3Property( ColorIntersectionStartInfo, glm::vec3(1.f, 0.89f, 0.f), glm::vec3(0.f), glm::vec3(1.f) - }, - { + ), + properties::Vec3Property( ColorIntersectionEndInfo, glm::vec3(1.f, 0.29f, 0.f), glm::vec3(0.f), glm::vec3(1.f) - }, - { SquareColorInfo, glm::vec3(0.85f), glm::vec3(0.f), glm::vec3(1.f) } + ), + properties::Vec3Property( + SquareColorInfo, + glm::vec3(0.85f), + glm::vec3(0.f), + glm::vec3(1.f) + ) }) { const Parameters p = codegen::bake(dictionary); diff --git a/modules/spacecraftinstruments/rendering/renderablefov.h b/modules/spacecraftinstruments/rendering/renderablefov.h index c84a5a1c6d..f3916b63ee 100644 --- a/modules/spacecraftinstruments/rendering/renderablefov.h +++ b/modules/spacecraftinstruments/rendering/renderablefov.h @@ -35,16 +35,11 @@ #include #include #include - -namespace ghoul::opengl { - class ProgramObject; - class Texture; -} // namespace ghoul::opengl +#include +#include namespace openspace { -namespace documentation { struct Documentation; } - class RenderableFov : public Renderable { public: explicit RenderableFov(const ghoul::Dictionary& dictionary); @@ -76,7 +71,6 @@ private: glm::dvec3 orthogonalProjection(const glm::dvec3& vecFov, double time, const std::string& target) const; - // properties properties::FloatProperty _lineWidth; properties::DoubleProperty _standOffDistance; properties::BoolProperty _alwaysDrawFov; diff --git a/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp b/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp index 4b02f6586e..894ebaf40c 100644 --- a/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp @@ -24,19 +24,28 @@ #include +#include #include #include -#include #include #include #include +#include #include +#include #include #include #include #include #include +#include +#include +#include +#include #include +#include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo PerformShadingInfo = { diff --git a/modules/spacecraftinstruments/rendering/renderablemodelprojection.h b/modules/spacecraftinstruments/rendering/renderablemodelprojection.h index d363993b32..ec310d5c93 100644 --- a/modules/spacecraftinstruments/rendering/renderablemodelprojection.h +++ b/modules/spacecraftinstruments/rendering/renderablemodelprojection.h @@ -29,25 +29,13 @@ #include #include -#include -#include -#include #include - -namespace ghoul::opengl { - class ProgramObject; - class Texture; -} // namespace ghoul::opengl +#include namespace ghoul::modelgeometry { class ModelGeometry; } namespace openspace { -namespace documentation { struct Documentation; } - -struct RenderData; -struct UpdateData; - class RenderableModelProjection : public Renderable { public: explicit RenderableModelProjection(const ghoul::Dictionary& dictionary); diff --git a/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp b/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp index 172c239eca..3cb8bb73be 100644 --- a/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderableplaneprojection.cpp @@ -25,21 +25,28 @@ #include #include +#include #include #include #include #include #include -#include #include #include +#include #include #include #include +#include #include #include #include #include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderablePlaneProjection"; diff --git a/modules/spacecraftinstruments/rendering/renderableplaneprojection.h b/modules/spacecraftinstruments/rendering/renderableplaneprojection.h index 0562e53f4e..ba776817cb 100644 --- a/modules/spacecraftinstruments/rendering/renderableplaneprojection.h +++ b/modules/spacecraftinstruments/rendering/renderableplaneprojection.h @@ -32,17 +32,10 @@ #include namespace ghoul::filesystem { class File; } -namespace ghoul::opengl { - class ProgramObject; - class Texture; -} // namespace ghoul::opengl namespace openspace { struct Image; -struct LinePoint; -struct RenderData; -struct UpdateData; class RenderablePlaneProjection : public Renderable { public: diff --git a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp index 36129791a5..bde0b2b132 100644 --- a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp @@ -31,12 +31,19 @@ #include #include #include +#include #include #include #include +#include #include #include #include +#include +#include +#include +#include +#include namespace { constexpr std::string_view NoImageText = "No Image"; @@ -295,8 +302,6 @@ RenderablePlanetProjection::RenderablePlanetProjection(const ghoul::Dictionary& addProperty(_segments); } -RenderablePlanetProjection::~RenderablePlanetProjection() {} - void RenderablePlanetProjection::initializeGL() { _programObject = SpacecraftInstrumentsModule::ProgramObjectManager.request( "ProjectiveProgram", @@ -478,7 +483,7 @@ void RenderablePlanetProjection::render(const RenderData& data, RendererTasks&) const std::shared_ptr t = _projectionComponent.loadProjectionTexture(img.path); imageProjectGPU(*t, projMatrix); - ++nProjections; + nProjections++; } catch (const SpiceManager::SpiceException& e) { LERRORC(e.component, e.what()); diff --git a/modules/spacecraftinstruments/rendering/renderableplanetprojection.h b/modules/spacecraftinstruments/rendering/renderableplanetprojection.h index e5f74d5836..4ff462932e 100644 --- a/modules/spacecraftinstruments/rendering/renderableplanetprojection.h +++ b/modules/spacecraftinstruments/rendering/renderableplanetprojection.h @@ -28,25 +28,23 @@ #include #include +#include #include #include #include +#include +#include +#include #include +#include #include +#include namespace openspace { -namespace documentation { struct Documentation; } - -struct Image; -class Sphere; - -namespace planetgeometry { class PlanetGeometry; } - class RenderablePlanetProjection : public Renderable { public: explicit RenderablePlanetProjection(const ghoul::Dictionary& dict); - ~RenderablePlanetProjection() override; void initializeGL() override; void deinitializeGL() override; diff --git a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp index 76115ff3fe..3900a802c1 100644 --- a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp +++ b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp @@ -26,12 +26,16 @@ #include #include -#include #include #include #include #include #include +#include +#include +#include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo NumberPointsInfo = { diff --git a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.h b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.h index d8d8239da5..7d4dcd096a 100644 --- a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.h +++ b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.h @@ -35,15 +35,8 @@ #include #include -namespace ghoul::opengl { class ProgramObject; } - namespace openspace { -namespace documentation { struct Documentation; } - -struct RenderData; -struct UpdateData; - class RenderableShadowCylinder : public Renderable { public: explicit RenderableShadowCylinder(const ghoul::Dictionary& dictionary); diff --git a/modules/spacecraftinstruments/spacecraftinstrumentsmodule.cpp b/modules/spacecraftinstruments/spacecraftinstrumentsmodule.cpp index 20f6a3ef74..8706a92222 100644 --- a/modules/spacecraftinstruments/spacecraftinstrumentsmodule.cpp +++ b/modules/spacecraftinstruments/spacecraftinstrumentsmodule.cpp @@ -31,11 +31,21 @@ #include #include #include +#include #include #include +#include #include #include +#include +#include #include +#include +#include +#include +#include +#include +#include namespace openspace { diff --git a/modules/spacecraftinstruments/spacecraftinstrumentsmodule.h b/modules/spacecraftinstruments/spacecraftinstrumentsmodule.h index 0beaa98d36..fb05339303 100644 --- a/modules/spacecraftinstruments/spacecraftinstrumentsmodule.h +++ b/modules/spacecraftinstruments/spacecraftinstrumentsmodule.h @@ -28,6 +28,7 @@ #include #include +#include namespace openspace { diff --git a/modules/spacecraftinstruments/util/hongkangparser.cpp b/modules/spacecraftinstruments/util/hongkangparser.cpp index 2d2579bf4c..4396f20888 100644 --- a/modules/spacecraftinstruments/util/hongkangparser.cpp +++ b/modules/spacecraftinstruments/util/hongkangparser.cpp @@ -24,17 +24,19 @@ #include -#include #include #include -#include #include #include -#include +#include #include +#include #include +#include #include #include +#include +#include namespace { double ephemerisTimeFromMissionElapsedTime(double met, double metReference) { diff --git a/modules/spacecraftinstruments/util/hongkangparser.h b/modules/spacecraftinstruments/util/hongkangparser.h index 066c101c48..b0a7550251 100644 --- a/modules/spacecraftinstruments/util/hongkangparser.h +++ b/modules/spacecraftinstruments/util/hongkangparser.h @@ -29,6 +29,8 @@ #include +namespace ghoul { class Dictionary; } + namespace openspace { class HongKangParser : public SequenceParser { diff --git a/modules/spacecraftinstruments/util/image.h b/modules/spacecraftinstruments/util/image.h index 022f9aecbc..c8dcd077fd 100644 --- a/modules/spacecraftinstruments/util/image.h +++ b/modules/spacecraftinstruments/util/image.h @@ -26,7 +26,7 @@ #define __OPENSPACE_MODULE_SPACECRAFTINSTRUMENTS___IMAGE___H__ #include - +#include #include #include diff --git a/modules/spacecraftinstruments/util/imagesequencer.cpp b/modules/spacecraftinstruments/util/imagesequencer.cpp index 7e2e6b26bc..d0def6cdc9 100644 --- a/modules/spacecraftinstruments/util/imagesequencer.cpp +++ b/modules/spacecraftinstruments/util/imagesequencer.cpp @@ -24,10 +24,15 @@ #include -#include -#include +#include #include #include +#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "ImageSequencer"; diff --git a/modules/spacecraftinstruments/util/imagesequencer.h b/modules/spacecraftinstruments/util/imagesequencer.h index da221d2182..3edb33cb18 100644 --- a/modules/spacecraftinstruments/util/imagesequencer.h +++ b/modules/spacecraftinstruments/util/imagesequencer.h @@ -25,17 +25,20 @@ #ifndef __OPENSPACE_MODULE_SPACECRAFTINSTRUMENTS___IMAGESEQUENCER___H__ #define __OPENSPACE_MODULE_SPACECRAFTINSTRUMENTS___IMAGESEQUENCER___H__ -#include - +#include +#include +#include +#include #include +#include #include #include #include namespace openspace { -class Time; class SequenceParser; +class Time; /** * The ImageSequencer singleton function is to manage the timekeeping and distribution of diff --git a/modules/spacecraftinstruments/util/instrumentdecoder.cpp b/modules/spacecraftinstruments/util/instrumentdecoder.cpp index ac55244644..3786981ffb 100644 --- a/modules/spacecraftinstruments/util/instrumentdecoder.cpp +++ b/modules/spacecraftinstruments/util/instrumentdecoder.cpp @@ -25,8 +25,6 @@ #include #include -#include -#include #include #include #include diff --git a/modules/spacecraftinstruments/util/instrumenttimesparser.cpp b/modules/spacecraftinstruments/util/instrumenttimesparser.cpp index 18077e9195..674f90edef 100644 --- a/modules/spacecraftinstruments/util/instrumenttimesparser.cpp +++ b/modules/spacecraftinstruments/util/instrumenttimesparser.cpp @@ -24,16 +24,21 @@ #include +#include +#include #include #include -#include +#include #include #include #include #include #include +#include #include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "InstrumentTimesParser"; diff --git a/modules/spacecraftinstruments/util/instrumenttimesparser.h b/modules/spacecraftinstruments/util/instrumenttimesparser.h index ac62db895b..a1c5ff884e 100644 --- a/modules/spacecraftinstruments/util/instrumenttimesparser.h +++ b/modules/spacecraftinstruments/util/instrumenttimesparser.h @@ -30,6 +30,8 @@ #include #include +namespace ghoul { class Dictionary; } + namespace openspace { class InstrumentTimesParser : public SequenceParser { diff --git a/modules/spacecraftinstruments/util/labelparser.cpp b/modules/spacecraftinstruments/util/labelparser.cpp index e079547d55..5e7843ea0e 100644 --- a/modules/spacecraftinstruments/util/labelparser.cpp +++ b/modules/spacecraftinstruments/util/labelparser.cpp @@ -24,16 +24,19 @@ #include +#include +#include #include -#include +#include #include #include #include #include #include #include -#include +#include #include +#include namespace { constexpr std::string_view _loggerCat = "LabelParser"; diff --git a/modules/spacecraftinstruments/util/labelparser.h b/modules/spacecraftinstruments/util/labelparser.h index e59c3df7e5..aba93f5099 100644 --- a/modules/spacecraftinstruments/util/labelparser.h +++ b/modules/spacecraftinstruments/util/labelparser.h @@ -29,6 +29,8 @@ #include +namespace ghoul { class Dictionary; } + namespace openspace { class LabelParser : public SequenceParser { diff --git a/modules/spacecraftinstruments/util/projectioncomponent.cpp b/modules/spacecraftinstruments/util/projectioncomponent.cpp index 584dc35554..7cde2bf5a6 100644 --- a/modules/spacecraftinstruments/util/projectioncomponent.cpp +++ b/modules/spacecraftinstruments/util/projectioncomponent.cpp @@ -28,18 +28,25 @@ #include #include #include +#include #include -#include #include +#include #include #include +#include +#include +#include #include #include #include #include #include #include +#include #include +#include +#include namespace { constexpr std::string_view PlaceholderFile = "${DATA}/placeholder.png"; diff --git a/modules/spacecraftinstruments/util/projectioncomponent.h b/modules/spacecraftinstruments/util/projectioncomponent.h index c81a28902b..f0f485709f 100644 --- a/modules/spacecraftinstruments/util/projectioncomponent.h +++ b/modules/spacecraftinstruments/util/projectioncomponent.h @@ -33,6 +33,8 @@ #include #include #include +#include +#include namespace ghoul { class Dictionary; } namespace ghoul::opengl { diff --git a/modules/spacecraftinstruments/util/scannerdecoder.cpp b/modules/spacecraftinstruments/util/scannerdecoder.cpp index 83ed3e9e41..f012460692 100644 --- a/modules/spacecraftinstruments/util/scannerdecoder.cpp +++ b/modules/spacecraftinstruments/util/scannerdecoder.cpp @@ -25,6 +25,7 @@ #include #include +#include namespace openspace { diff --git a/modules/spacecraftinstruments/util/scannerdecoder.h b/modules/spacecraftinstruments/util/scannerdecoder.h index 65564c1321..115cba71c5 100644 --- a/modules/spacecraftinstruments/util/scannerdecoder.h +++ b/modules/spacecraftinstruments/util/scannerdecoder.h @@ -26,8 +26,6 @@ #define __OPENSPACE_MODULE_SPACECRAFTINSTRUMENTS___SCANNERDECODER___H__ #include -#include -#include namespace openspace { diff --git a/modules/spacecraftinstruments/util/sequenceparser.cpp b/modules/spacecraftinstruments/util/sequenceparser.cpp index 95176f19ef..105e886873 100644 --- a/modules/spacecraftinstruments/util/sequenceparser.cpp +++ b/modules/spacecraftinstruments/util/sequenceparser.cpp @@ -24,10 +24,6 @@ #include -#include -#include -#include - namespace openspace { std::map& SequenceParser::subsetMap() { diff --git a/modules/spacecraftinstruments/util/sequenceparser.h b/modules/spacecraftinstruments/util/sequenceparser.h index af4b54dc92..3237ae1551 100644 --- a/modules/spacecraftinstruments/util/sequenceparser.h +++ b/modules/spacecraftinstruments/util/sequenceparser.h @@ -31,6 +31,7 @@ #include #include #include +#include #include namespace openspace { diff --git a/modules/spout/renderableplanespout.cpp b/modules/spout/renderableplanespout.cpp index 77f95f68b7..5de85be83c 100644 --- a/modules/spout/renderableplanespout.cpp +++ b/modules/spout/renderableplanespout.cpp @@ -26,10 +26,11 @@ #include +#include #include -#include -#include -#include +#include +#include +#include namespace { // This `Renderable` type can be used to render a plane with a texture that is @@ -38,7 +39,6 @@ namespace { struct [[codegen::Dictionary(RenderablePlaneSpout)]] Parameters { }; #include "renderableplanespout_codegen.cpp" - } // namespace namespace openspace { diff --git a/modules/spout/renderableplanespout.h b/modules/spout/renderableplanespout.h index 34e212db68..8c979870e4 100644 --- a/modules/spout/renderableplanespout.h +++ b/modules/spout/renderableplanespout.h @@ -33,8 +33,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class RenderablePlaneSpout : public RenderablePlane { public: explicit RenderablePlaneSpout(const ghoul::Dictionary& dictionary); diff --git a/modules/spout/renderablespherespout.cpp b/modules/spout/renderablespherespout.cpp index 6c53a6c0e9..102c1478ba 100644 --- a/modules/spout/renderablespherespout.cpp +++ b/modules/spout/renderablespherespout.cpp @@ -26,10 +26,11 @@ #include +#include #include -#include -#include -#include +#include +#include +#include namespace { // This `Renderable` type can be used to render a sphere with a texture that is diff --git a/modules/spout/renderablespherespout.h b/modules/spout/renderablespherespout.h index dd2fd65862..5da9ba0ab0 100644 --- a/modules/spout/renderablespherespout.h +++ b/modules/spout/renderablespherespout.h @@ -33,8 +33,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class RenderableSphereSpout : public RenderableSphere { public: explicit RenderableSphereSpout(const ghoul::Dictionary& dictionary); diff --git a/modules/spout/screenspacespout.cpp b/modules/spout/screenspacespout.cpp index 97756adc4d..4424245764 100644 --- a/modules/spout/screenspacespout.cpp +++ b/modules/spout/screenspacespout.cpp @@ -27,9 +27,9 @@ #include #include -#include -#include +#include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo NameInfo = { diff --git a/modules/spout/screenspacespout.h b/modules/spout/screenspacespout.h index ec158e7794..0dff84e024 100644 --- a/modules/spout/screenspacespout.h +++ b/modules/spout/screenspacespout.h @@ -33,8 +33,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class ScreenSpaceSpout : public ScreenSpaceRenderable { public: explicit ScreenSpaceSpout(const ghoul::Dictionary& dictionary); diff --git a/modules/spout/spoutmodule.cpp b/modules/spout/spoutmodule.cpp index b4b175f25e..310678c45c 100644 --- a/modules/spout/spoutmodule.cpp +++ b/modules/spout/spoutmodule.cpp @@ -27,9 +27,14 @@ #include #include #include +#include +#include +#include #include -#include #include +#include +#include +#include namespace openspace { diff --git a/modules/spout/spoutwrapper.cpp b/modules/spout/spoutwrapper.cpp index d47abeefff..f6a7b8c7ab 100644 --- a/modules/spout/spoutwrapper.cpp +++ b/modules/spout/spoutwrapper.cpp @@ -24,10 +24,17 @@ #include "modules/spout/spoutwrapper.h" +#include #include #include +#include +#include #include #include +#include +#include +#include + #define SPOUT_NO_GL_INCLUDE #include diff --git a/modules/spout/spoutwrapper.h b/modules/spout/spoutwrapper.h index c620420712..7cec9f6c04 100644 --- a/modules/spout/spoutwrapper.h +++ b/modules/spout/spoutwrapper.h @@ -25,18 +25,24 @@ #ifndef __OPENSPACE_MODULE_SPOUT___SPOUTWRAPPER___H__ #define __OPENSPACE_MODULE_SPOUT___SPOUTWRAPPER___H__ -#include #include #include #include +#include #include +#include +#include #include #include struct SPOUTLIBRARY; typedef SPOUTLIBRARY* SPOUTHANDLE; -namespace ghoul::opengl { class Texture; } +namespace ghoul { + namespace opengl { class Texture; } + class Dictionary; +} // namespace ghoul +namespace openspace::documentation { struct Documentation; } namespace openspace::spout { diff --git a/modules/statemachine/include/state.h b/modules/statemachine/include/state.h index 3c979e3756..1899b21423 100644 --- a/modules/statemachine/include/state.h +++ b/modules/statemachine/include/state.h @@ -25,9 +25,10 @@ #ifndef __OPENSPACE_MODULE_STATEMACHINE___STATE___H__ #define __OPENSPACE_MODULE_STATEMACHINE___STATE___H__ -#include #include +namespace ghoul { class Dictionary; } + namespace openspace { namespace documentation { struct Documentation; } diff --git a/modules/statemachine/include/statemachine.h b/modules/statemachine/include/statemachine.h index ca5bc94253..a840634e74 100644 --- a/modules/statemachine/include/statemachine.h +++ b/modules/statemachine/include/statemachine.h @@ -27,8 +27,12 @@ #include #include +#include +#include #include +namespace ghoul { class Dictionary; } + namespace openspace { namespace documentation { struct Documentation; } diff --git a/modules/statemachine/include/transition.h b/modules/statemachine/include/transition.h index aef4cf6dfe..f19e709b9e 100644 --- a/modules/statemachine/include/transition.h +++ b/modules/statemachine/include/transition.h @@ -25,9 +25,10 @@ #ifndef __OPENSPACE_MODULE_STATEMACHINE___TRANSITION___H__ #define __OPENSPACE_MODULE_STATEMACHINE___TRANSITION___H__ -#include #include +namespace ghoul { class Dictionary; } + namespace openspace { namespace documentation { struct Documentation; } diff --git a/modules/statemachine/src/state.cpp b/modules/statemachine/src/state.cpp index ce7c8eb694..a7b05ce22c 100644 --- a/modules/statemachine/src/state.cpp +++ b/modules/statemachine/src/state.cpp @@ -27,6 +27,8 @@ #include #include #include +#include +#include namespace { struct [[codegen::Dictionary(State)]] Parameters { diff --git a/modules/statemachine/src/statemachine.cpp b/modules/statemachine/src/statemachine.cpp index 772b2bacda..72866703e0 100644 --- a/modules/statemachine/src/statemachine.cpp +++ b/modules/statemachine/src/statemachine.cpp @@ -27,8 +27,10 @@ #include #include #include +#include #include #include +#include namespace { constexpr std::string_view _loggerCat = "StateMachine"; diff --git a/modules/statemachine/src/transition.cpp b/modules/statemachine/src/transition.cpp index 9ab9eaad52..c41a02f954 100644 --- a/modules/statemachine/src/transition.cpp +++ b/modules/statemachine/src/transition.cpp @@ -27,6 +27,8 @@ #include #include #include +#include +#include namespace { struct [[codegen::Dictionary(Transition)]] Parameters { diff --git a/modules/statemachine/statemachinemodule.cpp b/modules/statemachine/statemachinemodule.cpp index 0a782f1f93..3297373082 100644 --- a/modules/statemachine/statemachinemodule.cpp +++ b/modules/statemachine/statemachinemodule.cpp @@ -28,15 +28,15 @@ #include #include #include -#include -#include #include -#include #include +#include #include -#include -#include +#include +#include #include +#include +#include #include "statemachinemodule_lua.inl" @@ -48,7 +48,7 @@ namespace openspace { StateMachineModule::StateMachineModule() : OpenSpaceModule(Name) -{ } +{} void StateMachineModule::initializeStateMachine(const ghoul::Dictionary& states, const ghoul::Dictionary& transitions, diff --git a/modules/statemachine/statemachinemodule_lua.inl b/modules/statemachine/statemachinemodule_lua.inl index 660b94aab5..d4f9f08883 100644 --- a/modules/statemachine/statemachinemodule_lua.inl +++ b/modules/statemachine/statemachinemodule_lua.inl @@ -22,6 +22,11 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include +#include +#include +#include + namespace { /** diff --git a/modules/sync/syncmodule.cpp b/modules/sync/syncmodule.cpp index 5e6bb89488..5c320e4261 100644 --- a/modules/sync/syncmodule.cpp +++ b/modules/sync/syncmodule.cpp @@ -27,22 +27,17 @@ #include #include #include -#include -#include -#include -#include -#include #include #include #include #include -#include -#include #include #include -#include #include +#include #include +#include +#include #include "syncmodule_lua.inl" diff --git a/modules/sync/syncmodule_lua.inl b/modules/sync/syncmodule_lua.inl index 565fdfdfc3..34dab66184 100644 --- a/modules/sync/syncmodule_lua.inl +++ b/modules/sync/syncmodule_lua.inl @@ -22,6 +22,9 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include +#include + namespace { /** diff --git a/modules/sync/syncs/httpsynchronization.cpp b/modules/sync/syncs/httpsynchronization.cpp index 054f937466..1c04b3abc6 100644 --- a/modules/sync/syncs/httpsynchronization.cpp +++ b/modules/sync/syncs/httpsynchronization.cpp @@ -25,13 +25,26 @@ #include #include -#include +#include +#include #include #include +#include #include +#include #include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include #include +#include namespace { constexpr std::string_view _loggerCat = "HttpSynchronization"; @@ -332,9 +345,25 @@ HttpSynchronization::trySyncFromUrl(std::string url) { _nSynchronizedBytes += sd.second.downloadedBytes; } + DownloadEventEngine::DownloadEvent event = { + .type = DownloadEventEngine::DownloadEvent::Type::Progress, + .id = line, + .downloadedBytes = downloadedBytes, + .totalBytes = totalBytes + }; + global::downloadEventEngine->publish(event); + return !_shouldCancel; }); + DownloadEventEngine::DownloadEvent event = { + .type = DownloadEventEngine::DownloadEvent::Type::Started, + .id = line, + .downloadedBytes = 0 + }; + global::downloadEventEngine->publish(event); + LDEBUG(std::format("Started downloading '{}'", dl->url())); + dl->start(); } startedAllDownloads = true; @@ -362,7 +391,7 @@ HttpSynchronization::trySyncFromUrl(std::string url) { break; } else { - ++downloadTry; + downloadTry++; std::this_thread::sleep_for(std::chrono::seconds(1)); } } @@ -373,6 +402,12 @@ HttpSynchronization::trySyncFromUrl(std::string url) { if (!d->hasSucceeded()) { LERROR(std::format("Error downloading file from URL '{}'", d->url())); failed = true; + + global::downloadEventEngine->publish( + d->url(), + DownloadEventEngine::DownloadEvent::Type::Failed + ); + LERROR(std::format("Failed to download '{}'", d->url())); continue; } @@ -421,16 +456,39 @@ HttpSynchronization::trySyncFromUrl(std::string url) { std::filesystem::remove(source); } } - if (failed) { - for (const std::unique_ptr& d : downloads) { - // Store all files that were synced to the ossync + + for (const std::unique_ptr& d : downloads) { + if (failed) { + // At least one download failed, (some downloads may have succeeded) if (d->hasSucceeded()) { _newSyncedFiles.push_back(d->url()); + global::downloadEventEngine->publish( + d->url(), + DownloadEventEngine::DownloadEvent::Type::Finished + ); + LDEBUG(std::format("Finished downloading '{}'", d->url())); + } + else { + global::downloadEventEngine->publish( + d->url(), + DownloadEventEngine::DownloadEvent::Type::Failed + ); + LERROR(std::format("Failed to download '{}'", d->url())); } } - return SynchronizationState::FileDownloadFail; + else { + // All downloads are successful + global::downloadEventEngine->publish( + d->url(), + DownloadEventEngine::DownloadEvent::Type::Finished + ); + LDEBUG(std::format("Finished downloading '{}'", d->url())); + } + } - return SynchronizationState::Success; + + return + failed ? SynchronizationState::FileDownloadFail : SynchronizationState::Success; } } // namespace openspace diff --git a/modules/sync/syncs/urlsynchronization.cpp b/modules/sync/syncs/urlsynchronization.cpp index 885f9b29d6..00cd0627a4 100644 --- a/modules/sync/syncs/urlsynchronization.cpp +++ b/modules/sync/syncs/urlsynchronization.cpp @@ -25,17 +25,28 @@ #include #include -#include +#include +#include #include #include #include -#include +#include #include +#include +#include +#include #include +#include +#include +#include +#include #include -#include #include +#include +#include +#include #include +#include #include namespace { @@ -354,9 +365,25 @@ bool UrlSynchronization::trySyncUrls() { _nSynchronizedBytes += sd.second.downloadedBytes; } + DownloadEventEngine::DownloadEvent event = { + .type = DownloadEventEngine::DownloadEvent::Type::Progress, + .id = url, + .downloadedBytes = downloadedBytes, + .totalBytes = totalBytes + }; + global::downloadEventEngine->publish(event); + return !_shouldCancel; }); + DownloadEventEngine::DownloadEvent event = { + .type = DownloadEventEngine::DownloadEvent::Type::Started, + .id = url, + .downloadedBytes = 0 + }; + global::downloadEventEngine->publish(event); + LDEBUG(std::format("Started downloading '{}'", dl->url())); + dl->start(); } @@ -368,6 +395,11 @@ bool UrlSynchronization::trySyncUrls() { if (!d->hasSucceeded()) { failed = true; LERROR(std::format("Error downloading file from URL: {}", d->url())); + global::downloadEventEngine->publish( + d->url(), + DownloadEventEngine::DownloadEvent::Type::Failed + ); + LERROR(std::format("Failed to download '{}'", d->url())); continue; } @@ -394,7 +426,18 @@ bool UrlSynchronization::trySyncUrls() { ); failed = true; + global::downloadEventEngine->publish( + d->url(), + DownloadEventEngine::DownloadEvent::Type::Failed + ); + LERROR(std::format("Failed to download '{}'", d->url())); } + + global::downloadEventEngine->publish( + d->url(), + DownloadEventEngine::DownloadEvent::Type::Finished + ); + LDEBUG(std::format("Finished downloading '{}'", d->url())); } return !failed; diff --git a/modules/sync/syncs/urlsynchronization.h b/modules/sync/syncs/urlsynchronization.h index b86310d699..b63a64bab4 100644 --- a/modules/sync/syncs/urlsynchronization.h +++ b/modules/sync/syncs/urlsynchronization.h @@ -27,9 +27,7 @@ #include -#include -#include -#include +#include #include #include diff --git a/modules/telemetry/include/general/anglemodetelemetry.h b/modules/telemetry/include/general/anglemodetelemetry.h index 566fa5c485..a62201f27f 100644 --- a/modules/telemetry/include/general/anglemodetelemetry.h +++ b/modules/telemetry/include/general/anglemodetelemetry.h @@ -31,6 +31,8 @@ namespace openspace { +class Camera; + class AngleModeTelemetry : public TelemetryBase { public: AngleModeTelemetry(const std::string& ip, int port); diff --git a/modules/telemetry/include/general/cameratelemetry.h b/modules/telemetry/include/general/cameratelemetry.h index ad38f30d15..00431c7c61 100644 --- a/modules/telemetry/include/general/cameratelemetry.h +++ b/modules/telemetry/include/general/cameratelemetry.h @@ -32,6 +32,8 @@ namespace openspace { +class Camera; + class CameraTelemetry : public TelemetryBase { public: CameraTelemetry(const std::string& ip, int port); diff --git a/modules/telemetry/include/general/focustelemetry.h b/modules/telemetry/include/general/focustelemetry.h index 4b2f235b45..91078e7040 100644 --- a/modules/telemetry/include/general/focustelemetry.h +++ b/modules/telemetry/include/general/focustelemetry.h @@ -27,10 +27,10 @@ #include -#include - namespace openspace { +class Camera; + class FocusTelemetry : public TelemetryBase { public: FocusTelemetry(const std::string& ip, int port); diff --git a/modules/telemetry/include/general/nodestelemetry.h b/modules/telemetry/include/general/nodestelemetry.h index 2989541254..c7c8877559 100644 --- a/modules/telemetry/include/general/nodestelemetry.h +++ b/modules/telemetry/include/general/nodestelemetry.h @@ -33,6 +33,8 @@ namespace openspace { +class Camera; + namespace scripting { struct LuaLibrary; } class NodesTelemetry : public TelemetryBase { diff --git a/modules/telemetry/include/general/timetelemetry.h b/modules/telemetry/include/general/timetelemetry.h index af549e92e0..43ca2bcede 100644 --- a/modules/telemetry/include/general/timetelemetry.h +++ b/modules/telemetry/include/general/timetelemetry.h @@ -32,6 +32,8 @@ namespace openspace { +class Camera; + class TimeTelemetry : public TelemetryBase { public: TimeTelemetry(const std::string& ip, int port); diff --git a/modules/telemetry/include/specific/planetscomparesonification.h b/modules/telemetry/include/specific/planetscomparesonification.h index ce28b28d77..007439c2e8 100644 --- a/modules/telemetry/include/specific/planetscomparesonification.h +++ b/modules/telemetry/include/specific/planetscomparesonification.h @@ -27,9 +27,12 @@ #include +#include #include #include +namespace osc { struct Blob; } + namespace openspace { class PlanetsCompareSonification : public TelemetryBase { diff --git a/modules/telemetry/include/specific/planetsoverviewsonification.h b/modules/telemetry/include/specific/planetsoverviewsonification.h index a43f11bc32..2ecf33d725 100644 --- a/modules/telemetry/include/specific/planetsoverviewsonification.h +++ b/modules/telemetry/include/specific/planetsoverviewsonification.h @@ -27,6 +27,10 @@ #include +#include + +namespace osc { struct Blob; } + namespace openspace { class PlanetsOverviewSonification : public TelemetryBase { diff --git a/modules/telemetry/include/specific/planetssonification.h b/modules/telemetry/include/specific/planetssonification.h index a861d1de40..4a0b2be6e8 100644 --- a/modules/telemetry/include/specific/planetssonification.h +++ b/modules/telemetry/include/specific/planetssonification.h @@ -28,8 +28,12 @@ #include #include +#include #include +namespace ghoul { class Dictionary; } +namespace osc { struct Blob; } + namespace openspace { namespace scripting { struct LuaLibrary; } diff --git a/modules/telemetry/include/telemetrybase.h b/modules/telemetry/include/telemetrybase.h index 999c2b5d14..6771e8d37d 100644 --- a/modules/telemetry/include/telemetrybase.h +++ b/modules/telemetry/include/telemetrybase.h @@ -27,12 +27,13 @@ #include -#include -#include #include namespace openspace { +class Camera; +class OpenSoundControlConnection; + class TelemetryBase : public properties::PropertyOwner { public: TelemetryBase(properties::PropertyOwner::PropertyOwnerInfo info, diff --git a/modules/telemetry/include/util.h b/modules/telemetry/include/util.h index 92f7ee9b3a..4d60306a57 100644 --- a/modules/telemetry/include/util.h +++ b/modules/telemetry/include/util.h @@ -26,180 +26,182 @@ #define __OPENSPACE_MODULE_TELEMETRY___UTIL___H__ #include -#include #include +#include +#include namespace openspace { + +class Camera; + /** -* Calculate the distance from the camera to the node with the given identifier, in the -* given distance unit. -* -* \param camera Pointer to the camera in the scene that the distance should be calculated -* from -* \param nodeIdentifier The identifier of the node that the distance should be calculated -* to -* \param unit The distance unit that the answer should be in, the default is meters -* -* \return The distance from the camera to the node with the given identifier in the given -* distance unit -*/ + * Calculate the distance from the camera to the node with the given identifier, in the + * given distance unit. + * + * \param camera Pointer to the camera in the scene that the distance should be calculated + * from + * \param nodeIdentifier The identifier of the node that the distance should be calculated + * to + * \param unit The distance unit that the answer should be in, the default is meters + * + * \return The distance from the camera to the node with the given identifier in the given + * distance unit + */ double calculateDistanceTo(const Camera* camera, const std::string& nodeIdentifier, DistanceUnit unit = DistanceUnit::Meter); /** -* Calculate the distance from the camera to the node with the given position, in the given -* distance unit. -* -* \param camera Pointer to the camera in the scene that the distance should be calculated -* from -* \param nodePosition The world position of the node that the distance should be -* calculated to -* \param unit The distance unit that the answer should be in, the default is meters -* -* \return The distance from the camera to the node with the given position in the given -* distance unit -*/ + * Calculate the distance from the camera to the node with the given position, in the given + * distance unit. + * + * \param camera Pointer to the camera in the scene that the distance should be calculated + * from + * \param nodePosition The world position of the node that the distance should be + * calculated to + * \param unit The distance unit that the answer should be in, the default is meters + * + * \return The distance from the camera to the node with the given position in the given + * distance unit + */ double calculateDistanceTo(const Camera* camera, glm::dvec3 nodePosition, DistanceUnit unit = DistanceUnit::Meter); /** -* Calculate the angle in radians from the camera to the node with the given identifier. -* -* \param camera Pointer to the camera in the scene that the angle should be calculated -* from -* \param nodeIdentifier The identifier of the node, that the angle should be calculated to -* \param angleCalculationMode The angle calculation mode to use. This determines which -* method to use when calculating the angle. -* -* \return The angle in radians from the camera to the node with the given identifier -*/ + * Calculate the angle in radians from the camera to the node with the given identifier. + * + * \param camera Pointer to the camera in the scene that the angle should be calculated + * from + * \param nodeIdentifier The identifier of the node, that the angle should be calculated to + * \param angleCalculationMode The angle calculation mode to use. This determines which + * method to use when calculating the angle. + * + * \return The angle in radians from the camera to the node with the given identifier + */ double calculateAngleTo(const Camera* camera, const std::string& nodeIdentifier, TelemetryModule::AngleCalculationMode angleCalculationMode); /** -* Calculate the angle in radians from the camera to the node with the given position. -* -* \param camera Pointer to the camera in the scene that the angle should be calculated -* from -* \param nodePosition The position of the node, that the angle should be calculated to -* \param angleCalculationMode The angle calculation mode to use. This determines which -* method to use when calculating the angle. -* -* \return The angle in radians from the camera to the node with the given position -*/ + * Calculate the angle in radians from the camera to the node with the given position. + * + * \param camera Pointer to the camera in the scene that the angle should be calculated + * from + * \param nodePosition The position of the node, that the angle should be calculated to + * \param angleCalculationMode The angle calculation mode to use. This determines which + * method to use when calculating the angle. + * + * \return The angle in radians from the camera to the node with the given position + */ double calculateAngleTo(const Camera* camera, glm::dvec3 nodePosition, TelemetryModule::AngleCalculationMode angleCalculationMode); /** -* Calculate the angle in radians from the first node (A) with the given identifier to the -* second node (B) with the given identifier. -* -* \param camera Pointer to the camera in the scene -* \param nodeIdentifierA The identifier of the first node (A) that the angle should be -* calculated from -* \param nodeIdentifierB The identifier of the second node (B) that the angle should be -* calculated to -* \param angleCalculationMode The angle calculation mode to use. This determines which -* method to use when calculating the angle. -* -* \return The angle in radians from the first node (A) with the given identifier to the -* second node (B) with the given identifier -*/ -double calculateAngleFromAToB(const Camera* camera, - const std::string& nodeIdentifierA, const std::string& nodeIdentifierB, + * Calculate the angle in radians from the first node (A) with the given identifier to the + * second node (B) with the given identifier. + * + * \param camera Pointer to the camera in the scene + * \param nodeIdentifierA The identifier of the first node (A) that the angle should be + * calculated from + * \param nodeIdentifierB The identifier of the second node (B) that the angle should be + * calculated to + * \param angleCalculationMode The angle calculation mode to use. This determines which + * method to use when calculating the angle. + * + * \return The angle in radians from the first node (A) with the given identifier to the + * second node (B) with the given identifier + */ +double calculateAngleFromAToB(const Camera* camera, const std::string& nodeIdentifierA, + const std::string& nodeIdentifierB, TelemetryModule::AngleCalculationMode angleCalculationMode); /** -* Calculate the angle in radians from the first node (A) with the given position to the -* second node (B) with the given position. -* -* \param camera Pointer to the camera in the scene -* \param nodePositionA The position of the first node (A) that the angle should be -* calculated from -* \param nodePositionB The position of the second node (B) that the angle should be -* calculated to -* \param angleCalculationMode The angle calculation mode to use. This determines which -* method to use when calculating the angle. -* -* \return The angle in radians from the first node (A) with the given position to the -* second node (B) with the given position -*/ + * Calculate the angle in radians from the first node (A) with the given position to the + * second node (B) with the given position. + * + * \param camera Pointer to the camera in the scene + * \param nodePositionA The position of the first node (A) that the angle should be + * calculated from + * \param nodePositionB The position of the second node (B) that the angle should be + * calculated to + * \param angleCalculationMode The angle calculation mode to use. This determines which + * method to use when calculating the angle. + * + * \return The angle in radians from the first node (A) with the given position to the + * second node (B) with the given position + */ double calculateAngleFromAToB(const Camera* camera, glm::dvec3 nodePositionA, - glm::dvec3 nodePositionB, - TelemetryModule::AngleCalculationMode angleCalculationMode); + glm::dvec3 nodePositionB, TelemetryModule::AngleCalculationMode angleCalculationMode); /** -* Calculate the elevation angle in radians from the camera to the node with the given -* identifier. -* -* \param camera Pointer to the camera in the scene that the elevation angle should be -* calculated from -* \param nodeIdentifier The identifier of the node that the elevation angle should be -* calculated to -* \param angleCalculationMode The angle calculation mode to use. This determines which -* method to use when calculating the angle. -* -* \return The elevation angle in radians from the camera to the node with the given -* identifier -*/ + * Calculate the elevation angle in radians from the camera to the node with the given + * identifier. + * + * \param camera Pointer to the camera in the scene that the elevation angle should be + * calculated from + * \param nodeIdentifier The identifier of the node that the elevation angle should be + * calculated to + * \param angleCalculationMode The angle calculation mode to use. This determines which + * method to use when calculating the angle. + * + * \return The elevation angle in radians from the camera to the node with the given + * identifier + */ double calculateElevationAngleTo(const Camera* camera, const std::string& nodeIdentifier, TelemetryModule::AngleCalculationMode angleCalculationMode); /** -* Calculate the elevation angle in radians from the camera to the node with the given -* position. -* -* \param camera Pointer to the camera in the scene that the elevation angle should be -* calculated from -* \param nodePosition The position of the node that the elevation angle should be -* calculated to -* \param angleCalculationMode The angle calculation mode to use. This determines which -* method to use when calculating the angle. -* -* \return The elevation angle in radians from the camera to the node with the given -* position -*/ + * Calculate the elevation angle in radians from the camera to the node with the given + * position. + * + * \param camera Pointer to the camera in the scene that the elevation angle should be + * calculated from + * \param nodePosition The position of the node that the elevation angle should be + * calculated to + * \param angleCalculationMode The angle calculation mode to use. This determines which + * method to use when calculating the angle. + * + * \return The elevation angle in radians from the camera to the node with the given + * position + */ double calculateElevationAngleTo(const Camera* camera, glm::dvec3 nodePosition, TelemetryModule::AngleCalculationMode angleCalculationMode); /** -* Calculate the elevation angle in radians from the first node (A) with the given -* identifier to the second node (B) with the given identifier. -* -* \param camera Pointer to the camera in the scene -* \param nodeIdentifierA The identifier of the first node (A) that the elevation angle -* should be calculated from -* \param nodeIdentifierB The identifier of the second node (B) that the elevation angle -* should be calculated to -* \param angleCalculationMode The angle calculation mode to use. This determines which -* method to use when calculating the angle. -* -* \return The elevation angle in radians from the first node (A) with the given identifier -* to the second node (B) with the given identifier -*/ + * Calculate the elevation angle in radians from the first node (A) with the given + * identifier to the second node (B) with the given identifier. + * + * \param camera Pointer to the camera in the scene + * \param nodeIdentifierA The identifier of the first node (A) that the elevation angle + * should be calculated from + * \param nodeIdentifierB The identifier of the second node (B) that the elevation angle + * should be calculated to + * \param angleCalculationMode The angle calculation mode to use. This determines which + * method to use when calculating the angle. + * + * \return The elevation angle in radians from the first node (A) with the given identifier + * to the second node (B) with the given identifier + */ double calculateElevationAngleFromAToB(const Camera* camera, const std::string& nodeIdentifierA, const std::string& nodeIdentifierB, TelemetryModule::AngleCalculationMode angleCalculationMode); /** -* Calculate the elevation angle in radians from the first node (A) with the given position -* to the second node (B) with the given position. -* -* \param camera Pointer to the camera in the scene -* \param nodePositionA The position of the first node (A) that the elevation angle should -* be calculated from -* \param nodePositionB The position of the second node (B) that the elevation angle should -* be calculated to -* \param angleCalculationMode The angle calculation mode to use. This determines which -* method to use when calculating the angle. -* -* \return The elevation angle in radians from the first node (A) with the given position -* to the second node (B) with the given position -*/ -double calculateElevationAngleFromAToB(const Camera* camera, - glm::dvec3 nodePositionA, glm::dvec3 nodePositionB, - TelemetryModule::AngleCalculationMode angleCalculationMode); + * Calculate the elevation angle in radians from the first node (A) with the given position + * to the second node (B) with the given position. + * + * \param camera Pointer to the camera in the scene + * \param nodePositionA The position of the first node (A) that the elevation angle should + * be calculated from + * \param nodePositionB The position of the second node (B) that the elevation angle should + * be calculated to + * \param angleCalculationMode The angle calculation mode to use. This determines which + * method to use when calculating the angle. + * + * \return The elevation angle in radians from the first node (A) with the given position + * to the second node (B) with the given position + */ +double calculateElevationAngleFromAToB(const Camera* camera, glm::dvec3 nodePositionA, + glm::dvec3 nodePositionB, TelemetryModule::AngleCalculationMode angleCalculationMode); } // namespace openspace diff --git a/modules/telemetry/src/general/anglemodetelemetry.cpp b/modules/telemetry/src/general/anglemodetelemetry.cpp index 1959d4172e..bb8d2e59ed 100644 --- a/modules/telemetry/src/general/anglemodetelemetry.cpp +++ b/modules/telemetry/src/general/anglemodetelemetry.cpp @@ -24,6 +24,7 @@ #include +#include #include #include #include diff --git a/modules/telemetry/src/general/cameratelemetry.cpp b/modules/telemetry/src/general/cameratelemetry.cpp index 409dcf8005..4102a878b4 100644 --- a/modules/telemetry/src/general/cameratelemetry.cpp +++ b/modules/telemetry/src/general/cameratelemetry.cpp @@ -24,9 +24,13 @@ #include +#include +#include #include #include #include +#include +#include namespace { // Indices for data items diff --git a/modules/telemetry/src/general/focustelemetry.cpp b/modules/telemetry/src/general/focustelemetry.cpp index 46a1115277..eae7af09fe 100644 --- a/modules/telemetry/src/general/focustelemetry.cpp +++ b/modules/telemetry/src/general/focustelemetry.cpp @@ -24,6 +24,7 @@ #include +#include #include #include #include diff --git a/modules/telemetry/src/general/nodestelemetry.cpp b/modules/telemetry/src/general/nodestelemetry.cpp index d7110a0b93..cc7126ea4d 100644 --- a/modules/telemetry/src/general/nodestelemetry.cpp +++ b/modules/telemetry/src/general/nodestelemetry.cpp @@ -24,6 +24,7 @@ #include +#include #include #include #include @@ -31,6 +32,11 @@ #include #include #include +#include +#include +#include +#include +#include #include "nodestelemetry_lua.inl" diff --git a/modules/telemetry/src/general/timetelemetry.cpp b/modules/telemetry/src/general/timetelemetry.cpp index 5e3b6ecb78..ecb9351ce1 100644 --- a/modules/telemetry/src/general/timetelemetry.cpp +++ b/modules/telemetry/src/general/timetelemetry.cpp @@ -24,9 +24,12 @@ #include +#include #include #include #include +#include +#include namespace { // Indices for data items diff --git a/modules/telemetry/src/specific/planetscomparesonification.cpp b/modules/telemetry/src/specific/planetscomparesonification.cpp index 9fb4c4ef3b..41a4fe653b 100644 --- a/modules/telemetry/src/specific/planetscomparesonification.cpp +++ b/modules/telemetry/src/specific/planetscomparesonification.cpp @@ -24,11 +24,16 @@ #include +#include #include -#include #include #include +#include #include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "PlanetsCompareSonification"; diff --git a/modules/telemetry/src/specific/planetsoverviewsonification.cpp b/modules/telemetry/src/specific/planetsoverviewsonification.cpp index 0cf23c17c9..df06451a7f 100644 --- a/modules/telemetry/src/specific/planetsoverviewsonification.cpp +++ b/modules/telemetry/src/specific/planetsoverviewsonification.cpp @@ -24,8 +24,11 @@ #include +#include #include #include +#include +#include namespace { // Indices for data items diff --git a/modules/telemetry/src/specific/planetssonification.cpp b/modules/telemetry/src/specific/planetssonification.cpp index 71e283da19..e5d879155e 100644 --- a/modules/telemetry/src/specific/planetssonification.cpp +++ b/modules/telemetry/src/specific/planetssonification.cpp @@ -24,7 +24,9 @@ #include +#include #include +#include #include #include #include @@ -33,6 +35,16 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "planetssonification_lua.inl" diff --git a/modules/telemetry/src/telemetrybase.cpp b/modules/telemetry/src/telemetrybase.cpp index 6090440669..e950953fdd 100644 --- a/modules/telemetry/src/telemetrybase.cpp +++ b/modules/telemetry/src/telemetrybase.cpp @@ -24,10 +24,7 @@ #include -#include -#include -#include -#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { diff --git a/modules/telemetry/src/util.cpp b/modules/telemetry/src/util.cpp index f1ed3383c5..bf53b5f5cd 100644 --- a/modules/telemetry/src/util.cpp +++ b/modules/telemetry/src/util.cpp @@ -24,12 +24,13 @@ #include -#include -#include +#include #include #include #include #include +#include +#include namespace { /** diff --git a/modules/telemetry/telemetrymodule.cpp b/modules/telemetry/telemetrymodule.cpp index 3b8e9cef76..f0da1e32aa 100644 --- a/modules/telemetry/telemetrymodule.cpp +++ b/modules/telemetry/telemetrymodule.cpp @@ -32,6 +32,7 @@ #include #include #include +#include #include #include #include @@ -40,7 +41,11 @@ #include #include #include -#include +#include +#include +#include +#include +#include namespace { // The default Open Sound Control receiver is SuperCollider with these default values. diff --git a/modules/telemetry/telemetrymodule.h b/modules/telemetry/telemetrymodule.h index f96b6cc4ec..6a46b837b6 100644 --- a/modules/telemetry/telemetrymodule.h +++ b/modules/telemetry/telemetrymodule.h @@ -27,14 +27,14 @@ #include "openspace/util/openspacemodule.h" -#include #include #include #include #include -#include #include #include +#include +#include namespace openspace { diff --git a/modules/touch/include/directinputsolver.h b/modules/touch/include/directinputsolver.h index 615d36e770..52f437ee38 100644 --- a/modules/touch/include/directinputsolver.h +++ b/modules/touch/include/directinputsolver.h @@ -25,8 +25,9 @@ #ifndef __OPENSPACE_MODULE_TOUCH___DIRECTINPUT_SOLVER___H__ #define __OPENSPACE_MODULE_TOUCH___DIRECTINPUT_SOLVER___H__ -#include #include +#include +#include #include namespace openspace { diff --git a/modules/touch/include/touchinteraction.h b/modules/touch/include/touchinteraction.h index 52809fba9c..802a93ff83 100644 --- a/modules/touch/include/touchinteraction.h +++ b/modules/touch/include/touchinteraction.h @@ -28,24 +28,22 @@ #include #include -#include #include #include #include #include #include -#include #include +#include +#include #include #include -#include // #define TOUCH_DEBUG_PROPERTIES namespace openspace { class Camera; -class SceneGraphNode; // Class used for keeping track of the recent average frame time class FrameTimeAverage { @@ -64,8 +62,6 @@ private: class TouchInteraction : public properties::PropertyOwner { public: - TouchInteraction(); - enum class InteractionType { ROTATION = 0, PINCH, @@ -82,6 +78,8 @@ public: glm::dvec2 pan = glm::dvec2(0.0); }; + TouchInteraction(); + /** * Main function call: * 1. Checks if doubleTap occured diff --git a/modules/touch/include/touchmarker.h b/modules/touch/include/touchmarker.h index e5fac0123e..1453dcc2c8 100644 --- a/modules/touch/include/touchmarker.h +++ b/modules/touch/include/touchmarker.h @@ -25,18 +25,15 @@ #ifndef __OPENSPACE_MODULE_TOUCH___TOUCH_MARKER___H__ #define __OPENSPACE_MODULE_TOUCH___TOUCH_MARKER___H__ -#include #include -#include + #include #include #include #include -#include #include #include #include -#include namespace ghoul::opengl { class ProgramObject; } @@ -50,10 +47,10 @@ public: void initialize(); void deinitialize(); - void render(const std::vector& list); + void render(const std::vector& list); private: - void createVertexList(const std::vector& list); + void createVertexList(const std::vector& list); properties::BoolProperty _visible; properties::FloatProperty _radiusSize; diff --git a/modules/touch/include/tuioear.h b/modules/touch/include/tuioear.h index a2db75f503..27398c523d 100644 --- a/modules/touch/include/tuioear.h +++ b/modules/touch/include/tuioear.h @@ -33,8 +33,9 @@ #pragma GCC diagnostic ignored "-Wold-style-cast" #endif -#include -#include +#include +#include +#include #ifdef __clang__ #pragma clang diagnostic pop @@ -43,16 +44,20 @@ #endif #include -#include -#include #include #include +namespace TUIO { + class TuioBlob; + class TuioCursor; + class TuioObject; +} // namespace TUIO + namespace openspace { class TuioEar : public TUIO::TuioListener { public: - TuioEar(); + explicit TuioEar(int port = 3333); ~TuioEar(); /** diff --git a/modules/touch/include/win32_touch.h b/modules/touch/include/win32_touch.h index 7f488b1a75..cb8e759b2b 100644 --- a/modules/touch/include/win32_touch.h +++ b/modules/touch/include/win32_touch.h @@ -38,4 +38,5 @@ public: } // namespace openspace #endif // WIN32 + #endif // __OPENSPACE_MODULE_TOUCH___WIN32_TOUCH___H__ diff --git a/modules/touch/src/directinputsolver.cpp b/modules/touch/src/directinputsolver.cpp index d7e9d1755e..fd0e585641 100644 --- a/modules/touch/src/directinputsolver.cpp +++ b/modules/touch/src/directinputsolver.cpp @@ -24,8 +24,14 @@ #include +#include #include #include +#include +#include +#include +#include +#include namespace { // Used in the LM algorithm diff --git a/modules/touch/src/touchinteraction.cpp b/modules/touch/src/touchinteraction.cpp index 1d000607cf..55e519dde4 100644 --- a/modules/touch/src/touchinteraction.cpp +++ b/modules/touch/src/touchinteraction.cpp @@ -31,8 +31,18 @@ #include #include #include +#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef WIN32 #pragma warning (push) @@ -313,7 +323,10 @@ TouchInteraction::TouchInteraction() // projDiffLength/diffLength. , _enableDirectManipulation(EnableDirectManipulationInfo, true) , _directTouchDistanceThreshold(DirectManipulationThresholdInfo, 5.f, 0.f, 10.f) - , _pinchInputs({ TouchInput(0, 0, 0.f, 0.f, 0.0), TouchInput(0, 0, 0.f, 0.f, 0.0) }) + , _pinchInputs({ + TouchInputHolder(TouchInput(0, 0, 0.f, 0.f, 0.0)), + TouchInputHolder(TouchInput(0, 0, 0.f, 0.f, 0.0)) + }) , _vel{ glm::dvec2(0.0), 0.0, 0.0, glm::dvec2(0.0) } , _sensitivity{ glm::dvec2(0.08, 0.045), 12.0, 2.75, glm::dvec2(0.08, 0.045) } { @@ -1081,8 +1094,9 @@ void TouchInteraction::step(double dt, bool directTouch) { global::navigationHandler->orbitalNavigator().updateOnCameraInteraction(); #ifdef TOUCH_DEBUG_PROPERTIES - //Show velocity status every N frames - if (++stepVelUpdate >= 60) { + // Show velocity status every N frames + stepVelUpdate++; + if (stepVelUpdate >= 60) { stepVelUpdate = 0; LINFO(std::format( "DistToFocusNode {} stepZoomVelUpdate {}", diff --git a/modules/touch/src/touchmarker.cpp b/modules/touch/src/touchmarker.cpp index f9117fa801..e262ebb8f7 100644 --- a/modules/touch/src/touchmarker.cpp +++ b/modules/touch/src/touchmarker.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include namespace { diff --git a/modules/touch/src/tuioear.cpp b/modules/touch/src/tuioear.cpp index 9173ff0295..6a13cfd1f1 100644 --- a/modules/touch/src/tuioear.cpp +++ b/modules/touch/src/tuioear.cpp @@ -24,12 +24,9 @@ #include -#include -#include -#include -#include -#include -#include +#include +#include +#include using namespace TUIO; @@ -96,8 +93,8 @@ std::vector TuioEar::takeRemovals() { } // Standard UDP IP connection to port 3333 -TuioEar::TuioEar() - : _tuioClient(3333) +TuioEar::TuioEar(int port) + : _tuioClient(port) { _tuioClient.addTuioListener(this); _tuioClient.connect(); diff --git a/modules/touch/src/win32_touch.cpp b/modules/touch/src/win32_touch.cpp index 74da61931f..61d2650263 100644 --- a/modules/touch/src/win32_touch.cpp +++ b/modules/touch/src/win32_touch.cpp @@ -28,14 +28,21 @@ #include #include -#include +#include +#include #include #include +#include #include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include +#include +#include // #define ENABLE_TUIOMESSAGES #define ENABLE_DIRECTMSG diff --git a/modules/touch/touchmodule.cpp b/modules/touch/touchmodule.cpp index bb6e6b46b0..419664e0fd 100644 --- a/modules/touch/touchmodule.cpp +++ b/modules/touch/touchmodule.cpp @@ -26,20 +26,37 @@ #include #include +#include #include #include #include #include #include #include +#include #include +#include +#include #include +#include +#include +#include +#include +#include +#include using namespace TUIO; namespace { constexpr std::string_view _loggerCat = "TouchModule"; + constexpr openspace::properties::Property::PropertyInfo TuioPortInfo = { + "TuioPort", + "TUIO Port", + "TUIO UDP port, by default 3333. The port cannot be changed after startup.", + openspace::properties::Property::Visibility::AdvancedUser + }; + constexpr openspace::properties::Property::PropertyInfo EnableTouchInfo = { "EnableTouchInteraction", "Enable touch interaction", @@ -66,18 +83,28 @@ namespace { "relatively spherical objects.", openspace::properties::Property::Visibility::AdvancedUser }; + + struct [[codegen::Dictionary(TouchModule)]] Parameters { + // [[codegen::verbatim(TuioPortInfo.description)]] + std::optional tuioPort [[codegen::inrange(1, 65535)]]; + }; + + #include "touchmodule_codegen.cpp" } // namespace namespace openspace { TouchModule::TouchModule() : OpenSpaceModule("Touch") + , _tuioPort(TuioPortInfo, 3333, 1, 65535) , _touchIsEnabled(EnableTouchInfo, true) , _hasActiveTouchEvent(EventsInfo, false) , _defaultDirectTouchRenderableTypes(DefaultDirectTouchRenderableTypesInfo) { addPropertySubOwner(_touch); addPropertySubOwner(_markers); + _tuioPort.setReadOnly(true); + addProperty(_tuioPort); addProperty(_touchIsEnabled); _touchIsEnabled.onChange([this]() { _touch.resetAfterInput(); @@ -116,8 +143,11 @@ bool TouchModule::isDefaultDirectTouchType(std::string_view renderableType) cons _sortedDefaultRenderableTypes.end(); } -void TouchModule::internalInitialize(const ghoul::Dictionary&) { - _ear.reset(new TuioEar()); +void TouchModule::internalInitialize(const ghoul::Dictionary& dict) { + const Parameters p = codegen::bake(dict); + + _tuioPort = p.tuioPort.value_or(_tuioPort); + _ear = std::make_unique(_tuioPort); global::callback::initializeGL->push_back([this]() { LDEBUG("Initializing TouchMarker OpenGL"); diff --git a/modules/touch/touchmodule.h b/modules/touch/touchmodule.h index 6b922920d8..30257e669e 100644 --- a/modules/touch/touchmodule.h +++ b/modules/touch/touchmodule.h @@ -31,8 +31,10 @@ #include #include #include +#include #include #include +#include namespace openspace { @@ -77,6 +79,7 @@ private: std::vector _deferredRemovals; std::vector _lastTouchInputs; + properties::IntProperty _tuioPort; properties::BoolProperty _touchIsEnabled; properties::BoolProperty _hasActiveTouchEvent; properties::StringListProperty _defaultDirectTouchRenderableTypes; @@ -88,7 +91,7 @@ private: glm::ivec2 _webPositionCallback = glm::ivec2(0); #ifdef WIN32 std::unique_ptr _win32TouchHook; -#endif //WIN32 +#endif // WIN32 bool _tap = false; }; diff --git a/modules/toyvolume/rendering/renderabletoyvolume.cpp b/modules/toyvolume/rendering/renderabletoyvolume.cpp index 5254bb1e51..b8c6b163d0 100644 --- a/modules/toyvolume/rendering/renderabletoyvolume.cpp +++ b/modules/toyvolume/rendering/renderabletoyvolume.cpp @@ -24,13 +24,14 @@ #include -#include #include #include -#include #include #include -#include +#include +#include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo SizeInfo = { @@ -113,6 +114,10 @@ namespace { namespace openspace { +documentation::Documentation RenderableToyVolume::Documentation() { + return codegen::doc("toyvolume_renderabletoyvolume"); +} + RenderableToyVolume::RenderableToyVolume(const ghoul::Dictionary& dictionary) : Renderable(dictionary) , _size(SizeInfo, glm::vec3(1.f, 1.f, 1.f), glm::vec3(0.f), glm::vec3(10.f)) @@ -142,8 +147,6 @@ RenderableToyVolume::RenderableToyVolume(const ghoul::Dictionary& dictionary) _downScaleVolumeRendering = p.downscale.value_or(_downScaleVolumeRendering); } -RenderableToyVolume::~RenderableToyVolume() {} - void RenderableToyVolume::initializeGL() { glm::vec4 color = glm::vec4(glm::vec3(_color), opacity()); _raycaster = std::make_unique(std::move(color)); diff --git a/modules/toyvolume/rendering/renderabletoyvolume.h b/modules/toyvolume/rendering/renderabletoyvolume.h index d0571b86db..f6be9efd2e 100644 --- a/modules/toyvolume/rendering/renderabletoyvolume.h +++ b/modules/toyvolume/rendering/renderabletoyvolume.h @@ -27,19 +27,17 @@ #include +#include #include #include #include +#include namespace openspace { -class ToyVolumeRaycaster; -struct RenderData; - class RenderableToyVolume : public Renderable { public: explicit RenderableToyVolume(const ghoul::Dictionary& dictionary); - ~RenderableToyVolume() override; void initializeGL() override; void deinitializeGL() override; @@ -47,6 +45,8 @@ public: void render(const RenderData& data, RendererTasks& tasks) override; void update(const UpdateData& data) override; + static documentation::Documentation Documentation(); + private: properties::Vec3Property _size; properties::IntProperty _scalingExponent; diff --git a/modules/toyvolume/rendering/toyvolumeraycaster.cpp b/modules/toyvolume/rendering/toyvolumeraycaster.cpp index 58ec72c94e..59815cca74 100644 --- a/modules/toyvolume/rendering/toyvolumeraycaster.cpp +++ b/modules/toyvolume/rendering/toyvolumeraycaster.cpp @@ -24,15 +24,14 @@ #include -#include -#include #include #include +#include #include #include #include -#include -#include +#include +#include namespace { constexpr std::string_view GlslRaycastPath = diff --git a/modules/toyvolume/rendering/toyvolumeraycaster.h b/modules/toyvolume/rendering/toyvolumeraycaster.h index 9ffe3e867a..c76b2630ba 100644 --- a/modules/toyvolume/rendering/toyvolumeraycaster.h +++ b/modules/toyvolume/rendering/toyvolumeraycaster.h @@ -29,18 +29,10 @@ #include #include -#include - -namespace ghoul::opengl { - class Texture; - class ProgramObject; -} // namespace ghoul::opengl +#include namespace openspace { -struct RenderData; -struct RaycastData; - class ToyVolumeRaycaster : public VolumeRaycaster { public: explicit ToyVolumeRaycaster(glm::vec4 color); diff --git a/modules/toyvolume/toyvolumemodule.cpp b/modules/toyvolume/toyvolumemodule.cpp index f6d90fbdb0..3a6201698c 100644 --- a/modules/toyvolume/toyvolumemodule.cpp +++ b/modules/toyvolume/toyvolumemodule.cpp @@ -25,8 +25,11 @@ #include #include +#include +#include #include #include +#include #include namespace openspace { @@ -40,4 +43,10 @@ void ToyVolumeModule::internalInitialize(const ghoul::Dictionary&) { fRenderable->registerClass("RenderableToyVolume"); } +std::vector ToyVolumeModule::documentations() const { + return { + RenderableToyVolume::Documentation() + }; +} + } // namespace openspace diff --git a/modules/toyvolume/toyvolumemodule.h b/modules/toyvolume/toyvolumemodule.h index ba47b4894e..892c729f84 100644 --- a/modules/toyvolume/toyvolumemodule.h +++ b/modules/toyvolume/toyvolumemodule.h @@ -34,7 +34,9 @@ public: constexpr static const char* Name = "ToyVolume"; ToyVolumeModule(); + std::vector documentations() const override; +private: void internalInitialize(const ghoul::Dictionary&) override; }; diff --git a/modules/video/include/renderablevideoplane.h b/modules/video/include/renderablevideoplane.h index 6ff607da55..a1e2833cd9 100644 --- a/modules/video/include/renderablevideoplane.h +++ b/modules/video/include/renderablevideoplane.h @@ -28,11 +28,10 @@ #include #include +#include namespace openspace { -namespace documentation { struct Documentation; } - class RenderableVideoPlane : public RenderablePlane { public: explicit RenderableVideoPlane(const ghoul::Dictionary& dictionary); diff --git a/modules/video/include/renderablevideosphere.h b/modules/video/include/renderablevideosphere.h index c9da8642e6..1358ccbc40 100644 --- a/modules/video/include/renderablevideosphere.h +++ b/modules/video/include/renderablevideosphere.h @@ -31,8 +31,6 @@ namespace openspace { -namespace documentation { struct Documentation; } - class RenderableVideoSphere : public RenderableSphere { public: explicit RenderableVideoSphere(const ghoul::Dictionary& dictionary); diff --git a/modules/video/include/screenspacevideo.h b/modules/video/include/screenspacevideo.h index 3df6f5c025..9dfffc615c 100644 --- a/modules/video/include/screenspacevideo.h +++ b/modules/video/include/screenspacevideo.h @@ -28,14 +28,9 @@ #include #include -#include - -namespace ghoul::opengl { class Texture; } namespace openspace { -namespace documentation { struct Documentation; } - class ScreenSpaceVideo : public ScreenSpaceRenderable { public: explicit ScreenSpaceVideo(const ghoul::Dictionary& dictionary); diff --git a/modules/video/include/videoplayer.h b/modules/video/include/videoplayer.h index b53ef97dd4..f6c93eb7d4 100644 --- a/modules/video/include/videoplayer.h +++ b/modules/video/include/videoplayer.h @@ -28,20 +28,24 @@ #include #include -#include #include #include #include #include +#include #include -#include - -// libmpv #include -#include +#include +#include +#include +#include + +namespace ghoul { class Dictionary; } namespace openspace { +namespace documentation { struct Documentation; } + enum class PlaybackMode { MapToSimulationTime = 0, RealTimeLoop diff --git a/modules/video/include/videotileprovider.h b/modules/video/include/videotileprovider.h index 06303ea2e2..38a3cdc006 100644 --- a/modules/video/include/videotileprovider.h +++ b/modules/video/include/videotileprovider.h @@ -27,24 +27,17 @@ #include +#include +#include #include -#include -#include -#include -#include - -// libmpv -#include -#include - -namespace openspace { struct Documentation; } namespace openspace::globebrowsing { +struct ChunkTile; + class VideoTileProvider : public TileProvider { public: explicit VideoTileProvider(const ghoul::Dictionary& dictionary); - ~VideoTileProvider() override; void update() override final; void reset() override final; diff --git a/modules/video/src/renderablevideoplane.cpp b/modules/video/src/renderablevideoplane.cpp index 43f9b73928..5e628fc95a 100644 --- a/modules/video/src/renderablevideoplane.cpp +++ b/modules/video/src/renderablevideoplane.cpp @@ -25,14 +25,32 @@ #include #include -#include +#include +#include +#include +#include + +namespace { + // This `Renderable` creates a textured 3D plane where the texture is a video. + // + // The video can either be played back based on a given simulation time + // (`PlaybackMode` MapToSimulationTime) or through the user interface (for + // `PlaybackMode` RealTimeLoop). It is also possible to control whether the video + // should loop or just be played once. + // + // Note that, unless playback is mapped to simulation time, the video must be started + // manually via the user interface. + struct [[codegen::Dictionary(RenderableVideoPlane)]] Parameters {}; +#include "renderablevideoplane_codegen.cpp" +} // namespace namespace openspace { documentation::Documentation RenderableVideoPlane::Documentation() { - documentation::Documentation doc = RenderablePlane::Documentation(); - doc.name = "RenderableVideoPlane"; - doc.id = "video_renderablevideoplane"; + documentation::Documentation doc = codegen::doc( + "video_renderablevideoplane", + RenderablePlane::Documentation() + ); documentation::Documentation vp = VideoPlayer::Documentation(); doc.entries.insert(doc.entries.end(), vp.entries.begin(), vp.entries.end()); diff --git a/modules/video/src/renderablevideosphere.cpp b/modules/video/src/renderablevideosphere.cpp index e17b0fcc76..d7878063b5 100644 --- a/modules/video/src/renderablevideosphere.cpp +++ b/modules/video/src/renderablevideosphere.cpp @@ -25,15 +25,33 @@ #include #include -#include -#include +#include +#include + +namespace { + // This `Renderable` creates a textured 3D sphere where the texture is a video. Per + // default, the sphere uses an equirectangular projection for the image mapping + // and hence expects a video in equirectangular format. However, it can also be used + // to play fisheye videos by changing the `TextureProjection`. + // + // The video can either be played back based on a given simulation time + // (`PlaybackMode` MapToSimulationTime) or through the user interface (for + // `PlaybackMode` RealTimeLoop). It is also possible to control whether the video + // should loop or just be played once. + // + // Note that, unless playback is mapped to simulation time, the video must be started + // manually via the user interface. + struct [[codegen::Dictionary(RenderableVideoSphere)]] Parameters {}; +#include "renderablevideosphere_codegen.cpp" +} // namespace namespace openspace { documentation::Documentation RenderableVideoSphere::Documentation() { - documentation::Documentation doc = RenderableSphere::Documentation(); - doc.name = "RenderableVideoSphere"; - doc.id = "video_renderablevideosphere"; + documentation::Documentation doc = codegen::doc( + "video_renderablevideosphere", + RenderableSphere::Documentation() + ); documentation::Documentation vp = VideoPlayer::Documentation(); doc.entries.insert(doc.entries.end(), vp.entries.begin(), vp.entries.end()); @@ -68,7 +86,8 @@ void RenderableVideoSphere::render(const RenderData& data, RendererTasks& render } } -void RenderableVideoSphere::update(const UpdateData&) { +void RenderableVideoSphere::update(const UpdateData& data) { + RenderableSphere::update(data); if (!_videoPlayer.isInitialized()) { return; } diff --git a/modules/video/src/screenspacevideo.cpp b/modules/video/src/screenspacevideo.cpp index 4d82891416..22df7172f7 100644 --- a/modules/video/src/screenspacevideo.cpp +++ b/modules/video/src/screenspacevideo.cpp @@ -25,22 +25,32 @@ #include #include -#include -#include -#include -#include -#include +#include #include -#include #include -#include + +namespace { + // This `ScreenSpaceRenderable` can be used to render a video in front of the camera. + // + // The video can either be played back based on a given simulation time + // (`PlaybackMode` MapToSimulationTime) or through the user interface (for + // `PlaybackMode` RealTimeLoop). It is also possible to control whether the video + // should loop or just be played once. + // + // Note that, unless playback is mapped to simulation time, the video must be started + // manually via the user interface. + struct [[codegen::Dictionary(ScreenSpaceVideo)]] Parameters {}; +#include "screenspacevideo_codegen.cpp" +} // namespace namespace openspace { documentation::Documentation ScreenSpaceVideo::Documentation() { - documentation::Documentation doc = VideoPlayer::Documentation(); - doc.name = "ScreenSpaceVideo"; - doc.id = "video_screenspacevideo"; + documentation::Documentation doc = codegen::doc("video_screenspacevideo"); + + documentation::Documentation vp = VideoPlayer::Documentation(); + doc.entries.insert(doc.entries.end(), vp.entries.begin(), vp.entries.end()); + return doc; } diff --git a/modules/video/src/videoplayer.cpp b/modules/video/src/videoplayer.cpp index 3c334345a8..5e7675e63d 100644 --- a/modules/video/src/videoplayer.cpp +++ b/modules/video/src/videoplayer.cpp @@ -24,18 +24,26 @@ #include +#include #include -#include #include -#include #include #include #include #include #include -#include +#include +#include +#include +#include +#include #include #include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "VideoPlayer"; @@ -74,7 +82,7 @@ namespace { constexpr openspace::properties::Property::PropertyInfo AudioInfo = { "PlayAudio", "Play audio", - "Play audio." + "Decides whether to play audio when playing back the video." }; constexpr openspace::properties::Property::PropertyInfo StartTimeInfo = { @@ -133,8 +141,9 @@ namespace { RealTimeLoop }; - // The mode of how the video should be played back. - // Default is video is played back according to the set start and end times. + // The mode of how the video is played back. The Default is `RealTimeLoop`, + // which means that the video is played in realtime using the `Play` command + // in the user interface. std::optional playbackMode; }; #include "videoplayer_codegen.cpp" @@ -235,7 +244,7 @@ documentation::Documentation VideoPlayer::Documentation() { } VideoPlayer::VideoPlayer(const ghoul::Dictionary& dictionary) - : PropertyOwner({ "VideoPlayer" }) + : PropertyOwner({ "VideoPlayer", "Video Player"}) , _play(PlayInfo) , _pause(PauseInfo) , _goToStart(GoToStartInfo) diff --git a/modules/video/src/videotileprovider.cpp b/modules/video/src/videotileprovider.cpp index 4254c030ff..95b3e6ca46 100644 --- a/modules/video/src/videotileprovider.cpp +++ b/modules/video/src/videotileprovider.cpp @@ -24,28 +24,41 @@ #include -#include -#include #include -#include -#include -#include -#include -#include -#include -#include #include +#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "VideoTileProvider"; + + // This `TileProvider` can be used to render a video on the globe. + // + // The video can either be played back based on a given simulation time + // (`PlaybackMode` MapToSimulationTime) or through the user interface (for + // `PlaybackMode` RealTimeLoop). It is also possible to control whether the video + // should loop or just be played once. + // + // Note that, unless playback is mapped to simulation time, the video must be started + // manually via the user interface. + struct [[codegen::Dictionary(VideoTileProvider)]] Parameters {}; +#include "videotileprovider_codegen.cpp" } // namespace namespace openspace::globebrowsing { documentation::Documentation VideoTileProvider::Documentation() { - documentation::Documentation doc = VideoPlayer::Documentation(); - doc.name = "VideoTileProvider"; - doc.id = "video_videotileprovider"; + documentation::Documentation doc = codegen::doc( + "video_videotileprovider" + ); + + documentation::Documentation vp = VideoPlayer::Documentation(); + doc.entries.insert(doc.entries.end(), vp.entries.begin(), vp.entries.end()); + return doc; } @@ -56,8 +69,6 @@ VideoTileProvider::VideoTileProvider(const ghoul::Dictionary& dictionary) addPropertySubOwner(_videoPlayer); } -VideoTileProvider::~VideoTileProvider() {} - globebrowsing::Tile VideoTileProvider::tile(const globebrowsing::TileIndex& tileIndex) { ZoneScoped; diff --git a/modules/video/videomodule.cpp b/modules/video/videomodule.cpp index 47b457b2f7..e87ab42026 100644 --- a/modules/video/videomodule.cpp +++ b/modules/video/videomodule.cpp @@ -31,7 +31,11 @@ #include #include #include -#include +#include +#include +#include +#include +#include namespace openspace { diff --git a/modules/video/videomodule.h b/modules/video/videomodule.h index 3295877ce0..1024e12672 100644 --- a/modules/video/videomodule.h +++ b/modules/video/videomodule.h @@ -27,8 +27,6 @@ #include -#include - namespace openspace { class VideoModule : public OpenSpaceModule { diff --git a/modules/volume/envelope.cpp b/modules/volume/envelope.cpp index 8126f51490..7c948a63d0 100644 --- a/modules/volume/envelope.cpp +++ b/modules/volume/envelope.cpp @@ -25,11 +25,10 @@ #include #include - +#include +#include #include -using json = nlohmann::json; - namespace openspace::volume { EnvelopePoint::EnvelopePoint(glm::vec3 c, float x, float y) @@ -85,7 +84,7 @@ bool Envelope::isValueInEnvelope(float pos) const { bool Envelope::isEnvelopeValid() const { for (auto currentIter = _points.begin(), nextIter = currentIter + 1; nextIter != _points.end(); - ++currentIter, ++nextIter) + currentIter++, nextIter++) { if (currentIter->position.first > nextIter->position.first) { return false; @@ -104,7 +103,7 @@ glm::vec4 Envelope::valueAtPosition(float pos) const { if (afterIter == _points.end()) { return glm::vec4(0.f, 0.f, 0.f ,0.f); } - ++afterIter; + afterIter++; } if (afterIter->position.first == pos) { return glm::vec4(afterIter->color, afterIter->position.second); @@ -186,8 +185,8 @@ std::string EnvelopePoint::hexadecimalFromVec3(const glm::vec3& vec) const { return ("#" + r + g + b); } -json Envelope::jsonPoints() const { - json j; +nlohmann::json Envelope::jsonPoints() const { + nlohmann::json j; for (size_t i = 0; i < _points.size(); i++) { j[i] = { { @@ -206,8 +205,8 @@ json Envelope::jsonPoints() const { return j; } -json Envelope::jsonEnvelope() const { - json j; +nlohmann::json Envelope::jsonEnvelope() const { + nlohmann::json j; j["points"] = jsonPoints(); return j; } diff --git a/modules/volume/envelope.h b/modules/volume/envelope.h index 3c4b32f4af..d8f0db7eef 100644 --- a/modules/volume/envelope.h +++ b/modules/volume/envelope.h @@ -27,6 +27,9 @@ #include #include +#include +#include +#include struct lua_State; diff --git a/modules/volume/linearlrucache.h b/modules/volume/linearlrucache.h index 854329857d..df8412cf7b 100644 --- a/modules/volume/linearlrucache.h +++ b/modules/volume/linearlrucache.h @@ -25,9 +25,9 @@ #ifndef __OPENSPACE_MODULE_VOLUME___LINEARLRUCACHE___H__ #define __OPENSPACE_MODULE_VOLUME___LINEARLRUCACHE___H__ -#include #include -#include +#include +#include namespace openspace::volume { diff --git a/modules/volume/linearlrucache.inl b/modules/volume/linearlrucache.inl index 4ac087c1a6..934b082f8a 100644 --- a/modules/volume/linearlrucache.inl +++ b/modules/volume/linearlrucache.inl @@ -64,7 +64,7 @@ ValueType& LinearLruCache::get(size_t key) { template void LinearLruCache::evict() { - _cache[_tracker.front()] = make_pair(nullptr, _tracker.end()); + _cache[_tracker.front()] = std::make_pair(nullptr, _tracker.end()); _tracker.pop_front(); } diff --git a/modules/volume/lrucache.h b/modules/volume/lrucache.h index e857efe991..a6e08adcd8 100644 --- a/modules/volume/lrucache.h +++ b/modules/volume/lrucache.h @@ -25,16 +25,15 @@ #ifndef __OPENSPACE_MODULE_VOLUME___LRUCACHE___H__ #define __OPENSPACE_MODULE_VOLUME___LRUCACHE___H__ -#include #include -#include +#include namespace openspace::volume { -template< +template < typename KeyType, typename ValueType, - template class ContainerType + template class ContainerType > class LruCache { public: @@ -49,6 +48,7 @@ public: private: void insert(const KeyType& key, const ValueType& value); + ContainerType< KeyType, std::pair::iterator> > _cache; diff --git a/modules/volume/lrucache.inl b/modules/volume/lrucache.inl index d9d04c0589..d6292d2aff 100644 --- a/modules/volume/lrucache.inl +++ b/modules/volume/lrucache.inl @@ -24,18 +24,18 @@ namespace openspace::volume { -template class ContainerType> -LruCache::LruCache(size_t capacity) { +template class Container> +LruCache::LruCache(size_t capacity) { _capacity = capacity; } -template class ContainerType> -bool LruCache::has(const KeyType& key) { +template class Container> +bool LruCache::has(const Key& key) { return (_cache.find(key) != _cache.end()); } -template class ContainerType> -void LruCache::set(const KeyType& key, ValueType value) +template class Container> +void LruCache::set(const Key& key, Value value) { auto prev = _cache.find(key); if (prev != _cache.end()) { @@ -48,35 +48,33 @@ void LruCache::set(const KeyType& key, ValueT } } -template class ContainerType> -ValueType& LruCache::use(const KeyType& key) { +template class Container> +ValueType& LruCache::use(const Key& key) { auto iter = _cache.find(key); std::list::iterator trackerIter = iter->second.second; _tracker.splice(_tracker.end(), _tracker, trackerIter); return iter->second.first; } -template class ContainerType> -ValueType& LruCache::get(const KeyType& key) { +template class Container> +ValueType& LruCache::get(const Key& key) { auto iter = _cache.find(key); return iter->second.first; } -template class ContainerType> -void LruCache::evict() { +template class Container> +void LruCache::evict() { _cache.erase(_cache.find(_tracker.front())); _tracker.pop_front(); } -template class ContainerType> -size_t LruCache::capacity() const { +template class Container> +size_t LruCache::capacity() const { return _capacity; } -template class ContainerType> -void LruCache::insert(const KeyType& key, - const ValueType& value) -{ +template class Container> +void LruCache::insert(const Key& key, const Value& value) { if (_cache.size() == _capacity) { evict(); } diff --git a/modules/volume/rawvolume.inl b/modules/volume/rawvolume.inl index 703c712db2..bc0768b55a 100644 --- a/modules/volume/rawvolume.inl +++ b/modules/volume/rawvolume.inl @@ -23,6 +23,7 @@ ****************************************************************************************/ #include +#include namespace openspace::volume { @@ -45,7 +46,7 @@ void RawVolume::setDimensions(const glm::uvec3& dimensions) { _data.resize(nCells()); } -template +template size_t RawVolume::nCells() const { return static_cast(_dimensions.x) * static_cast(_dimensions.y) * diff --git a/modules/volume/rawvolumemetadata.cpp b/modules/volume/rawvolumemetadata.cpp index 5c27460f85..5e074b8046 100644 --- a/modules/volume/rawvolumemetadata.cpp +++ b/modules/volume/rawvolumemetadata.cpp @@ -24,11 +24,11 @@ #include -#include #include #include #include #include +#include namespace { struct [[codegen::Dictionary(RawVolumeMetaData)]] Parameters { diff --git a/modules/volume/rawvolumemetadata.h b/modules/volume/rawvolumemetadata.h index 1a0af13b5e..ab4e50d23a 100644 --- a/modules/volume/rawvolumemetadata.h +++ b/modules/volume/rawvolumemetadata.h @@ -27,9 +27,10 @@ #include #include +#include -namespace openspace::documentation { struct Documentation; } namespace ghoul { class Dictionary; } +namespace openspace::documentation { struct Documentation; } namespace openspace::volume { diff --git a/modules/volume/rawvolumereader.h b/modules/volume/rawvolumereader.h index c2af207af8..f7c6810596 100644 --- a/modules/volume/rawvolumereader.h +++ b/modules/volume/rawvolumereader.h @@ -27,7 +27,7 @@ #include #include -#include +#include namespace openspace::volume { diff --git a/modules/volume/rawvolumewriter.h b/modules/volume/rawvolumewriter.h index 34c089097e..82463ce5c9 100644 --- a/modules/volume/rawvolumewriter.h +++ b/modules/volume/rawvolumewriter.h @@ -25,9 +25,9 @@ #ifndef __OPENSPACE_MODULE_VOLUME___RAWVOLUMEWRITER___H__ #define __OPENSPACE_MODULE_VOLUME___RAWVOLUMEWRITER___H__ +#include #include #include -#include namespace openspace::volume { @@ -38,11 +38,10 @@ class RawVolumeWriter { public: explicit RawVolumeWriter(std::filesystem::path path, size_t bufferSize = 1024); - void setPath(std::filesystem::path path); glm::uvec3 dimensions() const; void setDimensions(glm::uvec3 dimensions); void write(const std::function& fn, - const std::function& onProgress = [](float) {}); + const std::function& onProgress = [](float) {}); void write(const RawVolume& volume); size_t coordsToIndex(const glm::uvec3& coords) const; diff --git a/modules/volume/rawvolumewriter.inl b/modules/volume/rawvolumewriter.inl index 8a09a6a9df..f076565b89 100644 --- a/modules/volume/rawvolumewriter.inl +++ b/modules/volume/rawvolumewriter.inl @@ -26,7 +26,10 @@ #include #include #include +#include #include +#include +#include namespace openspace::volume { @@ -66,8 +69,8 @@ void RawVolumeWriter::write( const size_t size = static_cast(dims.x) * static_cast(dims.y) * static_cast(dims.z); - std::vector buffer(_bufferSize); - std::ofstream file(_path, std::ios::binary); + std::vector buffer = std::vector(_bufferSize); + std::ofstream file = std::ofstream(_path, std::ios::binary); int nChunks = static_cast(size / _bufferSize); if (size % _bufferSize > 0) { @@ -87,7 +90,6 @@ void RawVolumeWriter::write( ); onProgress(static_cast(c + 1) / nChunks); } - file.close(); } template diff --git a/modules/volume/rendering/basicvolumeraycaster.cpp b/modules/volume/rendering/basicvolumeraycaster.cpp index e0c66211eb..2cf88e5d0e 100644 --- a/modules/volume/rendering/basicvolumeraycaster.cpp +++ b/modules/volume/rendering/basicvolumeraycaster.cpp @@ -25,8 +25,6 @@ #include #include -#include -#include #include #include #include @@ -35,7 +33,11 @@ #include #include #include -#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view GlslRaycast = "${MODULE_VOLUME}/shaders/raycast.glsl"; diff --git a/modules/volume/rendering/basicvolumeraycaster.h b/modules/volume/rendering/basicvolumeraycaster.h index 80e12645f4..361cccc01b 100644 --- a/modules/volume/rendering/basicvolumeraycaster.h +++ b/modules/volume/rendering/basicvolumeraycaster.h @@ -27,20 +27,13 @@ #include -#include #include +#include +#include -namespace ghoul::opengl { - class Texture; - class ProgramObject; - class TextureUnit; -} // namespace ghoul::opengl +namespace ghoul::opengl { class TextureUnit; } -namespace openspace { - struct RenderData; - struct RaycastData; - class TransferFunction; -} // namespace openspace +namespace openspace { class TransferFunction; } namespace openspace::volume { diff --git a/modules/volume/rendering/renderabletimevaryingvolume.cpp b/modules/volume/rendering/renderabletimevaryingvolume.cpp index 6c419ee8bb..53a4b90023 100644 --- a/modules/volume/rendering/renderabletimevaryingvolume.cpp +++ b/modules/volume/rendering/renderabletimevaryingvolume.cpp @@ -26,32 +26,34 @@ #include #include -#include #include +#include #include #include #include -#include #include #include -#include #include #include #include #include #include -#include #include +#include #include #include +#include +#include #include -#include #include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "RenderableTimeVaryingVolume"; - const float SecondsInOneDay = 60 * 60 * 24; + constexpr float SecondsInOneDay = 60 * 60 * 24; constexpr openspace::properties::Property::PropertyInfo StepSizeInfo = { "StepSize", diff --git a/modules/volume/rendering/renderabletimevaryingvolume.h b/modules/volume/rendering/renderabletimevaryingvolume.h index 631de3a34d..ff64db5449 100644 --- a/modules/volume/rendering/renderabletimevaryingvolume.h +++ b/modules/volume/rendering/renderabletimevaryingvolume.h @@ -34,11 +34,10 @@ #include #include #include +#include +#include -namespace openspace { - class Histogram; - struct RenderData; -} // namespace openspace +namespace openspace { class Histogram; } namespace openspace::volume { diff --git a/modules/volume/rendering/volumeclipplane.cpp b/modules/volume/rendering/volumeclipplane.cpp index 8ba0d38877..30cda6836a 100644 --- a/modules/volume/rendering/volumeclipplane.cpp +++ b/modules/volume/rendering/volumeclipplane.cpp @@ -24,6 +24,7 @@ #include +#include #include #include diff --git a/modules/volume/rendering/volumeclipplane.h b/modules/volume/rendering/volumeclipplane.h index a587077618..3a5f08d9f5 100644 --- a/modules/volume/rendering/volumeclipplane.h +++ b/modules/volume/rendering/volumeclipplane.h @@ -29,6 +29,7 @@ #include #include +#include namespace ghoul { class Dictionary; } diff --git a/modules/volume/rendering/volumeclipplanes.cpp b/modules/volume/rendering/volumeclipplanes.cpp index 14ad128458..157e4c31b6 100644 --- a/modules/volume/rendering/volumeclipplanes.cpp +++ b/modules/volume/rendering/volumeclipplanes.cpp @@ -26,6 +26,7 @@ #include #include +#include namespace openspace::volume { diff --git a/modules/volume/rendering/volumeclipplanes.h b/modules/volume/rendering/volumeclipplanes.h index 1343c61251..917b51c705 100644 --- a/modules/volume/rendering/volumeclipplanes.h +++ b/modules/volume/rendering/volumeclipplanes.h @@ -29,14 +29,12 @@ #include #include -#include +#include namespace ghoul { class Dictionary; } namespace openspace::volume { -class VolumeClipPlane; - class VolumeClipPlanes : public properties::PropertyOwner { public: explicit VolumeClipPlanes(const ghoul::Dictionary& dictionary); diff --git a/modules/volume/tasks/generaterawvolumefromfiletask.cpp b/modules/volume/tasks/generaterawvolumefromfiletask.cpp index 4d0df23cbc..822710767f 100644 --- a/modules/volume/tasks/generaterawvolumefromfiletask.cpp +++ b/modules/volume/tasks/generaterawvolumefromfiletask.cpp @@ -27,17 +27,22 @@ #include #include #include +#include #include -#include +#include +#include #include -#include #include -#include #include #include +#include #include +#include #include #include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "GenerateRawVolumeFromFileTask"; diff --git a/modules/volume/tasks/generaterawvolumefromfiletask.h b/modules/volume/tasks/generaterawvolumefromfiletask.h index 4ec2c04199..7b82991610 100644 --- a/modules/volume/tasks/generaterawvolumefromfiletask.h +++ b/modules/volume/tasks/generaterawvolumefromfiletask.h @@ -29,7 +29,6 @@ #include #include -#include namespace openspace::volume { diff --git a/modules/volume/tasks/generaterawvolumetask.cpp b/modules/volume/tasks/generaterawvolumetask.cpp index 3d35b70aae..915ba834eb 100644 --- a/modules/volume/tasks/generaterawvolumetask.cpp +++ b/modules/volume/tasks/generaterawvolumetask.cpp @@ -27,19 +27,21 @@ #include #include #include -#include +#include +#include #include #include #include -#include #include -#include #include #include -#include #include -#include +#include +#include +#include +#include #include +#include namespace { struct [[codegen::Dictionary(GenerateRawVolumeTask)]] Parameters { diff --git a/modules/volume/tasks/generaterawvolumetask.h b/modules/volume/tasks/generaterawvolumetask.h index 4d06aef51a..1848e6de6c 100644 --- a/modules/volume/tasks/generaterawvolumetask.h +++ b/modules/volume/tasks/generaterawvolumetask.h @@ -29,7 +29,6 @@ #include #include -#include namespace openspace::volume { diff --git a/modules/volume/textureslicevolumereader.h b/modules/volume/textureslicevolumereader.h index 6a5691f46a..28d65d0365 100644 --- a/modules/volume/textureslicevolumereader.h +++ b/modules/volume/textureslicevolumereader.h @@ -28,6 +28,7 @@ #include #include #include +#include #include namespace ghoul::opengl { class Texture; } diff --git a/modules/volume/textureslicevolumereader.inl b/modules/volume/textureslicevolumereader.inl index 0128d63505..f22c70660d 100644 --- a/modules/volume/textureslicevolumereader.inl +++ b/modules/volume/textureslicevolumereader.inl @@ -23,7 +23,9 @@ ****************************************************************************************/ #include +#include #include +#include namespace openspace::volume { diff --git a/modules/volume/transferfunction.cpp b/modules/volume/transferfunction.cpp index d7c21a05c6..fc0456ebd4 100644 --- a/modules/volume/transferfunction.cpp +++ b/modules/volume/transferfunction.cpp @@ -24,12 +24,20 @@ #include -#include #include #include +#include +#include +#include +#include #include +#include +#include +#include -using json = nlohmann::json; +namespace { + constexpr int Width = 1024; +} // namepsace namespace openspace::volume { @@ -38,7 +46,7 @@ TransferFunction::TransferFunction(const std::string& string) { } bool TransferFunction::setEnvelopesFromString(const std::string& s) { - const json j = json::parse(s); + const nlohmann::json j = nlohmann::json::parse(s); for (const nlohmann::json& it : j) { Envelope env; std::vector tmpVec; @@ -183,7 +191,7 @@ std::string TransferFunction::serializedToString() const { if (_envelopes.empty()) { return ""; } - json j; + nlohmann::json j; for (auto envIter = _envelopes.begin(); envIter != _envelopes.end(); envIter++) { j[std::distance(_envelopes.begin(), envIter)] = { envIter->jsonEnvelope() }; } @@ -195,11 +203,11 @@ bool TransferFunction::createTexture(ghoul::opengl::Texture& ptr) { return false; } - float* transferFunction = new float[_width * 4]; - std::memset(transferFunction, 0, _width * 4 * sizeof(float)); + float* transferFunction = new float[Width * 4]; + std::memset(transferFunction, 0, Width * 4 * sizeof(float)); - for (int i = 0; i < _width ; i++) { - const float position = static_cast(i) / static_cast(_width); + for (int i = 0; i < Width; i++) { + const float position = static_cast(i) / static_cast(Width); int count = 0; glm::vec4 rgbFromEnvelopes(0.f); float alpha = 0.f; diff --git a/modules/volume/transferfunction.h b/modules/volume/transferfunction.h index 983e55b2ed..93c54b573a 100644 --- a/modules/volume/transferfunction.h +++ b/modules/volume/transferfunction.h @@ -26,10 +26,14 @@ #define __OPENSPACE_MODULE_VOLUME___TRANSFERFUNCTION___H__ #include -#include +#include +#include -namespace ghoul { class Dictionary; } -namespace ghoul::opengl { class Texture; } +namespace ghoul { + namespace opengl { class Texture; } + class Dictionary; +} // namespace ghoul +struct lua_State; namespace openspace::volume { @@ -53,7 +57,6 @@ public: std::string serializedToString() const; private: - int _width = 1024; std::string _loadableFilePath; std::vector _envelopes; }; diff --git a/modules/volume/transferfunctionhandler.cpp b/modules/volume/transferfunctionhandler.cpp index 744b8c7b71..07552b29c6 100644 --- a/modules/volume/transferfunctionhandler.cpp +++ b/modules/volume/transferfunctionhandler.cpp @@ -25,8 +25,8 @@ #include #include -#include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo TransferFunctionInfo = { diff --git a/modules/volume/transferfunctionhandler.h b/modules/volume/transferfunctionhandler.h index 9ff64741c3..a43b8ecf7c 100644 --- a/modules/volume/transferfunctionhandler.h +++ b/modules/volume/transferfunctionhandler.h @@ -30,13 +30,10 @@ #include #include #include +#include #include -#include -namespace openspace { - class Histogram; - class TransferFunction; -} // namespace openspace +namespace ghoul::opengl { class Texture; } namespace openspace::volume { diff --git a/modules/volume/transferfunctionproperty.cpp b/modules/volume/transferfunctionproperty.cpp index 276aee135a..a15236ed20 100644 --- a/modules/volume/transferfunctionproperty.cpp +++ b/modules/volume/transferfunctionproperty.cpp @@ -23,7 +23,9 @@ ****************************************************************************************/ #include -#include + +#include +#include namespace openspace::properties { diff --git a/modules/volume/volumegridtype.cpp b/modules/volume/volumegridtype.cpp index 557c422c89..53667ee65c 100644 --- a/modules/volume/volumegridtype.cpp +++ b/modules/volume/volumegridtype.cpp @@ -24,6 +24,9 @@ #include +#include +#include + namespace openspace::volume { VolumeGridType parseGridType(const std::string& gridType) { @@ -40,8 +43,8 @@ std::string gridTypeToString(VolumeGridType gridType) { switch (gridType) { case VolumeGridType::Cartesian: return "Cartesian"; case VolumeGridType::Spherical: return "Spherical"; + default: return "Unknown"; } - return "Unknown"; } } // namespace openspace::volume diff --git a/modules/volume/volumegridtype.h b/modules/volume/volumegridtype.h index a91f811ab7..df53a4f2aa 100644 --- a/modules/volume/volumegridtype.h +++ b/modules/volume/volumegridtype.h @@ -25,7 +25,6 @@ #ifndef __OPENSPACE_MODULE_VOLUME___VOLUMEGRIDTYPE___H__ #define __OPENSPACE_MODULE_VOLUME___VOLUMEGRIDTYPE___H__ -#include #include namespace openspace::volume { @@ -36,7 +35,7 @@ enum class VolumeGridType : int { }; VolumeGridType parseGridType(const std::string& gridType); -std::string gridTypeToString(VolumeGridType); +std::string gridTypeToString(VolumeGridType gridType); } // namespace openspace::volume diff --git a/modules/volume/volumemodule.cpp b/modules/volume/volumemodule.cpp index 40883dd571..b7a16458e0 100644 --- a/modules/volume/volumemodule.cpp +++ b/modules/volume/volumemodule.cpp @@ -29,9 +29,10 @@ #include #include #include -#include #include +#include #include +#include #include namespace openspace { diff --git a/modules/webbrowser/CMakeLists.txt b/modules/webbrowser/CMakeLists.txt index f4cc2a3ddc..188f3df8d0 100644 --- a/modules/webbrowser/CMakeLists.txt +++ b/modules/webbrowser/CMakeLists.txt @@ -201,7 +201,7 @@ if (OS_MACOSX) set_executable_target_properties(${target}) # add_cef_logical_target("libcef_lib" "${CEF_LIB_DEBUG}" "${CEF_LIB_RELEASE}") add_dependencies(${target} libcef_dll_wrapper) - target_link_libraries(${target} libcef_dll_wrapper ${CEF_STANDARD_LIBS}) + target_link_libraries(${target} PRIVATE libcef_dll_wrapper ${CEF_STANDARD_LIBS}) set_target_properties(${target} PROPERTIES MACOSX_BUNDLE_INFO_PLIST ${CMAKE_CURRENT_SOURCE_DIR}/mac/helper-Info.plist OUTPUT_NAME "${target}_OUTPUT_NAME" @@ -212,7 +212,7 @@ if (OS_MACOSX) if (USE_SANDBOX) # Logical target used to link the cef_sandbox library. - target_link_libraries(${target} cef_sandbox_lib) + target_link_libraries(${target} PRIVATE cef_sandbox_lib) endif () endforeach() diff --git a/modules/webbrowser/include/browserclient.h b/modules/webbrowser/include/browserclient.h index eb256bc185..3bec38fa83 100644 --- a/modules/webbrowser/include/browserclient.h +++ b/modules/webbrowser/include/browserclient.h @@ -38,8 +38,8 @@ namespace openspace { -class WebRenderHandler; class WebKeyboardHandler; +class WebRenderHandler; class BrowserClient : public CefClient { public: diff --git a/modules/webbrowser/include/browserinstance.h b/modules/webbrowser/include/browserinstance.h index c5a8ae5688..5cb79c78fd 100644 --- a/modules/webbrowser/include/browserinstance.h +++ b/modules/webbrowser/include/browserinstance.h @@ -25,6 +25,9 @@ #ifndef __OPENSPACE_MODULE_WEBBROWSER__BROWSER_INSTANCE_H__ #define __OPENSPACE_MODULE_WEBBROWSER__BROWSER_INSTANCE_H__ +#include +#include + #ifdef _MSC_VER #pragma warning (push) #pragma warning (disable : 4100) @@ -45,14 +48,11 @@ #pragma warning (pop) #endif // _MSC_VER -#include -#include - namespace openspace { class BrowserClient; -class WebRenderHandler; class WebKeyboardHandler; +class WebRenderHandler; class BrowserInstance { public: diff --git a/modules/webbrowser/include/cefhost.h b/modules/webbrowser/include/cefhost.h index 02560847bf..53fadadf95 100644 --- a/modules/webbrowser/include/cefhost.h +++ b/modules/webbrowser/include/cefhost.h @@ -25,22 +25,8 @@ #ifndef __OPENSPACE_MODULE_WEBBROWSER___CEF_HOST___H__ #define __OPENSPACE_MODULE_WEBBROWSER___CEF_HOST___H__ -#ifdef WIN32 -#pragma warning(push) -#pragma warning(disable : 4100) -#endif // WIN32 - -#include - -#ifdef WIN32 -#pragma warning(pop) -#endif // WIN32 #include -struct CefSettingsTraits; -template class CefStructBase; -using CefSettings = CefStructBase; - namespace openspace { class CefHost { diff --git a/modules/webbrowser/include/defaultbrowserlauncher.h b/modules/webbrowser/include/defaultbrowserlauncher.h index dfd99c47b7..6c14cb2adb 100644 --- a/modules/webbrowser/include/defaultbrowserlauncher.h +++ b/modules/webbrowser/include/defaultbrowserlauncher.h @@ -41,18 +41,12 @@ namespace openspace { class DefaultBrowserLauncher : public CefLifeSpanHandler, public CefRequestHandler { public: - bool OnBeforePopup(CefRefPtr browser, - CefRefPtr frame, - const CefString& targetUrl, - const CefString& targetFrameName, - CefLifeSpanHandler::WindowOpenDisposition targetDisposition, - bool userGesture, - const CefPopupFeatures& popupFeatures, - CefWindowInfo& windowInfo, - CefRefPtr& client, - CefBrowserSettings& settings, - CefRefPtr& extra_info, - bool* noJavascriptAccess) override; + bool OnBeforePopup(CefRefPtr browser, CefRefPtr frame, + const CefString& targetUrl, const CefString& targetFrameName, + CefLifeSpanHandler::WindowOpenDisposition targetDisposition, bool userGesture, + const CefPopupFeatures& popupFeatures, CefWindowInfo& windowInfo, + CefRefPtr& client, CefBrowserSettings& settings, + CefRefPtr& extra_info, bool* noJavascriptAccess) override; //bool OnOpenURLFromTab(CefRefPtr browser, CefRefPtr frame, // const CefString& target_url, diff --git a/modules/webbrowser/include/screenspacebrowser.h b/modules/webbrowser/include/screenspacebrowser.h index 4bdd1c9b45..21573357f6 100644 --- a/modules/webbrowser/include/screenspacebrowser.h +++ b/modules/webbrowser/include/screenspacebrowser.h @@ -27,10 +27,12 @@ #include +#include #include #include #include #include +#include #ifdef _MSC_VER #pragma warning (push) @@ -58,7 +60,6 @@ namespace openspace { class BrowserInstance; class ScreenSpaceRenderHandler; -class WebKeyboardHandler; class ScreenSpaceBrowser : public ScreenSpaceRenderable { public: @@ -101,6 +102,7 @@ private: bool _useAcceleratedRendering = false; bool _isUrlDirty = false; }; + } // namespace openspace #endif // __OPENSPACE_MODULE_WEBBROWSER___SCREEN_SPACE_BROWSER___H__ diff --git a/modules/webbrowser/include/webkeyboardhandler.h b/modules/webbrowser/include/webkeyboardhandler.h index 993eb81656..3d11ec3221 100644 --- a/modules/webbrowser/include/webkeyboardhandler.h +++ b/modules/webbrowser/include/webkeyboardhandler.h @@ -30,7 +30,6 @@ #pragma warning (disable : 4100) #endif // _MSC_VER - #ifdef __clang__ #pragma clang diagnostic push #pragma clang diagnostic ignored "-Wunused-parameter" diff --git a/modules/webbrowser/include/webrenderhandler.h b/modules/webbrowser/include/webrenderhandler.h index df4805353d..c81f4e8175 100644 --- a/modules/webbrowser/include/webrenderhandler.h +++ b/modules/webbrowser/include/webrenderhandler.h @@ -25,8 +25,9 @@ #ifndef __OPENSPACE_MODULE_WEBBROWSER__WEB_RENDER_HANDLER_H #define __OPENSPACE_MODULE_WEBBROWSER__WEB_RENDER_HANDLER_H -#include #include +#include +#include #ifdef _MSC_VER #pragma warning (push) @@ -37,7 +38,6 @@ #endif // _MSC_VER #include -#include #ifdef _MSC_VER #pragma warning (pop) @@ -45,8 +45,6 @@ //#pragma clang diagnostic pop #endif // _MSC_VER -#include - namespace openspace { class WebRenderHandler : public CefRenderHandler { @@ -55,12 +53,12 @@ public: WebRenderHandler(); - virtual void draw(void) = 0; + virtual void draw() = 0; virtual void render() = 0; void reshape(int, int); - void GetViewRect(CefRefPtr browser, CefRect &rect) override; + void GetViewRect(CefRefPtr browser, CefRect& rect) override; // Regular OnPaint method. Uses CPU allocation void OnPaint(CefRefPtr browser, PaintElementType type, @@ -90,9 +88,7 @@ private: glm::ivec2 _windowSize = glm::ivec2(0); glm::ivec2 _browserBufferSize = glm::ivec2(0); - /** - * RGBA buffer from browser - */ + /// RGBA buffer from browser std::vector _browserBuffer; bool _needsRepaint = true; bool _textureSizeIsDirty = true; diff --git a/modules/webbrowser/src/browserinstance.cpp b/modules/webbrowser/src/browserinstance.cpp index 56424c148e..3d7beec96f 100644 --- a/modules/webbrowser/src/browserinstance.cpp +++ b/modules/webbrowser/src/browserinstance.cpp @@ -30,13 +30,15 @@ #include #include #include -#include #include #include #include #include #include +#include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "CEF BrowserInstance"; diff --git a/modules/webbrowser/src/cefhost.cpp b/modules/webbrowser/src/cefhost.cpp index d81e993c6e..597b555d1f 100644 --- a/modules/webbrowser/src/cefhost.cpp +++ b/modules/webbrowser/src/cefhost.cpp @@ -25,15 +25,33 @@ #include #include -#include +#include #include +#include #include -#include +#include +#include +#include #ifdef __APPLE__ #include #endif // __APPLE__ +#ifdef WIN32 +#pragma warning(push) +#pragma warning(disable : 4100) +#endif // WIN32 + +#include + +#ifdef WIN32 +#pragma warning(pop) +#endif // WIN32 + +struct CefSettingsTraits; +template class CefStructBase; +using CefSettings = CefStructBase; + namespace { constexpr std::string_view _loggerCat = "CefHost"; } // namespace diff --git a/modules/webbrowser/src/eventhandler.cpp b/modules/webbrowser/src/eventhandler.cpp index 106e931f24..8c6b6a759d 100644 --- a/modules/webbrowser/src/eventhandler.cpp +++ b/modules/webbrowser/src/eventhandler.cpp @@ -33,6 +33,17 @@ #include #include #include +#include +#include +#include +#include +#include +#include +#include + +#ifdef WIN32 +#include +#endif // WIN32 namespace { constexpr std::string_view _loggerCat = "WebBrowser:EventHandler"; @@ -365,7 +376,7 @@ bool EventHandler::mouseButtonCallback(MouseButton button, MouseAction action, } else { if (isDoubleClick(state)) { - ++clickCount; + clickCount++; } else { state.lastClickTime = std::chrono::high_resolution_clock::now(); diff --git a/modules/webbrowser/src/screenspacebrowser.cpp b/modules/webbrowser/src/screenspacebrowser.cpp index dffa1acf6a..bf080cb549 100644 --- a/modules/webbrowser/src/screenspacebrowser.cpp +++ b/modules/webbrowser/src/screenspacebrowser.cpp @@ -27,12 +27,12 @@ #include #include #include -#include +#include #include #include -#include +#include #include -#include +#include #include namespace { diff --git a/modules/webbrowser/src/webrenderhandler.cpp b/modules/webbrowser/src/webrenderhandler.cpp index 5af5e4d656..ec16da1950 100644 --- a/modules/webbrowser/src/webrenderhandler.cpp +++ b/modules/webbrowser/src/webrenderhandler.cpp @@ -23,9 +23,12 @@ ****************************************************************************************/ #include + #include +#include #include -#include +#include +#include namespace openspace { diff --git a/modules/webbrowser/webbrowsermodule.cpp b/modules/webbrowser/webbrowsermodule.cpp index 0e507c3284..8dacf096c8 100644 --- a/modules/webbrowser/webbrowsermodule.cpp +++ b/modules/webbrowser/webbrowsermodule.cpp @@ -29,17 +29,19 @@ #include #include #include -#include #include -#include +#include #include -#include #include +#include #include +#include #include #include +#include #include -#include +#include +#include namespace { constexpr std::string_view _loggerCat = "WebBrowser"; diff --git a/modules/webbrowser/webbrowsermodule.h b/modules/webbrowser/webbrowsermodule.h index 342a50fcfa..40a58092d3 100644 --- a/modules/webbrowser/webbrowsermodule.h +++ b/modules/webbrowser/webbrowsermodule.h @@ -31,6 +31,7 @@ #include #include #include +#include namespace openspace { @@ -38,13 +39,6 @@ class BrowserInstance; class CefHost; class EventHandler; -namespace webbrowser { - extern std::chrono::microseconds interval; - extern std::chrono::time_point latestCall; - extern CefHost* cefHost; - void update(); -} // namespace webbrowser - class WebBrowserModule : public OpenSpaceModule { public: static constexpr const char* Name = "WebBrowser"; @@ -79,6 +73,13 @@ private: static inline bool _disableAcceleratedRendering = false; }; +namespace webbrowser { + extern std::chrono::microseconds interval; + extern std::chrono::time_point latestCall; + extern CefHost* cefHost; + void update(); +} // namespace webbrowser + } // namespace openspace #endif // __OPENSPACE_MODULE_WEBBROWSER___WEBBROWSERMODULE___H__ diff --git a/modules/webgui/webguimodule.cpp b/modules/webgui/webguimodule.cpp index 4ca1e6ad69..7004a3c5c3 100644 --- a/modules/webgui/webguimodule.cpp +++ b/modules/webgui/webguimodule.cpp @@ -24,17 +24,19 @@ #include +#include #include #include -#include #include #include #include #include #include #include +#include #include #include +#include #include #include diff --git a/modules/webgui/webguimodule.h b/modules/webgui/webguimodule.h index b7aae7690a..1f4cc3e882 100644 --- a/modules/webgui/webguimodule.h +++ b/modules/webgui/webguimodule.h @@ -32,8 +32,11 @@ #include #include #include +#include #include +#include #include +#include #include namespace openspace { diff --git a/src/CMakeLists.txt b/src/CMakeLists.txt index 5016584ed4..72c30ad48c 100644 --- a/src/CMakeLists.txt +++ b/src/CMakeLists.txt @@ -85,6 +85,7 @@ set(OPENSPACE_SOURCE navigation/pathnavigator.cpp navigation/pathnavigator_lua.inl navigation/waypoint.cpp + network/messagestructures.cpp network/messagestructureshelper.cpp network/parallelconnection.cpp network/parallelpeer.cpp @@ -132,6 +133,7 @@ set(OPENSPACE_SOURCE rendering/dashboarditem.cpp rendering/dashboardtextitem.cpp rendering/framebufferrenderer.cpp + rendering/deferredcaster.cpp rendering/deferredcastermanager.cpp rendering/fadeable.cpp rendering/helper.cpp @@ -175,6 +177,7 @@ set(OPENSPACE_SOURCE util/collisionhelper.cpp util/coordinateconversion.cpp util/distanceconversion.cpp + util/downloadeventengine.cpp util/dynamicfilesequencedownloader.cpp util/ellipsoid.cpp util/factorymanager.cpp @@ -190,6 +193,7 @@ set(OPENSPACE_SOURCE util/sphere.cpp util/spicemanager.cpp util/spicemanager_lua.inl + util/syncable.cpp util/syncbuffer.cpp util/tstring.cpp util/histogram.cpp @@ -374,6 +378,7 @@ set(OPENSPACE_HEADER ${PROJECT_SOURCE_DIR}/include/openspace/util/coordinateconversion.h ${PROJECT_SOURCE_DIR}/include/openspace/util/distanceconstants.h ${PROJECT_SOURCE_DIR}/include/openspace/util/distanceconversion.h + ${PROJECT_SOURCE_DIR}/include/openspace/util/downloadeventengine.h ${PROJECT_SOURCE_DIR}/include/openspace/util/dynamicfilesequencedownloader.h ${PROJECT_SOURCE_DIR}/include/openspace/util/ellipsoid.h ${PROJECT_SOURCE_DIR}/include/openspace/util/factorymanager.h diff --git a/src/camera/camera.cpp b/src/camera/camera.cpp index 0a9a9453d8..6126a2f56b 100644 --- a/src/camera/camera.cpp +++ b/src/camera/camera.cpp @@ -25,7 +25,9 @@ #include #include -#include +#include +#include +#include namespace openspace { diff --git a/src/data/csvloader.cpp b/src/data/csvloader.cpp index 6df532d5ab..f5b35792ed 100644 --- a/src/data/csvloader.cpp +++ b/src/data/csvloader.cpp @@ -26,21 +26,22 @@ #include #include -#include -#include -#include #include #include #include +#include #include #include #include +#include #include -#include +#include #include #include #include +#include #include +#include namespace { constexpr std::string_view _loggerCat = "DataLoader: CSV"; diff --git a/src/data/dataloader.cpp b/src/data/dataloader.cpp index ac286aaae0..e0858def55 100644 --- a/src/data/dataloader.cpp +++ b/src/data/dataloader.cpp @@ -27,17 +27,28 @@ #include #include #include -#include #include #include #include #include #include +#include #include -#include +#include +#include +#include +#include +#include +#include #include #include +#include +#include +#include #include +#include +#include +#include namespace { constexpr int8_t DataCacheFileVersion = 13; diff --git a/src/data/datamapping.cpp b/src/data/datamapping.cpp index 12e80728c0..9747ec41eb 100644 --- a/src/data/datamapping.cpp +++ b/src/data/datamapping.cpp @@ -25,11 +25,14 @@ #include #include +#include #include #include #include +#include +#include #include -#include +#include namespace { constexpr std::string_view _loggerCat = "RenderablePolygonCloud"; @@ -38,9 +41,7 @@ namespace { constexpr std::string_view DefaultY = "y"; constexpr std::string_view DefaultZ = "z"; - enum class PositionColumn { - X, Y, Z - }; + enum class PositionColumn { X, Y, Z }; bool checkPosColumnInternal(PositionColumn columnCase, const std::string& c, const std::optional& mapping, diff --git a/src/data/speckloader.cpp b/src/data/speckloader.cpp index c192ab8e15..07fdc06b60 100644 --- a/src/data/speckloader.cpp +++ b/src/data/speckloader.cpp @@ -24,19 +24,24 @@ #include -#include -#include -#include +#include #include #include #include +#include #include +#include #include +#include +#include #include -#include +#include +#include #include +#include #include - +#include +#include namespace { bool startsWith(std::string lhs, std::string_view rhs) noexcept { diff --git a/src/documentation/core_registration.cpp b/src/documentation/core_registration.cpp index 24ba1ec1f6..0fc4c019e0 100644 --- a/src/documentation/core_registration.cpp +++ b/src/documentation/core_registration.cpp @@ -38,7 +38,9 @@ #include #include #include +#include #include +#include #include #include #include diff --git a/src/documentation/documentation.cpp b/src/documentation/documentation.cpp index fa0ccafc51..59f21e5626 100644 --- a/src/documentation/documentation.cpp +++ b/src/documentation/documentation.cpp @@ -25,10 +25,16 @@ #include #include +#include #include +#include #include -#include +#include #include +#include +#include +#include +#include namespace { diff --git a/src/documentation/documentationengine.cpp b/src/documentation/documentationengine.cpp index 6b44f0b25b..fde4b5c1e3 100644 --- a/src/documentation/documentationengine.cpp +++ b/src/documentation/documentationengine.cpp @@ -24,112 +24,128 @@ #include -#include #include +#include #include #include #include #include +#include #include #include #include #include #include +#include +#include #include #include #include +#include #include -#include +#include #include #include #include +#include #include #include #include #include #include +#include +#include +#include +#include +#include #include #include +#include +#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "DocumentationEngine"; // General keys - constexpr const char* NameKey = "name"; - constexpr const char* IdentifierKey = "identifier"; - constexpr const char* DescriptionKey = "description"; - constexpr const char* DataKey = "data"; - constexpr const char* TypeKey = "type"; - constexpr const char* DocumentationKey = "documentation"; - constexpr const char* ActionKey = "action"; - constexpr const char* IdKey = "id"; + constexpr std::string_view NameKey = "name"; + constexpr std::string_view IdentifierKey = "identifier"; + constexpr std::string_view DescriptionKey = "description"; + constexpr std::string_view DataKey = "data"; + constexpr std::string_view TypeKey = "type"; + constexpr std::string_view DocumentationKey = "documentation"; + constexpr std::string_view ActionKey = "action"; + constexpr std::string_view IdKey = "id"; // Actions - constexpr const char* ActionTitle = "Actions"; - constexpr const char* GuiNameKey = "guiName"; - constexpr const char* CommandKey = "command"; - constexpr const char* ColorKey = "color"; - constexpr const char* TextColorKey = "textColor"; + constexpr std::string_view ActionTitle = "Actions"; + constexpr std::string_view GuiNameKey = "guiName"; + constexpr std::string_view CommandKey = "command"; + constexpr std::string_view ColorKey = "color"; + constexpr std::string_view TextColorKey = "textColor"; // Factory - constexpr const char* MembersKey = "members"; - constexpr const char* OptionalKey = "optional"; - constexpr const char* ReferenceKey = "reference"; - constexpr const char* FoundKey = "found"; - constexpr const char* ClassesKey = "classes"; + constexpr std::string_view MembersKey = "members"; + constexpr std::string_view OptionalKey = "optional"; + constexpr std::string_view ReferenceKey = "reference"; + constexpr std::string_view FoundKey = "found"; + constexpr std::string_view ClassesKey = "classes"; - constexpr const char* OtherName = "Other"; - constexpr const char* OtherIdentifierName = "other"; - constexpr const char* propertyOwnerName = "propertyOwner"; - constexpr const char* categoryName = "category"; + constexpr std::string_view OtherName = "Other"; + constexpr std::string_view OtherIdentifierName = "other"; + constexpr std::string_view PropertyOwnerName = "propertyOwner"; + constexpr std::string_view CategoryName = "category"; // Properties - constexpr const char* SettingsTitle = "Settings"; - constexpr const char* SceneTitle = "Scene"; - constexpr const char* PropertiesKeys = "properties"; - constexpr const char* PropertyOwnersKey = "propertyOwners"; - constexpr const char* TagsKey = "tags"; - constexpr const char* UriKey = "uri"; + constexpr std::string_view SettingsTitle = "Settings"; + constexpr std::string_view SceneTitle = "Scene"; + constexpr std::string_view PropertiesKeys = "properties"; + constexpr std::string_view PropertyOwnersKey = "propertyOwners"; + constexpr std::string_view TagsKey = "tags"; + constexpr std::string_view UriKey = "uri"; // Scripting - constexpr const char* DefaultValueKey = "defaultValue"; - constexpr const char* ArgumentsKey = "arguments"; - constexpr const char* ReturnTypeKey = "returnType"; - constexpr const char* HelpKey = "help"; - constexpr const char* FileKey = "file"; - constexpr const char* LineKey = "line"; - constexpr const char* LibraryKey = "library"; - constexpr const char* FullNameKey = "fullName"; - constexpr const char* FunctionsKey = "functions"; - constexpr const char* SourceLocationKey = "sourceLocation"; - constexpr const char* OpenSpaceScriptingKey = "openspace"; + constexpr std::string_view DefaultValueKey = "defaultValue"; + constexpr std::string_view ArgumentsKey = "arguments"; + constexpr std::string_view ReturnTypeKey = "returnType"; + constexpr std::string_view HelpKey = "help"; + constexpr std::string_view FileKey = "file"; + constexpr std::string_view LineKey = "line"; + constexpr std::string_view LibraryKey = "library"; + constexpr std::string_view FullNameKey = "fullName"; + constexpr std::string_view FunctionsKey = "functions"; + constexpr std::string_view SourceLocationKey = "sourceLocation"; + constexpr std::string_view OpenSpaceScriptingKey = "openspace"; // Licenses - constexpr const char* LicensesTitle = "Licenses"; - constexpr const char* ProfileName = "Profile"; - constexpr const char* AssetsName = "Assets"; - constexpr const char* LicensesName = "Licenses"; - constexpr const char* NoLicenseName = "No License"; - constexpr const char* NoDataName = ""; + constexpr std::string_view LicensesTitle = "Licenses"; + constexpr std::string_view ProfileName = "Profile"; + constexpr std::string_view AssetsName = "Assets"; + constexpr std::string_view LicensesName = "Licenses"; + constexpr std::string_view NoLicenseName = "No License"; - constexpr const char* ProfileNameKey = "profileName"; - constexpr const char* VersionKey = "version"; - constexpr const char* AuthorKey = "author"; - constexpr const char* UrlKey = "url"; - constexpr const char* LicenseKey = "license"; - constexpr const char* IdentifiersKey = "identifiers"; - constexpr const char* PathKey = "path"; - constexpr const char* AssetKey = "assets"; - constexpr const char* LicensesKey = "licenses"; + constexpr std::string_view ProfileNameKey = "profileName"; + constexpr std::string_view VersionKey = "version"; + constexpr std::string_view AuthorKey = "author"; + constexpr std::string_view UrlKey = "url"; + constexpr std::string_view LicenseKey = "license"; + constexpr std::string_view IdentifiersKey = "identifiers"; + constexpr std::string_view PathKey = "path"; + constexpr std::string_view AssetKey = "assets"; + constexpr std::string_view LicensesKey = "licenses"; // Keybindings - constexpr const char* KeybindingsTitle = "Keybindings"; - constexpr const char* KeybindingsKey = "keybindings"; + constexpr std::string_view KeybindingsTitle = "Keybindings"; + constexpr std::string_view KeybindingsKey = "keybindings"; // Events - constexpr const char* EventsTitle = "Events"; - constexpr const char* FiltersKey = "filters"; - constexpr const char* ActionsKey = "actions"; + constexpr std::string_view EventsTitle = "Events"; + constexpr std::string_view FiltersKey = "filters"; + constexpr std::string_view ActionsKey = "actions"; nlohmann::json documentationToJson( const openspace::documentation::Documentation& documentation) @@ -242,7 +258,7 @@ namespace { nlohmann::json argument; argument[NameKey] = arg.name; argument[TypeKey] = arg.type; - argument[DefaultValueKey] = arg.defaultValue.value_or(NoDataName); + argument[DefaultValueKey] = arg.defaultValue.value_or(""); arguments.push_back(argument); } @@ -314,8 +330,9 @@ nlohmann::json DocumentationEngine::generateScriptEngineJson() const { // Keep the library key for backwards compatability library[LibraryKey] = libraryName; library[NameKey] = libraryName; - std::string os = OpenSpaceScriptingKey; - library[FullNameKey] = libraryName.empty() ? os : os + "." + libraryName; + std::string_view os = OpenSpaceScriptingKey; + library[FullNameKey] = + libraryName.empty() ? os : std::format("{}.{}", os, libraryName); for (const LuaLibrary::Function& f : l.functions) { constexpr bool HasSourceLocation = true; @@ -342,12 +359,12 @@ nlohmann::json DocumentationEngine::generateLicenseGroupsJson() const { nlohmann::json metaJson; metaJson[NameKey] = ProfileName; - metaJson[ProfileNameKey] = meta.name.value_or(NoDataName); - metaJson[VersionKey] = meta.version.value_or(NoDataName); - metaJson[DescriptionKey] = meta.description.value_or(NoDataName); - metaJson[AuthorKey] = meta.author.value_or(NoDataName); - metaJson[UrlKey] = meta.url.value_or(NoDataName); - metaJson[LicenseKey] = meta.license.value_or(NoDataName); + metaJson[ProfileNameKey] = meta.name.value_or(""); + metaJson[VersionKey] = meta.version.value_or(""); + metaJson[DescriptionKey] = meta.description.value_or(""); + metaJson[AuthorKey] = meta.author.value_or(""); + metaJson[UrlKey] = meta.url.value_or(""); + metaJson[LicenseKey] = meta.license.value_or(""); json.push_back(std::move(metaJson)); } @@ -360,17 +377,17 @@ nlohmann::json DocumentationEngine::generateLicenseGroupsJson() const { std::optional meta = asset->metaInformation(); // Ensure the license is not going to be an empty string - std::string licenseName = NoLicenseName; - if (meta.has_value() && meta->license != NoDataName) { + std::string licenseName = std::string(NoLicenseName); + if (meta.has_value() && !meta->license.empty()) { licenseName = meta->license; } nlohmann::json assetJson; - assetJson[NameKey] = meta.has_value() ? meta->name : NoDataName; - assetJson[VersionKey] = meta.has_value() ? meta->version : NoDataName; - assetJson[DescriptionKey] = meta.has_value() ? meta->description : NoDataName; - assetJson[AuthorKey] = meta.has_value() ? meta->author : NoDataName; - assetJson[UrlKey] = meta.has_value() ? meta->url : NoDataName; + assetJson[NameKey] = meta.has_value() ? meta->name : ""; + assetJson[VersionKey] = meta.has_value() ? meta->version : ""; + assetJson[DescriptionKey] = meta.has_value() ? meta->description : ""; + assetJson[AuthorKey] = meta.has_value() ? meta->author : ""; + assetJson[UrlKey] = meta.has_value() ? meta->url : ""; assetJson[LicenseKey] = licenseName; assetJson[PathKey] = asset->path().string(); assetJson[IdKey] = asset->path().string(); @@ -406,12 +423,12 @@ nlohmann::json DocumentationEngine::generateLicenseListJson() const { if (global::profile->meta.has_value()) { nlohmann::json profile; - profile[NameKey] = global::profile->meta->name.value_or(NoDataName); - profile[VersionKey] = global::profile->meta->version.value_or(NoDataName); - profile[DescriptionKey] = global::profile->meta->description.value_or(NoDataName); - profile[AuthorKey] = global::profile->meta->author.value_or(NoDataName); - profile[UrlKey] = global::profile->meta->url.value_or(NoDataName); - profile[LicenseKey] = global::profile->meta->license.value_or(NoDataName); + profile[NameKey] = global::profile->meta->name.value_or(""); + profile[VersionKey] = global::profile->meta->version.value_or(""); + profile[DescriptionKey] = global::profile->meta->description.value_or(""); + profile[AuthorKey] = global::profile->meta->author.value_or(""); + profile[UrlKey] = global::profile->meta->url.value_or(""); + profile[LicenseKey] = global::profile->meta->license.value_or(""); json.push_back(profile); } @@ -505,7 +522,7 @@ nlohmann::json DocumentationEngine::generateFactoryManagerJson() const { } nlohmann::json factory; factory[NameKey] = factoryInfo.name; - factory[IdentifierKey] = categoryName + factoryInfo.name; + factory[IdentifierKey] = std::format("{}{}", CategoryName, factoryInfo.name); ghoul::TemplateFactoryBase* f = factoryInfo.factory.get(); // Add documentation about base class @@ -615,7 +632,7 @@ nlohmann::json DocumentationEngine::generatePropertyOwnerJson( sortJson(json, NameKey); nlohmann::json result; - result[NameKey] = propertyOwnerName; + result[NameKey] = PropertyOwnerName; result[DataKey] = json; return result; @@ -710,7 +727,6 @@ nlohmann::json DocumentationEngine::generateActionJson() const { return res; } - void DocumentationEngine::addDocumentation(Documentation documentation) { if (documentation.id.empty()) { _documentations.push_back(std::move(documentation)); @@ -737,4 +753,5 @@ void DocumentationEngine::addDocumentation(Documentation documentation) { std::vector DocumentationEngine::documentations() const { return _documentations; } + } // namespace openspace::documentation diff --git a/src/documentation/verifier.cpp b/src/documentation/verifier.cpp index 3de9213361..e7e04b0cd1 100644 --- a/src/documentation/verifier.cpp +++ b/src/documentation/verifier.cpp @@ -24,8 +24,26 @@ #include +#include #include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace openspace::documentation { @@ -136,7 +154,7 @@ TestResult IntVerifier::operator()(const ghoul::Dictionary& dict, // If we have a double value, we need to check if it is integer const double value = dict.value(key); double intPart = 0.0; - const bool isInt = modf(value, &intPart) == 0.0; + const bool isInt = std::modf(value, &intPart) == 0.0; if (isInt) { TestResult res; res.success = true; diff --git a/src/engine/configuration.cpp b/src/engine/configuration.cpp index 4553b68c89..ac4513befe 100644 --- a/src/engine/configuration.cpp +++ b/src/engine/configuration.cpp @@ -25,18 +25,26 @@ #include #include +#include #include #include #include -#include -#include -#include +#include #include -#include #include #include +#include #include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include namespace { // We can't use ${SCRIPTS} here as that hasn't been defined by this point @@ -80,7 +88,6 @@ namespace { // up OpenSpace. If it is not provided, it defaults to 'true', i.e., each // individual property determines whether it requires a confirmation or not. std::optional showPropertyConfirmation; - // A list of paths that are automatically registered with the file system. If a // key X is used in the table, it is then useable by referencing ${X} in all other diff --git a/src/engine/downloadmanager.cpp b/src/engine/downloadmanager.cpp index df1a1cdeaa..f73bcf2db2 100644 --- a/src/engine/downloadmanager.cpp +++ b/src/engine/downloadmanager.cpp @@ -24,18 +24,23 @@ #include -#include -#include #include #include #include +#include #include #include #include +#include #include +#include +#include #include +#include #include +#include #include +#include namespace { constexpr std::string_view _loggerCat = "DownloadManager"; @@ -142,18 +147,14 @@ std::shared_ptr DownloadManager::downloadFile( const std::string f = file.string(); errno_t error = fopen_s(&fp, f.c_str(), "wb"); if (error != 0) { - LERROR(std::format( - "Could not open/create file: {}. Errno: {}", file, errno - )); + LERROR(std::format("Could not open/create file: {}. Errno: {}", file, errno)); } #else const std::string f = file.string(); FILE* fp = fopen(f.c_str(), "wb"); // write binary #endif // WIN32 if (!fp) { - LERROR(std::format( - "Could not open/create file: {}. Errno: {}", file, errno - )); + LERROR(std::format("Could not open/create file: {}. Errno: {}", file, errno)); } auto downloadFunction = [url, failOnError, timeout_secs, diff --git a/src/engine/globals.cpp b/src/engine/globals.cpp index 4ad57fce5a..f9c050a284 100644 --- a/src/engine/globals.cpp +++ b/src/engine/globals.cpp @@ -52,17 +52,16 @@ #include #include #include +#include #include #include #include #include -#include #include +#include #include -#include -#include +#include #include -#include #include namespace openspace { @@ -75,6 +74,7 @@ namespace { #ifdef WIN32 constexpr int TotalSize = sizeof(MemoryManager) + + sizeof(DownloadEventEngine) + sizeof(EventEngine) + sizeof(ghoul::fontrendering::FontManager) + sizeof(Dashboard) + @@ -141,6 +141,14 @@ void create() { openSpaceEngine = new OpenSpaceEngine; #endif // WIN32 +#ifdef WIN32 + downloadEventEngine = new (currentPos) DownloadEventEngine; + ghoul_assert(downloadEventEngine, "No downloadEventEngine"); + currentPos += sizeof(DownloadEventEngine); +#else // ^^^^ WIN32 / !WIN32 vvv + downloadEventEngine = new DownloadEventEngine; +#endif // WIN32 + #ifdef WIN32 eventEngine = new (currentPos) EventEngine; ghoul_assert(eventEngine, "No eventEngine"); @@ -626,6 +634,13 @@ void destroy() { delete fontManager; #endif // WIN32 + LDEBUGC("Globals", "Destroying 'DownloadEventEngine'"); +#ifdef WIN32 + downloadEventEngine->~DownloadEventEngine(); +#else // ^^^ WIN32 / !WIN32 vvv + delete downloadEventEngine; +#endif // WIN32 + LDEBUGC("Globals", "Destroying 'EventEngine'"); #ifdef WIN32 eventEngine->~EventEngine(); diff --git a/src/engine/globalscallbacks.cpp b/src/engine/globalscallbacks.cpp index bbe0a8df53..2a41a8d9aa 100644 --- a/src/engine/globalscallbacks.cpp +++ b/src/engine/globalscallbacks.cpp @@ -27,6 +27,7 @@ #include #include #include +#include namespace openspace::global::callback { diff --git a/src/engine/logfactory.cpp b/src/engine/logfactory.cpp index e5688a361b..c02fa0ba58 100644 --- a/src/engine/logfactory.cpp +++ b/src/engine/logfactory.cpp @@ -25,14 +25,16 @@ #include #include -#include #include +#include #include #include #include +#include #include -#include +#include #include +#include namespace { constexpr std::string_view BootstrapPath = "${WEB}/common/bootstrap.min.css"; diff --git a/src/engine/moduleengine.cpp b/src/engine/moduleengine.cpp index a45ee061d4..e7e3112b76 100644 --- a/src/engine/moduleengine.cpp +++ b/src/engine/moduleengine.cpp @@ -25,14 +25,19 @@ #include #include -#include #include #include -#include #include +#include #include -#include +#include +#include +#include #include +#include +#include +#include +#include #include "moduleengine_lua.inl" diff --git a/src/engine/moduleengine_lua.inl b/src/engine/moduleengine_lua.inl index e9bb73e33c..6ac8202744 100644 --- a/src/engine/moduleengine_lua.inl +++ b/src/engine/moduleengine_lua.inl @@ -22,9 +22,13 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include + namespace { -// Checks whether the passed OpenSpaceModule is loaded. +/** + * Checks whether the passed OpenSpaceModule is loaded. + */ [[codegen::luawrap]] bool isLoaded(std::string moduleName) { using namespace openspace; diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 285fe6be50..2d3bb7be00 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -27,10 +27,11 @@ #include #include #include +#include #include #include -#include #include +#include #include #include #include @@ -38,6 +39,7 @@ #include #include #include +#include #include #include #include @@ -46,52 +48,75 @@ #include #include #include +#include #include -#include #include #include #include #include -#include #include #include #include #include #include +#include #include #include #include +#include #include -#include +#include +#include #include #include #include +#include #include -#include -#include #include #include #include +#include +#include #include #include +#include +#include +#include +#include +#include #include #include #include #include #include +#include #include #include #include -#include #include #include +#include +#include +#include #include #include #include +#include +#include +#include +#include #include +#include #include +#include #include #include +#include +#include +#include +#include +#include +#include #ifdef WIN32 #include @@ -1473,6 +1498,18 @@ void OpenSpaceEngine::mouseButtonCallback(MouseButton button, MouseAction action } } + if (action == MouseAction::Press && isGuiWindow) { + const bool isConsumed = global::luaConsole->mouseActivationCallback( + _mousePosition, + button, + action, + mods + ); + if (isConsumed) { + return; + } + } + global::navigationHandler->mouseButtonCallback(button, action); global::interactionMonitor->markInteraction(); @@ -1744,6 +1781,7 @@ scripting::LuaLibrary OpenSpaceEngine::luaLibrary() { codegen::lua::RemoveTag, codegen::lua::DownloadFile, codegen::lua::CreateSingleColorImage, + codegen::lua::ImageSize, codegen::lua::SaveBase64File, codegen::lua::IsMaster, codegen::lua::Version, diff --git a/src/engine/openspaceengine_lua.inl b/src/engine/openspaceengine_lua.inl index 10acdbfae4..57ecfd78b4 100644 --- a/src/engine/openspaceengine_lua.inl +++ b/src/engine/openspaceengine_lua.inl @@ -24,42 +24,39 @@ #include #include -#include -#include -#include #include -#include -#include #include #include -#include -#include +#include #include #include #include #include #include #include -#include +#include +#include namespace { /** * Toggles the shutdown mode that will close the application after the countdown timer - * is reached + * is reached. */ [[codegen::luawrap]] void toggleShutdown() { openspace::global::openSpaceEngine->toggleShutdownMode(); } /** - * Writes out documentation files + * Writes out documentation files. */ [[codegen::luawrap]] void writeDocumentation() { DocEng.writeJavascriptDocumentation(); } -// Sets the folder used for storing screenshots or session recording frames +/** + * Sets the folder used for storing screenshots or session recording frames. + */ [[codegen::luawrap]] void setScreenshotFolder(std::string newFolder) { using namespace openspace; @@ -77,7 +74,9 @@ namespace { global::windowDelegate->setScreenshotFolder(std::move(folder)); } -// Adds a Tag to a SceneGraphNode identified by the provided uri +/** + * Adds a Tag to a SceneGraphNode identified by the provided uri. + */ [[codegen::luawrap]] void addTag(std::string uri, std::string tag) { using namespace openspace; @@ -89,7 +88,9 @@ namespace { node->addTag(std::move(tag)); } -// Removes a tag (second argument) from a scene graph node (first argument) +/** + * Removes a tag(second argument) from a scene graph node (first argument). + */ [[codegen::luawrap]] void removeTag(std::string uri, std::string tag) { using namespace openspace; @@ -101,7 +102,9 @@ namespace { node->removeTag(tag); } -// Downloads a file from Lua interpreter +/** + * Downloads a file from Lua interpreter. + */ [[codegen::luawrap]] void downloadFile(std::string url, std::string savePath, bool waitForCompletion = false, bool overrideExistingFile = true) @@ -200,6 +203,16 @@ namespace { return fileName; } +/** + * This function returns the size in pixels of an image file. + * + * \param path The location of the image file for which the pixel size will be returned + * \return The size of the image in pixels + */ +[[codegen::luawrap]] glm::ivec2 imageSize(std::filesystem::path path) { + return ghoul::io::TextureReader::ref().imageSize(path); +} + /** * This function takes a base64 encoded data string, decodes it and saves the resulting * data to the provided filepath. diff --git a/src/engine/settings.cpp b/src/engine/settings.cpp index 2bdc562a17..6cb98eff25 100644 --- a/src/engine/settings.cpp +++ b/src/engine/settings.cpp @@ -25,14 +25,15 @@ #include #include +#include +#include #include namespace openspace { namespace { template -std::optional get_to(nlohmann::json& obj, const std::string& key) -{ +std::optional get_to(nlohmann::json& obj, const std::string& key) { auto it = obj.find(key); if (it != obj.end()) { return it->get(); @@ -44,7 +45,7 @@ std::optional get_to(nlohmann::json& obj, const std::string& key) } // namespace namespace version1 { - Settings parseSettings(nlohmann::json json) { + static Settings parseSettings(nlohmann::json json) { ghoul_assert(json.at("version").get() == 1, "Wrong value"); Settings settings; diff --git a/src/engine/syncengine.cpp b/src/engine/syncengine.cpp index 1cceb42b3a..a733de2d1b 100644 --- a/src/engine/syncengine.cpp +++ b/src/engine/syncengine.cpp @@ -24,10 +24,11 @@ #include -#include +#include #include #include #include +#include namespace openspace { diff --git a/src/events/event.cpp b/src/events/event.cpp index 0cf72be3a6..21b67eb607 100644 --- a/src/events/event.cpp +++ b/src/events/event.cpp @@ -26,14 +26,16 @@ #include #include -#include #include #include #include #include -#include #include -#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "EventInfo"; @@ -43,7 +45,7 @@ using namespace std::string_literals; namespace openspace::events { -void log(int i, const EventParallelConnection& e) { +static void log(int i, const EventParallelConnection& e) { ghoul_assert(e.type == EventParallelConnection::Type, "Wrong type"); std::string_view state = [](EventParallelConnection::State s) { switch (s) { @@ -57,17 +59,26 @@ void log(int i, const EventParallelConnection& e) { LINFO(std::format("[{}] ParallelConnection ({})", i, state)); } -void log(int i, [[maybe_unused]] const EventProfileLoadingFinished& e) { +static void log(int i, [[maybe_unused]] const EventProfileLoadingFinished& e) { ghoul_assert(e.type == EventProfileLoadingFinished::Type, "Wrong type"); LINFO(std::format("[{}] ProfileLoadingFinished", i)); } -void log(int i, const EventAssetLoadingFinished& e) { - ghoul_assert(e.type == EventAssetLoadingFinished::Type, "Wrong type"); - LINFO(std::format("[{}] AssetLoadingFinished", i)); +static void log(int i, const EventAssetLoading& e) { + ghoul_assert(e.type == EventAssetLoading::Type, "Wrong type"); + std::string_view state = [](EventAssetLoading::State s) { + switch (s) { + case EventAssetLoading::State::Loaded: return "Loaded"; + case EventAssetLoading::State::Loading: return "Loading"; + case EventAssetLoading::State::Unloaded: return "Unloaded"; + case EventAssetLoading::State::Error: return "Error"; + default: throw ghoul::MissingCaseException(); + } + }(e.state); + LINFO(std::format("[{}] AssetLoading: '{}': ({})", i, e.assetPath, state)); } -void log(int i, const EventApplicationShutdown& e) { +static void log(int i, const EventApplicationShutdown& e) { ghoul_assert(e.type == EventApplicationShutdown::Type, "Wrong type"); const std::string t = [](EventApplicationShutdown::State state) { switch (state) { @@ -80,7 +91,7 @@ void log(int i, const EventApplicationShutdown& e) { LINFO(std::format("[{}] ApplicationShutdown", i)); } -void log(int i, const EventCameraFocusTransition& e) { +static void log(int i, const EventCameraFocusTransition& e) { ghoul_assert(e.type == EventCameraFocusTransition::Type, "Wrong type"); std::string_view t = [](EventCameraFocusTransition::Transition transition) { switch (transition) { @@ -103,7 +114,7 @@ void log(int i, const EventCameraFocusTransition& e) { )); } -void log(int i, const EventTimeOfInterestReached& e) { +static void log(int i, const EventTimeOfInterestReached& e) { ghoul_assert(e.type == EventTimeOfInterestReached::Type, "Wrong type"); LINFO(std::format( "[{}] TimeOfInterestReached: {}, {}", @@ -111,57 +122,57 @@ void log(int i, const EventTimeOfInterestReached& e) { )); } -void log(int i, const EventMissionAdded& e) { +static void log(int i, const EventMissionAdded& e) { ghoul_assert(e.type == EventMissionAdded::Type, "Wrong type"); LINFO(std::format("[{}] MissionAdded: {}", i, e.identifier)); } -void log(int i, const EventMissionRemoved& e) { +static void log(int i, const EventMissionRemoved& e) { ghoul_assert(e.type == EventMissionRemoved::Type, "Wrong type"); LINFO(std::format("[{}] MissionRemoved: {}", i, e.identifier)); } -void log(int i, [[maybe_unused]] const EventMissionEventReached& e) { +static void log(int i, [[maybe_unused]] const EventMissionEventReached& e) { ghoul_assert(e.type == EventMissionEventReached::Type, "Wrong type"); LINFO(std::format("[{}] MissionEventReached", i)); } -void log(int i, const EventPlanetEclipsed& e) { +static void log(int i, const EventPlanetEclipsed& e) { ghoul_assert(e.type == EventPlanetEclipsed::Type, "Wrong type"); LINFO(std::format("[{}] PlanetEclipsed: {} -> {}", i, e.eclipsee, e.eclipser)); } -void log(int i, [[maybe_unused]] const EventInterpolationFinished& e) { +static void log(int i, [[maybe_unused]] const EventInterpolationFinished& e) { ghoul_assert(e.type == EventInterpolationFinished::Type, "Wrong type"); LINFO(std::format("[{}] InterpolationFinished", i)); } -void log(int i, const EventFocusNodeChanged& e) { +static void log(int i, const EventFocusNodeChanged& e) { ghoul_assert(e.type == EventFocusNodeChanged::Type, "Wrong type"); LINFO(std::format("[{}] FocusNodeChanged: {} -> {}", i, e.oldNode, e.newNode)); } -void log(int i, const EventPropertyTreeUpdated& e) { +static void log(int i, const EventPropertyTreeUpdated& e) { ghoul_assert(e.type == EventPropertyTreeUpdated::Type, "Wrong type"); LINFO(std::format("[{}] PropertyTreeUpdated: {}", i, e.uri)); } -void log(int i, const EventPropertyTreePruned& e) { +static void log(int i, const EventPropertyTreePruned& e) { ghoul_assert(e.type == EventPropertyTreePruned::Type, "Wrong type"); LINFO(std::format("[{}] PropertyTreePruned: {}", i, e.uri)); } -void log(int i, const EventActionAdded& e) { +static void log(int i, const EventActionAdded& e) { ghoul_assert(e.type == EventActionAdded::Type, "Wrong type"); LINFO(std::format("[{}] ActionAdded: {}", i, e.uri)); } -void log(int i, const EventActionRemoved& e) { +static void log(int i, const EventActionRemoved& e) { ghoul_assert(e.type == EventActionRemoved::Type, "Wrong type"); LINFO(std::format("[{}] ActionRemoved: {}", i, e.uri)); } -void log(int i, const EventSessionRecordingPlayback& e) { +static void log(int i, const EventSessionRecordingPlayback& e) { ghoul_assert(e.type == EventSessionRecordingPlayback::Type, "Wrong type"); std::string_view state = [](EventSessionRecordingPlayback::State s) { @@ -177,7 +188,7 @@ void log(int i, const EventSessionRecordingPlayback& e) { LINFO(std::format("[{}] SessionRecordingPlayback: {}", i, state)); } -void log(int i, const EventPointSpacecraft& e) { +static void log(int i, const EventPointSpacecraft& e) { ghoul_assert(e.type == EventPointSpacecraft::Type, "Wrong type"); LINFO(std::format( "[{}] PointSpacecraft: Ra: {}, Dec: {}, Duration: {}", i, e.ra, e.dec, @@ -185,17 +196,17 @@ void log(int i, const EventPointSpacecraft& e) { )); } -void log(int i, const EventRenderableEnabled& e) { +static void log(int i, const EventRenderableEnabled& e) { ghoul_assert(e.type == EventRenderableEnabled::Type, "Wrong type"); LINFO(std::format("[{}] EventRenderableEnabled: {}", i, e.node)); } -void log(int i, const EventRenderableDisabled& e) { +static void log(int i, const EventRenderableDisabled& e) { ghoul_assert(e.type == EventRenderableDisabled::Type, "Wrong type"); LINFO(std::format("[{}] EventRenderableDisabled: {}", i, e.node)); } -void log(int i, const EventCameraPathStarted& e) { +static void log(int i, const EventCameraPathStarted& e) { ghoul_assert(e.type == EventCameraPathStarted::Type, "Wrong type"); LINFO(std::format( "[{}] EventCameraPathStarted: Origin: '{}' Destination: '{}'", @@ -203,7 +214,7 @@ void log(int i, const EventCameraPathStarted& e) { )); } -void log(int i, const EventCameraPathFinished& e) { +static void log(int i, const EventCameraPathFinished& e) { ghoul_assert(e.type == EventCameraPathFinished::Type, "Wrong type"); LINFO(std::format( "[{}] EventCameraPathFinished: Origin: '{}' Destination: '{}'", @@ -211,22 +222,22 @@ void log(int i, const EventCameraPathFinished& e) { )); } -void log(int i, const EventCameraMovedPosition& e) { +static void log(int i, const EventCameraMovedPosition& e) { ghoul_assert(e.type == EventCameraMovedPosition::Type, "Wrong type"); LINFO(std::format("[{}] EventCameraMovedPosition", i)); } -void log(int i, const EventScheduledScriptExecuted& e) { +static void log(int i, const EventScheduledScriptExecuted& e) { ghoul_assert(e.type == EventScheduledScriptExecuted::Type, "Wrong type"); LINFO(std::format("[{}] ScheduledScriptExecuted: Script '{}'", i, e.script)); } -void log(int i, const EventGuiTreeUpdated& e) { +static void log(int i, const EventGuiTreeUpdated& e) { ghoul_assert(e.type == EventGuiTreeUpdated::Type, "Wrong type"); LINFO(std::format("[{}] EventGuiTreeUpdated", i)); } -void log(int i, const CustomEvent& e) { +static void log(int i, const CustomEvent& e) { ghoul_assert(e.type == CustomEvent::Type, "Wrong type"); LINFO(std::format("[{}] CustomEvent: {} ({})", i, e.subtype, e.payload)); } @@ -235,7 +246,7 @@ std::string_view toString(Event::Type type) { switch (type) { case Event::Type::ParallelConnection: return "ParallelConnection"; case Event::Type::ProfileLoadingFinished: return "ProfileLoadingFinished"; - case Event::Type::AssetLoadingFinished: return "AssetLoadingFinished"; + case Event::Type::AssetLoading: return "AssetLoading"; case Event::Type::ApplicationShutdown: return "ApplicationShutdown"; case Event::Type::CameraFocusTransition: return "CameraFocusTransition"; case Event::Type::TimeOfInterestReached: return "TimeOfInterestReached"; @@ -271,8 +282,8 @@ Event::Type fromString(std::string_view str) { else if (str == "ProfileLoadingFinished") { return Event::Type::ProfileLoadingFinished; } - else if (str == "AssetLoadingFinished") { - return Event::Type::AssetLoadingFinished; + else if (str == "AssetLoading") { + return Event::Type::AssetLoading; } else if (str == "ApplicationShutdown") { return Event::Type::ApplicationShutdown; @@ -366,6 +377,26 @@ ghoul::Dictionary toParameter(const Event& e) { break; } break; + case Event::Type::AssetLoading: + d.setValue( + "AssetPath", + static_cast(e).assetPath + ); + switch (static_cast(e).state) { + case EventAssetLoading::State::Loaded: + d.setValue("State", "Loaded"s); + break; + case EventAssetLoading::State::Loading: + d.setValue("State", "Loading"s); + break; + case EventAssetLoading::State::Unloaded: + d.setValue("State", "Unloaded"s); + break; + case EventAssetLoading::State::Error: + d.setValue("State", "Error"s); + break; + } + break; case Event::Type::ApplicationShutdown: switch (static_cast(e).state) { case EventApplicationShutdown::State::Started: @@ -544,8 +575,8 @@ void logAllEvents(const Event* e) { case Event::Type::ProfileLoadingFinished: log(i, *static_cast(e)); break; - case Event::Type::AssetLoadingFinished: - log(i, *static_cast(e)); + case Event::Type::AssetLoading: + log(i, *static_cast(e)); break; case Event::Type::ApplicationShutdown: log(i, *static_cast(e)); @@ -634,8 +665,11 @@ EventProfileLoadingFinished::EventProfileLoadingFinished() : Event(Type) {} -EventAssetLoadingFinished::EventAssetLoadingFinished() +EventAssetLoading::EventAssetLoading(const std::filesystem::path& assetPath_, + State newState) : Event(Type) + , assetPath(assetPath_) + , state(newState) {} EventApplicationShutdown::EventApplicationShutdown(State state_) diff --git a/src/events/eventengine.cpp b/src/events/eventengine.cpp index 2a309fdf2b..360b4e3f6f 100644 --- a/src/events/eventengine.cpp +++ b/src/events/eventengine.cpp @@ -26,7 +26,14 @@ #include #include +#include +#include #include +#include +#include +#include +#include +#include #include "eventengine_lua.inl" diff --git a/src/events/eventengine_lua.inl b/src/events/eventengine_lua.inl index 2a42914ae0..9b9e549721 100644 --- a/src/events/eventengine_lua.inl +++ b/src/events/eventengine_lua.inl @@ -22,7 +22,11 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include +#include +#include +#include +#include namespace { diff --git a/src/interaction/actionmanager.cpp b/src/interaction/actionmanager.cpp index 0a38a410fb..bba59dfbec 100644 --- a/src/interaction/actionmanager.cpp +++ b/src/interaction/actionmanager.cpp @@ -24,15 +24,22 @@ #include +#include #include #include #include +#include #include #include +#include #include +#include #include +#include #include -#include +#include +#include +#include #include "actionmanager_lua.inl" diff --git a/src/interaction/actionmanager_lua.inl b/src/interaction/actionmanager_lua.inl index 4d752fe875..4bf5a68e9a 100644 --- a/src/interaction/actionmanager_lua.inl +++ b/src/interaction/actionmanager_lua.inl @@ -22,12 +22,16 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include #include +#include +#include namespace { -// Checks if the passed identifier corresponds to an action. +/** + * Checks if the passed identifier corresponds to an action. + */ [[codegen::luawrap]] bool hasAction(std::string identifier) { if (identifier.empty()) { throw ghoul::lua::LuaError("Identifier must not be empty"); @@ -73,20 +77,20 @@ namespace { } struct [[codegen::Dictionary(Action)]] Action { - // The identifier under which the action is registered + /// The identifier under which the action is registered std::string identifier; - // The Lua script that is to be executed when the action is triggered + /// The Lua script that is to be executed when the action is triggered std::string command; - // The user-facing name of the action + /// The user-facing name of the action std::optional name; - // A documentation that explains what the action does + /// A documentation that explains what the action does std::optional documentation; - // The path in the GUI under which the action is shown to the user. If the value is - // not provided, the default value is / + /// The path in the GUI under which the action is shown to the user. If the value is + /// not provided, the default value is / std::optional guiPath; /// This parameter, if specified, will be used as a hint to any potential user @@ -99,10 +103,11 @@ struct [[codegen::Dictionary(Action)]] Action { /// group similar Actions together std::optional textColor [[codegen::color()]]; - // Determines whether the provided command will be executed locally or will be sent to - // connected computers in a cluster or parallel connection environment + /// Determines whether the provided command will be executed locally or will be sent + /// to connected computers in a cluster or parallel connection environment std::optional isLocal; }; + /** * Registers a new action. The first argument is the identifier which cannot have been * used to register a previous action before, the second argument is the Lua command that @@ -204,7 +209,9 @@ struct [[codegen::Dictionary(Action)]] Action { return res; } -// Triggers the action given by the specified identifier. +/** + * Triggers the action given by the specified identifier. + */ [[codegen::luawrap]] void triggerAction(std::string id, ghoul::Dictionary arg = ghoul::Dictionary()) { diff --git a/src/interaction/interactionmonitor.cpp b/src/interaction/interactionmonitor.cpp index 6e66442405..97f11bfeac 100644 --- a/src/interaction/interactionmonitor.cpp +++ b/src/interaction/interactionmonitor.cpp @@ -26,7 +26,6 @@ #include #include -#include namespace { constexpr openspace::properties::Property::PropertyInfo IdleTimeInfo = { diff --git a/src/interaction/joystickcamerastates.cpp b/src/interaction/joystickcamerastates.cpp index f5c4acb38a..c0a34b42e1 100644 --- a/src/interaction/joystickcamerastates.cpp +++ b/src/interaction/joystickcamerastates.cpp @@ -28,9 +28,9 @@ #include #include #include -#include #include -#include +#include +#include #include namespace { diff --git a/src/interaction/joystickinputstate.cpp b/src/interaction/joystickinputstate.cpp index 8ca2113de1..ef5303dc42 100644 --- a/src/interaction/joystickinputstate.cpp +++ b/src/interaction/joystickinputstate.cpp @@ -26,9 +26,7 @@ #include #include -#include #include -#include #include namespace openspace::interaction { diff --git a/src/interaction/keybindingmanager.cpp b/src/interaction/keybindingmanager.cpp index 881095118e..dd3e12a4f0 100644 --- a/src/interaction/keybindingmanager.cpp +++ b/src/interaction/keybindingmanager.cpp @@ -27,11 +27,10 @@ #include #include #include -#include #include -#include -#include -#include +#include +#include +#include #include "keybindingmanager_lua.inl" diff --git a/src/interaction/keybindingmanager_lua.inl b/src/interaction/keybindingmanager_lua.inl index 77deee3321..c4b0a32589 100644 --- a/src/interaction/keybindingmanager_lua.inl +++ b/src/interaction/keybindingmanager_lua.inl @@ -22,7 +22,14 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include #include +#include +#include +#include +#include +#include +#include namespace { diff --git a/src/interaction/keyframerecordinghandler.cpp b/src/interaction/keyframerecordinghandler.cpp index 9ef0d345a9..e38b87b314 100644 --- a/src/interaction/keyframerecordinghandler.cpp +++ b/src/interaction/keyframerecordinghandler.cpp @@ -24,9 +24,25 @@ #include +#include +#include #include +#include +#include #include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "keyframerecordinghandler_lua.inl" diff --git a/src/interaction/keyframerecordinghandler_lua.inl b/src/interaction/keyframerecordinghandler_lua.inl index ee8207d581..a06385a22a 100644 --- a/src/interaction/keyframerecordinghandler_lua.inl +++ b/src/interaction/keyframerecordinghandler_lua.inl @@ -23,8 +23,8 @@ ****************************************************************************************/ #include -#include #include +#include namespace { diff --git a/src/interaction/mousecamerastates.cpp b/src/interaction/mousecamerastates.cpp index 8f8e0ffa1e..86e9338735 100644 --- a/src/interaction/mousecamerastates.cpp +++ b/src/interaction/mousecamerastates.cpp @@ -26,6 +26,10 @@ #include #include +#include +#include +#include +#include namespace { constexpr double SensitivityAdjustmentIncrease = 8.0; diff --git a/src/interaction/sessionrecording.cpp b/src/interaction/sessionrecording.cpp index 9edd16aefe..96c3181c25 100644 --- a/src/interaction/sessionrecording.cpp +++ b/src/interaction/sessionrecording.cpp @@ -26,9 +26,24 @@ #include #include +#include +#include +#include +#include #include -#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include namespace { template struct overloaded : Ts... { using Ts::operator()...; }; diff --git a/src/interaction/sessionrecordinghandler.cpp b/src/interaction/sessionrecordinghandler.cpp index 4f6e9c7a5c..59157a8bd9 100644 --- a/src/interaction/sessionrecordinghandler.cpp +++ b/src/interaction/sessionrecordinghandler.cpp @@ -28,19 +28,44 @@ #include #include #include +#include #include +#include +#include #include +#include #include +#include +#include #include #include #include #include #include +#include #include +#include #include #include #include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #ifdef WIN32 #include @@ -421,8 +446,7 @@ void SessionRecordingHandler::setupPlayback(double startTime) { _playback.saveScreenshots.currentRecordedTime = std::chrono::steady_clock::now(); _playback.saveScreenshots.currentApplicationTime = global::windowDelegate->applicationTime(); - global::navigationHandler->keyframeNavigator().setTimeReferenceMode( - KeyframeTimeRef::Relative_recordedStart, startTime); + global::navigationHandler->keyframeNavigator().setReferenceTime(startTime); auto firstCamera = _timeline.entries.begin(); @@ -652,7 +676,10 @@ void SessionRecordingHandler::checkIfScriptUsesScenegraphNode( else { // There were no closing quotes so we remove as much as possible constexpr std::string_view UnwantedChars = " );"; - s.remove_suffix(s.find_last_not_of(UnwantedChars)); + size_t i = s.find_last_not_of(UnwantedChars); + if (i != std::string_view::npos) { + s.remove_suffix(i); + } return s; } }; diff --git a/src/interaction/sessionrecordinghandler_lua.inl b/src/interaction/sessionrecordinghandler_lua.inl index 43a770e2da..518aac5780 100644 --- a/src/interaction/sessionrecordinghandler_lua.inl +++ b/src/interaction/sessionrecordinghandler_lua.inl @@ -22,7 +22,13 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include #include +#include +#include +#include +#include +#include namespace { diff --git a/src/interaction/tasks/convertrecformattask.cpp b/src/interaction/tasks/convertrecformattask.cpp index 60dc0130a0..bc1de89f7f 100644 --- a/src/interaction/tasks/convertrecformattask.cpp +++ b/src/interaction/tasks/convertrecformattask.cpp @@ -23,16 +23,13 @@ ****************************************************************************************/ #include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "ConvertRecFormatTask"; diff --git a/src/interaction/touchbar.mm b/src/interaction/touchbar.mm index 2de60e439c..a22addfafc 100644 --- a/src/interaction/touchbar.mm +++ b/src/interaction/touchbar.mm @@ -174,11 +174,11 @@ NSArray* focusIdentifiers; - (void)pauseResumeButtonAction:(id)sender { // No sync or send because time settings are always synced and sent // to the connected nodes and peers - global::scriptEngine->queueScript( - "openspace.time.togglePause();", - scripting::ScriptEngine::ShouldBeSynchronized::No, - scripting::ScriptEngine::ShouldSendToRemote::No - ); + global::scriptEngine->queueScript({ + .code = "openspace.time.togglePause();", + .synchronized = scripting::ScriptEngine::ShouldBeSynchronized::No, + .sendToRemote = scripting::ScriptEngine::ShouldSendToRemote::No + }); NSButton* button = static_cast(sender); // This check is inverted since the togglePause script has not run yet @@ -198,11 +198,11 @@ NSArray* focusIdentifiers; "NavigationHandler.OrbitalNavigator.Aim", "NavigationHandler.OrbitalNavigator.RetargetAnchor" ); - global::scriptEngine->queueScript( - str, - scripting::ScriptEngine::ShouldBeSynchronized::Yes, - scripting::ScriptEngine::ShouldSendToRemote::Yes - ); + global::scriptEngine->queueScript({ + .code = str, + .synchronized = scripting::ScriptEngine::ShouldBeSynchronized::Yes, + .sendToRemote = scripting::ScriptEngine::ShouldSendToRemote::Yes + }); } - (void)hideTextAction:(id)sender { @@ -214,21 +214,19 @@ NSArray* focusIdentifiers; openspace.setPropertyValueSingle('Dashboard.IsEnabled', not isEnabled);\ openspace.setPropertyValueSingle('RenderEngine.ShowLog', not isEnabled);\ openspace.setPropertyValueSingle('RenderEngine.ShowVersion', not isEnabled);\ - openspace.setPropertyValueSingle('RenderEngine.ShowCamera', not isEnabled)", - scripting::ScriptEngine::ShouldBeSynchronized::No, - scripting::ScriptEngine::ShouldSendToRemote::No + openspace.setPropertyValueSingle('RenderEngine.ShowCamera', not isEnabled)" ); } - (void)hideGuiAction:(id)sender { // Remove unused variable warning (void)sender; - global::scriptEngine->queueScript( - "local isEnabled = openspace.propertyValue('Modules.CefWebGui.Visible');\ + global::scriptEngine->queueScript({ + .code = "local isEnabled = openspace.propertyValue('Modules.CefWebGui.Visible');\ openspace.setPropertyValueSingle('Modules.CefWebGui.Visible', not isEnabled);", - scripting::ScriptEngine::ShouldBeSynchronized::No, - scripting::ScriptEngine::ShouldSendToRemote::No - ); + .synchronized = scripting::ScriptEngine::ShouldBeSynchronized::No, + .sendToRemote = scripting::ScriptEngine::ShouldSendToRemote::No + }); } @end diff --git a/src/interaction/websocketcamerastates.cpp b/src/interaction/websocketcamerastates.cpp index 55f14fbb4c..a1afdc4dbd 100644 --- a/src/interaction/websocketcamerastates.cpp +++ b/src/interaction/websocketcamerastates.cpp @@ -24,12 +24,9 @@ #include -#include -#include -#include -#include -#include +#include #include +#include namespace openspace::interaction { diff --git a/src/interaction/websocketinputstate.cpp b/src/interaction/websocketinputstate.cpp index b0dcd4486e..2b6ce9e357 100644 --- a/src/interaction/websocketinputstate.cpp +++ b/src/interaction/websocketinputstate.cpp @@ -24,11 +24,8 @@ #include -#include #include -#include #include -#include #include namespace openspace::interaction { diff --git a/src/mission/mission.cpp b/src/mission/mission.cpp index 346334d37f..a399bf86e5 100644 --- a/src/mission/mission.cpp +++ b/src/mission/mission.cpp @@ -24,14 +24,22 @@ #include -#include +#include #include -#include #include #include +#include +#include +#include +#include +#include #include #include +#include #include +#include +#include +#include namespace { struct [[codegen::Dictionary(MissionPhase)]] Parameters { diff --git a/src/mission/missionmanager.cpp b/src/mission/missionmanager.cpp index 1d5cc61f23..280227f410 100644 --- a/src/mission/missionmanager.cpp +++ b/src/mission/missionmanager.cpp @@ -24,13 +24,14 @@ #include +#include #include #include -#include -#include -#include +#include +#include #include -#include +#include +#include #include "missionmanager_lua.inl" diff --git a/src/mission/missionmanager_lua.inl b/src/mission/missionmanager_lua.inl index 870682e302..7615ffbf37 100644 --- a/src/mission/missionmanager_lua.inl +++ b/src/mission/missionmanager_lua.inl @@ -22,8 +22,10 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include #include +#include +#include +#include // Load mission phases from file. [[codegen::luawrap]] void loadMission(ghoul::Dictionary mission) { diff --git a/src/navigation/keyframenavigator.cpp b/src/navigation/keyframenavigator.cpp index cff0f416ca..e6315a99c2 100644 --- a/src/navigation/keyframenavigator.cpp +++ b/src/navigation/keyframenavigator.cpp @@ -27,13 +27,14 @@ #include #include #include +#include #include #include #include #include -#include - -#include +#include +#include +#include namespace openspace::interaction { @@ -159,21 +160,10 @@ void KeyframeNavigator::updateCamera(Camera* camera, const CameraPose& prevPose, } double KeyframeNavigator::currentTime() const { - if (_timeframeMode == KeyframeTimeRef::Relative_recordedStart) { - return (global::windowDelegate->applicationTime() - _referenceTimestamp); - } - else if (_timeframeMode == KeyframeTimeRef::Absolute_simTimeJ2000) { - return global::timeManager->time().j2000Seconds(); - } - else { - return global::windowDelegate->applicationTime(); - } + return (global::windowDelegate->applicationTime() - _referenceTimestamp); } -void KeyframeNavigator::setTimeReferenceMode(KeyframeTimeRef refType, - double referenceTimestamp) -{ - _timeframeMode = refType; +void KeyframeNavigator::setReferenceTime(double referenceTimestamp) { _referenceTimestamp = referenceTimestamp; } diff --git a/src/navigation/navigationhandler.cpp b/src/navigation/navigationhandler.cpp index 29fb6e96e3..bd25feb15a 100644 --- a/src/navigation/navigationhandler.cpp +++ b/src/navigation/navigationhandler.cpp @@ -25,16 +25,14 @@ #include #include -#include #include #include #include #include #include #include -#include -#include #include +#include #include #include #include @@ -42,16 +40,27 @@ #include #include #include +#include #include -#include #include #include -#include +#include +#include +#include +#include #include -#include +#include #include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include "navigationhandler_lua.inl" diff --git a/src/navigation/navigationhandler_lua.inl b/src/navigation/navigationhandler_lua.inl index 92c910a3e5..9b88cacf7e 100644 --- a/src/navigation/navigationhandler_lua.inl +++ b/src/navigation/navigationhandler_lua.inl @@ -22,9 +22,25 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include - +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace { @@ -535,8 +551,8 @@ struct [[codegen::Dictionary(JoystickAxis)]] JoystickAxis { * * \param horizontal The value to add in the x-direction (a positive value rotates to the * left and a negative value to the right) - * \param vertical The value to add in the y-direction (a positive value rotates the camera - * upwards and a negative value downwards) + * \param vertical The value to add in the y-direction (a positive value rotates the + * camera upwards and a negative value downwards) */ [[codegen::luawrap]] void addLocalRotation(double horizontal, double vertical) { using namespace openspace; @@ -604,7 +620,7 @@ struct [[codegen::Dictionary(JoystickAxis)]] JoystickAxis { try { global::navigationHandler->orbitalNavigator().triggerIdleBehavior(choice); } - catch (ghoul::RuntimeError& e) { + catch (const ghoul::RuntimeError& e) { throw ghoul::lua::LuaError(e.message); } } @@ -627,8 +643,8 @@ struct [[codegen::Dictionary(JoystickAxis)]] JoystickAxis { [[codegen::luawrap]] double distanceToFocus() { using namespace openspace; - const SceneGraphNode * focus = global::navigationHandler->anchorNode(); - Camera * camera = global::navigationHandler->camera(); + const SceneGraphNode* focus = global::navigationHandler->anchorNode(); + Camera* camera = global::navigationHandler->camera(); return glm::distance(camera->positionVec3(), focus->worldPosition()); } diff --git a/src/navigation/navigationstate.cpp b/src/navigation/navigationstate.cpp index 0c7ec52f5f..aca960fd2d 100644 --- a/src/navigation/navigationstate.cpp +++ b/src/navigation/navigationstate.cpp @@ -22,12 +22,19 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include -#include #include + +#include +#include #include #include #include +#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "NavigationState"; diff --git a/src/navigation/orbitalnavigator.cpp b/src/navigation/orbitalnavigator.cpp index 185508aed9..a042ac9515 100644 --- a/src/navigation/orbitalnavigator.cpp +++ b/src/navigation/orbitalnavigator.cpp @@ -22,24 +22,36 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include + +#include #include #include #include +#include #include #include -#include -#include +#include +#include +#include +#include #include +#include +#include #include #include #include #include #include +#include #include -#include +#include #include -#include +#include #include +#include +#include +#include #include #include "orbitalnavigator_lua.inl" diff --git a/src/navigation/orbitalnavigator_lua.inl b/src/navigation/orbitalnavigator_lua.inl index 9e17b41a1a..f866bbd231 100644 --- a/src/navigation/orbitalnavigator_lua.inl +++ b/src/navigation/orbitalnavigator_lua.inl @@ -22,11 +22,15 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include +#include + namespace { /** -* Set minimum allowed distance to a multiplier of the interaction sphere of the focus node -*/ + * Set minimum allowed distance to a multiplier of the interaction sphere of the focus + * node. + */ [[codegen::luawrap]] void setRelativeMinDistance(float multiplier) { using namespace openspace; const SceneGraphNode* node = global::navigationHandler->anchorNode(); @@ -41,8 +45,9 @@ namespace { } /** -* Set maximum allowed distance to a multiplier of the interaction sphere of the focus node -*/ + * Set maximum allowed distance to a multiplier of the interaction sphere of the focus + * node. + */ [[codegen::luawrap]] void setRelativeMaxDistance(float multiplier) { using namespace openspace; const SceneGraphNode* node = global::navigationHandler->anchorNode(); diff --git a/src/navigation/path.cpp b/src/navigation/path.cpp index 8d4215c85e..d30d7d09ee 100644 --- a/src/navigation/path.cpp +++ b/src/navigation/path.cpp @@ -24,22 +24,35 @@ #include -#include #include +#include #include -#include #include -#include +#include #include #include #include +#include +#include #include #include #include #include #include +#include #include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "Path"; diff --git a/src/navigation/pathcurve.cpp b/src/navigation/pathcurve.cpp index 8aad9ea7b7..385194ba99 100644 --- a/src/navigation/pathcurve.cpp +++ b/src/navigation/pathcurve.cpp @@ -25,13 +25,16 @@ #include #include -#include -#include -#include #include #include -#include +#include +#include #include +#include +#include +#include +#include +#include #include namespace { diff --git a/src/navigation/pathcurves/avoidcollisioncurve.cpp b/src/navigation/pathcurves/avoidcollisioncurve.cpp index 7fc34c1013..4791706f30 100644 --- a/src/navigation/pathcurves/avoidcollisioncurve.cpp +++ b/src/navigation/pathcurves/avoidcollisioncurve.cpp @@ -25,17 +25,19 @@ #include #include -#include #include +#include #include #include -#include #include #include +#include #include -#include #include #include +#include +#include +#include #include namespace { @@ -76,7 +78,7 @@ AvoidCollisionCurve::AvoidCollisionCurve(const Waypoint& start, const Waypoint& // Note that the factor 2.0 is arbitrarily chosen to look ok. // @TODO: (2022-02-27, emmbr) Should be unified to a "getting close to object sphere" // that can be used in multiple cases when creating paths more cleverly later on - const double closeToNodeThresholdFactor = glm::max( + const double closeToNodeThresholdFactor = std::max( CloseToNodeThresholdRadiusMultiplier, 2.0 * global::navigationHandler->pathNavigator().arrivalDistanceFactor() ); diff --git a/src/navigation/pathcurves/zoomoutoverviewcurve.cpp b/src/navigation/pathcurves/zoomoutoverviewcurve.cpp index 4948fef8b6..4e7d698098 100644 --- a/src/navigation/pathcurves/zoomoutoverviewcurve.cpp +++ b/src/navigation/pathcurves/zoomoutoverviewcurve.cpp @@ -24,14 +24,12 @@ #include -#include -#include #include -#include #include +#include #include #include -#include +#include #include namespace { diff --git a/src/navigation/pathnavigator.cpp b/src/navigation/pathnavigator.cpp index 0146d45cac..70ea2cf382 100644 --- a/src/navigation/pathnavigator.cpp +++ b/src/navigation/pathnavigator.cpp @@ -26,12 +26,13 @@ #include #include +#include #include -#include #include +#include #include #include -#include +#include #include #include #include @@ -40,14 +41,11 @@ #include #include #include -#include -#include -#include #include -#include -#include -#include -#include +#include +#include +#include +#include #include "pathnavigator_lua.inl" diff --git a/src/navigation/pathnavigator_lua.inl b/src/navigation/pathnavigator_lua.inl index b931699967..17c9a3beb1 100644 --- a/src/navigation/pathnavigator_lua.inl +++ b/src/navigation/pathnavigator_lua.inl @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include namespace { diff --git a/src/navigation/waypoint.cpp b/src/navigation/waypoint.cpp index 1949345665..a4ac50a6e8 100644 --- a/src/navigation/waypoint.cpp +++ b/src/navigation/waypoint.cpp @@ -26,19 +26,79 @@ #include #include -#include #include #include #include #include #include +#include #include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "Waypoint"; constexpr float LengthEpsilon = 1e-5f; constexpr const char* SunIdentifier = "Sun"; + + // Compute a target position close to the specified target node, using knowledge of + // the start point and a desired distance from the node's center + glm::dvec3 computeGoodStepDirection(const openspace::SceneGraphNode* targetNode, + const openspace::interaction::Waypoint& startPoint) + { + using namespace openspace; + using namespace openspace::interaction; + + const glm::dvec3 nodePos = targetNode->worldPosition(); + const SceneGraphNode* sun = sceneGraphNode(SunIdentifier); + const SceneGraphNode* closeNode = PathNavigator::findNodeNearTarget(targetNode); + + // @TODO (2021-07-09, emmbr): Not nice to depend on a specific scene graph node, + // as it might not exist. Ideally, each SGN could know about their preferred + // direction to be viewed from (their "good side"), and then that could be queried + // and used instead. + if (closeNode) { + // If the node is close to another node in the scene, set the direction in a + // way that minimizes risk of collision + return glm::normalize(nodePos - closeNode->worldPosition()); + } + else if (!sun) { + // Can't compute position from Sun position, so just use any direction + return glm::dvec3(0.0, 0.0, 1.0); + } + else if (targetNode->identifier() == SunIdentifier) { + // Special case for when the target is the Sun, in which we want to avoid a + // zero vector. The Z axis is chosen to provide an overview of the solar + // system, and not stay in the orbital plane + return glm::dvec3(0.0, 0.0, 1.0); + } + else { + // Go to a point that is lit by the Sun, slightly offsett from sun direction + const glm::dvec3 sunPos = sun->worldPosition(); + + const glm::dvec3 prevPos = startPoint.position(); + const glm::dvec3 targetToPrev = prevPos - nodePos; + const glm::dvec3 targetToSun = sunPos - nodePos; + + // Check against zero vectors, as this will lead to nan-values from the + // cross product + if (glm::length(targetToSun) < LengthEpsilon || + glm::length(targetToPrev) < LengthEpsilon) + { + // Same situation as if sun does not exist. Any direction will do + return glm::dvec3(0.0, 0.0, 1.0); + } + + constexpr float defaultPositionOffsetAngle = -30.f; // degrees + constexpr float angle = glm::radians(defaultPositionOffsetAngle); + const glm::dvec3 axis = glm::normalize(glm::cross(targetToPrev, targetToSun)); + const glm::dquat offsetRotation = angleAxis(static_cast(angle), axis); + + return glm::normalize(offsetRotation * targetToSun); + } + } } // namespace namespace openspace::interaction { @@ -118,59 +178,6 @@ Waypoint waypointFromCamera() { return Waypoint{ pos, rot, node }; } -// Compute a target position close to the specified target node, using knowledge of -// the start point and a desired distance from the node's center -glm::dvec3 computeGoodStepDirection(const SceneGraphNode* targetNode, - const Waypoint& startPoint) -{ - const glm::dvec3 nodePos = targetNode->worldPosition(); - const SceneGraphNode* sun = sceneGraphNode(SunIdentifier); - const SceneGraphNode* closeNode = PathNavigator::findNodeNearTarget(targetNode); - - // @TODO (2021-07-09, emmbr): Not nice to depend on a specific scene graph node, - // as it might not exist. Ideally, each SGN could know about their preferred - // direction to be viewed from (their "good side"), and then that could be queried - // and used instead. - if (closeNode) { - // If the node is close to another node in the scene, set the direction in a way - // that minimizes risk of collision - return glm::normalize(nodePos - closeNode->worldPosition()); - } - else if (!sun) { - // Can't compute position from Sun position, so just use any direction. Z will do - return glm::dvec3(0.0, 0.0, 1.0); - } - else if (targetNode->identifier() == SunIdentifier) { - // Special case for when the target is the Sun, in which we want to avoid a zero - // vector. The Z axis is chosen to provide an overview of the solar system, and - // not stay in the orbital plane - return glm::dvec3(0.0, 0.0, 1.0); - } - else { - // Go to a point that is lit up by the sun, slightly offsetted from sun direction - const glm::dvec3 sunPos = sun->worldPosition(); - - const glm::dvec3 prevPos = startPoint.position(); - const glm::dvec3 targetToPrev = prevPos - nodePos; - const glm::dvec3 targetToSun = sunPos - nodePos; - - // Check against zero vectors, as this will lead to nan-values from cross product - if (glm::length(targetToSun) < LengthEpsilon || - glm::length(targetToPrev) < LengthEpsilon) - { - // Same situation as if sun does not exist. Any direction will do - return glm::dvec3(0.0, 0.0, 1.0); - } - - constexpr float defaultPositionOffsetAngle = -30.f; // degrees - constexpr float angle = glm::radians(defaultPositionOffsetAngle); - const glm::dvec3 axis = glm::normalize(glm::cross(targetToPrev, targetToSun)); - const glm::dquat offsetRotation = angleAxis(static_cast(angle), axis); - - return glm::normalize(offsetRotation * targetToSun); - } -} - Waypoint computeWaypointFromNodeInfo(const NodeCameraStateSpec& spec, const std::optional& startPoint, bool useLinear) diff --git a/src/network/messagestructures.cpp b/src/network/messagestructures.cpp new file mode 100644 index 0000000000..03e0cd5d7c --- /dev/null +++ b/src/network/messagestructures.cpp @@ -0,0 +1,431 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2025 * + * * + * 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. * + ****************************************************************************************/ + +#include + +#include +#include +#include +#include +#include + +namespace openspace::datamessagestructures { + +CameraKeyframe::CameraKeyframe(const std::vector& buffer) { + deserialize(buffer); +} + +CameraKeyframe::CameraKeyframe(glm::dvec3 pos, glm::dquat rot, std::string focusNode, + bool followNodeRot, float scale) + : _position(pos) + , _rotation(rot) + , _followNodeRotation(followNodeRot) + , _focusNode(focusNode) + , _scale(scale) +{} + +void CameraKeyframe::serialize(std::vector& buffer) const { + // Add position + buffer.insert( + buffer.end(), + reinterpret_cast(&_position), + reinterpret_cast(&_position) + sizeof(_position) + ); + + // Add orientation + buffer.insert( + buffer.end(), + reinterpret_cast(&_rotation), + reinterpret_cast(&_rotation) + sizeof(_rotation) + ); + + // Follow focus node rotation? + buffer.insert( + buffer.end(), + reinterpret_cast(&_followNodeRotation), + reinterpret_cast(&_followNodeRotation) + + sizeof(_followNodeRotation) + ); + + uint32_t nodeNameLength = static_cast(_focusNode.size()); + + // Add focus node + buffer.insert( + buffer.end(), + reinterpret_cast(&nodeNameLength), + reinterpret_cast(&nodeNameLength) + sizeof(uint32_t) + ); + buffer.insert( + buffer.end(), + _focusNode.data(), + _focusNode.data() + nodeNameLength + ); + + buffer.insert( + buffer.end(), + reinterpret_cast(&_scale), + reinterpret_cast(&_scale) + sizeof(_scale) + ); + + // Add timestamp + buffer.insert( + buffer.end(), + reinterpret_cast(&_timestamp), + reinterpret_cast(&_timestamp) + sizeof(_timestamp) + ); +} + +size_t CameraKeyframe::deserialize(const std::vector& buffer, size_t offset) { + int size = 0; + + // Position + size = sizeof(_position); + std::memcpy(glm::value_ptr(_position), buffer.data() + offset, size); + offset += size; + + // Orientation + size = sizeof(_rotation); + std::memcpy(glm::value_ptr(_rotation), buffer.data() + offset, size); + offset += size; + + // Follow focus node rotation? + size = sizeof(_followNodeRotation); + std::memcpy(&_followNodeRotation, buffer.data() + offset, size); + offset += size; + + // Focus node + int nodeNameLength; + size = sizeof(int); + std::memcpy(&nodeNameLength, buffer.data() + offset, size); + offset += size; + size = nodeNameLength; + _focusNode = std::string(buffer.data() + offset, buffer.data() + offset + size); + offset += size; + + // Scale + size = sizeof(_scale); + std::memcpy(&_scale, buffer.data() + offset, size); + offset += size; + + // Timestamp + size = sizeof(_timestamp); + std::memcpy(&_timestamp, buffer.data() + offset, size); + offset += size; + + return offset; +} + +void CameraKeyframe::write(std::ostream& out) const { + out.write( + reinterpret_cast(glm::value_ptr(_position)), + sizeof(_position) + ); + out.write( + reinterpret_cast(glm::value_ptr(_rotation)), + sizeof(_rotation) + ); + + // Write follow focus node rotation? + out.write( + reinterpret_cast(&_followNodeRotation), + sizeof(_followNodeRotation) + ); + + int nodeNameLength = static_cast(_focusNode.size()); + + // Write focus node + out.write(reinterpret_cast(&nodeNameLength), sizeof(nodeNameLength)); + out.write(_focusNode.c_str(), _focusNode.size()); + + // Write scale + out.write(reinterpret_cast(&_scale), sizeof(_scale)); + + // Write timestamp + out.write(reinterpret_cast(&_timestamp), sizeof(_timestamp)); +} + +void CameraKeyframe::write(std::stringstream& out) const { + // Add camera position + out << std::setprecision(std::numeric_limits::max_digits10); + out << _position.x << ' ' << _position.y << ' ' << _position.z << ' '; + // Add camera rotation + out << _rotation.x << ' ' + << _rotation.y << ' ' + << _rotation.z << ' ' + << _rotation.w << ' '; + out << std::scientific << _scale << ' '; + if (_followNodeRotation) { + out << "F "; + } + else { + out << "- "; + } + out << _focusNode; +} + +void CameraKeyframe::read(std::istream* in) { + // Read position + in->read(reinterpret_cast(&_position), sizeof(_position)); + + // Read orientation + in->read(reinterpret_cast(&_rotation), sizeof(_rotation)); + + // Read follow focus node rotation + unsigned char b; + in->read(reinterpret_cast(&b), sizeof(unsigned char)); + _followNodeRotation = (b == 1); + + // Read focus node + int nodeNameLength = static_cast(_focusNode.size()); + in->read(reinterpret_cast(&nodeNameLength), sizeof(nodeNameLength)); + std::vector temp(static_cast(nodeNameLength) + 1); + in->read(temp.data(), nodeNameLength); + + temp[nodeNameLength] = '\0'; + _focusNode = temp.data(); + + // Read scale + in->read(reinterpret_cast(&_scale), sizeof(_scale)); + + // Read timestamp + in->read(reinterpret_cast(&_timestamp), sizeof(_timestamp)); +} + +void CameraKeyframe::read(std::istringstream& iss) { + std::string rotationFollowing; + + iss >> _position.x + >> _position.y + >> _position.z + >> _rotation.x + >> _rotation.y + >> _rotation.z + >> _rotation.w + >> _scale + >> rotationFollowing + >> _focusNode; + _followNodeRotation = (rotationFollowing == "F"); +} + +TimeKeyframe::TimeKeyframe(const std::vector& buffer) { + deserialize(buffer); +} + +void TimeKeyframe::serialize(std::vector& buffer) const { + buffer.insert( + buffer.end(), + reinterpret_cast(this), + reinterpret_cast(this) + sizeof(TimeKeyframe) + ); +} + +size_t TimeKeyframe::deserialize(const std::vector& buffer, size_t offset) { + *this = *reinterpret_cast(buffer.data() + offset); + offset += sizeof(TimeKeyframe); + return offset; +} + +void TimeKeyframe::write(std::ostream* out) const { + out->write(reinterpret_cast(this), sizeof(TimeKeyframe)); +} + +void TimeKeyframe::write(std::stringstream& out) const { + out << ' ' << _dt; + if (_paused) { + out << " P"; + } + else { + out << " R"; + } + if (_requiresTimeJump) { + out << " J"; + } + else { + out << " -"; + } +} + +void TimeKeyframe::read(std::istream* in) { + in->read(reinterpret_cast(this), sizeof(TimeKeyframe)); +} + +void TimeKeyframe::read(std::istringstream& iss) { + std::string paused, jump; + + iss >> _dt + >> paused + >> jump; + _paused = (paused == "P"); + _requiresTimeJump = (jump == "J"); +} + +TimeTimeline::TimeTimeline(const std::vector& buffer) { + deserialize(buffer); +} + +void TimeTimeline::serialize(std::vector& buffer) const { + buffer.insert( + buffer.end(), + reinterpret_cast(&_clear), + reinterpret_cast(&_clear) + sizeof(bool) + ); + + int64_t nKeyframes = _keyframes.size(); + buffer.insert( + buffer.end(), + reinterpret_cast(&nKeyframes), + reinterpret_cast(&nKeyframes) + sizeof(int64_t) + ); + for (const TimeKeyframe& k : _keyframes) { + k.serialize(buffer); + } +} + +size_t TimeTimeline::deserialize(const std::vector& buffer, size_t offset) { + int size = 0; + + size = sizeof(_clear); + std::memcpy(&_clear, buffer.data() + offset, size); + offset += size; + + int64_t nKeyframes = _keyframes.size(); + size = sizeof(nKeyframes); + std::memcpy(&nKeyframes, buffer.data() + offset, size); + offset += size; + + _keyframes.resize(nKeyframes); + for (TimeKeyframe& k : _keyframes) { + offset = k.deserialize(buffer, offset); + } + return offset; +} + +void TimeTimeline::write(std::ostream* out) const { + out->write(reinterpret_cast(&_clear), sizeof(bool)); + + int64_t nKeyframes = _keyframes.size(); + out->write(reinterpret_cast(&nKeyframes), sizeof(int64_t)); + for (const TimeKeyframe& k : _keyframes) { + k.write(out); + } +} + +void TimeTimeline::read(std::istream* in) { + in->read(reinterpret_cast(&_clear), sizeof(bool)); + + int64_t nKeyframes = _keyframes.size(); + in->read(reinterpret_cast(&nKeyframes), sizeof(int64_t)); + for (TimeKeyframe& k : _keyframes) { + k.read(in); + } +} + +void ScriptMessage::serialize(std::vector& buffer) const { + uint32_t strLen = static_cast(_script.size()); + + const char* p = reinterpret_cast(&strLen); + buffer.insert(buffer.end(), p, p + sizeof(uint32_t)); + + buffer.insert(buffer.end(), _script.begin(), _script.end()); +} + +void ScriptMessage::deserialize(const std::vector& buffer) { + const char* p = buffer.data(); + const uint32_t len = *reinterpret_cast(p); + + if (buffer.size() != (sizeof(uint32_t) + len)) { + LERRORC( + "ParallelPeer", + std::format( + "Received buffer with wrong size. Expected {} got {}", + len, buffer.size() + ) + ); + return; + } + + // We can skip over the first uint32_t that encoded the length + _script.assign(buffer.begin() + sizeof(uint32_t), buffer.end()); +} + +void ScriptMessage::write(std::ostream* out) const { + out->write(_script.c_str(), _script.size()); +} + +void ScriptMessage::write(unsigned char* buf, size_t& idx, std::ofstream& file) const { + size_t strLen = _script.size(); + size_t writeSize_bytes = sizeof(size_t); + + unsigned char const* p = reinterpret_cast(&strLen); + memcpy((buf + idx), p, writeSize_bytes); + idx += static_cast(writeSize_bytes); + + memcpy((buf + idx), _script.c_str(), _script.size()); + idx += static_cast(strLen); + file.write(reinterpret_cast(buf), idx); + //Write directly to file because some scripts can be very long + file.write(_script.c_str(), _script.size()); +} + +void ScriptMessage::write(std::stringstream& ss) const { + unsigned int numLinesInScript = static_cast( + std::count(_script.begin(), _script.end(), '\n') + ); + ss << ' ' << (numLinesInScript + 1) << ' '; + ss << _script; +} + +void ScriptMessage::read(std::istream* in) { + uint32_t strLen = 0; + //Read string length from file + in->read(reinterpret_cast(&strLen), sizeof(strLen)); + //Read back full string + std::vector temp(strLen + 1); + in->read(temp.data(), strLen); + temp[strLen] = '\0'; + + _script.erase(); + _script = temp.data(); +} + +void ScriptMessage::read(std::istringstream& iss) { + int numScriptLines; + iss >> numScriptLines; + if (numScriptLines < 0) { + numScriptLines = 0; + } + std::string tmpReadbackScript; + _script.erase(); + for (int i = 0; i < numScriptLines; i++) { + ghoul::getline(iss, tmpReadbackScript); + size_t start = tmpReadbackScript.find_first_not_of(" "); + tmpReadbackScript = tmpReadbackScript.substr(start); + _script.append(tmpReadbackScript); + if (i < (numScriptLines - 1)) { + _script.append("\n"); + } + } +} + +} // namespace openspace::datamessagestructures diff --git a/src/network/messagestructureshelper.cpp b/src/network/messagestructureshelper.cpp index a01c4cb3c5..3a79ab6ecb 100644 --- a/src/network/messagestructureshelper.cpp +++ b/src/network/messagestructureshelper.cpp @@ -29,9 +29,11 @@ #include #include #include +#include #include #include #include +#include namespace openspace::datamessagestructures { diff --git a/src/network/parallelconnection.cpp b/src/network/parallelconnection.cpp index 28672ec517..ed073ef905 100644 --- a/src/network/parallelconnection.cpp +++ b/src/network/parallelconnection.cpp @@ -24,11 +24,11 @@ #include -#include -#include #include #include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "ParallelConnection"; diff --git a/src/network/parallelpeer.cpp b/src/network/parallelpeer.cpp index c8a8bf2b1d..39726b705b 100644 --- a/src/network/parallelpeer.cpp +++ b/src/network/parallelpeer.cpp @@ -32,13 +32,21 @@ #include #include #include +#include #include +#include #include #include +#include #include #include #include #include +#include +#include +#include +#include +#include #include "parallelpeer_lua.inl" @@ -164,7 +172,7 @@ void ParallelPeer::connect() { auto socket = std::make_unique( _address, - atoi(_port.value().c_str()) + std::atoi(_port.value().c_str()) ); socket->connect(); @@ -218,7 +226,7 @@ void ParallelPeer::sendAuthentication() { passwordSize + // password sizeof(uint16_t) + // host password length hostPasswordSize + // host password - sizeof(uint8_t) + // server name length + sizeof(uint8_t) + // server name length serverNameSize + // server name sizeof(uint8_t) + // name length nameLength; // name @@ -309,7 +317,6 @@ double ParallelPeer::convertTimestamp(double messageTimestamp) { return messageTimestamp + _initialTimeDiff + _bufferTime; } - double ParallelPeer::latencyStandardDeviation() const { double accumulatedLatencyDiffSquared = 0; double accumulatedLatencyDiff = 0; diff --git a/src/network/parallelpeer_lua.inl b/src/network/parallelpeer_lua.inl index d4a2a8c0b0..b78f028b84 100644 --- a/src/network/parallelpeer_lua.inl +++ b/src/network/parallelpeer_lua.inl @@ -22,7 +22,7 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ -#include +#include namespace { diff --git a/src/properties/list/doublelistproperty.cpp b/src/properties/list/doublelistproperty.cpp index ab61262f24..1a639e0fed 100644 --- a/src/properties/list/doublelistproperty.cpp +++ b/src/properties/list/doublelistproperty.cpp @@ -24,11 +24,8 @@ #include -#include -#include #include #include -#include namespace openspace::properties { diff --git a/src/properties/list/intlistproperty.cpp b/src/properties/list/intlistproperty.cpp index 8358ee595a..8dcf20a5ed 100644 --- a/src/properties/list/intlistproperty.cpp +++ b/src/properties/list/intlistproperty.cpp @@ -24,11 +24,8 @@ #include -#include -#include #include #include -#include namespace openspace::properties { diff --git a/src/properties/list/stringlistproperty.cpp b/src/properties/list/stringlistproperty.cpp index 63db92cc21..18e6d69352 100644 --- a/src/properties/list/stringlistproperty.cpp +++ b/src/properties/list/stringlistproperty.cpp @@ -24,11 +24,8 @@ #include -#include -#include #include #include -#include namespace openspace::properties { diff --git a/src/properties/matrix/dmat2property.cpp b/src/properties/matrix/dmat2property.cpp index 26b0cd612f..bbbcb60c3b 100644 --- a/src/properties/matrix/dmat2property.cpp +++ b/src/properties/matrix/dmat2property.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include namespace openspace::properties { diff --git a/src/properties/matrix/dmat3property.cpp b/src/properties/matrix/dmat3property.cpp index 7461e2e877..5a42adaa7a 100644 --- a/src/properties/matrix/dmat3property.cpp +++ b/src/properties/matrix/dmat3property.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include namespace openspace::properties { diff --git a/src/properties/matrix/dmat4property.cpp b/src/properties/matrix/dmat4property.cpp index 38ab2b7477..b571343615 100644 --- a/src/properties/matrix/dmat4property.cpp +++ b/src/properties/matrix/dmat4property.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include namespace openspace::properties { diff --git a/src/properties/matrix/mat2property.cpp b/src/properties/matrix/mat2property.cpp index 2027986e28..66770d958a 100644 --- a/src/properties/matrix/mat2property.cpp +++ b/src/properties/matrix/mat2property.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include namespace openspace::properties { diff --git a/src/properties/matrix/mat3property.cpp b/src/properties/matrix/mat3property.cpp index a0cec81b4b..24fbcf7ec5 100644 --- a/src/properties/matrix/mat3property.cpp +++ b/src/properties/matrix/mat3property.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include namespace openspace::properties { diff --git a/src/properties/matrix/mat4property.cpp b/src/properties/matrix/mat4property.cpp index 91e1887f4f..7ed3a13c25 100644 --- a/src/properties/matrix/mat4property.cpp +++ b/src/properties/matrix/mat4property.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include namespace openspace::properties { diff --git a/src/properties/misc/optionproperty.cpp b/src/properties/misc/optionproperty.cpp index f652a6646f..9d53311769 100644 --- a/src/properties/misc/optionproperty.cpp +++ b/src/properties/misc/optionproperty.cpp @@ -27,7 +27,6 @@ #include #include #include -#include namespace { constexpr std::string_view _loggerCat = "OptionProperty"; diff --git a/src/properties/misc/selectionproperty.cpp b/src/properties/misc/selectionproperty.cpp index 1ddcdebaa8..7804fd2f4e 100644 --- a/src/properties/misc/selectionproperty.cpp +++ b/src/properties/misc/selectionproperty.cpp @@ -28,12 +28,10 @@ #include #include #include -#include -#include +#include namespace { constexpr std::string_view _loggerCat = "SelectionProperty"; - constexpr std::string_view OptionsKey = "options"; } // namespace diff --git a/src/properties/property.cpp b/src/properties/property.cpp index e2583a8e21..2c5b699e64 100644 --- a/src/properties/property.cpp +++ b/src/properties/property.cpp @@ -25,13 +25,11 @@ #include #include +#include #include #include -#include -#include -#include -#include #include +#include namespace openspace::properties { diff --git a/src/properties/propertyowner.cpp b/src/properties/propertyowner.cpp index 055219890d..35867cfd32 100644 --- a/src/properties/propertyowner.cpp +++ b/src/properties/propertyowner.cpp @@ -29,13 +29,14 @@ #include #include #include -#include #include #include -#include +#include #include +#include #include -#include +#include +#include namespace { constexpr std::string_view _loggerCat = "PropertyOwner"; @@ -106,7 +107,7 @@ std::vector PropertyOwner::subownersRecursive() const { return subowners; } -Property* PropertyOwner::property(const std::string& uri) const { +Property* PropertyOwner::property(std::string_view uri) const { auto it = std::find_if( _properties.begin(), _properties.end(), @@ -122,8 +123,8 @@ Property* PropertyOwner::property(const std::string& uri) const { return nullptr; } else { - const std::string ownerName = uri.substr(0, ownerSeparator); - const std::string propertyName = uri.substr(ownerSeparator + 1); + const std::string_view ownerName = uri.substr(0, ownerSeparator); + const std::string_view propertyName = uri.substr(ownerSeparator + 1); PropertyOwner* owner = propertySubOwner(ownerName); if (!owner) { @@ -140,7 +141,7 @@ Property* PropertyOwner::property(const std::string& uri) const { } } -PropertyOwner* PropertyOwner::propertyOwner(const std::string& uri) const { +PropertyOwner* PropertyOwner::propertyOwner(std::string_view uri) const { PropertyOwner* directChild = propertySubOwner(uri); if (directChild) { return directChild; @@ -154,8 +155,8 @@ PropertyOwner* PropertyOwner::propertyOwner(const std::string& uri) const { return nullptr; } else { - const std::string parentName = uri.substr(0, ownerSeparator); - const std::string ownerName = uri.substr(ownerSeparator + 1); + const std::string_view parentName = uri.substr(0, ownerSeparator); + const std::string_view ownerName = uri.substr(ownerSeparator + 1); PropertyOwner* owner = propertySubOwner(parentName); return owner ? owner->propertyOwner(ownerName) : nullptr; @@ -206,7 +207,7 @@ const std::vector& PropertyOwner::propertySubOwners() const { return _subOwners; } -PropertyOwner* PropertyOwner::propertySubOwner(const std::string& identifier) const { +PropertyOwner* PropertyOwner::propertySubOwner(std::string_view identifier) const { std::vector::const_iterator it = std::find_if( _subOwners.begin(), _subOwners.end(), diff --git a/src/properties/scalar/doubleproperty.cpp b/src/properties/scalar/doubleproperty.cpp index 23fc0f1783..10ff4caa97 100644 --- a/src/properties/scalar/doubleproperty.cpp +++ b/src/properties/scalar/doubleproperty.cpp @@ -24,8 +24,7 @@ #include -#include -#include +#include namespace openspace::properties { diff --git a/src/properties/scalar/floatproperty.cpp b/src/properties/scalar/floatproperty.cpp index ad8c79c611..dbf48bddaf 100644 --- a/src/properties/scalar/floatproperty.cpp +++ b/src/properties/scalar/floatproperty.cpp @@ -24,8 +24,7 @@ #include -#include -#include +#include namespace openspace::properties { diff --git a/src/properties/scalar/intproperty.cpp b/src/properties/scalar/intproperty.cpp index a37ed0db18..86f4da931e 100644 --- a/src/properties/scalar/intproperty.cpp +++ b/src/properties/scalar/intproperty.cpp @@ -24,8 +24,7 @@ #include -#include -#include +#include namespace openspace::properties { diff --git a/src/properties/scalar/longproperty.cpp b/src/properties/scalar/longproperty.cpp index a97dd0209b..97a388dc2a 100644 --- a/src/properties/scalar/longproperty.cpp +++ b/src/properties/scalar/longproperty.cpp @@ -24,8 +24,7 @@ #include -#include -#include +#include namespace openspace::properties { diff --git a/src/properties/scalar/shortproperty.cpp b/src/properties/scalar/shortproperty.cpp index e226f9e560..e54afe79f4 100644 --- a/src/properties/scalar/shortproperty.cpp +++ b/src/properties/scalar/shortproperty.cpp @@ -24,8 +24,7 @@ #include -#include -#include +#include namespace openspace::properties { diff --git a/src/properties/scalar/uintproperty.cpp b/src/properties/scalar/uintproperty.cpp index 08c0caf333..ef111adf3d 100644 --- a/src/properties/scalar/uintproperty.cpp +++ b/src/properties/scalar/uintproperty.cpp @@ -24,8 +24,7 @@ #include -#include -#include +#include namespace openspace::properties { diff --git a/src/properties/scalar/ulongproperty.cpp b/src/properties/scalar/ulongproperty.cpp index 72a53ea6ec..42a52b8d0f 100644 --- a/src/properties/scalar/ulongproperty.cpp +++ b/src/properties/scalar/ulongproperty.cpp @@ -24,8 +24,7 @@ #include -#include -#include +#include namespace openspace::properties { diff --git a/src/properties/scalar/ushortproperty.cpp b/src/properties/scalar/ushortproperty.cpp index b828dc5c39..4849f938dd 100644 --- a/src/properties/scalar/ushortproperty.cpp +++ b/src/properties/scalar/ushortproperty.cpp @@ -24,8 +24,7 @@ #include -#include -#include +#include namespace openspace::properties { diff --git a/src/properties/vector/dvec2property.cpp b/src/properties/vector/dvec2property.cpp index 9c05535f20..6b383db8b2 100644 --- a/src/properties/vector/dvec2property.cpp +++ b/src/properties/vector/dvec2property.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include namespace openspace::properties { diff --git a/src/properties/vector/dvec3property.cpp b/src/properties/vector/dvec3property.cpp index 70bd5869b2..eb96491be4 100644 --- a/src/properties/vector/dvec3property.cpp +++ b/src/properties/vector/dvec3property.cpp @@ -24,9 +24,7 @@ #include -#include -#include -#include +#include namespace openspace::properties { diff --git a/src/properties/vector/dvec4property.cpp b/src/properties/vector/dvec4property.cpp index 0043455dc2..287c4d7959 100644 --- a/src/properties/vector/dvec4property.cpp +++ b/src/properties/vector/dvec4property.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include namespace openspace::properties { diff --git a/src/properties/vector/ivec2property.cpp b/src/properties/vector/ivec2property.cpp index ee41df1816..4ba64a895c 100644 --- a/src/properties/vector/ivec2property.cpp +++ b/src/properties/vector/ivec2property.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include namespace openspace::properties { diff --git a/src/properties/vector/ivec3property.cpp b/src/properties/vector/ivec3property.cpp index 768251cd9b..dfbd96af80 100644 --- a/src/properties/vector/ivec3property.cpp +++ b/src/properties/vector/ivec3property.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include namespace openspace::properties { diff --git a/src/properties/vector/ivec4property.cpp b/src/properties/vector/ivec4property.cpp index 785b43e1d1..214c9d620a 100644 --- a/src/properties/vector/ivec4property.cpp +++ b/src/properties/vector/ivec4property.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include namespace openspace::properties { diff --git a/src/properties/vector/uvec2property.cpp b/src/properties/vector/uvec2property.cpp index c8210ec77a..f2f56bd665 100644 --- a/src/properties/vector/uvec2property.cpp +++ b/src/properties/vector/uvec2property.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include namespace openspace::properties { diff --git a/src/properties/vector/uvec3property.cpp b/src/properties/vector/uvec3property.cpp index 274c6f6961..15bbbe3902 100644 --- a/src/properties/vector/uvec3property.cpp +++ b/src/properties/vector/uvec3property.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include namespace openspace::properties { diff --git a/src/properties/vector/uvec4property.cpp b/src/properties/vector/uvec4property.cpp index cbf4e09450..70acb038f7 100644 --- a/src/properties/vector/uvec4property.cpp +++ b/src/properties/vector/uvec4property.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include namespace openspace::properties { diff --git a/src/properties/vector/vec2property.cpp b/src/properties/vector/vec2property.cpp index a956b39509..8ba77d9d3d 100644 --- a/src/properties/vector/vec2property.cpp +++ b/src/properties/vector/vec2property.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include namespace openspace::properties { diff --git a/src/properties/vector/vec3property.cpp b/src/properties/vector/vec3property.cpp index a14412d102..348be4cd4f 100644 --- a/src/properties/vector/vec3property.cpp +++ b/src/properties/vector/vec3property.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include namespace openspace::properties { diff --git a/src/properties/vector/vec4property.cpp b/src/properties/vector/vec4property.cpp index dcd1bb97b7..1bfd2234f6 100644 --- a/src/properties/vector/vec4property.cpp +++ b/src/properties/vector/vec4property.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include namespace openspace::properties { diff --git a/src/query/query.cpp b/src/query/query.cpp index 6df0a0a01a..9f7cf9aa29 100644 --- a/src/query/query.cpp +++ b/src/query/query.cpp @@ -26,8 +26,11 @@ #include #include +#include +#include #include #include +#include namespace openspace { @@ -35,7 +38,7 @@ Scene* sceneGraph() { return global::renderEngine->scene(); } -SceneGraphNode* sceneGraphNode(const std::string& name) { +SceneGraphNode* sceneGraphNode(std::string_view name) { const Scene* graph = sceneGraph(); if (!graph) { return nullptr; @@ -43,7 +46,7 @@ SceneGraphNode* sceneGraphNode(const std::string& name) { return graph->sceneGraphNode(name); } -const Renderable* renderable(const std::string& name) { +const Renderable* renderable(std::string_view name) { SceneGraphNode* node = sceneGraphNode(name); if (!node) { return nullptr; @@ -51,12 +54,12 @@ const Renderable* renderable(const std::string& name) { return node->renderable(); } -properties::Property* property(const std::string& uri) { +properties::Property* property(std::string_view uri) { properties::Property* property = global::rootPropertyOwner->property(uri); return property; } -properties::PropertyOwner* propertyOwner(const std::string& uri) { +properties::PropertyOwner* propertyOwner(std::string_view uri) { properties::PropertyOwner* property = global::rootPropertyOwner->propertyOwner(uri); return property; } diff --git a/src/rendering/colormappingcomponent.cpp b/src/rendering/colormappingcomponent.cpp index a21402dc3f..31a468330e 100644 --- a/src/rendering/colormappingcomponent.cpp +++ b/src/rendering/colormappingcomponent.cpp @@ -25,9 +25,12 @@ #include #include -#include -#include #include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "ColorMapping"; diff --git a/src/rendering/dashboard.cpp b/src/rendering/dashboard.cpp index b75bca2218..09061ef8f3 100644 --- a/src/rendering/dashboard.cpp +++ b/src/rendering/dashboard.cpp @@ -24,13 +24,13 @@ #include -#include #include -#include +#include #include -#include #include #include +#include +#include #include "dashboard_lua.inl" @@ -98,7 +98,7 @@ void Dashboard::addDashboardItem(std::unique_ptr item) { else { item->setIdentifier(originalIdentifier + std::to_string(suffix)); item->setGuiName(originalIdentifier + " " + std::to_string(suffix)); - ++suffix; + suffix++; } } diff --git a/src/rendering/dashboard_lua.inl b/src/rendering/dashboard_lua.inl index 59361808c5..7f7ff0f779 100644 --- a/src/rendering/dashboard_lua.inl +++ b/src/rendering/dashboard_lua.inl @@ -23,7 +23,12 @@ ****************************************************************************************/ #include +#include #include +#include +#include +#include +#include namespace { diff --git a/src/rendering/dashboarditem.cpp b/src/rendering/dashboarditem.cpp index f3505d67e4..928a84ccc8 100644 --- a/src/rendering/dashboarditem.cpp +++ b/src/rendering/dashboarditem.cpp @@ -24,12 +24,14 @@ #include -#include #include -#include #include +#include +#include #include #include +#include +#include namespace { constexpr std::string_view KeyType = "Type"; diff --git a/src/rendering/dashboardtextitem.cpp b/src/rendering/dashboardtextitem.cpp index c2eee6549a..089535c70e 100644 --- a/src/rendering/dashboardtextitem.cpp +++ b/src/rendering/dashboardtextitem.cpp @@ -25,11 +25,12 @@ #include #include -#include #include #include #include #include +#include +#include #include namespace { diff --git a/src/rendering/deferredcaster.cpp b/src/rendering/deferredcaster.cpp new file mode 100644 index 0000000000..ae9fc24a46 --- /dev/null +++ b/src/rendering/deferredcaster.cpp @@ -0,0 +1,37 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2025 * + * * + * 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. * + ****************************************************************************************/ + +#include + +namespace openspace { + +void Deferredcaster::preRaycast(const RenderData&, const DeferredcastData&, + ghoul::opengl::ProgramObject&) +{} + +void Deferredcaster::postRaycast(const RenderData&, const DeferredcastData&, + ghoul::opengl::ProgramObject&) +{} + +} // namespace openspace diff --git a/src/rendering/deferredcastermanager.cpp b/src/rendering/deferredcastermanager.cpp index 3297ef8699..3b282bd1d4 100644 --- a/src/rendering/deferredcastermanager.cpp +++ b/src/rendering/deferredcastermanager.cpp @@ -26,7 +26,6 @@ #include #include -#include namespace openspace { diff --git a/src/rendering/fadeable.cpp b/src/rendering/fadeable.cpp index 3f7d9508ca..71ac5bf4fe 100644 --- a/src/rendering/fadeable.cpp +++ b/src/rendering/fadeable.cpp @@ -24,10 +24,6 @@ #include -#include -#include -#include - namespace { constexpr openspace::properties::Property::PropertyInfo OpacityInfo = { "Opacity", diff --git a/src/rendering/framebufferrenderer.cpp b/src/rendering/framebufferrenderer.cpp index e31630d727..137db1e4ad 100644 --- a/src/rendering/framebufferrenderer.cpp +++ b/src/rendering/framebufferrenderer.cpp @@ -27,9 +27,10 @@ #include #include #include -#include #include +#include #include +#include #include #include #include @@ -39,14 +40,19 @@ #include #include #include +#include #include #include #include #include #include #include -#include +#include +#include +#include #include +#include +#include #include namespace { @@ -589,8 +595,8 @@ void FramebufferRenderer::updateDownscaleTextures() const { GL_TEXTURE_2D, 0, GL_DEPTH_COMPONENT32F, - static_cast(glm::max(_resolution.x * cdf, 1.f)), - static_cast(glm::max(_resolution.y * cdf, 1.f)), + static_cast(std::max(_resolution.x * cdf, 1.f)), + static_cast(std::max(_resolution.y * cdf, 1.f)), 0, GL_DEPTH_COMPONENT, GL_FLOAT, diff --git a/src/rendering/helper.cpp b/src/rendering/helper.cpp index 7c11759b27..9de292522c 100644 --- a/src/rendering/helper.cpp +++ b/src/rendering/helper.cpp @@ -24,21 +24,22 @@ #include -#include -#include #include #include #include #include -#include +#include #include #include #include #include +#include +#include +#include #include #include -#include -#include +#include +#include namespace { @@ -614,7 +615,7 @@ std::vector convert(std::vector v) { return result; } -Vertex computeCircleVertex(int i, int nSegments, float radius, +static Vertex computeCircleVertex(int i, int nSegments, float radius, const glm::vec4& color = glm::vec4(1.f)) { const float fsegments = static_cast(nSegments); @@ -713,10 +714,10 @@ VertexIndexListCombo createSphere(int nSegments, glm::vec3 radii, return { vertices, indices }; } -VertexIndexListCombo createConicalCylinder(unsigned int nSegments, - float bottomRadius, - float topRadius, - float height) +static VertexIndexListCombo createConicalCylinder(unsigned int nSegments, + float bottomRadius, + float topRadius, + float height) { // Create a ring for the top and bottom vertices (XY plane) std::vector bottomVertices = createRingXYZ(nSegments, bottomRadius); @@ -880,7 +881,7 @@ void LightSourceRenderData::updateBasedOnLightSources(const RenderData& renderDa directionsViewSpaceBuffer[nEnabledLightSources] = lightSource->directionViewSpace(renderData); - ++nEnabledLightSources; + nEnabledLightSources++; } nLightSources = nEnabledLightSources; } diff --git a/src/rendering/labelscomponent.cpp b/src/rendering/labelscomponent.cpp index 51a23b0cc2..041cb6a2c7 100644 --- a/src/rendering/labelscomponent.cpp +++ b/src/rendering/labelscomponent.cpp @@ -32,7 +32,9 @@ #include #include #include +#include #include +#include namespace { constexpr std::string_view _loggerCat = "LabelsComponent"; diff --git a/src/rendering/loadingscreen.cpp b/src/rendering/loadingscreen.cpp index 68ea097572..e1629fe034 100644 --- a/src/rendering/loadingscreen.cpp +++ b/src/rendering/loadingscreen.cpp @@ -37,17 +37,18 @@ #include #include #include +#include #include #include -#include #include -#include #include -#include -#include +#include +#include +#include #include #include #include +#include namespace { constexpr float LoadingFontSize = 25.f; @@ -609,10 +610,10 @@ void LoadingScreen::renderLogMessages() const { if (charactersSinceNewLine > MessageLength) { result << '\n'; charactersSinceNewLine = static_cast(word.size()); - ++nRows; + nRows++; } result << word << ' '; - ++charactersSinceNewLine; + charactersSinceNewLine++; } } @@ -625,7 +626,7 @@ void LoadingScreen::renderLogMessages() const { it.message.size() < MessageLength ? it.message : result.str(), ghoul::toColor(it.level) ); - ++nRows; + nRows++; } const glm::vec2 dpiScaling = global::windowDelegate->dpiScaling(); @@ -650,7 +651,7 @@ void LoadingScreen::renderLogMessages() const { text, ghoul::toColor(level) ); - ++row; + row++; } } diff --git a/src/rendering/luaconsole.cpp b/src/rendering/luaconsole.cpp index a9896d847a..1c41eaddd0 100644 --- a/src/rendering/luaconsole.cpp +++ b/src/rendering/luaconsole.cpp @@ -35,13 +35,17 @@ #include #include #include +#include #include #include #include #include -#include +#include +#include +#include #include #include +#include namespace { constexpr std::string_view HistoryFile = "ConsoleHistory"; @@ -322,8 +326,8 @@ bool LuaConsole::keyboardCallback(Key key, KeyModifier modifier, KeyAction actio return false; } - const bool modifierShift = (modifier == KeyModifier::Shift); - const bool modifierControl = (modifier == KeyModifier::Control); + const bool modifierShift = hasKeyModifier(modifier, KeyModifier::Shift); + const bool modifierControl = hasKeyModifier(modifier, KeyModifier::Control); // Button left of 1 and above TAB (default) // Can be changed to any other key with the setCommandInputButton funciton @@ -410,7 +414,7 @@ void LuaConsole::charCallback(unsigned int codepoint, if (modifierControl && (codepoint == codepoint_C || codepoint == codepoint_V)) { return; } -#endif +#endif // WIN32 // Disallow all non ASCII characters for now if (codepoint > 0x7f) { @@ -420,6 +424,25 @@ void LuaConsole::charCallback(unsigned int codepoint, addToCommand(std::string(1, static_cast(codepoint))); } +bool LuaConsole::mouseActivationCallback(glm::vec2, MouseButton button, + MouseAction action, KeyModifier) +{ + const bool isMiddleMouseButton = button == MouseButton::Button3; + const bool isPress = action == MouseAction::Press; + + if (_isVisible && isMiddleMouseButton && isPress) { + // Using the Primary selection area as that is more akin to the behavior on Linux + // where the middle mouse button pastes the currently selected text that comes + // from the primary selection area. + // On Windows, specifying this selection area doesn't change anything as there is + // only a single clipboard + addToCommand(sanitizeInput(ghoul::clipboardText(ghoul::SelectionArea::Primary))); + return true; + } + + return false; +} + void LuaConsole::update() { ZoneScoped; @@ -939,7 +962,8 @@ void LuaConsole::registerKeyHandlers() { return; } - // If the next character after _inputPosition is a JumpCharacter, delete just that + // If the next character after _inputPosition is a JumpCharacter, delete just + // that if (JumpCharacters.find(command[_inputPosition]) != std::string::npos) { command.erase(_inputPosition, 1); return; @@ -1129,20 +1153,10 @@ bool LuaConsole::gatherPathSuggestions(size_t contextStart) { ghoul::filesystem::Sorted::Yes ); - auto containsNonAscii = [](const std::filesystem::path& p) { - const std::u8string s = p.generic_u8string(); - for (auto it = s.rbegin(); it != s.rend(); it++) { - if (static_cast(*it) > 0x7F) { - return true; - } - } - return false; - }; - std::vector entries; for (const std::filesystem::path& entry : suggestions) { // Filter paths that contain non-ASCII characters - if (containsNonAscii(entry)) { + if (ghoul::containsNonAscii(entry)) { continue; } diff --git a/src/rendering/raycastermanager.cpp b/src/rendering/raycastermanager.cpp index f6bbe00f29..8050182e20 100644 --- a/src/rendering/raycastermanager.cpp +++ b/src/rendering/raycastermanager.cpp @@ -26,7 +26,6 @@ #include #include -#include namespace openspace { diff --git a/src/rendering/renderable.cpp b/src/rendering/renderable.cpp index e06fccdc08..2a2df6b9d3 100644 --- a/src/rendering/renderable.cpp +++ b/src/rendering/renderable.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -36,9 +35,14 @@ #include #include #include +#include +#include #include -#include -#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view KeyType = "Type"; @@ -150,8 +154,6 @@ ghoul::mm_unique_ptr Renderable::createFromDictionary( return ghoul::mm_unique_ptr(result); } - - Renderable::Renderable(const ghoul::Dictionary& dictionary, RenderableSettings settings) : properties::PropertyOwner({ "Renderable" }) , _enabled(EnabledInfo, true) diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 94558383f3..27bdfb509e 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -25,18 +25,15 @@ #include #include +#include #include #include #include #include #include -#include -#include #include #include -#include #include -#include #include #include #include @@ -45,10 +42,11 @@ #include #include #include +#include #include -#include -#include #include +#include +#include #include #include #include @@ -63,16 +61,24 @@ #include #include #include +#include #include +#include +#include #include #include -#include #include -#include #include -#include +#include +#include +#include +#include +#include +#include +#include #include "renderengine_lua.inl" +#include namespace { constexpr std::string_view _loggerCat = "RenderEngine"; @@ -949,7 +955,7 @@ float RenderEngine::combinedBlackoutFactor() const { void RenderEngine::postDraw() { ZoneScoped; - ++_frameNumber; + _frameNumber++; } Scene* RenderEngine::scene() { @@ -1452,7 +1458,7 @@ void RenderEngine::renderScreenLog() { message, white ); - ++nRows; + nRows++; } } diff --git a/src/rendering/renderengine_lua.inl b/src/rendering/renderengine_lua.inl index aeabab9664..9cccfbc654 100644 --- a/src/rendering/renderengine_lua.inl +++ b/src/rendering/renderengine_lua.inl @@ -23,10 +23,15 @@ ****************************************************************************************/ #include +#include +#include +#include namespace { -/// Will create a ScreenSpaceRenderable from a lua Table and add it in the RenderEngine +/** + * Will create a ScreenSpaceRenderable from a lua Table and add it in the RenderEngine. + */ [[codegen::luawrap]] void addScreenSpaceRenderable(ghoul::Dictionary screenSpace) { using namespace openspace; std::unique_ptr s = @@ -70,15 +75,17 @@ namespace { } /** -* Reset screenshot index to 0. -*/ + * Reset screenshot index to 0. + */ [[codegen::luawrap]] void resetScreenshotNumber() { using namespace openspace; global::renderEngine->resetScreenshotNumber(); } -// Extracts the DPI scaling for either the GUI window or if there is no dedicated GUI -// window, the first window. +/** + * Extracts the DPI scaling for either the GUI window or if there is no dedicated GUI + * window, the first window. + */ [[codegen::luawrap]] float dpiScaling() { return openspace::global::windowDelegate->osDpiScaling(); } diff --git a/src/rendering/screenspacerenderable.cpp b/src/rendering/screenspacerenderable.cpp index 094001fbc7..185c716aa7 100644 --- a/src/rendering/screenspacerenderable.cpp +++ b/src/rendering/screenspacerenderable.cpp @@ -26,7 +26,6 @@ #include #include -#include #include #include #include @@ -35,12 +34,19 @@ #include #include #include +#include +#include #include #include #include #include +#include +#include #include #include +#include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { diff --git a/src/rendering/screenspacerenderableframebuffer.cpp b/src/rendering/screenspacerenderableframebuffer.cpp index fb530835a8..9cca414280 100644 --- a/src/rendering/screenspacerenderableframebuffer.cpp +++ b/src/rendering/screenspacerenderableframebuffer.cpp @@ -27,10 +27,11 @@ #include #include #include -#include +#include +#include #include -#include -#include +#include +#include namespace { constexpr openspace::properties::Property::PropertyInfo SizeInfo = { @@ -91,7 +92,7 @@ void ScreenSpaceRenderableFramebuffer::deinitializeGL() { ghoul::opengl::FramebufferObject::deactivate(); removeAllRenderFunctions(); - ScreenSpaceRenderableFramebuffer::deinitializeGL(); + ScreenSpaceRenderable::deinitializeGL(); } void ScreenSpaceRenderableFramebuffer::render(const RenderData& renderData) { diff --git a/src/rendering/screenspacerenderabletext.cpp b/src/rendering/screenspacerenderabletext.cpp index 9986ec9cf1..45ddea377a 100644 --- a/src/rendering/screenspacerenderabletext.cpp +++ b/src/rendering/screenspacerenderabletext.cpp @@ -25,13 +25,14 @@ #include #include -#include #include #include #include #include #include #include +#include +#include #include namespace { diff --git a/src/rendering/texturecomponent.cpp b/src/rendering/texturecomponent.cpp index 6f80abd8b0..b0d355acbc 100644 --- a/src/rendering/texturecomponent.cpp +++ b/src/rendering/texturecomponent.cpp @@ -25,9 +25,11 @@ #include #include -#include #include #include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "TextureComponent"; diff --git a/src/rendering/transferfunction.cpp b/src/rendering/transferfunction.cpp index 15b4e47f8a..db5862dc24 100644 --- a/src/rendering/transferfunction.cpp +++ b/src/rendering/transferfunction.cpp @@ -28,13 +28,17 @@ #include #include #include +#include #include #include -#include +#include #include #include #include #include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "TransferFunction"; @@ -197,7 +201,7 @@ void TransferFunction::setTextureFromTxt() { _texture = std::make_unique( transferFunction, - glm::size3_t(width, 1, 1), + glm::uvec3(width, 1, 1), GL_TEXTURE_1D, ghoul::opengl::Texture::Format::RGBA, GL_RGBA, diff --git a/src/scene/asset.cpp b/src/scene/asset.cpp index c2f901d3fc..f815750685 100644 --- a/src/scene/asset.cpp +++ b/src/scene/asset.cpp @@ -25,16 +25,23 @@ #include #include +#include +#include +#include #include -#include -#include +#include #include #include -#include +#include +#include +#include +#include #include #include #include -#include +#include +#include +#include namespace openspace { @@ -184,6 +191,16 @@ bool Asset::hasInitializedParent() const { ); } +std::vector Asset::initializedParents() const { + std::vector parents; + for (const Asset* parent : _parentAssets) { + if (parent->isInitialized()) { + parents.push_back(parent->path()); + } + } + return parents; +} + bool Asset::isInitialized() const { return _state == State::Initialized; } @@ -284,6 +301,10 @@ void Asset::initialize() { } LDEBUG(std::format("Initializing asset '{}'", _assetPath)); + global::eventEngine->publishEvent( + _assetPath.string(), + events::EventAssetLoading::State::Loading + ); // 1. Initialize requirements for (Asset* child : _requiredAssets) { child->initialize(); @@ -308,6 +329,10 @@ void Asset::initialize() { // 3. Update state setState(State::Initialized); + global::eventEngine->publishEvent( + _assetPath.string(), + events::EventAssetLoading::State::Loaded + ); } void Asset::deinitialize() { diff --git a/src/scene/assetmanager.cpp b/src/scene/assetmanager.cpp index 723ba68f45..f5e9427d05 100644 --- a/src/scene/assetmanager.cpp +++ b/src/scene/assetmanager.cpp @@ -25,15 +25,23 @@ #include #include -#include #include #include #include #include +#include #include +#include #include +#include +#include +#include #include #include +#include +#include +#include +#include #include "assetmanager_lua.inl" @@ -230,10 +238,6 @@ void AssetManager::runAddQueue() { void AssetManager::update() { ZoneScoped; - - // Flag to keep track of when to emit synchronization event - const bool isLoadingAssets = !_toBeInitialized.empty(); - // Delete all the assets that have been marked for deletion in the previous frame { ZoneScopedN("Deleting assets"); @@ -303,11 +307,6 @@ void AssetManager::update() { it++; } } - - // If the _toBeInitialized state has changed in this update call we emit the event - if (isLoadingAssets && _toBeInitialized.empty()) { - global::eventEngine->publishEvent(); - } } void AssetManager::add(const std::string& path) { @@ -387,6 +386,10 @@ bool AssetManager::loadAsset(Asset* asset, Asset* parent) { } catch (const ghoul::lua::LuaRuntimeException& e) { LERROR(std::format("Could not load asset '{}': {}", asset->path(), e.message)); + global::eventEngine->publishEvent( + asset->path().string(), + events::EventAssetLoading::State::Error + ); return false; } catch (const ghoul::RuntimeError& e) { @@ -466,6 +469,10 @@ void AssetManager::unloadAsset(Asset* asset) { // might be painful _toBeDeleted.push_back(std::move(*it)); _assets.erase(it); + global::eventEngine->publishEvent( + asset->path().string(), + events::EventAssetLoading::State::Unloaded + ); } } @@ -964,6 +971,10 @@ void AssetManager::callOnInitialize(Asset* asset) const { for (const int init : it->second) { lua_rawgeti(*_luaState, LUA_REGISTRYINDEX, init); if (lua_pcall(*_luaState, 0, 0, 0) != LUA_OK) { + global::eventEngine->publishEvent( + asset->path().string(), + events::EventAssetLoading::State::Error + ); throw ghoul::lua::LuaRuntimeException(std::format( "When initializing '{}': {}", asset->path(), @@ -1058,7 +1069,8 @@ scripting::LuaLibrary AssetManager::luaLibrary() { codegen::lua::RemoveAll, codegen::lua::IsLoaded, codegen::lua::AllAssets, - codegen::lua::RootAssets + codegen::lua::RootAssets, + codegen::lua::Parents } }; } diff --git a/src/scene/assetmanager_lua.inl b/src/scene/assetmanager_lua.inl index 58c2d96cdf..b03260b798 100644 --- a/src/scene/assetmanager_lua.inl +++ b/src/scene/assetmanager_lua.inl @@ -22,6 +22,10 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include +#include +#include + namespace { /** @@ -108,6 +112,21 @@ namespace { return res; } +/** + * Returns the path to all parents that are still interested in this Asset e.g., through + * 'asset.require()' + */ +[[codegen::luawrap]] std::vector parents(std::string assetName) { + using namespace openspace; + std::vector as = global::openSpaceEngine->assetManager().allAssets(); + for (const Asset* a : as) { + if (a->path() == assetName) { + return a->initializedParents(); + } + } + return std::vector(); +} + #include "assetmanager_lua_codegen.cpp" } // namespace diff --git a/src/scene/lightsource.cpp b/src/scene/lightsource.cpp index e2d4fb036b..5638e1354d 100644 --- a/src/scene/lightsource.cpp +++ b/src/scene/lightsource.cpp @@ -25,14 +25,11 @@ #include #include -#include #include -#include -#include -#include #include #include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { diff --git a/src/scene/profile.cpp b/src/scene/profile.cpp index cb7970720c..8393f68bc0 100644 --- a/src/scene/profile.cpp +++ b/src/scene/profile.cpp @@ -24,7 +24,6 @@ #include -#include #include #include #include @@ -32,18 +31,20 @@ #include #include #include -#include +#include #include -#include -#include #include -#include #include +#include +#include #include -#include -#include +#include #include +#include +#include +#include #include +#include #include "profile_lua.inl" @@ -122,12 +123,12 @@ namespace { // Current version: // -void to_json(nlohmann::json& j, const Profile::Version& v) { +static void to_json(nlohmann::json& j, const Profile::Version& v) { j["major"] = v.major; j["minor"] = v.minor; } -void from_json(const nlohmann::json& j, Profile::Version& v) { +static void from_json(const nlohmann::json& j, Profile::Version& v) { checkValue(j, "major", &nlohmann::json::is_number, "version", false); checkValue(j, "minor", &nlohmann::json::is_number, "version", false); checkExtraKeys(j, "version", { "major", "minor" }); @@ -136,7 +137,7 @@ void from_json(const nlohmann::json& j, Profile::Version& v) { j["minor"].get_to(v.minor); } -void to_json(nlohmann::json& j, const Profile::Module& v) { +static void to_json(nlohmann::json& j, const Profile::Module& v) { j["name"] = v.name; if (v.loadedInstruction.has_value()) { j["loadedInstruction"] = *v.loadedInstruction; @@ -146,7 +147,7 @@ void to_json(nlohmann::json& j, const Profile::Module& v) { } } -void from_json(const nlohmann::json& j, Profile::Module& v) { +static void from_json(const nlohmann::json& j, Profile::Module& v) { checkValue(j, "name", &nlohmann::json::is_string, "module", false); checkValue(j, "loadedInstruction", &nlohmann::json::is_string, "module", true); checkValue(j, "notLoadedInstruction", &nlohmann::json::is_string, "module", true); @@ -161,7 +162,7 @@ void from_json(const nlohmann::json& j, Profile::Module& v) { } } -void to_json(nlohmann::json& j, const Profile::Meta& v) { +static void to_json(nlohmann::json& j, const Profile::Meta& v) { if (v.name.has_value()) { j["name"] = *v.name; } @@ -182,7 +183,7 @@ void to_json(nlohmann::json& j, const Profile::Meta& v) { } } -void from_json(const nlohmann::json& j, Profile::Meta& v) { +static void from_json(const nlohmann::json& j, Profile::Meta& v) { checkValue(j, "name", &nlohmann::json::is_string, "meta", true); checkValue(j, "version", &nlohmann::json::is_string, "meta", true); checkValue(j, "description", &nlohmann::json::is_string, "meta", true); @@ -215,7 +216,7 @@ void from_json(const nlohmann::json& j, Profile::Meta& v) { } } -void to_json(nlohmann::json& j, const Profile::Property::SetType& v) { +static void to_json(nlohmann::json& j, const Profile::Property::SetType& v) { j = [](Profile::Property::SetType t) { switch (t) { case Profile::Property::SetType::SetPropertyValue: @@ -228,7 +229,7 @@ void to_json(nlohmann::json& j, const Profile::Property::SetType& v) { }(v); } -void from_json(const nlohmann::json& j, Profile::Property::SetType& v) { +static void from_json(const nlohmann::json& j, Profile::Property::SetType& v) { const std::string value = j.get(); if (value == "setPropertyValue") { v = Profile::Property::SetType::SetPropertyValue; @@ -243,13 +244,13 @@ void from_json(const nlohmann::json& j, Profile::Property::SetType& v) { } } -void to_json(nlohmann::json& j, const Profile::Property& v) { +static void to_json(nlohmann::json& j, const Profile::Property& v) { j["type"] = v.setType; j["name"] = v.name; j["value"] = v.value; } -void from_json(const nlohmann::json& j, Profile::Property& v) { +static void from_json(const nlohmann::json& j, Profile::Property& v) { checkValue(j, "type", &nlohmann::json::is_string, "property", false); checkValue(j, "name", &nlohmann::json::is_string, "property", false); checkValue(j, "value", &nlohmann::json::is_string, "property", false); @@ -260,7 +261,7 @@ void from_json(const nlohmann::json& j, Profile::Property& v) { j["value"].get_to(v.value); } -void to_json(nlohmann::json& j, const Profile::Action& v) { +static void to_json(nlohmann::json& j, const Profile::Action& v) { j["identifier"] = v.identifier; j["documentation"] = v.documentation; j["name"] = v.name; @@ -269,7 +270,7 @@ void to_json(nlohmann::json& j, const Profile::Action& v) { j["script"] = v.script; } -void from_json(const nlohmann::json& j, Profile::Action& v) { +static void from_json(const nlohmann::json& j, Profile::Action& v) { checkValue(j, "identifier", &nlohmann::json::is_string, "action", false); checkValue(j, "documentation", &nlohmann::json::is_string, "action", false); checkValue(j, "name", &nlohmann::json::is_string, "action", false); @@ -290,12 +291,12 @@ void from_json(const nlohmann::json& j, Profile::Action& v) { j["script"].get_to(v.script); } -void to_json(nlohmann::json& j, const Profile::Keybinding& v) { +static void to_json(nlohmann::json& j, const Profile::Keybinding& v) { j["key"] = keyToString(v.key); j["action"] = v.action; } -void from_json(const nlohmann::json& j, Profile::Keybinding& v) { +static void from_json(const nlohmann::json& j, Profile::Keybinding& v) { checkValue(j, "key", &nlohmann::json::is_string, "keybinding", false); checkValue(j, "action", &nlohmann::json::is_string, "keybinding", false); checkExtraKeys(j, "keybinding", { "key", "action" }); @@ -304,7 +305,7 @@ void from_json(const nlohmann::json& j, Profile::Keybinding& v) { j["action"].get_to(v.action); } -void to_json(nlohmann::json& j, const Profile::Time::Type& v) { +static void to_json(nlohmann::json& j, const Profile::Time::Type& v) { j = [](Profile::Time::Type t) { switch (t) { case Profile::Time::Type::Absolute: return "absolute"; @@ -314,7 +315,7 @@ void to_json(nlohmann::json& j, const Profile::Time::Type& v) { }(v); } -void from_json(const nlohmann::json& j, Profile::Time::Type& v) { +static void from_json(const nlohmann::json& j, Profile::Time::Type& v) { const std::string value = j.get(); if (value == "absolute") { v = Profile::Time::Type::Absolute; @@ -329,13 +330,13 @@ void from_json(const nlohmann::json& j, Profile::Time::Type& v) { } } -void to_json(nlohmann::json& j, const Profile::Time& v) { +static void to_json(nlohmann::json& j, const Profile::Time& v) { j["type"] = v.type; j["value"] = v.value; j["is_paused"] = v.startPaused; } -void from_json(const nlohmann::json& j, Profile::Time& v) { +static void from_json(const nlohmann::json& j, Profile::Time& v) { checkValue(j, "type", &nlohmann::json::is_string, "time", false); checkValue(j, "value", &nlohmann::json::is_string, "time", false); checkValue(j, "is_paused", &nlohmann::json::is_boolean, "time", false); @@ -346,7 +347,7 @@ void from_json(const nlohmann::json& j, Profile::Time& v) { j["is_paused"].get_to(v.startPaused); } -void to_json(nlohmann::json& j, const Profile::CameraGoToNode& v) { +static void to_json(nlohmann::json& j, const Profile::CameraGoToNode& v) { j["type"] = Profile::CameraGoToNode::Type; j["anchor"] = v.anchor; if (v.height.has_value()) { @@ -354,7 +355,7 @@ void to_json(nlohmann::json& j, const Profile::CameraGoToNode& v) { } } -void from_json(const nlohmann::json& j, Profile::CameraGoToNode& v) { +static void from_json(const nlohmann::json& j, Profile::CameraGoToNode& v) { ghoul_assert( j.at("type").get() == Profile::CameraGoToNode::Type, "Wrong type for Camera" @@ -374,7 +375,7 @@ void from_json(const nlohmann::json& j, Profile::CameraGoToNode& v) { } } -void to_json(nlohmann::json& j, const Profile::CameraNavState& v) { +static void to_json(nlohmann::json& j, const Profile::CameraNavState& v) { j["type"] = Profile::CameraNavState::Type; j["anchor"] = v.anchor; if (v.aim.has_value()) { @@ -403,7 +404,7 @@ void to_json(nlohmann::json& j, const Profile::CameraNavState& v) { } } -void from_json(const nlohmann::json& j, Profile::CameraNavState& v) { +static void from_json(const nlohmann::json& j, Profile::CameraNavState& v) { ghoul_assert( j.at("type").get() == Profile::CameraNavState::Type, "Wrong type for Camera" @@ -460,7 +461,7 @@ void from_json(const nlohmann::json& j, Profile::CameraNavState& v) { } } -void to_json(nlohmann::json& j, const Profile::CameraGoToGeo& v) { +static void to_json(nlohmann::json& j, const Profile::CameraGoToGeo& v) { j["type"] = Profile::CameraGoToGeo::Type; j["anchor"] = v.anchor; j["latitude"] = v.latitude; @@ -470,7 +471,7 @@ void to_json(nlohmann::json& j, const Profile::CameraGoToGeo& v) { } } -void from_json(const nlohmann::json& j, Profile::CameraGoToGeo& v) { +static void from_json(const nlohmann::json& j, Profile::CameraGoToGeo& v) { ghoul_assert( j.at("type").get() == Profile::CameraGoToGeo::Type, "Wrong type for Camera" @@ -508,7 +509,7 @@ struct Keybinding { std::string script; }; -void from_json(const nlohmann::json& j, version10::Keybinding& v) { +static void from_json(const nlohmann::json& j, version10::Keybinding& v) { checkValue(j, "key", &nlohmann::json::is_string, "keybinding", false); checkValue(j, "documentation", &nlohmann::json::is_string, "keybinding", false); checkValue(j, "name", &nlohmann::json::is_string, "keybinding", false); @@ -561,7 +562,7 @@ void from_json(const nlohmann::json& j, version10::Keybinding& v) { j["script"].get_to(v.script); } -void convertVersion10to11(nlohmann::json& profile) { +static void convertVersion10to11(nlohmann::json& profile) { // Version 1.1 introduced actions and remove Lua function calling from keybindings profile["version"] = Profile::Version{ 1, 1 }; @@ -602,7 +603,7 @@ void convertVersion10to11(nlohmann::json& profile) { namespace version11 { -void convertVersion11to12(nlohmann::json& profile) { +static void convertVersion11to12(nlohmann::json& profile) { // Version 1.2 introduced a state whether the delta time starts out as paused profile["version"] = Profile::Version{ 1, 2 }; @@ -616,7 +617,7 @@ void convertVersion11to12(nlohmann::json& profile) { namespace version12 { -void convertVersion12to13(nlohmann::json& profile) { +static void convertVersion12to13(nlohmann::json& profile) { // Version 1.3 introduced to GoToNode camera initial position profile["version"] = Profile::Version{ 1, 3 }; } @@ -625,7 +626,7 @@ void convertVersion12to13(nlohmann::json& profile) { namespace version13 { -void convertVersion13to14(nlohmann::json& profile) { +static void convertVersion13to14(nlohmann::json& profile) { // Version 1.4 introduced the ui panel view profile["version"] = Profile::Version{ 1, 4 }; } diff --git a/src/scene/profile_lua.inl b/src/scene/profile_lua.inl index a2af7588f8..7cd36fb6fd 100644 --- a/src/scene/profile_lua.inl +++ b/src/scene/profile_lua.inl @@ -22,6 +22,8 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include +#include #include namespace { diff --git a/src/scene/rotation.cpp b/src/scene/rotation.cpp index 8ef010c9b5..9d966e0d5b 100644 --- a/src/scene/rotation.cpp +++ b/src/scene/rotation.cpp @@ -25,15 +25,14 @@ #include #include -#include #include #include #include #include #include -#include #include -#include +#include +#include namespace { // A `Rotation` object describes a specific rotation for a scene graph node, which may diff --git a/src/scene/scale.cpp b/src/scene/scale.cpp index aec649c5c6..5cbb5969b3 100644 --- a/src/scene/scale.cpp +++ b/src/scene/scale.cpp @@ -25,14 +25,13 @@ #include #include -#include #include #include #include #include -#include #include -#include +#include +#include namespace { struct [[codegen::Dictionary(Scale)]] Parameters { diff --git a/src/scene/scene.cpp b/src/scene/scene.cpp index 2874a3befa..6350858915 100644 --- a/src/scene/scene.cpp +++ b/src/scene/scene.cpp @@ -25,17 +25,35 @@ #include #include +#include #include +#include #include #include -#include +#include #include #include +#include #include #include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include +#include +#include #include "scene_lua.inl" @@ -495,7 +513,7 @@ void Scene::render(const RenderData& data, RendererTasks& tasks) { ZoneScoped; ZoneText( renderBinToString(data.renderBinMask), - strlen(renderBinToString(data.renderBinMask)) + std::strlen(renderBinToString(data.renderBinMask)) ); for (SceneGraphNode* node : _topologicallySortedNodes) { @@ -524,10 +542,6 @@ void Scene::render(const RenderData& data, RendererTasks& tasks) { } } -const std::unordered_map& Scene::nodesByIdentifier() const { - return _nodesByIdentifier; -} - SceneGraphNode* Scene::root() { return &_rootNode; } @@ -536,7 +550,7 @@ const SceneGraphNode* Scene::root() const { return &_rootNode; } -SceneGraphNode* Scene::sceneGraphNode(const std::string& name) const { +SceneGraphNode* Scene::sceneGraphNode(std::string_view name) const { const auto it = _nodesByIdentifier.find(name); if (it != _nodesByIdentifier.end()) { return it->second; diff --git a/src/scene/scene_lua.inl b/src/scene/scene_lua.inl index 73fc188d0e..73d8155027 100644 --- a/src/scene/scene_lua.inl +++ b/src/scene/scene_lua.inl @@ -27,12 +27,14 @@ #include #include #include +#include #include #include #include #include #include #include +#include #include #include #include @@ -54,12 +56,18 @@ #include #include #include +#include #include #include #include +#include +#include +#include #include #include -#include +#include +#include +#include namespace { @@ -232,7 +240,7 @@ bool checkUriMatchFromRegexResults(std::string_view uri, ) { const bool isGroupMode = !groupTag.empty(); - auto [parentUri, identifier, isLiteral] = regexResults; + auto& [parentUri, identifier, isLiteral] = regexResults; // Literal check if (isLiteral && uri != identifier) { @@ -300,7 +308,9 @@ std::vector findMatchesInAllProperties( std::mutex mutex; std::for_each( +#ifndef __APPLE__ std::execution::par_unseq, +#endif // __APPLE__ properties.cbegin(), properties.cend(), [&](Property* prop) { @@ -348,13 +358,15 @@ std::vector findMatchesInAllPropertyOwner std::mutex mutex; std::for_each( +#ifndef __APPLE__ std::execution::par_unseq, +#endif // __APPLE__ propertyOwners.cbegin(), propertyOwners.cend(), [&](PropertyOwner* propOwner) { if (inputIsOnlyTag) { // If we only got a tag as input, the result is all owners that directly - // match the group tag (without looking recusively in parent owners) + // match the group tag (without looking recursively in parent owners) if (!ownerMatchesGroupTag(propOwner, groupTag, false)) { return; } diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index 614fe5747a..ffe720baf6 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -27,20 +27,32 @@ #include #include #include +#include #include #include -#include #include #include #include #include +#include +#include #include #include +#include #include #include #include #include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "SceneGraphNode"; diff --git a/src/scene/sceneinitializer.cpp b/src/scene/sceneinitializer.cpp index ba49a58c05..7bc097fe2f 100644 --- a/src/scene/sceneinitializer.cpp +++ b/src/scene/sceneinitializer.cpp @@ -29,6 +29,11 @@ #include #include #include +#include +#include +#include +#include +#include namespace openspace { diff --git a/src/scene/timeframe.cpp b/src/scene/timeframe.cpp index 5ac3683bda..c5ced4b180 100644 --- a/src/scene/timeframe.cpp +++ b/src/scene/timeframe.cpp @@ -25,14 +25,11 @@ #include #include -#include -#include #include -#include -#include -#include #include +#include #include +#include namespace { constexpr openspace::properties::Property::PropertyInfo IsInTimeFrameInfo = { diff --git a/src/scene/translation.cpp b/src/scene/translation.cpp index b203161ceb..c74fdec0c8 100644 --- a/src/scene/translation.cpp +++ b/src/scene/translation.cpp @@ -24,14 +24,18 @@ #include -#include +#include #include +#include #include #include #include -#include #include -#include +#include +#include +#include +#include +#include namespace { struct [[codegen::Dictionary(Translation)]] Parameters { diff --git a/src/scripting/lualibrary.cpp b/src/scripting/lualibrary.cpp index 89c9f7c2a1..3e92f65e7f 100644 --- a/src/scripting/lualibrary.cpp +++ b/src/scripting/lualibrary.cpp @@ -24,7 +24,10 @@ #include +#include #include +#include +#include namespace openspace::scripting { diff --git a/src/scripting/scriptengine.cpp b/src/scripting/scriptengine.cpp index 44ba6fb1f6..2d3aa9f35b 100644 --- a/src/scripting/scriptengine.cpp +++ b/src/scripting/scriptengine.cpp @@ -28,19 +28,22 @@ #include #include #include -#include #include #include #include -#include -#include #include +#include #include +#include #include +#include +#include #include -#include +#include #include #include +#include +#include #include "scriptengine_lua.inl" diff --git a/src/scripting/scriptengine_lua.inl b/src/scripting/scriptengine_lua.inl index 699823fd6a..31cb80e159 100644 --- a/src/scripting/scriptengine_lua.inl +++ b/src/scripting/scriptengine_lua.inl @@ -22,6 +22,10 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include +#include +#include + namespace openspace::luascriptfunctions { int printInternal(ghoul::logging::LogLevel level, lua_State* L) { diff --git a/src/scripting/scriptscheduler.cpp b/src/scripting/scriptscheduler.cpp index 2114910be1..7fe83cc455 100644 --- a/src/scripting/scriptscheduler.cpp +++ b/src/scripting/scriptscheduler.cpp @@ -25,11 +25,15 @@ #include #include -#include #include +#include #include #include -#include +#include +#include +#include +#include +#include #include "scriptscheduler_lua.inl" diff --git a/src/scripting/scriptscheduler_lua.inl b/src/scripting/scriptscheduler_lua.inl index 3f115fc6be..bdb86f64e3 100644 --- a/src/scripting/scriptscheduler_lua.inl +++ b/src/scripting/scriptscheduler_lua.inl @@ -26,7 +26,9 @@ namespace { -// Load timed scripts from a Lua script file that returns a list of scheduled scripts. +/** + * Load timed scripts from a Lua script file that returns a list of scheduled scripts. + */ [[codegen::luawrap]] void loadFile(std::string fileName) { using namespace openspace; @@ -80,12 +82,16 @@ namespace { global::scriptScheduler->loadScripts(scripts); } -// Clears all scheduled scripts. +/** + * Clears all scheduled scripts. + */ [[codegen::luawrap]] void clear(std::optional group) { openspace::global::scriptScheduler->clearSchedule(group); } -// Returns the list of all scheduled scripts +/** + * Returns the list of all scheduled scripts. + */ [[codegen::luawrap]] std::vector scheduledScripts() { using namespace openspace; diff --git a/src/scripting/systemcapabilitiesbinding.cpp b/src/scripting/systemcapabilitiesbinding.cpp index 26a3e081e2..19cc42159a 100644 --- a/src/scripting/systemcapabilitiesbinding.cpp +++ b/src/scripting/systemcapabilitiesbinding.cpp @@ -25,11 +25,6 @@ #include #include -#include -#include -#include -#include -#include #include "systemcapabilitiesbinding_lua.inl" diff --git a/src/scripting/systemcapabilitiesbinding_lua.inl b/src/scripting/systemcapabilitiesbinding_lua.inl index a075e5199b..1311e38a35 100644 --- a/src/scripting/systemcapabilitiesbinding_lua.inl +++ b/src/scripting/systemcapabilitiesbinding_lua.inl @@ -23,6 +23,15 @@ ****************************************************************************************/ #include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace { diff --git a/src/util/blockplaneintersectiongeometry.cpp b/src/util/blockplaneintersectiongeometry.cpp index de4d6a4728..a4bac67c4c 100644 --- a/src/util/blockplaneintersectiongeometry.cpp +++ b/src/util/blockplaneintersectiongeometry.cpp @@ -25,8 +25,10 @@ #include #include -#include #include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "BlockPlaneIntersectionGeometry"; diff --git a/src/util/boxgeometry.cpp b/src/util/boxgeometry.cpp index 524d29cb84..2cd0057c77 100644 --- a/src/util/boxgeometry.cpp +++ b/src/util/boxgeometry.cpp @@ -24,9 +24,8 @@ #include -#include -#include -#include +#include +#include namespace openspace { diff --git a/src/util/collisionhelper.cpp b/src/util/collisionhelper.cpp index b599beb4d2..2fef716127 100644 --- a/src/util/collisionhelper.cpp +++ b/src/util/collisionhelper.cpp @@ -24,7 +24,8 @@ #include -#include +#include +#include namespace openspace::collision { diff --git a/src/util/coordinateconversion.cpp b/src/util/coordinateconversion.cpp index 8d3385ecc8..5679e22a7b 100644 --- a/src/util/coordinateconversion.cpp +++ b/src/util/coordinateconversion.cpp @@ -26,7 +26,10 @@ #include #include -#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "Coordinateconversion"; diff --git a/src/util/distanceconversion.cpp b/src/util/distanceconversion.cpp index 67b10deba6..d4329edd74 100644 --- a/src/util/distanceconversion.cpp +++ b/src/util/distanceconversion.cpp @@ -26,8 +26,7 @@ #include #include - -#include +#include namespace openspace { @@ -36,7 +35,7 @@ std::pair simplifyDistance(double meters, { constexpr double GraceFactor = 0.5; - const double metersVal = glm::abs(meters); + const double metersVal = std::abs(meters); if (metersVal == 0.0) { return { 0.0, forceSingularForm ? "meter" : "meters"}; diff --git a/src/util/downloadeventengine.cpp b/src/util/downloadeventengine.cpp new file mode 100644 index 0000000000..1b2bc7d1ae --- /dev/null +++ b/src/util/downloadeventengine.cpp @@ -0,0 +1,64 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2025 * + * * + * 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. * + ****************************************************************************************/ + +#include + +#include + +namespace openspace { + +int DownloadEventEngine::subscribe(Callback cb) { + std::lock_guard lock(_mutex); + int id = _id++; + _subscribers[id] = std::move(cb); + return id; +} + +void DownloadEventEngine::unsubscribe(int id) { + std::lock_guard lock(_mutex); + _subscribers.erase(id); +} + +void DownloadEventEngine::publish(const DownloadEvent& event) { + std::lock_guard lock(_mutex); + for (auto& [_, callback] : _subscribers) { + callback(event); + } +} + +void DownloadEventEngine::publish(const std::string& id, DownloadEvent::Type type, + int64_t downloadedBytes, + std::optional totalBytes) +{ + const DownloadEvent event = { + .type = type, + .id = id, + .downloadedBytes = downloadedBytes, + .totalBytes = totalBytes + }; + + publish(event); +} + +} // namespace openspace diff --git a/src/util/dynamicfilesequencedownloader.cpp b/src/util/dynamicfilesequencedownloader.cpp index 357728ce7c..3266c41821 100644 --- a/src/util/dynamicfilesequencedownloader.cpp +++ b/src/util/dynamicfilesequencedownloader.cpp @@ -24,12 +24,26 @@ #include -#include #include -#include +#include +#include #include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include +#include #include +#include namespace { constexpr std::string_view _loggerCat = "DynamicFileSequenceDownloader"; @@ -136,7 +150,7 @@ DynamicFileSequenceDownloader::DynamicFileSequenceDownloader(int dataID, requestAvailableFiles(httpDataRequest, _syncDir); } -void DynamicFileSequenceDownloader::deinitialize(bool cacheFiles) { +void DynamicFileSequenceDownloader::deinitialize(bool cacheFiles) const { const std::vector& currentlyDownloadingFiles = filesCurrentlyDownloading(); for (File* file : currentlyDownloadingFiles) { file->download->cancel(); @@ -338,7 +352,7 @@ void DynamicFileSequenceDownloader::requestAvailableFiles(std::string httpDataRe fileElement.state = File::State::Available; } _availableData.push_back(std::move(fileElement)); - ++index; + index++; } const double cadence = calculateCadence(); @@ -446,7 +460,7 @@ void DynamicFileSequenceDownloader::checkForFinishedDownloads() { } // The file is not finished downloading, move on to next else { - ++currentIt; + currentIt++; } // Since in the if statement one is removed and else statement it got incremented, diff --git a/src/util/ellipsoid.cpp b/src/util/ellipsoid.cpp index f1a973fc33..d5416cbdb3 100644 --- a/src/util/ellipsoid.cpp +++ b/src/util/ellipsoid.cpp @@ -27,7 +27,9 @@ #include #include #include -#include +#include +#include +#include namespace { constexpr size_t MaxIterations = 8; @@ -83,7 +85,7 @@ glm::dvec3 Ellipsoid::geodeticSurfaceProjection(const glm::dvec3& p) const { s = glm::dot(p2 / (_cached.radiiSquared * d2), glm::dvec3(1.0)) - 1.0; dSdA = -2.0 * glm::dot(p2 / (_cached.radiiToTheFourth * d3), glm::dvec3(1.0)); - ++nIterations; + nIterations++; } while (std::abs(s) > Epsilon && nIterations < MaxIterations); diff --git a/src/util/factorymanager.cpp b/src/util/factorymanager.cpp index 3f02d0d809..5c4b207ba9 100644 --- a/src/util/factorymanager.cpp +++ b/src/util/factorymanager.cpp @@ -24,8 +24,6 @@ #include -#include -#include #include #include #include @@ -36,7 +34,8 @@ #include #include #include -#include +#include +#include namespace openspace { diff --git a/src/util/geodetic.cpp b/src/util/geodetic.cpp index 2648285a72..e7fa193ee8 100644 --- a/src/util/geodetic.cpp +++ b/src/util/geodetic.cpp @@ -27,10 +27,12 @@ #include #include #include +#include #include +#include #include #include -#include +#include namespace openspace { @@ -133,7 +135,7 @@ glm::dvec3 geoViewFromCamera() { glm::normalize(cameraPositionModelSpace), glm::normalize(glm::transpose(rotationOnly) * cameraViewDirection) ); - + const SurfacePositionHandle posHandle = n->calculateSurfacePositionHandle( cameraViewDirectionModelSpace ); diff --git a/src/util/histogram.cpp b/src/util/histogram.cpp index 3628934076..04ca696fda 100644 --- a/src/util/histogram.cpp +++ b/src/util/histogram.cpp @@ -26,7 +26,10 @@ #include #include +#include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "Histogram"; @@ -203,7 +206,7 @@ const float* Histogram::data() const { std::vector> Histogram::getDecimated(int) const { // Return a copy of _data decimated as in Ljung 2004 - return std::vector>(); + return std::vector>(); } void Histogram::normalize() { @@ -316,7 +319,7 @@ float Histogram::highestBinValue(bool equalized, int overBins) { } value += _data[i]; - value /= static_cast(++num); + value /= static_cast(num + 1); if (value > highestValue) { highestBin = i; @@ -329,7 +332,7 @@ float Histogram::highestBinValue(bool equalized, int overBins) { const float low = _minValue + static_cast(highestBin) / _numBins * (_maxValue - _minValue); const float high = low + (_maxValue - _minValue) / static_cast(_numBins); - return (high+low) / 2.f; + return (high + low) / 2.f; } else { return highestBin / static_cast(_numBins); diff --git a/src/util/httprequest.cpp b/src/util/httprequest.cpp index b5237521f2..7214bb07de 100644 --- a/src/util/httprequest.cpp +++ b/src/util/httprequest.cpp @@ -24,12 +24,13 @@ #include -#include -#include #include #include #include +#include #include +#include +#include namespace openspace { @@ -253,8 +254,6 @@ bool HttpDownload::teardown() { return true; } - - std::atomic_int HttpFileDownload::nCurrentFileHandles = 0; std::mutex HttpFileDownload::_directoryCreationMutex; diff --git a/src/util/json_helper.cpp b/src/util/json_helper.cpp index 11c05d8655..4d0b986fb4 100644 --- a/src/util/json_helper.cpp +++ b/src/util/json_helper.cpp @@ -24,7 +24,12 @@ #include +#include +#include +#include #include +#include +#include namespace openspace { @@ -86,7 +91,7 @@ std::string formatJsonNumber(double d) { return std::format("{}", d); } -void sortJson(nlohmann::json& json, const std::string& key) { +void sortJson(nlohmann::json& json, std::string_view key) { std::sort( json.begin(), json.end(), diff --git a/src/util/keys.cpp b/src/util/keys.cpp index a278136152..e332d5385b 100644 --- a/src/util/keys.cpp +++ b/src/util/keys.cpp @@ -25,7 +25,6 @@ #include #include -#include #include #include #include diff --git a/src/util/openspacemodule.cpp b/src/util/openspacemodule.cpp index 1d0afdb34d..0b5d80b699 100644 --- a/src/util/openspacemodule.cpp +++ b/src/util/openspacemodule.cpp @@ -32,8 +32,9 @@ #include #include #include -#include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "OpenSpaceModule"; diff --git a/src/util/planegeometry.cpp b/src/util/planegeometry.cpp index ce1bed4e43..56cdd2850e 100644 --- a/src/util/planegeometry.cpp +++ b/src/util/planegeometry.cpp @@ -24,9 +24,9 @@ #include -#include -#include -#include +#include +#include +#include namespace openspace { @@ -59,11 +59,11 @@ void PlaneGeometry::updateSize(const glm::vec2& size) { updateGeometry(); } -void PlaneGeometry::updateSize(const float size) { +void PlaneGeometry::updateSize(float size) { updateSize(glm::vec2(size)); } -void PlaneGeometry::updateGeometry() { +void PlaneGeometry::updateGeometry() const { const glm::vec2 size = _size; struct VertexData { GLfloat x; diff --git a/src/util/progressbar.cpp b/src/util/progressbar.cpp index 4251da9853..4c9d2aae99 100644 --- a/src/util/progressbar.cpp +++ b/src/util/progressbar.cpp @@ -25,6 +25,7 @@ #include #include +#include namespace openspace { diff --git a/src/util/resourcesynchronization.cpp b/src/util/resourcesynchronization.cpp index ecf6b6e3da..6ac5a6f4be 100644 --- a/src/util/resourcesynchronization.cpp +++ b/src/util/resourcesynchronization.cpp @@ -24,11 +24,13 @@ #include -#include +#include #include +#include #include #include #include +#include namespace { struct [[codegen::Dictionary(ResourceSynchronization)]] Parameters { diff --git a/src/util/sphere.cpp b/src/util/sphere.cpp index 457bf9b7d6..72e7803f36 100644 --- a/src/util/sphere.cpp +++ b/src/util/sphere.cpp @@ -25,11 +25,12 @@ #include #include -#include +#include #include +#include namespace { - constexpr std::string_view _loggerCat = "PowerScaledSphere"; + constexpr std::string_view _loggerCat = "Sphere"; } // namespace namespace openspace { @@ -85,7 +86,7 @@ Sphere::Sphere(glm::vec3 radius, int segments) _varray[nr].tex[0] = t1; _varray[nr].tex[1] = t2; - ++nr; + nr++; } } @@ -95,18 +96,18 @@ Sphere::Sphere(glm::vec3 radius, int segments) for (int j = 0; j < segments; j++) { const int t = segments + 1; _iarray[nr] = t * (i - 1) + j + 0; //1 - ++nr; + nr++; _iarray[nr] = t * (i + 0) + j + 0; //2 - ++nr; + nr++; _iarray[nr] = t * (i + 0) + j + 1; //3 - ++nr; + nr++; _iarray[nr] = t * (i - 1) + j + 0; //4 - ++nr; + nr++; _iarray[nr] = t * (i + 0) + j + 1; //5 - ++nr; + nr++; _iarray[nr] = t * (i - 1) + j + 1; //6 - ++nr; + nr++; } } } diff --git a/src/util/spicemanager.cpp b/src/util/spicemanager.cpp index c8f1d3c3e4..71606eb710 100644 --- a/src/util/spicemanager.cpp +++ b/src/util/spicemanager.cpp @@ -24,19 +24,21 @@ #include -#include #include #include -#include -#include #include #include +#include #include #include +#include +#include +#include #include #include -#include "SpiceUsr.h" -#include "SpiceZpr.h" +#include +#include +#include #include "spicemanager_lua.inl" @@ -65,6 +67,25 @@ namespace { default: throw ghoul::MissingCaseException(); } } + + + void getValueInternal(const std::string& body, const std::string& value, int size, + double* v) + { + ghoul_assert(!body.empty(), "Empty body"); + ghoul_assert(!value.empty(), "Empty value"); + ghoul_assert(v != nullptr, "Empty value pointer"); + + SpiceInt n = 0; + bodvrd_c(body.c_str(), value.c_str(), size, &n, v); + + if (failed_c()) { + openspace::throwSpiceError(std::format( + "Error getting value '{}' for body '{}'", value, body + )); + } + } + } // namespace namespace openspace { @@ -538,23 +559,6 @@ bool SpiceManager::hasFrameId(const std::string& frame) const { return id != 0; } -void getValueInternal(const std::string& body, const std::string& value, int size, - double* v) -{ - ghoul_assert(!body.empty(), "Empty body"); - ghoul_assert(!value.empty(), "Empty value"); - ghoul_assert(v != nullptr, "Empty value pointer"); - - SpiceInt n = 0; - bodvrd_c(body.c_str(), value.c_str(), size, &n, v); - - if (failed_c()) { - throwSpiceError( - std::format("Error getting value '{}' for body '{}'", value, body) - ); - } -} - void SpiceManager::getValue(const std::string& body, const std::string& value, double& v) const { diff --git a/src/util/spicemanager_lua.inl b/src/util/spicemanager_lua.inl index 17ba0c9dfc..ede83808bf 100644 --- a/src/util/spicemanager_lua.inl +++ b/src/util/spicemanager_lua.inl @@ -22,8 +22,16 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include #include +#include +#include +#include #include +#include +#include +#include +#include namespace { diff --git a/src/util/syncable.cpp b/src/util/syncable.cpp new file mode 100644 index 0000000000..b9b587dbc2 --- /dev/null +++ b/src/util/syncable.cpp @@ -0,0 +1,33 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2025 * + * * + * 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. * + ****************************************************************************************/ + +#include + +namespace openspace { + +void Syncable::preSync(bool) {} + +void Syncable::postSync(bool) {} + +} // namespace openspace diff --git a/src/util/syncbuffer.cpp b/src/util/syncbuffer.cpp index 3a7b3836d0..f528e0440b 100644 --- a/src/util/syncbuffer.cpp +++ b/src/util/syncbuffer.cpp @@ -24,7 +24,11 @@ #include +#include #include +#include +#include +#include namespace openspace { @@ -45,13 +49,13 @@ void SyncBuffer::encode(const std::string& s) { } int32_t length = static_cast(s.size() * sizeof(char)); - memcpy( + std::memcpy( _dataStream.data() + _encodeOffset, reinterpret_cast(&length), sizeof(int32_t) ); _encodeOffset += sizeof(int32_t); - memcpy(_dataStream.data() + _encodeOffset, s.c_str(), length); + std::memcpy(_dataStream.data() + _encodeOffset, s.c_str(), length); _encodeOffset += length; } @@ -111,7 +115,6 @@ void SyncBuffer::setData(std::vector data) { std::vector SyncBuffer::data() { _dataStream.resize(_encodeOffset); - return _dataStream; } diff --git a/src/util/task.cpp b/src/util/task.cpp index 3c0d5e902c..8bd29f732f 100644 --- a/src/util/task.cpp +++ b/src/util/task.cpp @@ -25,10 +25,10 @@ #include #include -#include #include #include #include +#include namespace { diff --git a/src/util/taskloader.cpp b/src/util/taskloader.cpp index 0870045cdc..32a5d87bdc 100644 --- a/src/util/taskloader.cpp +++ b/src/util/taskloader.cpp @@ -26,14 +26,16 @@ #include #include -#include #include #include #include -#include +#include #include +#include #include #include +#include +#include namespace { constexpr std::string_view _loggerCat = "TaskRunner"; diff --git a/src/util/threadpool.cpp b/src/util/threadpool.cpp index d8ccccfd7d..4defbf2ee9 100644 --- a/src/util/threadpool.cpp +++ b/src/util/threadpool.cpp @@ -24,29 +24,31 @@ #include +#include + namespace openspace { -Worker::Worker(ThreadPool& p) : pool(p) {} +Worker::Worker(ThreadPool& p) : _pool(p) {} void Worker::operator()() { std::function task; while (true) { { - std::unique_lock lock(pool.queue_mutex); + std::unique_lock lock(_pool._queueMutex); // look for a work item - while (!pool.stop && pool.tasks.empty()) { + while (!_pool._shouldStop && _pool._tasks.empty()) { // if there are none wait for notification - pool.condition.wait(lock); + _pool._condition.wait(lock); } - if (pool.stop) { // exit if the pool is stopped + if (_pool._shouldStop) { // exit if the pool is stopped return; } // get the task from the queue - task = pool.tasks.front(); - pool.tasks.pop_front(); + task = _pool._tasks.front(); + _pool._tasks.pop_front(); } // execute the task @@ -54,25 +56,25 @@ void Worker::operator()() { } } -ThreadPool::ThreadPool(size_t numThreads) : stop(false) { +ThreadPool::ThreadPool(size_t numThreads) { for (size_t i = 0; i < numThreads; i++) { - workers.emplace_back(Worker(*this)); + _workers.emplace_back(Worker(*this)); } } -ThreadPool::ThreadPool(const ThreadPool& toCopy) : ThreadPool(toCopy.workers.size()) {} +ThreadPool::ThreadPool(const ThreadPool& toCopy) : ThreadPool(toCopy._workers.size()) {} // the destructor joins all threads ThreadPool::~ThreadPool() { // stop all threads { - const std::unique_lock lock(queue_mutex); - stop = true; + const std::unique_lock lock(_queueMutex); + _shouldStop = true; } - condition.notify_all(); + _condition.notify_all(); // join them - for (std::thread& w : workers) { + for (std::thread& w : _workers) { w.join(); } } @@ -80,23 +82,23 @@ ThreadPool::~ThreadPool() { // add new work item to the pool void ThreadPool::enqueue(std::function f) { { - const std::unique_lock lock(queue_mutex); + const std::unique_lock lock(_queueMutex); // add the task - tasks.push_back(std::move(f)); + _tasks.push_back(std::move(f)); } // wake up one thread - condition.notify_one(); + _condition.notify_one(); } void ThreadPool::clearTasks() { - const std::unique_lock lock(queue_mutex); - tasks.clear(); + const std::unique_lock lock(_queueMutex); + _tasks.clear(); } bool ThreadPool::hasOutstandingTasks() const { - return !tasks.empty(); + return !_tasks.empty(); } } // namespace openspace diff --git a/src/util/time.cpp b/src/util/time.cpp index 3dcf06894f..2a28d56fbf 100644 --- a/src/util/time.cpp +++ b/src/util/time.cpp @@ -24,27 +24,20 @@ #include -#include #include -#include -#include -#include -#include -#include -#include +#include #include #include -#include #include -#include -#include #include #include +#include #include #include +#include #include +#include #include -#include #include #include "time_lua.inl" diff --git a/src/util/time_lua.inl b/src/util/time_lua.inl index f8a6a00904..8557b952fd 100644 --- a/src/util/time_lua.inl +++ b/src/util/time_lua.inl @@ -22,9 +22,18 @@ * OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. * ****************************************************************************************/ +#include +#include +#include +#include +#include #include -#include -#include +#include +#include +#include +#include +#include +#include namespace { diff --git a/src/util/timeconversion.cpp b/src/util/timeconversion.cpp index 0084a1380c..6078ab4d3f 100644 --- a/src/util/timeconversion.cpp +++ b/src/util/timeconversion.cpp @@ -24,15 +24,14 @@ #include -#include - -#include +#include +#include namespace { std::pair extractUnit(double seconds) { using namespace openspace; - const double secondsVal = glm::abs(seconds); + const double secondsVal = std::abs(seconds); if (secondsVal == 0.0) { return { 0.0, TimeUnit::Second }; diff --git a/src/util/timemanager.cpp b/src/util/timemanager.cpp index e5adf07cfb..f3d3b8743c 100644 --- a/src/util/timemanager.cpp +++ b/src/util/timemanager.cpp @@ -27,15 +27,27 @@ #include #include #include +#include #include #include #include -#include +#include #include #include #include +#include #include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "TimeManager"; diff --git a/src/util/timerange.cpp b/src/util/timerange.cpp index a18826ee60..0035fed794 100644 --- a/src/util/timerange.cpp +++ b/src/util/timerange.cpp @@ -25,10 +25,9 @@ #include #include -#include #include - #include +#include namespace { struct [[codegen::Dictionary(TimeRange)]] Parameters { diff --git a/src/util/touch.cpp b/src/util/touch.cpp index 2f2c5bd4e2..ed627ce286 100644 --- a/src/util/touch.cpp +++ b/src/util/touch.cpp @@ -27,6 +27,7 @@ #include #include #include +#include namespace openspace { diff --git a/src/util/transformationmanager.cpp b/src/util/transformationmanager.cpp index f05b888f49..4f3a55210a 100644 --- a/src/util/transformationmanager.cpp +++ b/src/util/transformationmanager.cpp @@ -55,8 +55,8 @@ TransformationManager::TransformationManager() { ); #endif _kameleonFrames = { - "J2000", "GEI", "GEO", "MAG", "GSE", "GSM", "SM", "RTN", "GSEQ", //geocentric - "HEE", "HAE", "HEEQ" //heliocentric + "J2000", "GEI", "GEO", "MAG", "GSE", "GSM", "SM", "RTN", "GSEQ", // geocentric + "HEE", "HAE", "HEEQ" // heliocentric }; } @@ -110,9 +110,9 @@ glm::dmat3 TransformationManager::kameleonTransformationMatrix( out1.c0, out1.c1, out1.c2, out2.c0, out2.c1, out2.c2 ); -#else +#else // ^^^^ OPENSPACE_MODULE_KAMELEON_ENABLED // !OPENSPACE_MODULE_KAMELEON_ENABLED vvvv return glm::dmat3(0.0); -#endif +#endif // OPENSPACE_MODULE_KAMELEON_ENABLED } glm::dmat3 TransformationManager::frameTransformationMatrix( @@ -122,13 +122,13 @@ glm::dmat3 TransformationManager::frameTransformationMatrix( { #ifdef OPENSPACE_MODULE_KAMELEON_ENABLED auto fromit = _kameleonFrames.find(from); - auto toit = _kameleonFrames.find(to); + auto toit = _kameleonFrames.find(to); - bool fromKameleon = (fromit != _kameleonFrames.end()); - bool toKameleon = (toit != _kameleonFrames.end()); + bool fromKameleon = (fromit != _kameleonFrames.end()); + bool toKameleon = (toit != _kameleonFrames.end()); if (!fromKameleon && !toKameleon) { - return SpiceManager::ref().frameTransformationMatrix(from, to, ephemerisTime); + return SpiceManager::ref().frameTransformationMatrix(from, to, ephemerisTime); } if (fromKameleon && toKameleon) { @@ -162,12 +162,12 @@ glm::dmat3 TransformationManager::frameTransformationMatrix( return kameleonTransformation*spiceTransformation; } -#else +#else // ^^^^ OPENSPACE_MODULE_KAMELEON_ENABLED // !OPENSPACE_MODULE_KAMELEON_ENABLED vvvv LERRORC( "TransformationManager", "Can not transform dynamic frames without kameleon module enabled" ); -#endif +#endif // OPENSPACE_MODULE_KAMELEON_ENABLED return glm::dmat3(1.0); } diff --git a/src/util/tstring.cpp b/src/util/tstring.cpp index ef3ed28bd7..f8f9b01069 100644 --- a/src/util/tstring.cpp +++ b/src/util/tstring.cpp @@ -26,6 +26,7 @@ #include #include +#include namespace openspace { diff --git a/src/util/universalhelpers.cpp b/src/util/universalhelpers.cpp index d52b2e0e7c..55f0bddbdf 100644 --- a/src/util/universalhelpers.cpp +++ b/src/util/universalhelpers.cpp @@ -24,6 +24,9 @@ #include +#include +#include + namespace openspace::helpers { double shiftAndScale(double t, double start, double end) { diff --git a/src/util/versionchecker.cpp b/src/util/versionchecker.cpp index 76777137bd..d61110ce80 100644 --- a/src/util/versionchecker.cpp +++ b/src/util/versionchecker.cpp @@ -34,6 +34,11 @@ #include #include #include +#include +#include +#include +#include +#include namespace { constexpr std::string_view _loggerCat = "VersionChecker"; @@ -91,58 +96,61 @@ void VersionChecker::cancel() { if (_latestVersion.has_value()) { return true; } - if (_request) { - if (_request->hasSucceeded()) { - _request->wait(); - std::vector data = _request->downloadedData(); - const std::string versionString(data.begin(), data.end()); - std::istringstream versionData(versionString); - - std::string token; - ghoul::getline(versionData, token, '.'); - const int major = std::atoi(token.c_str()); - ghoul::getline(versionData, token, '.'); - const int minor = std::atoi(token.c_str()); - ghoul::getline(versionData, token, '.'); - const int patch = std::atoi(token.c_str()); - - _latestVersion = { major, minor, patch }; - _request = nullptr; - - SemanticVersion currentVersion{ - OPENSPACE_VERSION_MAJOR, - OPENSPACE_VERSION_MINOR, - OPENSPACE_VERSION_PATCH - }; - - if (currentVersion < _latestVersion) { - LINFO(std::format( - "Newer OpenSpace version {}.{}.{} is available. " - "Currently running {}.{}.{}", - _latestVersion->major, - _latestVersion->minor, - _latestVersion->patch, - currentVersion.major, - currentVersion.minor, - currentVersion.patch - )); - } - return true; - } - if (_request->hasFailed()) { - _request->cancel(); - _request->wait(); - std::vector data = _request->downloadedData(); - const std::string response = std::string(data.begin(), data.end()); - LWARNING(std::format( - "Failed to get OpenSpace version information from {}. Response: {}", - _request->url(), - response - )); - _request = nullptr; - return false; - } + if (!_request) { + return false; } + + if (_request->hasSucceeded()) { + _request->wait(); + std::vector data = _request->downloadedData(); + const std::string versionString(data.begin(), data.end()); + std::istringstream versionData(versionString); + + std::string token; + ghoul::getline(versionData, token, '.'); + const int major = std::atoi(token.c_str()); + ghoul::getline(versionData, token, '.'); + const int minor = std::atoi(token.c_str()); + ghoul::getline(versionData, token, '.'); + const int patch = std::atoi(token.c_str()); + + _latestVersion = { major, minor, patch }; + _request = nullptr; + + SemanticVersion currentVersion{ + OPENSPACE_VERSION_MAJOR, + OPENSPACE_VERSION_MINOR, + OPENSPACE_VERSION_PATCH + }; + + if (currentVersion < _latestVersion) { + LINFO(std::format( + "Newer OpenSpace version {}.{}.{} is available. " + "Currently running {}.{}.{}", + _latestVersion->major, + _latestVersion->minor, + _latestVersion->patch, + currentVersion.major, + currentVersion.minor, + currentVersion.patch + )); + } + return true; + } + + if (_request->hasFailed()) { + _request->cancel(); + _request->wait(); + std::vector data = _request->downloadedData(); + const std::string response = std::string(data.begin(), data.end()); + LWARNING(std::format( + "Failed to get OpenSpace version information from {}. Response: {}", + _request->url(), response + )); + _request = nullptr; + return false; + } + return false; } diff --git a/support/coding/codegen b/support/coding/codegen index 02b0d6ad6a..2a78626025 160000 --- a/support/coding/codegen +++ b/support/coding/codegen @@ -1 +1 @@ -Subproject commit 02b0d6ad6a3da07e1817f8f83aaeed01e54aa9a7 +Subproject commit 2a78626025db89e211ec6dd60e02969751246531 diff --git a/support/deploy.bat b/support/deploy.bat index 8706e35aa7..1cbed48b0e 100644 --- a/support/deploy.bat +++ b/support/deploy.bat @@ -109,7 +109,7 @@ exit /b 0 echo ### Dealing with some files :: Remove unnecessary files of our own making del bin\RelWithDebInfo\*.pdb -del bin\RelWithDebInfo\codegen.exe +del bin\RelWithDebInfo\codegen-tool.exe del bin\RelWithDebInfo\Qt6Svg.dll :: Remove unnecessary Qt files diff --git a/tests/test_profile.cpp b/tests/test_profile.cpp index b8e8063224..c2a74f1ebe 100644 --- a/tests/test_profile.cpp +++ b/tests/test_profile.cpp @@ -23,18 +23,16 @@ ****************************************************************************************/ #include -#include +#include #include +#include #include #include #include #include #include #include -#include -#include -#include // clang-tidy is convinced that it is possible to use emplace_back instead of push_back // for the profiole types, but I haven't been able to convince the Visual Studio diff --git a/visualtests/example/screenspacerenderable/screenspacedebugplane/debugplane.ostest b/visualtests/example/screenspacerenderable/screenspacedebugplane/debugplane.ostest deleted file mode 100644 index aeb8ba22b5..0000000000 --- a/visualtests/example/screenspacerenderable/screenspacedebugplane/debugplane.ostest +++ /dev/null @@ -1,52 +0,0 @@ -{ - "profile": "empty", - "commands": [ - { - "type": "asset", - "value": "examples/screenspacerenderable/screenspaceimagelocal/imagelocal.asset" - }, - { - "type": "asset", - "value": "examples/screenspacerenderable/screenspacedebugplane/debugplane.asset" - }, - { - "type": "property", - "value": { - "property": "ScreenSpace.ScreenSpaceDebugPlane_Example.FaceCamera", - "value": false - } - }, - { - "type": "property", - "value": { - "property": "ScreenSpace.ScreenSpaceDebugPlane_Example.CartesianPosition", - "value": [ - 0.0, - 0.9599999785423279, - -2.0 - ] - } - }, - { - "type": "property", - "value": { - "property": "ScreenSpace.ScreenSpaceDebugPlane_Example.Scale", - "value": 1.4500000476837158 - } - }, - { - "type": "property", - "value": { - "property": "ScreenSpace.ScreenSpaceDebugPlane_Example.Texture", - "value": 2 - } - }, - { - "type": "wait", - "value": 5 - }, - { - "type": "screenshot" - } - ] -}