diff --git a/.gitignore b/.gitignore index 11489c2ac9..78bfbc5a7d 100644 --- a/.gitignore +++ b/.gitignore @@ -41,3 +41,4 @@ COMMIT.md # SkyBrowser Module downloaded data /modules/skybrowser/wwtimagedata doc +config/schema/sgct.schema.json diff --git a/.gitmodules b/.gitmodules index e599dbca0e..76c093dc48 100644 --- a/.gitmodules +++ b/.gitmodules @@ -32,6 +32,9 @@ [submodule "support/coding/codegen"] path = support/coding/codegen url = https://github.com/OpenSpace/codegen +[submodule "modules/globebrowsing/ext/geos"] + path = modules/globebrowsing/ext/geos + url = https://github.com/OpenSpace/geos.git [submodule "documentation"] path = documentation url = https://github.com/OpenSpace/OpenSpace-Documentation-Dist.git diff --git a/apps/OpenSpace/CMakeLists.txt b/apps/OpenSpace/CMakeLists.txt index 94ecb33a82..f79ee8f174 100644 --- a/apps/OpenSpace/CMakeLists.txt +++ b/apps/OpenSpace/CMakeLists.txt @@ -121,12 +121,21 @@ target_link_libraries(OpenSpace PRIVATE sgct) set_target_properties(sgct PROPERTIES FOLDER "External") set_target_properties(glfw PROPERTIES FOLDER "External") -set_target_properties(SGCTTest PROPERTIES FOLDER "External") +if (TARGET SGCTTest) + set_target_properties(SGCTTest PROPERTIES FOLDER "External") +endif () if (UNIX AND (NOT APPLE)) target_link_libraries(OpenSpace PRIVATE Xcursor Xinerama X11) endif () +add_custom_command(TARGET OpenSpace POST_BUILD + COMMAND ${CMAKE_COMMAND} -E copy + ${CMAKE_CURRENT_SOURCE_DIR}/ext/sgct/sgct.schema.json + ${CMAKE_CURRENT_SOURCE_DIR}/../../config/schema/sgct.schema.json + COMMAND_EXPAND_LISTS +) + end_header("Dependency: SGCT") begin_header("Dependency: Profile Editor") diff --git a/apps/OpenSpace/ext/launcher/include/launcherwindow.h b/apps/OpenSpace/ext/launcher/include/launcherwindow.h index 2f1ca6b732..b0965a3231 100644 --- a/apps/OpenSpace/ext/launcher/include/launcherwindow.h +++ b/apps/OpenSpace/ext/launcher/include/launcherwindow.h @@ -29,6 +29,8 @@ #include "sgctedit/sgctedit.h" #include +#include +#include #include #include @@ -79,15 +81,28 @@ public: */ std::string selectedWindowConfig() const; + /** + * Returns true if the window configuration filename selected in the combo box + * is a file in the user configurations section + * + * \return true if window configuration is a user configuration file + */ + bool isUserConfigSelected() const; + private: QWidget* createCentralWidget(); void setBackgroundImage(const std::string& syncPath); void openProfileEditor(const std::string& profile, bool isUserProfile); - void openWindowEditor(); + void openWindowEditor(const std::string& winCfg, bool isUserWinCfg); + void editRefusalDialog(const std::string& title, const std::string& msg, + const std::string& detailedText); void populateProfilesList(std::string preset); void populateWindowConfigsList(std::string preset); + void handleReturnFromWindowEditor(const sgct::config::Cluster& cluster, + std::filesystem::path savePath, const std::string& saveWindowCfgPath); + bool versionCheck(sgct::config::GeneratorVersion& v) const; const std::string _assetPath; const std::string _userAssetPath; @@ -95,14 +110,19 @@ private: const std::string _userConfigPath; const std::string _profilePath; const std::string _userProfilePath; + const std::vector& _readOnlyWindowConfigs; const std::vector& _readOnlyProfiles; bool _shouldLaunch = false; int _userAssetCount = 0; + int _userConfigStartingIdx = 0; int _userConfigCount = 0; + int _preDefinedConfigStartingIdx = 0; const std::string _sgctConfigName; + int _windowConfigBoxIndexSgctCfgDefault = 0; QComboBox* _profileBox = nullptr; QComboBox* _windowConfigBox = nullptr; QLabel* _backgroundImage = nullptr; + QPushButton* _editWindowButton = nullptr; }; #endif // __OPENSPACE_UI_LAUNCHER___LAUNCHERWINDOW___H__ diff --git a/apps/OpenSpace/ext/launcher/include/sgctedit/displaywindowunion.h b/apps/OpenSpace/ext/launcher/include/sgctedit/displaywindowunion.h index ea64258da9..d4d67968c3 100644 --- a/apps/OpenSpace/ext/launcher/include/sgctedit/displaywindowunion.h +++ b/apps/OpenSpace/ext/launcher/include/sgctedit/displaywindowunion.h @@ -48,10 +48,12 @@ public: * \param winColors An array of QColor objects for window colors. The indexing of * this array matches the window indexing used elsewhere in the * class. This allows for a unique color for each window. + * \param resetToDefault If set to true, all display and window settings will be + * initialized to their default values. * \param parent The parent to which this widget belongs */ DisplayWindowUnion(const std::vector& monitorSizeList, - int nMaxWindows, const std::array& windowColors, + int nMaxWindows, const std::array& windowColors, bool resetToDefault, QWidget* parent = nullptr); /** @@ -59,7 +61,15 @@ public: * * \return vector of pointers of WindowControl objects */ - std::vector windowControls() const; + std::vector activeWindowControls() const; + + /** + * Returns a vector of pointers to the WindowControl objects for all windows, whether + * they are visible or not. + * + * \return vector of pointers of all WindowControl objects + */ + std::vector& windowControls(); /** * When called will add a new window to the set of windows, which will, in turn, send @@ -73,6 +83,14 @@ public: */ void removeWindow(); + /** + * Returns the number of windows that are displayed (there can be more window + * objects than are currently displayed). + * + * \return the number of displayed windows in the current configuration + */ + unsigned int numWindowsDisplayed() const; + signals: /** * This signal is emitted when a windowhas changed. @@ -92,7 +110,7 @@ signals: private: void createWidgets(int nMaxWindows, std::vector monitorResolutions, - std::array windowColors); + std::array windowColors, bool resetToDefault); void showWindows(); unsigned int _nWindowsDisplayed = 0; diff --git a/apps/OpenSpace/ext/launcher/include/sgctedit/settingswidget.h b/apps/OpenSpace/ext/launcher/include/sgctedit/settingswidget.h index 1ff9fd8578..b20a11a1f3 100644 --- a/apps/OpenSpace/ext/launcher/include/sgctedit/settingswidget.h +++ b/apps/OpenSpace/ext/launcher/include/sgctedit/settingswidget.h @@ -62,6 +62,23 @@ public: */ bool showUiOnFirstWindow() const; + /** + * Sets the value of the checkbox for putting the GUI only on the first window. + * If this is enabled, then the first window will draw2D but not draw3D. All + * subsequent windows will be the opposite of this. + * + * \param setUiOnFirstWindow boolean value, if set true then the GUI will only + * be on the first window + */ + void setShowUiOnFirstWindow(bool setUiOnFirstWindow); + + /** + * Sets the value of the checkbox for enabling VSync. + * + * \param enableVsync boolean value, if set true then VSync is enabled + */ + void setVsync(bool enableVsync); + private: sgct::quat _orientationValue = sgct::quat(0.f, 0.f, 0.f, 0.f); QCheckBox* _checkBoxVsync = nullptr; diff --git a/apps/OpenSpace/ext/launcher/include/sgctedit/sgctedit.h b/apps/OpenSpace/ext/launcher/include/sgctedit/sgctedit.h index b3a0e7983d..17918e320c 100644 --- a/apps/OpenSpace/ext/launcher/include/sgctedit/sgctedit.h +++ b/apps/OpenSpace/ext/launcher/include/sgctedit/sgctedit.h @@ -28,6 +28,7 @@ #include #include +#include #include #include #include @@ -38,12 +39,16 @@ class SettingsWidget; class QBoxLayout; class QWidget; +const sgct::config::GeneratorVersion versionMin { "SgctWindowConfig", 1, 1 }; +const sgct::config::GeneratorVersion versionLegacy18 { "OpenSpace", 0, 18 }; +const sgct::config::GeneratorVersion versionLegacy19 { "OpenSpace", 0, 19 }; + class SgctEdit final : public QDialog { Q_OBJECT public: /** * Constructor for SgctEdit class, the underlying class for the full window - * configuration editor + * configuration editor. Used when creating a new config. * * \param parent The Qt QWidget parent object * \param userConfigPath A string containing the file path of the user config @@ -51,6 +56,22 @@ public: */ SgctEdit(QWidget* parent, std::string userConfigPath); + /** + * Constructor for SgctEdit class, the underlying class for the full window + * configuration editor. Used when editing an existing config. + * + * \param cluster The #sgct::config::Cluster object containing all data of the + * imported window cluster configuration. + * \param configName The name of the window configuration filename + * \param configBasePath The path to the folder where default config files reside + * \param configsReadOnly vector list of window config names that are read-only and + * must not be overwritten + * \param parent Pointer to parent Qt widget + */ + SgctEdit(sgct::config::Cluster& cluster, const std::string& configName, + std::string& configBasePath, const std::vector& configsReadOnly, + QWidget* parent); + /** * Returns the saved filename * @@ -66,8 +87,16 @@ public: sgct::config::Cluster cluster() const; private: - void createWidgets(const std::vector& monitorSizes); - sgct::config::Cluster generateConfiguration() const; + std::vector createMonitorInfoSet(); + void createWidgets(const std::vector& monitorSizes, unsigned int nWindows, + bool setToDefaults); + void generateConfiguration(); + void generateConfigSetupVsync(); + void generateConfigUsers(); + void generateConfigAddresses(sgct::config::Node& node); + void generateConfigResizeWindowsAccordingToSelected(sgct::config::Node& node); + void generateConfigIndividualWindowSettings(sgct::config::Node& node); + void setupProjectionTypeInGui(sgct::config::Viewport& vPort, WindowControl* wCtrl); void save(); void apply(); @@ -82,12 +111,15 @@ private: QColor(0x44, 0xAF, 0x69), QColor(0xF8, 0x33, 0x3C) }; + std::string _configurationFilename; + const std::vector _readOnlyConfigs; QBoxLayout* _layoutButtonBox = nullptr; QPushButton* _saveButton = nullptr; QPushButton* _cancelButton = nullptr; QPushButton* _applyButton = nullptr; std::string _saveTarget; + bool _didImportValues = false; }; #endif // __OPENSPACE_UI_LAUNCHER___SGCTEDIT___H__ diff --git a/apps/OpenSpace/ext/launcher/include/sgctedit/windowcontrol.h b/apps/OpenSpace/ext/launcher/include/sgctedit/windowcontrol.h index 71f155823c..13065b5c54 100644 --- a/apps/OpenSpace/ext/launcher/include/sgctedit/windowcontrol.h +++ b/apps/OpenSpace/ext/launcher/include/sgctedit/windowcontrol.h @@ -41,6 +41,14 @@ class QSpinBox; class WindowControl final : public QWidget { Q_OBJECT public: + enum class ProjectionIndices { + Planar = 0, + Fisheye, + SphericalMirror, + Cylindrical, + Equirectangular + }; + /** * Constructor for WindowControl class, which contains settings and configuration * for individual windows @@ -52,7 +60,8 @@ public: * \param winColor A QColor object for this window's unique color */ WindowControl(int monitorIndex, int windowIndex, - const std::vector& monitorDims, const QColor& winColor, QWidget* parent); + const std::vector& monitorDims, const QColor& winColor, + bool resetToDefault, QWidget* parent); /** * Makes the window label at top of a window control column visible @@ -66,20 +75,100 @@ public: */ void resetToDefaults(); - sgct::config::Window generateWindowInformation() const; + /** + * Sets the window dimensions + * + * \param newDims The x, y dimensions to set the window to + */ + void setDimensions(QRectF newDims); + + /** + * Sets the monitor selection combobox + * + * \param monitorIndex The zero-based monitor index to set the combobox selection to + */ + void setMonitorSelection(int monitorIndex); + + /** + * Sets the window name in the text edit box + * + * \param windowName The window title to set + */ + void setWindowName(const std::string& windowName); + + /** + * Sets the window's decoration status. If set to true, then the window has a + * border. If false it is borderless + * + * \param hasWindowDecoration boolean for if window has decoration (border) + */ + void setDecorationState(bool hasWindowDecoration); + + /** + * Generates window configuration (sgct::config::Window struct) based on the + * GUI settings. + * + * \param window The sgct::config::Window struct that is passed into the function + * and modified with the generated window content + */ + void generateWindowInformation(sgct::config::Window& window) const; + + /** + * Sets the window's projection type to planar, with the accompanying parameters + * for horizontal and vertical FOV. + * + * \param hfov float value for horizontal field of view angle (degrees) + * \param vfov float value for vertical field of view angle (degrees) + */ + void setProjectionPlanar(float hfov, float vfov); + + /** + * Sets the window's projection type to fisheye, with the accompanying quality + * setting and spout option + * + * \param quality int value for number of vertical lines of resolution. This will + * be compared against the QualityValues array in order to set the + * correct combobox index + * \param spoutOutput bool for enabling the spout output option + */ + void setProjectionFisheye(int quality, bool spoutOutput); + + /** + * Sets the window's projection type to spherical mirror, with the accompanying + * quality setting + * + * \param quality int value for number of vertical lines of resolution. This will + * be compared against the QualityValues array in order to set the + * correct combobox index + */ + void setProjectionSphericalMirror(int quality); + + /** + * Sets the window's projection type to cylindrical, with the accompanying quality + * setting and height offset value + * + * \param quality int value for number of vertical lines of resolution. This will + * be compared against the QualityValues array in order to set the + * correct combobox index + * \param heightOffset float value for height offset to be applied + */ + void setProjectionCylindrical(int quality, float heightOffset); + + /** + * Sets the window's projection type to equirectangular, with the accompanying + * quality setting and spout option + * + * \param quality int value for number of vertical lines of resolution. This will + * be compared against the QualityValues array in order to set the + * correct combobox index + * \param spoutOutput bool for enabling the spout output option + */ + void setProjectionEquirectangular(int quality, bool spoutOutput); signals: void windowChanged(int monitorIndex, int windowIndex, const QRectF& newDimensions); private: - enum class ProjectionIndices { - Planar = 0, - Fisheye, - SphericalMirror, - Cylindrical, - Equirectangular - }; - void createWidgets(const QColor& windowColor); QWidget* createPlanarWidget(); QWidget* createFisheyeWidget(); @@ -98,6 +187,7 @@ private: sgct::config::Projections generateProjectionInformation() const; void updatePlanarLockedFov(); + void setQualityComboBoxFromLinesResolution(int lines, QComboBox* combo); static constexpr float IdealAspectRatio = 16.f / 9.f; float _aspectRatioSize = IdealAspectRatio; diff --git a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp index 9f379e3d63..c7334ab384 100644 --- a/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp +++ b/apps/OpenSpace/ext/launcher/src/launcherwindow.cpp @@ -175,16 +175,12 @@ namespace { } void saveWindowConfig(QWidget* parent, const std::filesystem::path& path, - sgct::config::Cluster& cluster) + const sgct::config::Cluster& cluster) { std::ofstream outFile; try { outFile.open(path, std::ofstream::out); - sgct::config::GeneratorVersion genEntry = sgct::config::GeneratorVersion{ - "OpenSpace", - OPENSPACE_VERSION_MAJOR, - OPENSPACE_VERSION_MINOR - }; + sgct::config::GeneratorVersion genEntry = versionMin; outFile << sgct::serializeConfig( cluster, genEntry @@ -217,6 +213,7 @@ LauncherWindow::LauncherWindow(bool profileEnabled, , _userProfilePath( absPath(globalConfig.pathTokens.at("USER_PROFILES")).string() + '/' ) + , _readOnlyWindowConfigs(globalConfig.readOnlyWindowConfigs) , _readOnlyProfiles(globalConfig.readOnlyProfiles) , _sgctConfigName(sgctConfigName) { @@ -246,9 +243,10 @@ LauncherWindow::LauncherWindow(bool profileEnabled, populateProfilesList(globalConfig.profile); _profileBox->setEnabled(profileEnabled); - populateWindowConfigsList(_sgctConfigName); _windowConfigBox->setEnabled(sgctConfigEnabled); - + populateWindowConfigsList(_sgctConfigName); + // Trigger currentIndexChanged so the preview file read is performed + _windowConfigBox->currentIndexChanged(_windowConfigBox->currentIndex()); std::filesystem::path p = absPath( globalConfig.pathTokens.at("SYNC") + "/http/launcher_images" @@ -343,13 +341,31 @@ QWidget* LauncherWindow::createCentralWidget() { connect( newWindowButton, &QPushButton::released, [this]() { - openWindowEditor(); + openWindowEditor("", true); } ); newWindowButton->setObjectName("small"); newWindowButton->setGeometry(geometry::NewWindowButton); newWindowButton->setCursor(Qt::PointingHandCursor); + _editWindowButton = new QPushButton("Edit", centralWidget); + connect( + _editWindowButton, + &QPushButton::released, + [this]() { + std::filesystem::path pathSelected = absPath(selectedWindowConfig()); + bool isUserConfig = isUserConfigSelected(); + std::string fileSelected = pathSelected.generic_string(); + if (std::filesystem::is_regular_file(pathSelected)) { + openWindowEditor(fileSelected, isUserConfig); + } + } + ); + _editWindowButton->setVisible(true); + _editWindowButton->setObjectName("small"); + _editWindowButton->setGeometry(geometry::EditWindowButton); + _editWindowButton->setCursor(Qt::PointingHandCursor); + return centralWidget; } @@ -537,15 +553,26 @@ bool handleConfigurationFile(QComboBox& box, const std::filesystem::directory_en void LauncherWindow::populateWindowConfigsList(std::string preset) { namespace fs = std::filesystem; + // Disconnect the signal for new window config selection during population process + disconnect( + _windowConfigBox, + QOverload::of(&QComboBox::currentIndexChanged), + nullptr, + nullptr + ); _windowConfigBox->clear(); _userConfigCount = 0; + _userConfigStartingIdx = 0; + _preDefinedConfigStartingIdx = 0; _windowConfigBox->addItem(QString::fromStdString("--- User Configurations ---")); const QStandardItemModel* model = qobject_cast(_windowConfigBox->model()); model->item(_userConfigCount)->setEnabled(false); - ++_userConfigCount; + _userConfigCount++; + _userConfigStartingIdx++; + _preDefinedConfigStartingIdx++; bool hasXmlConfig = false; @@ -560,14 +587,16 @@ void LauncherWindow::populateWindowConfigsList(std::string preset) { for (const fs::directory_entry& p : files) { bool isConfigFile = handleConfigurationFile(*_windowConfigBox, p); if (isConfigFile) { - ++_userConfigCount; + _userConfigCount++; + _userConfigStartingIdx++; + _preDefinedConfigStartingIdx++; } - hasXmlConfig |= p.path().extension() == ".xml"; } _windowConfigBox->addItem(QString::fromStdString("--- OpenSpace Configurations ---")); model = qobject_cast(_windowConfigBox->model()); model->item(_userConfigCount)->setEnabled(false); + _preDefinedConfigStartingIdx++; if (std::filesystem::exists(_configPath)) { // Sort files @@ -601,7 +630,10 @@ void LauncherWindow::populateWindowConfigsList(std::string preset) { } // Always add the .cfg sgct default as first item - _windowConfigBox->insertItem(0, QString::fromStdString(_sgctConfigName)); + _windowConfigBox->insertItem( + _windowConfigBoxIndexSgctCfgDefault, + QString::fromStdString(_sgctConfigName) + ); // Try to find the requested configuration file and set it as the current one. As we // have support for function-generated configuration files that will not be in the // list we need to add a preset that doesn't exist a file for @@ -611,12 +643,63 @@ void LauncherWindow::populateWindowConfigsList(std::string preset) { } else { // Add the requested preset at the top - _windowConfigBox->insertItem(1, QString::fromStdString(preset)); + _windowConfigBox->insertItem( + _windowConfigBoxIndexSgctCfgDefault + 1, + QString::fromStdString(preset) + ); // Increment the user config count because there is an additional option added // before the user config options _userConfigCount++; - _windowConfigBox->setCurrentIndex(1); + _userConfigStartingIdx++; + _preDefinedConfigStartingIdx++; + _windowConfigBox->setCurrentIndex(_windowConfigBoxIndexSgctCfgDefault + 1); } + connect( + _windowConfigBox, + QOverload::of(&QComboBox::currentIndexChanged), + [this](int newIndex) { + std::filesystem::path pathSelected = absPath(selectedWindowConfig()); + std::string fileSelected = pathSelected.generic_string(); + if (newIndex == _windowConfigBoxIndexSgctCfgDefault) { + _editWindowButton->setEnabled(false); + _editWindowButton->setToolTip( + "Cannot edit the 'Default' configuration since it is not a file" + ); + } + else if (newIndex >= _preDefinedConfigStartingIdx) { + _editWindowButton->setEnabled(false); + _editWindowButton->setToolTip( + QString::fromStdString(fmt::format( + "Cannot edit '{}' since it is one of the configuration " + "files provided in the OpenSpace installation", fileSelected)) + ); + } + else { + try { + sgct::config::GeneratorVersion previewGenVersion = + sgct::readConfigGenerator(fileSelected); + if (!versionCheck(previewGenVersion)) { + _editWindowButton->setEnabled(false); + _editWindowButton->setToolTip(QString::fromStdString(fmt::format( + "This file does not meet the minimum required version of {}.", + versionMin.versionString() + ))); + return; + } + } + catch (const std::runtime_error& e) { + // Ignore an exception here because clicking the edit button will + // bring up an explanatory error message + } + _editWindowButton->setEnabled(true); + _editWindowButton->setToolTip(""); + } + } + ); +} + +bool LauncherWindow::versionCheck(sgct::config::GeneratorVersion& v) const { + return (v.versionCheck(versionMin) || v == versionLegacy18 || v == versionLegacy19); } void LauncherWindow::openProfileEditor(const std::string& profile, bool isUserProfile) { @@ -659,18 +742,112 @@ void LauncherWindow::openProfileEditor(const std::string& profile, bool isUserPr } } -void LauncherWindow::openWindowEditor() { - SgctEdit editor(this, _userConfigPath); - int ret = editor.exec(); - if (ret == QDialog::DialogCode::Accepted) { - sgct::config::Cluster cluster = editor.cluster(); +void LauncherWindow::editRefusalDialog(const std::string& title, const std::string& msg, + const std::string& detailedText) +{ + QMessageBox msgBox(this); + msgBox.setText(QString::fromStdString(msg)); + msgBox.setWindowTitle(QString::fromStdString(title)); + msgBox.setDetailedText(QString::fromStdString(detailedText)); + msgBox.setIcon(QMessageBox::Warning); + msgBox.exec(); +} - std::filesystem::path savePath = editor.saveFilename(); - saveWindowConfig(this, savePath, cluster); - // Truncate path to convert this back to path relative to _userConfigPath - std::string p = savePath.string().substr(_userConfigPath.size()); - populateWindowConfigsList(p); +void LauncherWindow::openWindowEditor(const std::string& winCfg, bool isUserWinCfg) { + using namespace sgct; + + std::string saveWindowCfgPath = isUserWinCfg ? _userConfigPath : _configPath; + int ret = QDialog::DialogCode::Rejected; + config::Cluster preview; + if (winCfg.empty()) { + SgctEdit editor(this, _userConfigPath); + ret = editor.exec(); + if (ret == QDialog::DialogCode::Accepted) { + handleReturnFromWindowEditor( + editor.cluster(), + editor.saveFilename(), + saveWindowCfgPath + ); + } } + else { + try { + config::GeneratorVersion previewGenVersion = readConfigGenerator(winCfg); + loadFileAndSchemaThenValidate( + winCfg, + _configPath + "/schema/sgct.schema.json", + "This configuration file is unable to generate a proper display" + ); + loadFileAndSchemaThenValidate( + winCfg, + _configPath + "/schema/sgcteditor.schema.json", + "This configuration file is valid for generating a display, but " + "its format does not match the window editor requirements and " + "cannot be opened in the editor" + ); + if (versionCheck(previewGenVersion)) { + try { + preview = readConfig( + winCfg, + "This configuration file is unable to generate a proper display " + "due to a problem detected in the readConfig function" + ); + } + catch (const std::runtime_error& e) { + //Re-throw an SGCT error exception with the runtime exception message + throw std::runtime_error( + fmt::format( + "Importing of this configuration file failed because of a " + "problem detected in the readConfig function:\n\n{}", e.what() + ) + ); + } + SgctEdit editor( + preview, + winCfg, + saveWindowCfgPath, + _readOnlyWindowConfigs, + this + ); + ret = editor.exec(); + if (ret == QDialog::DialogCode::Accepted) { + handleReturnFromWindowEditor( + editor.cluster(), + editor.saveFilename(), + saveWindowCfgPath + ); + } + } + else { + editRefusalDialog( + "File Format Version Error", + fmt::format( + "File '{}' does not meet the minimum required version of {}.", + winCfg, versionMin.versionString() + ), + "" + ); + } + } + catch (const std::runtime_error& e) { + editRefusalDialog( + "Format Validation Error", + fmt::format("Parsing error found in file '{}'", winCfg), + e.what() + ); + } + } +} + +void LauncherWindow::handleReturnFromWindowEditor(const sgct::config::Cluster& cluster, + std::filesystem::path savePath, + const std::string& saveWindowCfgPath) +{ + savePath.replace_extension(".json"); + saveWindowConfig(this, savePath, cluster); + // Truncate path to convert this back to path relative to _userConfigPath + std::string p = std::filesystem::proximate(savePath, saveWindowCfgPath).string(); + populateWindowConfigsList(p); } bool LauncherWindow::wasLaunchSelected() const { @@ -694,3 +871,8 @@ std::string LauncherWindow::selectedWindowConfig() const { return "${USER_CONFIG}/" + _windowConfigBox->currentText().toStdString(); } } + +bool LauncherWindow::isUserConfigSelected() const { + int selectedIndex = _windowConfigBox->currentIndex(); + return (selectedIndex <= _userConfigCount); +} diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/displaywindowunion.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/displaywindowunion.cpp index 0f420d9de1..361004653a 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/displaywindowunion.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/displaywindowunion.cpp @@ -36,16 +36,22 @@ DisplayWindowUnion::DisplayWindowUnion(const std::vector& monitorSizeList, int nMaxWindows, const std::array& windowColors, - QWidget* parent) + bool resetToDefault, QWidget* parent) : QWidget(parent) { - createWidgets(nMaxWindows, monitorSizeList, windowColors); + createWidgets( + nMaxWindows, + monitorSizeList, + windowColors, + resetToDefault + ); showWindows(); } void DisplayWindowUnion::createWidgets(int nMaxWindows, std::vector monitorResolutions, - std::array windowColors) + std::array windowColors, + bool resetToDefault) { // Add all window controls (some will be hidden from GUI initially) for (int i = 0; i < nMaxWindows; ++i) { @@ -57,6 +63,7 @@ void DisplayWindowUnion::createWidgets(int nMaxWindows, i, monitorResolutions, windowColors[i], + resetToDefault, this ); _windowControl.push_back(ctrl); @@ -120,7 +127,7 @@ void DisplayWindowUnion::createWidgets(int nMaxWindows, layout->addStretch(); } -std::vector DisplayWindowUnion::windowControls() const { +std::vector DisplayWindowUnion::activeWindowControls() const { std::vector res; res.reserve(_nWindowsDisplayed); for (unsigned int i = 0; i < _nWindowsDisplayed; ++i) { @@ -129,6 +136,10 @@ std::vector DisplayWindowUnion::windowControls() const { return res; } +std::vector& DisplayWindowUnion::windowControls() { + return _windowControl; +} + void DisplayWindowUnion::addWindow() { if (_nWindowsDisplayed < _windowControl.size()) { _windowControl[_nWindowsDisplayed]->resetToDefaults(); @@ -144,6 +155,10 @@ void DisplayWindowUnion::removeWindow() { } } +unsigned int DisplayWindowUnion::numWindowsDisplayed() const { + return _nWindowsDisplayed; +} + void DisplayWindowUnion::showWindows() { for (size_t i = 0; i < _windowControl.size(); ++i) { _windowControl[i]->setVisible(i < _nWindowsDisplayed); diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/settingswidget.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/settingswidget.cpp index 99ee2a9f6a..6240f68f0a 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/settingswidget.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/settingswidget.cpp @@ -80,3 +80,11 @@ bool SettingsWidget::vsync() const { bool SettingsWidget::showUiOnFirstWindow() const { return _showUiOnFirstWindow->isChecked(); } + +void SettingsWidget::setShowUiOnFirstWindow(bool setUiOnFirstWindow) { + _showUiOnFirstWindow->setChecked(setUiOnFirstWindow); +} + +void SettingsWidget::setVsync(bool enableVsync) { + _checkBoxVsync->setChecked(enableVsync); +} diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp index f896a14800..e53e94bbba 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp @@ -27,7 +27,6 @@ #include #include #include -#include #include #include #include @@ -65,15 +64,160 @@ namespace { // We got to the end without running into any problems, so we are golden return false; } + + template struct overloaded : Ts... { using Ts::operator()...; }; + template overloaded(Ts...) -> overloaded; } // namespace SgctEdit::SgctEdit(QWidget* parent, std::string userConfigPath) : QDialog(parent) , _userConfigPath(std::move(userConfigPath)) { - QList screens = qApp->screens(); setWindowTitle("Window Configuration Editor"); - + createWidgets(createMonitorInfoSet(), 1, true); +} + +SgctEdit::SgctEdit(sgct::config::Cluster& cluster, const std::string& configName, + std::string& configBasePath, + const std::vector& configsReadOnly, QWidget* parent) + : QDialog(parent) + , _cluster(cluster) + , _userConfigPath(configBasePath) + , _configurationFilename(configName) + , _readOnlyConfigs(configsReadOnly) + , _didImportValues(true) +{ + setWindowTitle("Window Configuration Editor"); + size_t nWindows = _cluster.nodes.front().windows.size(); + bool firstWindowGuiIsEnabled = (nWindows > 1); + std::vector monitorSizes = createMonitorInfoSet(); + createWidgets(monitorSizes, nWindows, false); + size_t existingWindowsControlSize = _displayWidget->windowControls().size(); + for (size_t i = 0; i < nWindows; ++i) { + sgct::config::Window& w = _cluster.nodes.front().windows[i]; + WindowControl* wCtrl = _displayWidget->windowControls()[i]; + if (i < existingWindowsControlSize && wCtrl) { + unsigned int monitorNum = 0; + if (w.monitor) { + monitorNum = static_cast(w.monitor.value()); + if (monitorNum > (monitorSizes.size() - 1)) { + monitorNum = 0; + } + } + unsigned int posX = 0; + unsigned int posY = 0; + wCtrl->setMonitorSelection(monitorNum); + if (w.pos.has_value()) { + posX = w.pos.value().x; + posY = w.pos.value().y; + // Convert offsets to coordinates relative to the selected monitor bounds, + // since window offsets are stored n the sgct config file relative to the + // coordinates of the total "canvas" of all displays + if (monitorSizes.size() > monitorNum) { + posX -= monitorSizes[monitorNum].x(); + posY -= monitorSizes[monitorNum].y(); + } + } + QRectF newDims( + posX, + posY, + w.size.x, + w.size.y + ); + wCtrl->setDimensions(newDims); + if (w.name.has_value()) { + wCtrl->setWindowName(w.name.value()); + } + wCtrl->setDecorationState(w.isDecorated.value()); + } + // If first window only renders 2D, and all subsequent windows render 3D, then + // will enable the checkbox option for showing GUI only on first window + if (w.draw2D.has_value() && w.draw3D.has_value()) { + firstWindowGuiIsEnabled &= (i == 0) ? w.draw2D.value() : !w.draw2D.value(); + firstWindowGuiIsEnabled &= (i == 0) ? !w.draw3D.value() : w.draw3D.value(); + } + else { + firstWindowGuiIsEnabled = false; + } + setupProjectionTypeInGui(w.viewports.back(), wCtrl); + } + _settingsWidget->setShowUiOnFirstWindow(firstWindowGuiIsEnabled); + _settingsWidget->setVsync( + _cluster.settings && + _cluster.settings.value().display && + _cluster.settings.value().display.value().swapInterval + ); +} + +void SgctEdit::setupProjectionTypeInGui(sgct::config::Viewport& vPort, + WindowControl* wCtrl) +{ + std::visit(overloaded{ + [&](sgct::config::CylindricalProjection p) { + if (p.quality && p.heightOffset) { + wCtrl->setProjectionCylindrical( + *p.quality, + *p.heightOffset + ); + } + }, + [&](sgct::config::EquirectangularProjection p) { + if (p.quality) { + wCtrl->setProjectionEquirectangular( + *p.quality, + false + ); + } + }, + [&](sgct::config::FisheyeProjection p) { + if (p.quality) { + wCtrl->setProjectionFisheye( + *p.quality, + false + ); + } + }, + [&](sgct::config::PlanarProjection p) { + wCtrl->setProjectionPlanar( + (std::abs(p.fov.left) + std::abs(p.fov.right)), + (std::abs(p.fov.up) + std::abs(p.fov.down)) + ); + }, + [&](sgct::config::SphericalMirrorProjection p) { + if (p.quality) { + wCtrl->setProjectionSphericalMirror( + *p.quality + ); + } + }, + [&](sgct::config::SpoutOutputProjection p) { + if (p.quality) { + if (p.mapping == + sgct::config::SpoutOutputProjection::Mapping::Equirectangular) + { + wCtrl->setProjectionEquirectangular( + *p.quality, + true + ); + } + else if (p.mapping == + sgct::config::SpoutOutputProjection::Mapping::Fisheye) + { + wCtrl->setProjectionFisheye( + *p.quality, + true + ); + } + } + }, + [&](sgct::config::NoProjection) {}, + [&](sgct::config::ProjectionPlane) {}, + [&](sgct::config::SpoutFlatProjection) {} + }, vPort.projection); +} + +std::vector SgctEdit::createMonitorInfoSet() { + QList screens = qApp->screens(); int nScreensManaged = std::min(static_cast(screens.length()), 4); std::vector monitorSizes; for (int s = 0; s < nScreensManaged; ++s) { @@ -88,11 +232,12 @@ SgctEdit::SgctEdit(QWidget* parent, std::string userConfigPath) static_cast(actualHeight * screens[s]->devicePixelRatio()) ); } - - createWidgets(monitorSizes); + return monitorSizes; } -void SgctEdit::createWidgets(const std::vector& monitorSizes) { +void SgctEdit::createWidgets(const std::vector& monitorSizes, + unsigned int nWindows, bool setToDefaults) +{ QBoxLayout* layout = new QVBoxLayout(this); layout->setSizeConstraint(QLayout::SetFixedSize); @@ -118,6 +263,7 @@ void SgctEdit::createWidgets(const std::vector& monitorSizes) { monitorSizes, MaxNumberWindows, _colorsForWindows, + setToDefaults, this ); connect( @@ -128,7 +274,9 @@ void SgctEdit::createWidgets(const std::vector& monitorSizes) { _displayWidget, &DisplayWindowUnion::nWindowsChanged, monitorBox, &MonitorBox::nWindowsDisplayedChanged ); - _displayWidget->addWindow(); + for (unsigned int i = 0; i < nWindows; ++i) { + _displayWidget->addWindow(); + } displayLayout->addWidget(_displayWidget); @@ -152,7 +300,8 @@ void SgctEdit::createWidgets(const std::vector& monitorSizes) { connect(_cancelButton, &QPushButton::released, this, &SgctEdit::reject); layoutButtonBox->addWidget(_cancelButton); - _saveButton = new QPushButton("Save As"); + _saveButton = _didImportValues ? + new QPushButton("Save") : new QPushButton("Save As"); _saveButton->setToolTip("Save configuration changes"); _saveButton->setFocusPolicy(Qt::NoFocus); connect(_saveButton, &QPushButton::released, this, &SgctEdit::save); @@ -173,8 +322,8 @@ std::filesystem::path SgctEdit::saveFilename() const { } void SgctEdit::save() { - sgct::config::Cluster cluster = generateConfiguration(); - if (hasWindowIssues(cluster)) { + generateConfiguration(); + if (hasWindowIssues(_cluster)) { int ret = QMessageBox::warning( this, "Window Sizes Incompatible", @@ -190,27 +339,32 @@ void SgctEdit::save() { } } - QString fileName = QFileDialog::getSaveFileName( - this, - "Save Window Configuration File", - QString::fromStdString(_userConfigPath), - "Window Configuration (*.json)", - nullptr -#ifdef __linux__ - // Linux in Qt5 and Qt6 crashes when trying to access the native dialog here - , QFileDialog::DontUseNativeDialog -#endif - ); - if (!fileName.isEmpty()) { - _saveTarget = fileName.toStdString(); - _cluster = std::move(cluster); + if (_didImportValues) { + _saveTarget = _configurationFilename; accept(); } + else { + QString fileName = QFileDialog::getSaveFileName( + this, + "Save Window Configuration File", + QString::fromStdString(_userConfigPath), + "Window Configuration (*.json)", + nullptr +#ifdef __linux__ + // Linux in Qt5 and Qt6 crashes when trying to access the native dialog here + , QFileDialog::DontUseNativeDialog +#endif + ); + if (!fileName.isEmpty()) { + _saveTarget = fileName.toStdString(); + accept(); + } + } } void SgctEdit::apply() { - sgct::config::Cluster cluster = generateConfiguration(); - if (hasWindowIssues(cluster)) { + generateConfiguration(); + if (hasWindowIssues(_cluster)) { int ret = QMessageBox::warning( this, "Window Sizes Incompatible", @@ -235,63 +389,101 @@ void SgctEdit::apply() { std::filesystem::create_directories(absPath(userCfgTempDir)); } _saveTarget = userCfgTempDir + "/apply-without-saving.json"; - _cluster = std::move(cluster); accept(); } -sgct::config::Cluster SgctEdit::generateConfiguration() const { - sgct::config::Cluster cluster; +void SgctEdit::generateConfiguration() { + _cluster.scene = sgct::config::Scene(); + _cluster.scene->orientation = _settingsWidget->orientation(); + if (_cluster.nodes.empty()) { + _cluster.nodes.push_back(sgct::config::Node()); + } + sgct::config::Node& node = _cluster.nodes.back(); - sgct::config::Scene scene; - scene.orientation = _settingsWidget->orientation(); - cluster.scene = std::move(scene); - - cluster.masterAddress = "localhost"; + generateConfigSetupVsync(); + generateConfigUsers(); + generateConfigAddresses(node); + generateConfigResizeWindowsAccordingToSelected(node); + generateConfigIndividualWindowSettings(node); +} +void SgctEdit::generateConfigSetupVsync() { if (_settingsWidget->vsync()) { - sgct::config::Settings::Display display; - display.swapInterval = 1; - - sgct::config::Settings settings; - settings.display = display; - - cluster.settings = settings; - } - - sgct::config::Node node; - node.address = "localhost"; - node.port = 20401; - - // Save Windows - unsigned int windowIndex = 0; - for (WindowControl* wCtrl : _displayWidget->windowControls()) { - sgct::config::Window window = wCtrl->generateWindowInformation(); - - window.id = windowIndex++; - node.windows.push_back(std::move(window)); - } - - if (_settingsWidget->showUiOnFirstWindow()) { - sgct::config::Window& window = node.windows.front(); - window.viewports.back().isTracked = false; - window.tags.push_back("GUI"); - window.draw2D = true; - window.draw3D = false; - - // Disable 2D rendering on all non-GUI windows - for (size_t w = 1; w < node.windows.size(); ++w) { - node.windows[w].draw2D = false; + if (!_cluster.settings || !_cluster.settings->display || + !_cluster.settings->display->swapInterval) + { + sgct::config::Settings::Display display; + display.swapInterval = 1; + sgct::config::Settings settings; + settings.display = display; + _cluster.settings = settings; } } + else { + _cluster.settings = std::nullopt; + } +} - cluster.nodes.push_back(node); +void SgctEdit::generateConfigUsers() { + if (!_didImportValues) { + sgct::config::User user; + user.eyeSeparation = 0.065f; + user.position = { 0.f, 0.f, 4.f }; + _cluster.users = { user }; + } +} - sgct::config::User user; - user.eyeSeparation = 0.065f; - user.position = sgct::vec3(0.f, 0.f, 4.f); - cluster.users = { user }; +void SgctEdit::generateConfigAddresses(sgct::config::Node& node) { + if (!_didImportValues) { + _cluster.masterAddress = "localhost"; + node.address = "localhost"; + node.port = 20401; + } +} - return cluster; +void SgctEdit::generateConfigResizeWindowsAccordingToSelected(sgct::config::Node& node) { + std::vector windowControls = _displayWidget->activeWindowControls(); + for (size_t wIdx = 0; wIdx < windowControls.size(); ++wIdx) { + if (node.windows.size() <= wIdx) { + node.windows.push_back(sgct::config::Window()); + } + if (windowControls[wIdx]) { + windowControls[wIdx]->generateWindowInformation( + node.windows[wIdx] + ); + } + } + while (node.windows.size() > windowControls.size()) { + node.windows.pop_back(); + } +} + +void SgctEdit::generateConfigIndividualWindowSettings(sgct::config::Node& node) { + for (size_t i = 0; i < node.windows.size(); ++i) { + // First apply default settings to each window... + node.windows[i].id = i; + node.windows[i].draw2D = true; + node.windows[i].draw3D = true; + node.windows[i].viewports.back().isTracked = true; + node.windows[i].tags.erase( + std::remove( + node.windows[i].tags.begin(), + node.windows[i].tags.end(), + "GUI" + ), + node.windows[i].tags.end() + ); + // If "show UI on first window" option is enabled, then modify the settings + // depending on if this is the first window or not + if (_settingsWidget->showUiOnFirstWindow()) { + if (i == 0) { + node.windows[i].viewports.back().isTracked = false; + node.windows[i].tags.push_back("GUI"); + } + node.windows[i].draw2D = (i == 0); + node.windows[i].draw3D = (i != 0); + } + } } sgct::config::Cluster SgctEdit::cluster() const { diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp index a466f450af..c2d6c8cb32 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/windowcontrol.cpp @@ -43,15 +43,22 @@ namespace { "Primary", "Secondary", "Tertiary", "Quaternary" }; + constexpr int nQualityTypes = 10; + const QList QualityTypes = { "Low (256)", "Medium (512)", "High (1K)", "1.5K (1536)", "2K (2048)", "4K (4096)", "8K (8192)", "16K (16384)", "32K (32768)", "64K (65536)" }; - constexpr int QualityValues[10] = { + constexpr int QualityValues[nQualityTypes] = { 256, 512, 1024, 1536, 2048, 4096, 8192, 16384, 32768, 65536 }; + const QList ProjectionTypes = { + "Planar Projection", "Fisheye", "Spherical Mirror Projection", + "Cylindrical Projection", "Equirectangular Projection" + }; + constexpr std::array DefaultWindowSizes = { QRectF(50.f, 50.f, 1280.f, 720.f), QRectF(150.f, 150.f, 1280.f, 720.f), @@ -59,7 +66,7 @@ namespace { QRectF(150.f, 150.f, 1280.f, 720.f) }; - constexpr int LineEditWidthFixedWindowSize = 50; + constexpr int LineEditWidthFixedWindowSize = 64; constexpr float DefaultFovLongEdge = 80.f; constexpr float DefaultFovShortEdge = 50.534f; constexpr float DefaultHeightOffset = 0.f; @@ -81,7 +88,7 @@ namespace { WindowControl::WindowControl(int monitorIndex, int windowIndex, const std::vector& monitorDims, - const QColor& winColor, QWidget* parent) + const QColor& winColor, bool resetToDefault, QWidget* parent) : QWidget(parent) , _monitorIndexDefault(monitorIndex) , _windowIndex(windowIndex) @@ -90,7 +97,9 @@ WindowControl::WindowControl(int monitorIndex, int windowIndex, , _unlockIcon(":/images/outline_unlocked.png") { createWidgets(winColor); - resetToDefaults(); + if (resetToDefault) { + resetToDefaults(); + } } void WindowControl::createWidgets(const QColor& windowColor) { @@ -293,11 +302,11 @@ void WindowControl::createWidgets(const QColor& windowColor) { _projectionType = new QComboBox; _projectionType->addItems({ - "Planar Projection", - "Fisheye", - "Spherical Mirror Projection", - "Cylindrical Projection", - "Equirectangular Projection" + ProjectionTypes[0], + ProjectionTypes[1], + ProjectionTypes[2], + ProjectionTypes[3], + ProjectionTypes[4] }); _projectionType->setToolTip("Select from the supported window projection types"); _projectionType->setCurrentIndex(0); @@ -625,10 +634,30 @@ void WindowControl::resetToDefaults() { emit windowChanged(_monitorIndexDefault, _windowIndex, _windowDimensions); } +void WindowControl::setDimensions(QRectF newDims) { + _windowDimensions = newDims; + _sizeX->setValue(_windowDimensions.width()); + _sizeY->setValue(_windowDimensions.height()); + _offsetX->setValue(_windowDimensions.x()); + _offsetY->setValue(_windowDimensions.y()); +} + +void WindowControl::setMonitorSelection(int monitorIndex) { + _monitor->setCurrentIndex(monitorIndex); +} + void WindowControl::showWindowLabel(bool show) { _windowNumber->setVisible(show); } +void WindowControl::setWindowName(const std::string& windowName) { + _windowName->setText(QString::fromStdString(windowName)); +} + +void WindowControl::setDecorationState(bool hasWindowDecoration) { + _windowDecoration->setChecked(hasWindowDecoration); +} + sgct::config::Projections WindowControl::generateProjectionInformation() const { ProjectionIndices type = static_cast(_projectionType->currentIndex()); @@ -706,9 +735,9 @@ sgct::config::Projections WindowControl::generateProjectionInformation() const { } } -sgct::config::Window WindowControl::generateWindowInformation() const { - sgct::config::Window window; - window.size = sgct::ivec2(_sizeX->text().toInt(), _sizeY->text().toInt()); +void WindowControl::generateWindowInformation(sgct::config::Window& window) const { + window.size = { _sizeX->text().toInt(), _sizeY->text().toInt() }; + window.monitor = _monitor->currentIndex(); QRect resolution = _monitorResolutions[_monitor->currentIndex()]; window.pos = sgct::ivec2( resolution.x() + _offsetX->text().toInt(), @@ -720,17 +749,56 @@ sgct::config::Window WindowControl::generateWindowInformation() const { vp.position = sgct::vec2(0.f, 0.f); vp.size = sgct::vec2(1.f, 1.f); vp.projection = generateProjectionInformation(); + window.viewports.clear(); window.viewports.push_back(vp); window.isDecorated = _windowDecoration->isChecked(); - if (window.isFullScreen) { - window.monitor = _monitor->currentIndex(); - } - if (!_windowName->text().isEmpty()) { window.name = _windowName->text().toStdString(); } - return window; +} + +void WindowControl::setProjectionPlanar(float hfov, float vfov) { + _planar.fovH->setValue(hfov); + _planar.fovV->setValue(vfov); + _projectionType->setCurrentIndex(static_cast(ProjectionIndices::Planar)); +} + +void WindowControl::setProjectionFisheye(int quality, bool spoutOutput) { + setQualityComboBoxFromLinesResolution(quality, _fisheye.quality); + _fisheye.spoutOutput->setChecked(spoutOutput); + _projectionType->setCurrentIndex(static_cast(ProjectionIndices::Fisheye)); +} + +void WindowControl::setProjectionSphericalMirror(int quality) { + setQualityComboBoxFromLinesResolution(quality, _sphericalMirror.quality); + _projectionType->setCurrentIndex( + static_cast(ProjectionIndices::SphericalMirror) + ); +} + +void WindowControl::setProjectionCylindrical(int quality, float heightOffset) { + setQualityComboBoxFromLinesResolution(quality, _cylindrical.quality); + _cylindrical.heightOffset->setValue(heightOffset); + _projectionType->setCurrentIndex(static_cast(ProjectionIndices::Cylindrical)); +} + +void WindowControl::setProjectionEquirectangular(int quality, bool spoutOutput) { + setQualityComboBoxFromLinesResolution(quality, _equirectangular.quality); + _equirectangular.spoutOutput->setChecked(spoutOutput); + _projectionType->setCurrentIndex( + static_cast(ProjectionIndices::Equirectangular) + ); +} + +void WindowControl::setQualityComboBoxFromLinesResolution(int lines, QComboBox* combo) { + ghoul_assert(combo, "Invalid pointer"); + for (unsigned int v = 0; v < nQualityTypes; ++v) { + if (lines == QualityValues[v]) { + combo->setCurrentIndex(v); + break; + } + } } void WindowControl::onSizeXChanged(int newValue) { diff --git a/apps/OpenSpace/ext/sgct b/apps/OpenSpace/ext/sgct index 05ed52d053..92ca9e7811 160000 --- a/apps/OpenSpace/ext/sgct +++ b/apps/OpenSpace/ext/sgct @@ -1 +1 @@ -Subproject commit 05ed52d0533b95954913a363499bb828512a6245 +Subproject commit 92ca9e7811ab4969cc8f21a06520409f04b7a308 diff --git a/config/schema/sgcteditor.schema.json b/config/schema/sgcteditor.schema.json new file mode 100644 index 0000000000..7f0b2276d4 --- /dev/null +++ b/config/schema/sgcteditor.schema.json @@ -0,0 +1,322 @@ +{ + "$id": "schema2e", + + "$defs": { + "cylindricalprojection": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "CylindricalProjection", + "default": "CylindricalProjection", + "readOnly": true + }, + "quality": { + "$ref": "sgct.schema.json#/$defs/projectionquality" + }, + "heightOffset": { + "type": "number", + "title": "Height Offset", + "description": "Offsets the height from which the cylindrical projection is generated. This is, in general, only necessary if the user position is offset and you want to counter that offset to continue producing a “standard” cylindrical projection" + } + }, + "required": [ "type" ], + "additionalProperties": false, + "description": "This projection method renders the scene into a view that can be mapped on the inside or outside of a cylinder. This projection method is support by some live media curation tools. The forward-facing direction will be at the left border of the image unless changed via the rotation option" + }, + + "fisheyeprojection": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "FisheyeProjection", + "default": "FisheyeProjection", + "readOnly": true + }, + "quality": { + "$ref": "sgct.schema.json#/$defs/projectionquality" + } + }, + "required": [ "type" ], + "additionalProperties": false, + "description": "Describes a fisheye projection that is used to render into its parent Viewport. This uses a default of 180 degrees field of view and has a 1:1 aspect ratio. This projection type counts as a non-linear projection, which requires 4-6 render passes of the application, meaning that the application might render slower when using these kind of projections than a flat projection. In either case, the application does not need to be aware of the projection as this abstract is handled internally and the applications draw method is only called multiple times per frame with different projection methods that are used to create the full fisheye projection" + }, + + "planarprojection": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "PlanarProjection", + "default": "PlanarProjection", + "readOnly": true + }, + "fov": { + "$ref": "sgct.schema.json#/$defs/fovhorizontalvertical", + "title": "Camera Field-of-View", + "description": "This element describes the field of view used the camera in this planar projection" + } + }, + "additionalProperties": false, + "description": "Describes a projection for the Viewport that is a flat projection described by simple frustum, which may be asymmetric" + }, + + "sphericalmirrorprojection": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "SphericalMirrorProjection", + "default": "SphericalMirrorProjection", + "readOnly": true + }, + "quality": { + "$ref": "sgct.schema.json#/$defs/projectionquality" + } + }, + "required": [ "type" ], + "additionalProperties": false, + "description": "Used to create a projection used for Paul Bourke's spherical mirror setup (see here), which makes it possible to use an off-the-shelf projector to create a planetarium-like environment by bouncing the image of a shiny metal mirror. Please note that this is not the only way to produce these kind of images. Depending on your setup and availability of warping meshes, it might suffice to use the FisheyeProjection node type instead and add a single mesh to the parent Viewport instead. The config folder in SGCT contains an example of this using a default 16x9 warping mesh. This projection type specifically deals with the case where you have four different meshes, one for the bottom, top, left, and right parts of the distorted image" + }, + + "spoutoutputprojection": { + "type": "object", + "properties": { + "type": { + "type": "string", + "const": "SpoutOutputProjection", + "default": "SpoutOutputProjection", + "readOnly": true + }, + "quality": { + "$ref": "sgct.schema.json#/$defs/projectionquality" + }, + "mapping": { + "type": "string", + "enum": [ "fisheye", "equirectangular" ], + "title": "Mapping", + "description": "Determines the type of sharing that occurs with this projection and thus how many and which texture is shared via Spout. For the “fisheye” and “equirectangular”, only the single, final reprojected image is shared, for the “cubemap” method, all selected cubemaps will be provided through the Spout interface. The default value is “cubemap”" + }, + "mappingspoutname": { + "type": "string", + "title": "Mapping Spout Name", + "description": "Sets the name of the texture if the mapping type is 'fisheye' or 'equirectangular'. If the mapping is 'cubemap', this value is ignored" + } + }, + "required": [ "type", "mapping" ], + "additionalProperties": false, + "description": "Provides the ability to share a fully reprojected image using the Spout library. This library only supports the Windows operating system, so this projection will only work on Windows machines. Spout's functionality is the abilty to shared textures between different applications on the same machine, making it possible to render images using SGCT and making them available to other real-time applications on the same machine for further processing. Spout uses a textual name for accessing which texture should be used for sharing. The SpoutOutputProjection has three different output types, outputting each cube map face, sharing a fisheye image, or sharing an equirectangular projection, as determined by the mapping attribute" + }, + + "projection": { + "oneOf": [ + { + "$ref": "#/$defs/planarprojection", + "title": "Planar Projection" + }, + { + "$ref": "#/$defs/fisheyeprojection", + "title": "Fisheye Projection" + }, + { + "$ref": "#/$defs/sphericalmirrorprojection", + "title": "Spherical Mirror Projection" + }, + { + "$ref": "#/$defs/spoutoutputprojection", + "title": "Spout Output Projection" + }, + { + "$ref": "#/$defs/cylindricalprojection", + "title": "Cylindrical Projection" + }, + { + "$ref": "sgct.schema.json#/$defs/equirectangularprojection", + "title": "Equirectangular Projection" + } + ], + "title": "Projection" + }, + + "node": { + "type": "object", + "properties": { + "address": { + "$ref": "sgct.schema.json#/$defs/address" + }, + "port": { + "$ref": "sgct.schema.json#/$defs/port" + }, + "windows": { + "type": "array", + "items": { + "type": "object", + "properties": { + "border": { + "$ref": "sgct.schema.json#/$defs/windowborder" + }, + "draw2d": { + "$ref": "sgct.schema.json#/$defs/draw2d" + }, + "draw3d": { + "$ref": "sgct.schema.json#/$defs/draw3d" + }, + "monitor": { + "$ref": "sgct.schema.json#/$defs/monitor" + }, + "id": { + "$ref": "sgct.schema.json#/$defs/id" + }, + "name": { + "$ref": "sgct.schema.json#/$defs/windowname" + }, + "pos": { + "$ref": "sgct.schema.json#/$defs/windowpos" + }, + "size": { + "$ref": "sgct.schema.json#/$defs/windowsize" + }, + "tags": { + "$ref": "sgct.schema.json#/$defs/tags" + }, + "viewports": { + "type": "array", + "items": { + "type": "object", + "properties": { + "pos": { + "$ref": "sgct.schema.json#/$defs/viewportpos" + }, + "size": { + "$ref": "sgct.schema.json#/$defs/viewportsize" + }, + "projection": { + "$ref": "sgct.schema.json#/$defs/projection" + }, + "tracked": { + "$ref": "sgct.schema.json#/$defs/tracked" + } + } + }, + "title": "Viewports" + } + }, + "required": [ "pos", "size", "viewports" ] + }, + "title": "Windows", + "description": "Specifies a single window that is used to render content into. There can be an arbitrary(-ish) number of windows for each node and they all will be created and initialized at start time. Each window has at least one Viewport that specifies exactly where in the window the rendering occurs with which parameters" + } + }, + "required": [ "address", "port", "windows" ], + "additionalProperties": false, + "description": "Defines a single computing node that is contained in the described cluster. In general this corresponds to a single computer, but it is also possible to create multiple nodes on a local machine by using the 127.0.0.x IP address with x from 0 to 255. It is not possible to create multiple nodes on the same remote computer, however" + }, + + "scene": { + "type": "object", + "properties": { + "orientation": { + "$ref": "sgct.schema.json#/$defs/quat", + "title": "Orientation", + "description": "Describes a fixed orientation of the global scene" + } + }, + "required": [ "orientation" ], + "additionalProperties": false, + "description": "Determines an overall orientation of the scene. It consists only of an Orientation, which is included in the projection matrix that is passed to the rendering function callback of the specific application. This node can be used to customize the rendering for a specific rendering window. A common use-case in planetariums, for example, is to account for a tilt in the display system by providing an Orientation with the same pitch as the planetarium surface. This makes it possible to reuse the same application between the planetarium dome and fixed setups without the need for special care" + }, + + "display": { + "type": "object", + "properties": { + "swapinterval": { + "type": "integer", + "minimum": 0, + "title": "Swap Interval", + "description": "Determines the swap interval for the application. This determines the amount of V-Sync that should occur for the application. The two most common values for this are 0 for disabling V-Sync and 1 for regular V-Sync. The number provided determines the number of screen updates to wait before swapping the backbuffers and returning. For example on a 60Hz monitor, swapinterval=\"1\" would lead to a maximum of 60Hz frame rate, swapinterval=\"2\" would lead to a maximum of 30Hz frame rate. Using the same values for a 144Hz monitor would be a refresh rate of 144 and 72 respectively. The default value is 0, meaning that V-Sync is disabled" + } + }, + "title": "Display", + "additionalProperties": false, + "description": "Settings specific for the handling of display-related settings for the whole application" + }, + + "settings": { + "type": "object", + "properties": { + "display": { + "$ref": "#/$defs/display" + } + }, + "additionalProperties": false, + "description": "Controls global settings that affect the overall behavior of the SGCT library that are not limited just to a single window" + }, + + "user": { + "type": "object", + "properties": { + "name": { + "type": "string", + "title": "Name", + "description": "Specifies the name of this user. Each user needs to have a unique name, but there also has to be exactly one user present that has an empty name (or without a name attribute) which is used as the default user" + }, + "eyeseparation": { + "type": "number", + "minimum": 0.0, + "title": "Eye Separation", + "description": "Determines the eye separation used for stereoscopic viewports. If no viewports in the configuration are using stereo, this setting is ignored" + }, + "pos": { + "$ref": "sgct.schema.json#/$defs/vec3", + "title": "Position", + "description": "A linear offset of the user position. Must define three float attributes x, y, and z. The default values are x=0, y=0, z=0, meaning that no linear offset is applied to the user's position" + } + }, + "additionalProperties": false, + "required": [ "pos" ], + "description": "Specifies a user position and parameters. In most cases, only a single unnamed user is necessary. However, in more general cases, it is possible to assign Users to specific Viewports to provide a more fine-grained control over the rendering that occurs in that viewport" + } + }, + + "type": "object", + "properties": { + "masteraddress": { + "$ref": "sgct.schema.json#/$defs/masteraddress" + }, + "nodes": { + "type": "array", + "items": { "$ref": "#/$defs/node" }, + "title": "Nodes" + }, + "scene": { + "$ref": "#/$defs/scene", + "title": "Scene" + }, + "settings": { + "$ref": "#/$defs/settings", + "title": "Settings" + }, + "version": { + "type": "integer" + }, + "users": { + "type": "array", + "items": { "$ref": "#/$defs/user" }, + "title": "Users" + }, + "generator": { + "type": "object", + "properties": { + "name": { "type": "string" }, + "major": { "type": "integer" }, + "minor": { "type": "integer" } + }, + "required": [ "name", "major", "minor" ] + } + }, + "additionalProperties": false, + "required": [ + "version", "masteraddress", "scene", "users", "generator" + ] +} diff --git a/data/assets/actions/nightsky/camera.asset b/data/assets/actions/nightsky/camera.asset new file mode 100644 index 0000000000..07ec8c766e --- /dev/null +++ b/data/assets/actions/nightsky/camera.asset @@ -0,0 +1,110 @@ +local level_horizon_yaw = { + Identifier = "os.nightsky.level_horizon_yaw", + Name = "Level Horizon Yaw", + Command = [[ + local currentNavState = openspace.navigation.getNavigationState(); + local newNavState = {}; + newNavState["Pitch"] = currentNavState["Pitch"]; + newNavState["Anchor"] = currentNavState["Anchor"]; + newNavState["Yaw"] = 0.0; + newNavState["Position"] = currentNavState["Position"]; + newNavState["Up"] = currentNavState["Up"]; + openspace.navigation.setNavigationState(newNavState) + ]], + Documentation = "Levels the horizon horizontally.", + GuiPath = "/Night Sky/View", + IsLocal = false +} +local look_up = { + Identifier = "os.nightsky.look_up", + Name = "Look up", + Command = [[ + local currentNavState = openspace.navigation.getNavigationState(); + local newNavState = {}; + newNavState["Pitch"] = math.pi; + newNavState["Anchor"] = currentNavState["Anchor"]; + newNavState["Yaw"] = currentNavState["Yaw"]; + newNavState["Position"] = currentNavState["Position"]; + newNavState["Up"] = currentNavState["Up"]; + openspace.navigation.setNavigationState(newNavState) + ]], + Documentation = "Sets the view to be looking at the zenith", + GuiPath = "/Night Sky/View", + IsLocal = false +} + +local level_horizon_pitch = { + Identifier = "os.nightsky.level_horizon_pitch", + Name = "Level Horizon Pitch", + Command = [[ + local currentNavState = openspace.navigation.getNavigationState(); + local newNavState = {}; + newNavState["Pitch"] = math.pi / 2.0; + newNavState["Anchor"] = currentNavState["Anchor"]; + newNavState["Yaw"] = currentNavState["Yaw"]; + newNavState["Position"] = currentNavState["Position"]; + newNavState["Up"] = currentNavState["Up"]; + openspace.navigation.setNavigationState(newNavState) + ]], + Documentation = "Levels the view to the horizon.", + GuiPath = "/Night Sky/View", + IsLocal = false +} + +local looking_north = { + Identifier = "os.nightsky.looking_north", + Name = "Looking North", + Command = [[ + local currentNavState = openspace.navigation.getNavigationState(); + local newNavState = {}; + newNavState["Pitch"] = math.pi / 2.0; + newNavState["Anchor"] = currentNavState["Anchor"]; + newNavState["Yaw"] = currentNavState["Yaw"]; + newNavState["Position"] = currentNavState["Position"]; + newNavState["Up"] = { 0.0, 0.0, 1.0 }; + openspace.navigation.setNavigationState(newNavState) + ]], + Documentation = "Sets the view for a horizon looking North.", + GuiPath = "/Night Sky/View", + IsLocal = false +} + +local looking_south = { + Identifier = "os.nightsky.looking_south", + Name = "Looking South", + Command = [[ + local currentNavState = openspace.navigation.getNavigationState(); + local newNavState = {}; + newNavState["Pitch"] = math.pi / 2.0; + newNavState["Anchor"] = currentNavState["Anchor"]; + newNavState["Yaw"] = currentNavState["Yaw"]; + newNavState["Position"] = currentNavState["Position"]; + newNavState["Up"] = { 0.0, 0.0, -1.0 }; + openspace.navigation.setNavigationState(newNavState) + ]], + Documentation = "Sets the view for a horizon looking South.", + GuiPath = "/Night Sky/View", + IsLocal = false +} + +asset.onInitialize(function() + openspace.action.registerAction(look_up) + openspace.action.registerAction(level_horizon_yaw) + openspace.action.registerAction(level_horizon_pitch) + openspace.action.registerAction(looking_north) + openspace.action.registerAction(looking_south) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(looking_south) + openspace.action.removeAction(looking_north) + openspace.action.removeAction(level_horizon_pitch) + openspace.action.removeAction(level_horizon_yaw) + openspace.action.removeAction(look_up) +end) + +asset.export(look_up) +asset.export(level_horizon_yaw) +asset.export(level_horizon_pitch) +asset.export(looking_north) +asset.export(looking_south) diff --git a/data/assets/actions/nightsky/daytime.asset b/data/assets/actions/nightsky/daytime.asset new file mode 100644 index 0000000000..6895088581 --- /dev/null +++ b/data/assets/actions/nightsky/daytime.asset @@ -0,0 +1,30 @@ +local enableDimming = { + Identifier = "os.nightsky.enable_dimming", + Name = "Enable atmosphere dimming", + Command = "openspace.setPropertyValue('{daytime_hidden}.Renderable.DimInAtmosphere', true)", + Documentation = "Sets items like the stars and constellations to be hidden during the day", + GuiPath = "/Night Sky/Daytime", + IsLocal = false +} + +local disableDimming = { + Identifier = "os.nightsky.disable_dimming", + Name = "Disable atmosphere dimming", + Command = "openspace.setPropertyValue('{daytime_hidden}.Renderable.DimInAtmosphere', false)", + Documentation = "Sets items like the stars and constellations to be shown during the day", + GuiPath = "/Night Sky/Daytime", + IsLocal = false +} + +asset.onInitialize(function() + openspace.action.registerAction(enableDimming) + openspace.action.registerAction(disableDimming) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(disableDimming) + openspace.action.removeAction(enableDimming) +end) + +asset.export(enableDimming) +asset.export(disableDimming) diff --git a/data/assets/base.asset b/data/assets/base.asset index 341463b15a..c9d501b38c 100644 --- a/data/assets/base.asset +++ b/data/assets/base.asset @@ -53,6 +53,7 @@ asset.require("scene/digitaluniverse/superclusters") asset.require("scene/digitaluniverse/supernovaremnants") asset.require("scene/digitaluniverse/tully") asset.require("scene/digitaluniverse/voids") +asset.require("nightsky/nightsky") asset.require("customization/globebrowsing") asset.require("util/default_actions") diff --git a/data/assets/educational/scale/arc_de_triomphe.asset b/data/assets/educational/scale/arc_de_triomphe.asset new file mode 100644 index 0000000000..40a92d01f0 --- /dev/null +++ b/data/assets/educational/scale/arc_de_triomphe.asset @@ -0,0 +1,79 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') +local sunAsset = asset.require('scene/solarsystem/sun/sun') + +local modelFolder = asset.syncedResource({ + Name = "Scale Model Arc de Triomphe", + Type = "HttpSynchronization", + Identifier = "scale_model_arc_de_triomphe", + Version = 1 +}) + +local scaleModel = { + Identifier = "Scale_ArcDeTriomphe", + Parent = earthAsset.Earth.Identifier, + --Note: Lat/Lon/Scale values comes from alignment with Esri World Imagery 2D layer + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = 48.87389, + Longitude = 2.29492, + Altitude = 0.0, + UseHeightmap = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = 48.87389, + Longitude = 2.29492, + UseHeightmap = false + } + }, + Renderable = { + Type = "RenderableModel", + GeometryFile = modelFolder .. "Fr_arch_OBJ.osmodel", + LightSources = { sunAsset.LightSource }, + }, + GUI = { + Name = "Arc de Triomphe", + Path = "/Scale Objects" + } +} + +local updatePositionAction = { + Identifier = "os.scale_models.drop_arc_de_triomphe", + Name = "Drop Arc de Triomphe under camera", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera('Scale_ArcDeTriomphe') + ]], + Documentation = "Updates the Arc de Triomphe position based on the globe location of the camera", + GuiPath = "/Scale Objects", + IsLocal = false +} + +local resetPositionAction = { + Identifier = "os.scale_models.reset_arc_de_triomphe", + Name = "Reset Arc de Triomphe position", + Command = [[ + openspace.globebrowsing.setNodePosition('Scale_ArcDeTriomphe', ']] .. earthAsset.Earth.Identifier .. [[', 48.87389, 2.29492) + ]], + Documentation = "Resets the Arc de Triomphe back to it's actual location", + GuiPath = "/Scale Objects", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(scaleModel) + openspace.action.registerAction(updatePositionAction) + openspace.action.registerAction(resetPositionAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(resetPositionAction) + openspace.action.removeAction(updatePositionAction) + openspace.removeSceneGraphNode(scaleModel) +end) + +asset.export(scaleModel) +asset.export(updatePositionAction) +asset.export(resetPositionAction) diff --git a/data/assets/educational/scale/big_ben.asset b/data/assets/educational/scale/big_ben.asset new file mode 100644 index 0000000000..c0aec62079 --- /dev/null +++ b/data/assets/educational/scale/big_ben.asset @@ -0,0 +1,81 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') +local sunAsset = asset.require('scene/solarsystem/sun/sun') + +local modelFolder = asset.syncedResource({ + Name = "Scale Model Big Ben", + Type = "HttpSynchronization", + Identifier = "scale_model_big_ben", + Version = 1 +}) + +local scaleModel = { + Identifier = "Scale_BigBen", + Parent = earthAsset.Earth.Identifier, + --Note: Lat/Lon/Scale values comes from alignment with Esri World Imagery 2D layer + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = 51.50079, + Longitude = -0.124279, + Altitude = 0.0, + UseHeightmap = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = 51.50079, + Longitude = -0.124279, + UseHeightmap = false + } + }, + Renderable = { + Type = "RenderableModel", + GeometryFile = modelFolder .. "bigben.osmodel", + RotationVector = { 0.0, 265.0, 0.0 }, + LightSources = { sunAsset.LightSource }, + ModelScale = "Millimeter" + }, + GUI = { + Name = "Big Ben", + Path = "/Scale Objects" + } +} + +local updatePositionAction = { + Identifier = "os.scale_models.drop_big_ben", + Name = "Drop Big Ben under camera", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera('Scale_BigBen') + ]], + Documentation = "Updates the Big Ben position based on the globe location of the camera", + GuiPath = "/Scale Objects", + IsLocal = false +} + +local resetPositionAction = { + Identifier = "os.scale_models.reset_big_ben", + Name = "Reset Big Ben position", + Command = [[ + openspace.globebrowsing.setNodePosition('Scale_BigBen', ']] .. earthAsset.Earth.Identifier .. [[', 51.50079, -0.124279) + ]], + Documentation = "Resets the Big Ben back to it's actual location", + GuiPath = "/Scale Objects", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(scaleModel) + openspace.action.registerAction(updatePositionAction) + openspace.action.registerAction(resetPositionAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(resetPositionAction) + openspace.action.removeAction(updatePositionAction) + openspace.removeSceneGraphNode(scaleModel) +end) + +asset.export(scaleModel) +asset.export(updatePositionAction) +asset.export(resetPositionAction) diff --git a/data/assets/educational/scale/burj_khalifa.asset b/data/assets/educational/scale/burj_khalifa.asset new file mode 100644 index 0000000000..863a3eb581 --- /dev/null +++ b/data/assets/educational/scale/burj_khalifa.asset @@ -0,0 +1,82 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') +local sunAsset = asset.require('scene/solarsystem/sun/sun') + +local modelFolder = asset.syncedResource({ + Name = "Scale Burj Khalifa", + Type = "UrlSynchronization", + Identifier = "scale_model_burj_khalifa", + Url = "https://wms.openspace.amnh.org/static/sync/url/scalemodels/Burj_Khalifa.osmodel", + Filename = "Burj_Khalifa.osmodel", + Override = false +}) + +local scaleModel = { + Identifier = "Scale_BurjKhalifa", + Parent = earthAsset.Earth.Identifier, + --Note: Lat/Lon/Scale values comes from alignment with Esri World Imagery 2D layer + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = 25.196715, + Longitude = 55.273972, + Altitude = -3.0, + UseHeightmap = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = 25.196715, + Longitude = 55.273972, + UseHeightmap = false + } + }, + Renderable = { + Type = "RenderableModel", + GeometryFile = modelFolder .. "Burj_Khalifa.osmodel", + LightSources = { sunAsset.LightSource }, + ModelScale = "Centimeter" + }, + GUI = { + Name = "Burj Khalifa", + Path = "/Scale Objects" + } +} + +local updatePositionAction = { + Identifier = "os.scale_models.drop_burj_khalifa", + Name = "Drop Burj Khalifa under camera", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera('Scale_BurjKhalifa') + ]], + Documentation = "Updates the Burj Khalifa position based on the globe location of the camera", + GuiPath = "/Scale Objects", + IsLocal = false +} + +local resetPositionAction = { + Identifier = "os.os.scale_models.reset_burj_khalifa", + Name = "Reset Burj Khalifa position", + Command = [[ + openspace.globebrowsing.setNodePosition('Scale_BurjKhalifa', ']] .. earthAsset.Earth.Identifier .. [[', 25.196715, 55.273972) + ]], + Documentation = "Resets the Burj Khalifa back to it's actual location", + GuiPath = "/Scale Objects", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(scaleModel) + openspace.action.registerAction(updatePositionAction) + openspace.action.registerAction(resetPositionAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(resetPositionAction) + openspace.action.removeAction(updatePositionAction) + openspace.removeSceneGraphNode(scaleModel) +end) + +asset.export(scaleModel) +asset.export(updatePositionAction) +asset.export(resetPositionAction) diff --git a/data/assets/educational/scale/eiffeltower.asset b/data/assets/educational/scale/eiffeltower.asset index 9b16c63579..7c51b7c513 100644 --- a/data/assets/educational/scale/eiffeltower.asset +++ b/data/assets/educational/scale/eiffeltower.asset @@ -2,30 +2,30 @@ local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') local sunAsset = asset.require('scene/solarsystem/sun/sun') local modelFolder = asset.syncedResource({ - Name = "Eiffel Tower Model", + Name = "Scale Eiffel Tower", Type = "HttpSynchronization", - Identifier = "eiffel_tower_model", + Identifier = "scale_model_eiffel_tower", Version = 1 }) -local eiffelTower = { - Identifier = "eiffelTower", +local scaleModel = { + Identifier = "Scale_EiffelTower", Parent = earthAsset.Earth.Identifier, --Note: Lat/Lon/Scale values comes from alignment with Esri World Imagery 2D layer Transform = { Translation = { Type = "GlobeTranslation", Globe = earthAsset.Earth.Identifier, - Longitude = 2.29448, Latitude = 48.85824, + Longitude = 2.29448, Altitude = 0.0, UseHeightmap = true }, Rotation = { Type = "GlobeRotation", Globe = earthAsset.Earth.Identifier, - Longitude = 2.29448, Latitude = 48.85824, + Longitude = 2.29448, UseHeightmap = false }, Scale = { @@ -36,9 +36,9 @@ local eiffelTower = { Renderable = { Type = "RenderableModel", GeometryFile = modelFolder .. "eiffeltower.osmodel", - ModelScale = "Centimeter", RotationVector = { 0.0, 45.0, 0.0 }, - LightSources = { sunAsset.LightSource } + LightSources = { sunAsset.LightSource }, + ModelScale = "Centimeter" }, GUI = { Name = "Eiffel Tower", @@ -47,18 +47,10 @@ local eiffelTower = { } local updatePositionAction = { - Identifier = "os.drop_eiffel_tower", - Name = "Drop Eiffel tower under camera", + Identifier = "os.scale_models.drop_eiffel_tower", + Name = "Drop Eiffel Tower under camera", Command = [[ - local lat, lon, alt = openspace.globebrowsing.getGeoPositionForCamera(); - local camera = openspace.navigation.getNavigationState(); - openspace.setParent('eiffelTower', camera.Anchor) - openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Globe', camera.Anchor); - openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Latitude', lat); - openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Longitude', lon); - openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Globe', camera.Anchor); - openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Latitude', lat); - openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Longitude', lon); + openspace.globebrowsing.setNodePositionFromCamera('Scale_EiffelTower') ]], Documentation = "Updates the Eiffel Tower position based on the globe location of the camera", GuiPath = "/Scale Objects", @@ -66,29 +58,18 @@ local updatePositionAction = { } local resetPositionAction = { - Identifier = "os.reset_eiffel_tower", - Name = "Reset Eiffel tower position", + Identifier = "os.os.scale_models.reset_eiffel_tower", + Name = "Reset Eiffel Tower position", Command = [[ - -- same position as above - local lat = 48.85824 - local lon = 2.29448 - local globe = ']] .. earthAsset.Earth.Identifier .. [[' - openspace.setParent('eiffelTower', globe) - openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Globe', globe); - openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Latitude', lat); - openspace.setPropertyValueSingle('Scene.eiffelTower.Translation.Longitude', lon); - openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Globe', globe); - openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Latitude', lat); - openspace.setPropertyValueSingle('Scene.eiffelTower.Rotation.Longitude', lon); + openspace.globebrowsing.setNodePosition('Scale_EiffelTower', ']] .. earthAsset.Earth.Identifier .. [[', 48.85824, 2.29448) ]], - Documentation = "Updates the Eiffel Tower position based on the globe location of the camera", + Documentation = "Resets the Eiffel Tower back to it's actual location", GuiPath = "/Scale Objects", IsLocal = false } - asset.onInitialize(function() - openspace.addSceneGraphNode(eiffelTower) + openspace.addSceneGraphNode(scaleModel) openspace.action.registerAction(updatePositionAction) openspace.action.registerAction(resetPositionAction) end) @@ -96,7 +77,9 @@ end) asset.onDeinitialize(function() openspace.action.removeAction(resetPositionAction) openspace.action.removeAction(updatePositionAction) - openspace.removeSceneGraphNode(eiffelTower) + openspace.removeSceneGraphNode(scaleModel) end) -asset.export(eiffelTower) +asset.export(scaleModel) +asset.export(updatePositionAction) +asset.export(resetPositionAction) diff --git a/data/assets/educational/scale/empire_state_building.asset b/data/assets/educational/scale/empire_state_building.asset new file mode 100644 index 0000000000..b83e6c1609 --- /dev/null +++ b/data/assets/educational/scale/empire_state_building.asset @@ -0,0 +1,84 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') +local sunAsset = asset.require('scene/solarsystem/sun/sun') + +local modelFolder = asset.syncedResource({ + Name = "Scale Empire State Building", + Type = "HttpSynchronization", + Identifier = "scale_model_empire_state", + Version = 1 +}) + +local scaleModel = { + Identifier = "Scale_EmpireStateBuilding", + Parent = earthAsset.Earth.Identifier, + --Note: Lat/Lon/Scale values comes from alignment with Esri World Imagery 2D layer + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = 40.748441, + Longitude = -73.985664, + Altitude = 0.0, + UseHeightmap = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = 40.748441, + Longitude = -73.985664, + UseHeightmap = false + }, + Scale = { + Type = "StaticScale", + Scale = 0.5 + } + }, + Renderable = { + Type = "RenderableModel", + GeometryFile = modelFolder .. "Empire_State_fbx.osmodel", + RotationVector = { 0.0, 60.0, 0.0 }, + LightSources = { sunAsset.LightSource } + }, + GUI = { + Name = "Empire State Building", + Path = "/Scale Objects" + } +} + +local updatePositionAction = { + Identifier = "os.scale_models.drop_empire_state_building", + Name = "Drop Empire State Building under camera", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera('Scale_EmpireStateBuilding') + ]], + Documentation = "Updates the Empire State Building position based on the globe location of the camera", + GuiPath = "/Scale Objects", + IsLocal = false +} + +local resetPositionAction = { + Identifier = "os.os.scale_models.reset_empire_state_building", + Name = "Reset Empire State Building position", + Command = [[ + openspace.globebrowsing.setNodePosition('Scale_EmpireStateBuilding', ']] .. earthAsset.Earth.Identifier .. [[', 40.748441, -73.985664) + ]], + Documentation = "Resets the Empire State Building back to it's actual location", + GuiPath = "/Scale Objects", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(scaleModel) + openspace.action.registerAction(updatePositionAction) + openspace.action.registerAction(resetPositionAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(resetPositionAction) + openspace.action.removeAction(updatePositionAction) + openspace.removeSceneGraphNode(scaleModel) +end) + +asset.export(scaleModel) +asset.export(updatePositionAction) +asset.export(resetPositionAction) diff --git a/data/assets/educational/scale/gateway_arch.asset b/data/assets/educational/scale/gateway_arch.asset new file mode 100644 index 0000000000..f6cc29b4ec --- /dev/null +++ b/data/assets/educational/scale/gateway_arch.asset @@ -0,0 +1,86 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') +local sunAsset = asset.require('scene/solarsystem/sun/sun') + +local modelFolder = asset.syncedResource({ + Name = "Scale Gateway Arch", + Type = "UrlSynchronization", + Identifier = "scale_model_gateway_arch", + Url = "https://wms.openspace.amnh.org/static/sync/url/scalemodels/GatewayArch_fbx.osmodel", + Filename = "GatewayArch_fbx.osmodel", + Override = false +}) + +local scaleModel = { + Identifier = "Scale_GatewayArch", + Parent = earthAsset.Earth.Identifier, + --Note: Lat/Lon/Scale values comes from alignment with Esri World Imagery 2D layer + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = 38.624880, + Longitude = -90.184939, + Altitude = 0.0, + UseHeightmap = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = 38.624880, + Longitude = -90.184939, + UseHeightmap = false + }, + Scale = { + Type = "StaticScale", + Scale = 0.5 + } + }, + Renderable = { + Type = "RenderableModel", + GeometryFile = modelFolder .. "GatewayArch_fbx.osmodel", + RotationVector = { 0.0, 157, 0.0 }, + LightSources = { sunAsset.LightSource } + }, + GUI = { + Name = "Gateway Arch", + Path = "/Scale Objects" + } +} + +local updatePositionAction = { + Identifier = "os.scale_models.drop_gateway_arch", + Name = "Drop Gateway Arch under camera", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera('Scale_GatewayArch') + ]], + Documentation = "Updates the Gateway Arch position based on the globe location of the camera", + GuiPath = "/Scale Objects", + IsLocal = false +} + +local resetPositionAction = { + Identifier = "os.os.scale_models.reset_gateway_arch", + Name = "Reset Gateway Arch position", + Command = [[ + openspace.globebrowsing.setNodePosition('Scale_GatewayArch', ']] .. earthAsset.Earth.Identifier .. [[', 38.624880, -90.184939) + ]], + Documentation = "Resets the Gateway Arch back to it's actual location", + GuiPath = "/Scale Objects", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(scaleModel) + openspace.action.registerAction(updatePositionAction) + openspace.action.registerAction(resetPositionAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(resetPositionAction) + openspace.action.removeAction(updatePositionAction) + openspace.removeSceneGraphNode(scaleModel) +end) + +asset.export(scaleModel) +asset.export(updatePositionAction) +asset.export(resetPositionAction) diff --git a/data/assets/educational/scale/golden_gate_bridge.asset b/data/assets/educational/scale/golden_gate_bridge.asset new file mode 100644 index 0000000000..b362c04678 --- /dev/null +++ b/data/assets/educational/scale/golden_gate_bridge.asset @@ -0,0 +1,87 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') +local sunAsset = asset.require('scene/solarsystem/sun/sun') + +local modelFolder = asset.syncedResource({ + Name = "Scale Golden Gate Bridge", + Type = "UrlSynchronization", + Identifier = "scale_model_golden_gate_bridge", + Url = "https://wms.openspace.amnh.org/static/sync/url/scalemodels/golden_gate.osmodel", + Filename = "golden_gate.osmodel", + Override = false +}) + +local scaleModel = { + Identifier = "Scale_GoldenGateBridge", + Parent = earthAsset.Earth.Identifier, + --Note: Lat/Lon/Scale values comes from alignment with Esri World Imagery 2D layer + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = 37.816116, + Longitude = -122.477890, + Altitude = 120.0, + UseHeightmap = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = 37.816116, + Longitude = -122.477890, + UseHeightmap = false + }, + Scale = { + Type = "StaticScale", + Scale = 0.2 + } + }, + Renderable = { + Type = "RenderableModel", + GeometryFile = modelFolder .. "golden_gate.osmodel", + ForceRenderInvisible = true, + RotationVector = { 0.0, 95.4, 0.0 }, + LightSources = { sunAsset.LightSource } + }, + GUI = { + Name = "Golden Gate Bridge", + Path = "/Scale Objects" + } +} + +local updatePositionAction = { + Identifier = "os.scale_models.drop_golden_gate_bridge", + Name = "Drop Golden Gate Bridge under camera", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera('Scale_GoldenGateBridge') + ]], + Documentation = "Updates the Golden Gate Bridge position based on the globe location of the camera", + GuiPath = "/Scale Objects", + IsLocal = false +} + +local resetPositionAction = { + Identifier = "os.os.scale_models.reset_golden_gate_bridge", + Name = "Reset Golden Gate Bridge position", + Command = [[ + openspace.globebrowsing.setNodePosition('Scale_GoldenGateBridge', ']] .. earthAsset.Earth.Identifier .. [[', 37.816116, -122.477890) + ]], + Documentation = "Resets the Golden Gate Bridge back to it's actual location", + GuiPath = "/Scale Objects", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(scaleModel) + openspace.action.registerAction(updatePositionAction) + openspace.action.registerAction(resetPositionAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(resetPositionAction) + openspace.action.removeAction(updatePositionAction) + openspace.removeSceneGraphNode(scaleModel) +end) + +asset.export(scaleModel) +asset.export(updatePositionAction) +asset.export(resetPositionAction) diff --git a/data/assets/educational/scale/kuala_lumpur_tower.asset b/data/assets/educational/scale/kuala_lumpur_tower.asset new file mode 100644 index 0000000000..d009d52824 --- /dev/null +++ b/data/assets/educational/scale/kuala_lumpur_tower.asset @@ -0,0 +1,79 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') +local sunAsset = asset.require('scene/solarsystem/sun/sun') + +local modelFolder = asset.syncedResource({ + Name = "Scale Kuala Lumpur Tower", + Type = "HttpSynchronization", + Identifier = "scale_model_kuala_lumpur_tower", + Version = 1 +}) + +local scaleModel = { + Identifier = "Scale_KualaLumpurTower", + Parent = earthAsset.Earth.Identifier, + --Note: Lat/Lon/Scale values comes from alignment with Esri World Imagery 2D layer + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = 3.152878, + Longitude = 101.703533, + Altitude = 0.0, + UseHeightmap = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = 3.152878, + Longitude = 101.703533, + UseHeightmap = false + } + }, + Renderable = { + Type = "RenderableModel", + GeometryFile = modelFolder .. "menara_kl_FBX.osmodel", + LightSources = { sunAsset.LightSource } + }, + GUI = { + Name = "Kuala Lumpur Tower", + Path = "/Scale Objects" + } +} + +local updatePositionAction = { + Identifier = "os.scale_models.drop_kuala_lumpur_tower", + Name = "Drop Kuala Lumpur Tower under camera", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera('Scale_KualaLumpurTower') + ]], + Documentation = "Updates the Kuala Lumpur Tower position based on the globe location of the camera", + GuiPath = "/Scale Objects", + IsLocal = false +} + +local resetPositionAction = { + Identifier = "os.os.scale_models.reset_kuala_lumpur_tower", + Name = "Reset Kuala Lumpur Tower position", + Command = [[ + openspace.globebrowsing.setNodePosition('Scale_KualaLumpurTower', ']] .. earthAsset.Earth.Identifier .. [[', 3.152878, 101.703533) + ]], + Documentation = "Resets the Kuala Lumpur Tower back to it's actual location", + GuiPath = "/Scale Objects", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(scaleModel) + openspace.action.registerAction(updatePositionAction) + openspace.action.registerAction(resetPositionAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(resetPositionAction) + openspace.action.removeAction(updatePositionAction) + openspace.removeSceneGraphNode(scaleModel) +end) + +asset.export(scaleModel) +asset.export(updatePositionAction) +asset.export(resetPositionAction) diff --git a/data/assets/educational/scale/rose_bowl.asset b/data/assets/educational/scale/rose_bowl.asset new file mode 100644 index 0000000000..180438ad49 --- /dev/null +++ b/data/assets/educational/scale/rose_bowl.asset @@ -0,0 +1,80 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') +local sunAsset = asset.require('scene/solarsystem/sun/sun') + +local modelFolder = asset.syncedResource({ + Name = "Scale Rose Bowl", + Type = "HttpSynchronization", + Identifier = "scale_model_rose_bowl", + Version = 1 +}) + +local scaleModel = { + Identifier = "Scale_RoseBowl", + Parent = earthAsset.Earth.Identifier, + --Note: Lat/Lon/Scale values comes from alignment with Esri World Imagery 2D layer + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = 34.161318, + Longitude = -118.167623, + Altitude = 0.0, + UseHeightmap = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = 34.161318, + Longitude = -118.167623, + UseHeightmap = false + } + }, + Renderable = { + Type = "RenderableModel", + GeometryFile = modelFolder .. "rose_bowl.gltf", + RotationVector = { 0.0, 98.68, 0.0 }, + LightSources = { sunAsset.LightSource } + }, + GUI = { + Name = "Rose Bowl", + Path = "/Scale Objects" + } +} + +local updatePositionAction = { + Identifier = "os.scale_models.drop_rose_bowl", + Name = "Drop Rose Bowl under camera", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera('Scale_RoseBowl') + ]], + Documentation = "Updates the Rose Bowl position based on the globe location of the camera", + GuiPath = "/Scale Objects", + IsLocal = false +} + +local resetPositionAction = { + Identifier = "os.os.scale_models.reset_rose_bowl", + Name = "Reset Rose Bowl position", + Command = [[ + openspace.globebrowsing.setNodePosition('Scale_RoseBowl', ']] .. earthAsset.Earth.Identifier .. [[', 34.161318, -118.167623) + ]], + Documentation = "Resets the Rose Bowl back to it's actual location", + GuiPath = "/Scale Objects", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(scaleModel) + openspace.action.registerAction(updatePositionAction) + openspace.action.registerAction(resetPositionAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(resetPositionAction) + openspace.action.removeAction(updatePositionAction) + openspace.removeSceneGraphNode(scaleModel) +end) + +asset.export(scaleModel) +asset.export(updatePositionAction) +asset.export(resetPositionAction) diff --git a/data/assets/educational/scale/school_bus.asset b/data/assets/educational/scale/school_bus.asset new file mode 100644 index 0000000000..eb48b4c08d --- /dev/null +++ b/data/assets/educational/scale/school_bus.asset @@ -0,0 +1,80 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') +local sunAsset = asset.require('scene/solarsystem/sun/sun') + +local modelFolder = asset.syncedResource({ + Name = "Scale School Bus", + Type = "HttpSynchronization", + Identifier = "scale_model_school_bus", + Version = 1 +}) + +local scaleModel = { + Identifier = "Scale_SchoolBus", + Parent = earthAsset.Earth.Identifier, + --Note: Lat/Lon/Scale values comes from alignment with Esri World Imagery 2D layer + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = 40.780671, + Longitude = -73.971701, + Altitude = 0.78, + UseHeightmap = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = 40.780671, + Longitude = -73.971701, + UseHeightmap = false + } + }, + Renderable = { + Type = "RenderableModel", + GeometryFile = modelFolder .. "school_bus.gltf", + RotationVector = { 0.0, 90.0, 0.0 }, + LightSources = { sunAsset.LightSource } + }, + GUI = { + Name = "School bus", + Path = "/Scale Objects" + } +} + +local updatePositionAction = { + Identifier = "os.scale_models.drop_school_bus", + Name = "Drop school bus under camera", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera('Scale_SchoolBus') + ]], + Documentation = "Updates the school bus position based on the globe location of the camera", + GuiPath = "/Scale Objects", + IsLocal = false +} + +local resetPositionAction = { + Identifier = "os.os.scale_models.reset_school_bus", + Name = "Reset School bus position", + Command = [[ + openspace.globebrowsing.setNodePosition('Scale_SchoolBus', ']] .. earthAsset.Earth.Identifier .. [[', 40.780671, -73.971701) + ]], + Documentation = "Resets the school bus back to it's actual location", + GuiPath = "/Scale Objects", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(scaleModel) + openspace.action.registerAction(updatePositionAction) + openspace.action.registerAction(resetPositionAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(resetPositionAction) + openspace.action.removeAction(updatePositionAction) + openspace.removeSceneGraphNode(scaleModel) +end) + +asset.export(scaleModel) +asset.export(updatePositionAction) +asset.export(resetPositionAction) diff --git a/data/assets/educational/scale/scientist.asset b/data/assets/educational/scale/scientist.asset new file mode 100644 index 0000000000..ae5b5e51eb --- /dev/null +++ b/data/assets/educational/scale/scientist.asset @@ -0,0 +1,80 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') +local sunAsset = asset.require('scene/solarsystem/sun/sun') + +local modelFolder = asset.syncedResource({ + Name = "Scale Model Scientist", + Type = "HttpSynchronization", + Identifier = "scale_model_scientist", + Version = 1 +}) + +local scaleModel = { + Identifier = "Scale_Scientist", + Parent = earthAsset.Earth.Identifier, + --Note: Lat/Lon/Scale values comes from alignment with Esri World Imagery 2D layer + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = 34.201639, + Longitude = -118.171319, + Altitude = 0.78, + UseHeightmap = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = 34.201639, + Longitude = -118.171319, + UseHeightmap = false + } + }, + Renderable = { + Type = "RenderableModel", + GeometryFile = modelFolder .. "scientist.gltf", + RotationVector = { 0.0, 90.0, 0.0 }, + LightSources = { sunAsset.LightSource } + }, + GUI = { + Name = "Scientist", + Path = "/Scale Objects" + } +} + +local updatePositionAction = { + Identifier = "os.scale_models.drop_scientist", + Name = "Drop Scientist under camera", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera('Scale_Scientist') + ]], + Documentation = "Updates the Scientist position based on the globe location of the camera", + GuiPath = "/Scale Objects", + IsLocal = false +} + +local resetPositionAction = { + Identifier = "os.os.scale_models.reset_scientist", + Name = "Reset Scientist position", + Command = [[ + openspace.globebrowsing.setNodePosition('Scale_Scientist', ']] .. earthAsset.Earth.Identifier .. [[', 34.201639, -118.171319) + ]], + Documentation = "Resets the Scientist back to it's actual location", + GuiPath = "/Scale Objects", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(scaleModel) + openspace.action.registerAction(updatePositionAction) + openspace.action.registerAction(resetPositionAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(resetPositionAction) + openspace.action.removeAction(updatePositionAction) + openspace.removeSceneGraphNode(scaleModel) +end) + +asset.export(scaleModel) +asset.export(updatePositionAction) +asset.export(resetPositionAction) diff --git a/data/assets/educational/scale/statue_of_liberty.asset b/data/assets/educational/scale/statue_of_liberty.asset new file mode 100644 index 0000000000..2aedc527b6 --- /dev/null +++ b/data/assets/educational/scale/statue_of_liberty.asset @@ -0,0 +1,80 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') +local sunAsset = asset.require('scene/solarsystem/sun/sun') + +local modelFolder = asset.syncedResource({ + Name = "Scale Model Statue of Liberty", + Type = "HttpSynchronization", + Identifier = "scale_model_statue_of_liberty", + Version = 1 +}) + +local scaleModel = { + Identifier = "Scale_StatueOfLiberty", + Parent = earthAsset.Earth.Identifier, + --Note: Lat/Lon/Scale values comes from alignment with Esri World Imagery 2D layer + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = 40.689206, + Longitude = -74.044487, + Altitude = -3, + UseHeightmap = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = 40.689206, + Longitude = -74.044487, + UseHeightmap = false + } + }, + Renderable = { + Type = "RenderableModel", + GeometryFile = modelFolder .. "STATUE_OF_LIBERTY.osmodel", + RotationVector = { 0.0, 235.0, 0.0 }, + LightSources = { sunAsset.LightSource } + }, + GUI = { + Name = "Statue of Liberty", + Path = "/Scale Objects" + } +} + +local updatePositionAction = { + Identifier = "os.scale_models.drop_statue_of_libery", + Name = "Drop Statue of Liberty under camera", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera('Scale_StatueOfLiberty') + ]], + Documentation = "Updates the Statue of Liberty position based on the globe location of the camera", + GuiPath = "/Scale Objects", + IsLocal = false +} + +local resetPositionAction = { + Identifier = "os.scale_models.reset_statue_of_libery", + Name = "Reset Statue of Liberty position", + Command = [[ + openspace.globebrowsing.setNodePosition('Scale_StatueOfLiberty', ']] .. earthAsset.Earth.Identifier .. [[', 40.689206, -74.044487) + ]], + Documentation = "Resets the Statue of Liberty back to it's actual location", + GuiPath = "/Scale Objects", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(scaleModel) + openspace.action.registerAction(updatePositionAction) + openspace.action.registerAction(resetPositionAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(resetPositionAction) + openspace.action.removeAction(updatePositionAction) + openspace.removeSceneGraphNode(scaleModel) +end) + +asset.export(scaleModel) +asset.export(updatePositionAction) +asset.export(resetPositionAction) diff --git a/data/assets/examples/geojson/geojson_extruded_shaded_polygon.asset b/data/assets/examples/geojson/geojson_extruded_shaded_polygon.asset new file mode 100644 index 0000000000..b3400ec522 --- /dev/null +++ b/data/assets/examples/geojson/geojson_extruded_shaded_polygon.asset @@ -0,0 +1,49 @@ +local earth = asset.require('scene/solarsystem/planets/earth/earth') +local earthIdentifier = earth.Earth.Identifier + +local sun = asset.require("scene/solarsystem/sun/sun") + +local data = asset.syncedResource({ + Name = "GeoJSON Example Africa", + Type = "UrlSynchronization", + Identifier = "geojson_example_polygon_extruded_africa", + Url = "http://liu-se.cdn.openspaceproject.com/files/examples/geojson/polygon_extruded_africa.geojson" +}) + +local Example_Polygon = { + Identifier = "Earth-Polygon-withLights", + File = data .. "polygon_extruded_africa.geojson", + HeightOffset = 20000.0, + DefaultProperties = { + Color = { 0.0, 1.0, 0.0 }, + FillColor = { 0.5, 0.6, 0.5 }, + LineWidth = 0.5, + FillOpacity = 1.0, + PerformShading = true + }, + LightSources = { + sun.LightSource + }, + Name = "Extruded and Shaded Polygon (lit by Sun)" +} + +asset.onInitialize(function() + openspace.globebrowsing.addGeoJson(earthIdentifier, Example_Polygon) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteGeoJson(earthIdentifier, Example_Polygon) +end) + +asset.export(Example_Polygon) + + +asset.meta = { + Name = "GeoJson Example - Extruded and Shaded Polygon", + Version = "1.0", + Description = [[GeoJson example asset demonstrating how to apply shading from light + sources on polygons]], + Author = "OpenSpace Team", + URL = "http://openspaceproject.com", + License = "MIT license" +} diff --git a/data/assets/examples/geojson/geojson_lines.asset b/data/assets/examples/geojson/geojson_lines.asset new file mode 100644 index 0000000000..07ce734622 --- /dev/null +++ b/data/assets/examples/geojson/geojson_lines.asset @@ -0,0 +1,39 @@ +local earth = asset.require('scene/solarsystem/planets/earth/earth') +local earthIdentifier = earth.Earth.Identifier + +local data = asset.syncedResource({ + Name = "GeoJSON Example Lines", + Type = "UrlSynchronization", + Identifier = "geojson_example_lines", + Url = "http://liu-se.cdn.openspaceproject.com/files/examples/geojson/lines.geojson" +}) + +local Example_Lines = { + Identifier = "Lines-Example", + File = data .. "lines.geojson", + HeightOffset = 20000.0, + DefaultProperties = { + LineWidth = 2.0 + }, + Name = "Example Lines" +} + +asset.onInitialize(function() + openspace.globebrowsing.addGeoJson(earthIdentifier, Example_Lines) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteGeoJson(earthIdentifier, Example_Lines) +end) + +asset.export(Example_Lines) + + +asset.meta = { + Name = "GeoJson Example - Lines", + Version = "1.0", + Description = [[GeoJson example asset with lines]], + Author = "OpenSpace Team", + URL = "http://openspaceproject.com", + License = "MIT license" +} diff --git a/data/assets/examples/geojson/geojson_multiple_polygons.asset b/data/assets/examples/geojson/geojson_multiple_polygons.asset new file mode 100644 index 0000000000..a61d676a30 --- /dev/null +++ b/data/assets/examples/geojson/geojson_multiple_polygons.asset @@ -0,0 +1,58 @@ +local earth = asset.require('scene/solarsystem/planets/earth/earth') +local earthIdentifier = earth.Earth.Identifier + +local data = asset.syncedResource({ + Name = "GeoJSON Example Polygon Multiple", + Type = "UrlSynchronization", + Identifier = "geojson_example_polygon_multiple", + Url = { + "http://liu-se.cdn.openspaceproject.com/files/examples/geojson/polygon_multiple.geojson", + "http://liu-se.cdn.openspaceproject.com/files/examples/geojson/polygon_different_heights.geojson" + } +}) + +local Example_Polygon = { + Identifier = "Earth-Polygon", + File = data .. "polygon_multiple.geojson", + HeightOffset = 20000.0, + DefaultProperties = { + Color = { 1.0, 0.0, 0.0 }, + LineWidth = 2.0 + }, + Name = "Polygon (Multiple)" +} + +local Example_Polygon_Diff_Heights = { + Identifier = "Earth-Polygon-Different-Heights", + File = data .. "polygon_different_heights.geojson", + HeightOffset = 20000.0, + DefaultProperties = { + Color = { 0.5, 0.0, 1.0 }, + LineWidth = 2.0 + }, + Name = "Polygon (Different heights)", + Description = "A GeoJSON test layer with some different heights" +} + +asset.onInitialize(function() + openspace.globebrowsing.addGeoJson(earthIdentifier, Example_Polygon) + openspace.globebrowsing.addGeoJson(earthIdentifier, Example_Polygon_Diff_Heights) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteGeoJson(earthIdentifier, Example_Polygon) + openspace.globebrowsing.deleteGeoJson(earthIdentifier, Example_Polygon_Diff_Heights) +end) + +asset.export(Example_Polygon) +asset.export(Example_Polygon_Diff_Heights) + + +asset.meta = { + Name = "GeoJson Example - Multiple Polygons", + Version = "1.0", + Description = [[GeoJson example asset with multiple polygons]], + Author = "OpenSpace Team", + URL = "http://openspaceproject.com", + License = "MIT license" +} diff --git a/data/assets/examples/geojson/geojson_points.asset b/data/assets/examples/geojson/geojson_points.asset new file mode 100644 index 0000000000..f152ebe077 --- /dev/null +++ b/data/assets/examples/geojson/geojson_points.asset @@ -0,0 +1,40 @@ +local earth = asset.require('scene/solarsystem/planets/earth/earth') +local earthIdentifier = earth.Earth.Identifier + +local data = asset.syncedResource({ + Name = "GeoJSON Example Outfacing", + Type = "UrlSynchronization", + Identifier = "geojson_example_points", + Url = "http://liu-se.cdn.openspaceproject.com/files/examples/geojson/points.geojson" +}) + +local Example_Points = { + Identifier = "Points-Example", + File = data .. "points.geojson", + HeightOffset = 20000.0, + DefaultProperties = { + PointSize = 10.0 + }, + Name = "Example Points" +} + +asset.onInitialize(function() + openspace.globebrowsing.addGeoJson(earthIdentifier, Example_Points) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteGeoJson(earthIdentifier, Example_Points) +end) + +asset.export(Example_Points) + + +asset.meta = { + Name = "GeoJson Example - Points", + Version = "1.0", + Description = [[GeoJson example asset with points that are facing the camera + (default)]], + Author = "OpenSpace Team", + URL = "http://openspaceproject.com", + License = "MIT license" +} diff --git a/data/assets/examples/geojson/geojson_points_outfacing.asset b/data/assets/examples/geojson/geojson_points_outfacing.asset new file mode 100644 index 0000000000..765d4cefb7 --- /dev/null +++ b/data/assets/examples/geojson/geojson_points_outfacing.asset @@ -0,0 +1,41 @@ +local earth = asset.require('scene/solarsystem/planets/earth/earth') +local earthIdentifier = earth.Earth.Identifier + +local data = asset.syncedResource({ + Name = "GeoJSON Example Outfacing", + Type = "UrlSynchronization", + Identifier = "geojson_example_points", + Url = "http://liu-se.cdn.openspaceproject.com/files/examples/geojson/points.geojson" +}) + +local Example_Points = { + Identifier = "Points-Example-outfacing", + File = data .. "points.geojson", + HeightOffset = 20000.0, + DefaultProperties = { + PointSize = 10.0 + }, + PointRenderMode = "Globe Normal", + Name = "Example Points (align to globe normal)" +} + +asset.onInitialize(function() + openspace.globebrowsing.addGeoJson(earthIdentifier, Example_Points) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteGeoJson(earthIdentifier, Example_Points) +end) + +asset.export(Example_Points) + + +asset.meta = { + Name = "GeoJson Example - Outfacing Points", + Version = "1.0", + Description = [[GeoJson example asset with point that are aligned to "stick out" of + the globe, i.e. face out of the planet]], + Author = "OpenSpace Team", + URL = "http://openspaceproject.com", + License = "MIT license" +} diff --git a/data/assets/examples/geojson/geojson_polygons_with_holes.asset b/data/assets/examples/geojson/geojson_polygons_with_holes.asset new file mode 100644 index 0000000000..48747fa337 --- /dev/null +++ b/data/assets/examples/geojson/geojson_polygons_with_holes.asset @@ -0,0 +1,39 @@ +local earth = asset.require('scene/solarsystem/planets/earth/earth') +local earthIdentifier = earth.Earth.Identifier + +local data = asset.syncedResource({ + Name = "GeoJSON Example Polygon with holes", + Type = "UrlSynchronization", + Identifier = "geojson_example_polygon_with_holes", + Url = "http://liu-se.cdn.openspaceproject.com/files/examples/geojson/polygon_with_holes.geojson" +}) + +local Example_Holes = { + Identifier = "PolygonWithHoles", + File = data .. "polygon_with_holes.geojson", + HeightOffset = 2000.0, + DefaultProperties = { + Color = { 0.0, 1.0, 1.0 } + }, + Name = "Example Polygon (holes)" +} + +asset.onInitialize(function() + openspace.globebrowsing.addGeoJson(earthIdentifier, Example_Holes) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteGeoJson(earthIdentifier, Example_Holes) +end) + +asset.export(Example_Holes) + + +asset.meta = { + Name = "GeoJson Example - Polygon with holes", + Version = "1.0", + Description = [[GeoJson example asset with polygon that has holes in it]], + Author = "OpenSpace Team", + URL = "http://openspaceproject.com", + License = "MIT license" +} diff --git a/data/assets/examples/geojson/geojson_roverpath.asset b/data/assets/examples/geojson/geojson_roverpath.asset new file mode 100644 index 0000000000..2b699eeed2 --- /dev/null +++ b/data/assets/examples/geojson/geojson_roverpath.asset @@ -0,0 +1,41 @@ +local mars = asset.require('scene/solarsystem/planets/mars/mars') +local marsIdentifier = mars.Mars.Identifier + +local data = asset.syncedResource({ + Name = "GeoJSON Example Path Perseverance", + Type = "UrlSynchronization", + Identifier = "geojson_example_path_perseverance", + Url = "http://liu-se.cdn.openspaceproject.com/files/examples/geojson/path_perseverance.geojson" +}) + +local Example_RoverPath = { + Identifier = "Mars-Perseverance-Path", + File = data .. "path_perseverance.geojson", + HeightOffset = 10.0, + IgnoreHeights = true, -- Ignores height values from the file itself + DefaultProperties = { + LineWidth = 2.0 + }, + Name = "Perseverance Rover Path" +} + +asset.onInitialize(function() + openspace.globebrowsing.addGeoJson(marsIdentifier, Example_RoverPath) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteGeoJson(marsIdentifier, Example_RoverPath) +end) + +asset.export(Example_RoverPath) + + +asset.meta = { + Name = "GeoJson Example - Rover path", + Version = "1.0", + Description = [[GeoJson example asset that renderes a snapshot of the path of the + Perseverance Rover on Mars. Data from: https://mars.nasa.gov/mars2020/mission/where-is-the-rover/]], + Author = "OpenSpace Team", + URL = "http://openspaceproject.com", + License = "MIT license" +} diff --git a/data/assets/examples/geojson/geojson_toronto_neighborhoods.asset b/data/assets/examples/geojson/geojson_toronto_neighborhoods.asset new file mode 100644 index 0000000000..a7122242ba --- /dev/null +++ b/data/assets/examples/geojson/geojson_toronto_neighborhoods.asset @@ -0,0 +1,42 @@ +local earth = asset.require('scene/solarsystem/planets/earth/earth') +local earthIdentifier = earth.Earth.Identifier + +local data = asset.syncedResource({ + Name = "GeoJSON Example Toronto Neighborhoods", + Type = "UrlSynchronization", + Identifier = "geojson_example_toronto_neighborhoods", + Url = "http://liu-se.cdn.openspaceproject.com/files/examples/geojson/toronto_neighborhoods.geojson" +}) + +local Example_Toronto = { + Identifier = "Toronto-Neighborhoods", + File = data .. "toronto_neighborhoods.geojson", + HeightOffset = 1000.0, + DefaultProperties = { + Color = { 0.0, 1.0, 0.0 }, + FillColor = { 0.2, 0.33, 0.2 }, + LineWidth = 2.0, + }, + Name = "Toronto Neighbourhoods" +} + +asset.onInitialize(function() + openspace.globebrowsing.addGeoJson(earthIdentifier, Example_Toronto) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteGeoJson(earthIdentifier, Example_Toronto) +end) + +asset.export(Example_Toronto) + + +asset.meta = { + Name = "GeoJson Example - Toronto neighborhoods", + Version = "1.0", + Description = [[GeoJson example asset that shows the neighborhoods of the city Toronto, + Canada, as polygons. Data source: https://handsondataviz.org/geojsonio.html]], + Author = "OpenSpace Team", + URL = "http://openspaceproject.com", + License = "MIT license" +} diff --git a/data/assets/examples/videoglobe.asset b/data/assets/examples/video/videoglobe.asset similarity index 91% rename from data/assets/examples/videoglobe.asset rename to data/assets/examples/video/videoglobe.asset index 3a9abe18fb..0819b4eac3 100644 --- a/data/assets/examples/videoglobe.asset +++ b/data/assets/examples/video/videoglobe.asset @@ -4,7 +4,7 @@ local data = asset.syncedResource({ Name = "Example Globe Video", Type = "UrlSynchronization", Identifier = "example_globe_video", - Url = "http://liu-se.cdn.openspaceproject.com/files/examples/test-video.mp4" + Url = "http://liu-se.cdn.openspaceproject.com/files/examples/video/test-video.mp4" }) local layer = { diff --git a/data/assets/examples/videoplane.asset b/data/assets/examples/video/videoplane.asset similarity index 92% rename from data/assets/examples/videoplane.asset rename to data/assets/examples/video/videoplane.asset index 564ae9cfc9..9492588ea3 100644 --- a/data/assets/examples/videoplane.asset +++ b/data/assets/examples/video/videoplane.asset @@ -4,7 +4,7 @@ local data = asset.syncedResource({ Name = "Example Globe Video", Type = "UrlSynchronization", Identifier = "example_globe_video", - Url = "http://liu-se.cdn.openspaceproject.com/files/examples/test-video.mp4" + Url = "http://liu-se.cdn.openspaceproject.com/files/examples/video/test-video.mp4" }) diff --git a/data/assets/examples/videoscreenspace.asset b/data/assets/examples/video/videoscreenspace.asset similarity index 82% rename from data/assets/examples/videoscreenspace.asset rename to data/assets/examples/video/videoscreenspace.asset index 22af9b67f4..221e12de11 100644 --- a/data/assets/examples/videoscreenspace.asset +++ b/data/assets/examples/video/videoscreenspace.asset @@ -2,14 +2,14 @@ local data = asset.syncedResource({ Name = "Example Globe Video", Type = "UrlSynchronization", Identifier = "example_globe_video", - Url = "http://liu-se.cdn.openspaceproject.com/files/examples/test-video.mp4" + Url = "http://liu-se.cdn.openspaceproject.com/files/examples/video/chlorophyll_model_2048.mp4" }) local spec = { Type = "ScreenSpaceVideo", Identifier = "ScreenSpaceVideoExample", Name = "Screen Space Video Example", - Video = data .. "/test-video.mp4" + Video = data .. "/chlorophyll_model_2048.mp4" }; asset.onInitialize(function() diff --git a/data/assets/examples/videosphere.asset b/data/assets/examples/video/videosphere.asset similarity index 92% rename from data/assets/examples/videosphere.asset rename to data/assets/examples/video/videosphere.asset index f7bc534b60..363e9cea02 100644 --- a/data/assets/examples/videosphere.asset +++ b/data/assets/examples/video/videosphere.asset @@ -2,7 +2,7 @@ local data = asset.syncedResource({ Name = "Example Globe Video", Type = "UrlSynchronization", Identifier = "example_globe_video", - Url = "http://liu-se.cdn.openspaceproject.com/files/examples/test-video.mp4" + Url = "http://liu-se.cdn.openspaceproject.com/files/examples/video/test-video.mp4" }) local sphere = { diff --git a/data/assets/examples/videostretchedtotime.asset b/data/assets/examples/video/videostretchedtotime.asset similarity index 92% rename from data/assets/examples/videostretchedtotime.asset rename to data/assets/examples/video/videostretchedtotime.asset index 5da34c242c..c88e6789a8 100644 --- a/data/assets/examples/videostretchedtotime.asset +++ b/data/assets/examples/video/videostretchedtotime.asset @@ -4,7 +4,7 @@ local data = asset.syncedResource({ Name = "Example Globe Video", Type = "UrlSynchronization", Identifier = "example_globe_video", - Url = "http://liu-se.cdn.openspaceproject.com/files/examples/test-video.mp4" + Url = "http://liu-se.cdn.openspaceproject.com/files/examples/video/test-video.mp4" }) local spec = { diff --git a/data/assets/nightsky/altaz.asset b/data/assets/nightsky/altaz.asset new file mode 100644 index 0000000000..5028184ace --- /dev/null +++ b/data/assets/nightsky/altaz.asset @@ -0,0 +1,109 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') + +local gridPosition = { + Identifier = "AltAzGridPosition", + Parent = earthAsset.Earth.Identifier, + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = 0.0, + Longitude = 0.0, + Altitude = 0.0, + UseHeightmap = false, + UseCamera = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = 0.0, + Longitude = 0.0, + UseHeightmap = false, + UseCamera = true + } + }, + GUI = { + Name = "Altitude/Azimuth Grid Position", + Path = "/Other/Grids", + Hidden = true + } +} + +local grid = { + Identifier = "AltAzGrid", + Parent = gridPosition.Identifier, + Transform = { + Scale = { + Type = "StaticScale", + Scale = 50000 + }, + Rotation = { + Type = "StaticRotation", + Rotation = { -math.pi / 2.0, 0.0, 0.0 } + }, + }, + Renderable = { + Type = "RenderableSphericalGrid", + Enabled = asset.enabled, + Opacity = 0.8, + Color = { 0.4, 0.8, 0.4 }, + LineWidth = 2.0, + RenderBinMode = "PostDeferredTransparent" + }, + GUI = { + Name = "Altitude/Azimuth Grid", + Path = "/Other/Grids" + } +} + +local showAction = { + Identifier = "os.nightsky.show_altaz", + Name = "Show Alt/Az grid", + Command = [[ + local lat, lon, alt = openspace.globebrowsing.getGeoPositionForCamera(); + local camera = openspace.navigation.getNavigationState(); + openspace.setParent('AltAzGridPosition', camera.Anchor) + openspace.setPropertyValueSingle('Scene.AltAzGridPosition.Translation.Globe', camera.Anchor); + openspace.setPropertyValueSingle('Scene.AltAzGridPosition.Translation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.AltAzGridPosition.Translation.Longitude', lon); + openspace.setPropertyValueSingle('Scene.AltAzGridPosition.Rotation.Globe', camera.Anchor); + openspace.setPropertyValueSingle('Scene.AltAzGridPosition.Rotation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.AltAzGridPosition.Rotation.Longitude', lon); + openspace.setPropertyValueSingle('Scene.AltAzGrid.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.AltAzGrid.Renderable.Fade', 0.0); + openspace.setPropertyValueSingle('Scene.AltAzGrid.Renderable.Fade', 1.0, 1.0); + ]], + Documentation = "Shows a local Altitude/Azimuth grid centered around your position", + GuiPath = "/Night Sky/Lines and Grids", + IsLocal = false +} + +local hideAction = { + Identifier = "os.nightsky.hide_altaz", + Name = "Hide Alt/Az grid", + Command = [[ + openspace.setPropertyValueSingle('Scene.AltAzGrid.Renderable.Fade', 0, 1); + ]], + Documentation = "Hides the Alt/Az grid", + GuiPath = "/Night Sky/Lines and Grids", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(gridPosition) + openspace.addSceneGraphNode(grid) + openspace.action.registerAction(hideAction) + openspace.action.registerAction(showAction) + +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(showAction) + openspace.action.removeAction(hideAction) + openspace.removeSceneGraphNode(grid) + openspace.removeSceneGraphNode(gridPosition) +end) + +asset.export(showAction) +asset.export(hideAction) +asset.export(grid) diff --git a/data/assets/nightsky/cardinal_directions.asset b/data/assets/nightsky/cardinal_directions.asset new file mode 100644 index 0000000000..c52b6743f4 --- /dev/null +++ b/data/assets/nightsky/cardinal_directions.asset @@ -0,0 +1,139 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') + +local textures = asset.syncedResource({ + Name = "Cardinal Direction Textures", + Type = "UrlSynchronization", + Identifier = "cardinal_direction_textures", + Url = { + "https://wms.openspace.amnh.org/static/sync/url/directions/sphere.png", + "https://wms.openspace.amnh.org/static/sync/url/directions/sphere2.png", + "https://wms.openspace.amnh.org/static/sync/url/directions/sphere3.png", + "https://wms.openspace.amnh.org/static/sync/url/directions/sphere4.png", + "https://wms.openspace.amnh.org/static/sync/url/directions/sphere5.png" + }, + Override = false +}) + +local Position = { + Identifier = "CardinalDirectionsPosition", + Parent = earthAsset.Earth.Identifier, + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = 0.0, + Longitude = 0.0, + Altitude = 0.0, + UseCamera = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = 0.0, + Longitude = 0.0, + UseCamera = true, + Angle = 270.0 + } + }, + GUI = { + Name = "Cardinal Directions Position", + Path = "/Other/Night Sky", + Hidden = true + } +} + +local sphere = { + Identifier = "CardinalDirectionSphere", + Parent = Position.Identifier, + Transform = { + Rotation = { + Type = "StaticRotation", + Rotation = { -math.pi/2, 0.0, 0.0 } + }, + }, + Renderable = { + Type = "RenderableSphere", + Enabled = asset.enabled, + Size = 50000, + Segments = 80, + Opacity = 0.9, + Texture = textures .. 'sphere.png', + Orientation = "Inside", + MirrorTexture = true, + RenderBinMode = "PostDeferredTransparent" + }, + GUI = { + Name = "Cardinal Directions", + Path = "/Other/Night Sky" + } +} + +local showCommand = [[ + local lat, lon, alt = openspace.globebrowsing.getGeoPositionForCamera(); + local camera = openspace.navigation.getNavigationState(); + openspace.setParent('CardinalDirectionsPosition', camera.Anchor) + openspace.setPropertyValueSingle('Scene.CardinalDirectionsPosition.Translation.Globe', camera.Anchor); + openspace.setPropertyValueSingle('Scene.CardinalDirectionsPosition.Translation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.CardinalDirectionsPosition.Translation.Longitude', lon); + openspace.setPropertyValueSingle('Scene.CardinalDirectionsPosition.Rotation.Globe', camera.Anchor); + openspace.setPropertyValueSingle('Scene.CardinalDirectionsPosition.Rotation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.CardinalDirectionsPosition.Rotation.Longitude', lon); + openspace.setPropertyValueSingle('Scene.CardinalDirectionSphere.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.CardinalDirectionSphere.Renderable.Fade', 0.0); + openspace.setPropertyValueSingle('Scene.CardinalDirectionSphere.Renderable.Fade', 1.0, 1.0); +]] + +local showBandAction = { +Identifier = "os.nightsky.show_nesw_band", + Name = "Show cardinal directions (with ticks)", + Command = "openspace.setPropertyValueSingle('Scene.CardinalDirectionSphere.Renderable.Texture','" + .. textures:gsub("\\","/") .. "sphere5.png')" + .. showCommand, + Documentation = "Shows the cardinal direction sphere with letters and circle with tick marks", + GuiPath = "/Night Sky/Directions", + IsLocal = false +} + +local showLettersAction = { + Identifier = "os.nightsky.show_nesw_letters", + Name = "Show cardinal directions (letters only)", + Command = "openspace.setPropertyValueSingle('Scene.CardinalDirectionSphere.Renderable.Texture','" + .. textures:gsub("\\","/") .. "sphere.png')" + .. showCommand, + Documentation = "Shows the cardinal direction sphere with letters only", + GuiPath = "/Night Sky/Directions", + IsLocal = false +} + +local hideAction = { + Identifier = "os.nightsky.hide_nesw", + Name = "Hide cardinal directions", + Command = [[ + openspace.setPropertyValueSingle('Scene.CardinalDirectionSphere.Renderable.Fade', 0.0, 1.0); + ]], + Documentation = "Hides the cardinal directions", + GuiPath = "/Night Sky/Directions", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(Position) + openspace.addSceneGraphNode(sphere) + openspace.action.registerAction(hideAction) + openspace.action.registerAction(showBandAction) + openspace.action.registerAction(showLettersAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(showLettersAction) + openspace.action.removeAction(showBandAction) + openspace.action.removeAction(hideAction) + openspace.removeSceneGraphNode(sphere) + openspace.removeSceneGraphNode(Position) +end) + +asset.export(showBandAction) +asset.export(showLettersAction) +asset.export(hideAction) +asset.export(sphere) +asset.export(Position) diff --git a/data/assets/nightsky/ecliptic_band.asset b/data/assets/nightsky/ecliptic_band.asset new file mode 100644 index 0000000000..e075aba8a6 --- /dev/null +++ b/data/assets/nightsky/ecliptic_band.asset @@ -0,0 +1,140 @@ +local transforms = asset.require("scene/solarsystem/sun/transforms") + +local textures = asset.syncedResource({ + Name = "Ecliptic Band Textures", + Type = "HttpSynchronization", + Identifier = "ecliptic_band_textures", + Version = 1 +}) + +local eclipticRotationMatrix = { + -0.05487554, 0.4941095, -0.8676661, + -0.9938214, -0.1109906, -0.0003515167, + -0.09647644, 0.8622859, 0.4971472 +} + +local line = { + Identifier = "EclipticLine", + Parent = transforms.SolarSystemBarycenter.Name, + Transform = { + Scale = { + Type = "StaticScale", + Scale = 4.28601E17; + }, + Rotation = { + Type = "StaticRotation", + Rotation = eclipticRotationMatrix + } + }, + Renderable = { + Type = "RenderableRadialGrid", + Opacity = 0.8, + Color = { 1.0, 1.0, 1.0 }, + LineWidth = 3.0, + GridSegments = { 1, 1 }, + Radii = { 0.5, 0.5 }, + Enabled = asset.enabled + }, + GUI = { + Name = "Ecliptic Line", + Path = "/Other/Lines" + } +} + +local band = { + Identifier = "EclipticBand", + Parent = transforms.SolarSystemBarycenter.Name, + Transform = { + Rotation = { + Type = "StaticRotation", + Rotation = eclipticRotationMatrix + } + }, + Renderable = { + Type = "RenderableSphere", + Texture = textures .. "band.png", + Size = 4.28601E17, + Segments = 50, + DisableFadeInOut = true, + Orientation = "Inside", + Opacity = 0.05, + Enabled = asset.enabled + }, + GUI = { + Name = "Ecliptic Band", + Path = "/Other/Lines" + } +} + +local showLineAction = { + Identifier = "os.nightsky.show_ecliptic_line", + Name = "Show ecliptic line", + Command = [[ + openspace.setPropertyValueSingle('Scene.EclipticLine.Renderable.Fade', 0.0); + openspace.setPropertyValueSingle('Scene.EclipticLine.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.EclipticLine.Renderable.Fade', 1.0, 1.0); + ]], + Documentation = "Shows the ecliptic line", + GuiPath = "/Night Sky/Lines and Grids", + IsLocal = false +} + +local hideLineAction = { + Identifier = "os.nightsky.hide_ecliptic_line", + Name = "Hide ecliptic line", + Command = [[ + openspace.setPropertyValueSingle('Scene.EclipticLine.Renderable.Fade', 0.0, 1.0); + ]], + Documentation = "Hides the ecliptic line", + GuiPath = "/Night Sky/Lines and Grids", + IsLocal = false +} + +local showBandAction = { + Identifier = "os.nightsky.show_ecliptic_band", + Name = "Show ecliptic band", + Command = [[ + openspace.setPropertyValueSingle('Scene.EclipticBand.Renderable.Fade', 0.0); + openspace.setPropertyValueSingle('Scene.EclipticBand.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.EclipticBand.Renderable.Fade', 1.0, 1.0); + ]], + Documentation = "Shows the ecliptic band", + GuiPath = "/Night Sky/Lines and Grids", + IsLocal = false +} + +local hideBandAction = { + Identifier = "os.nightsky.hide_ecliptic_band", + Name = "Hide ecliptic band", + Command = [[ + openspace.setPropertyValueSingle('Scene.EclipticBand.Renderable.Fade', 0.0, 1.0); + ]], + Documentation = "Hides the ecliptic band", + GuiPath = "/Night Sky/Lines and Grids", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(line) + openspace.addSceneGraphNode(band) + openspace.action.registerAction(showLineAction) + openspace.action.registerAction(hideLineAction) + openspace.action.registerAction(showBandAction) + openspace.action.registerAction(hideBandAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(hideLineAction) + openspace.action.removeAction(showLineAction) + openspace.action.removeAction(hideBandAction) + openspace.action.removeAction(showBandAction) + openspace.removeSceneGraphNode(band) + openspace.removeSceneGraphNode(line) +end) + +asset.export(band) +asset.export(line) +asset.export(showLineAction) +asset.export(hideLineAction) +asset.export(showBandAction) +asset.export(hideBandAction) diff --git a/data/assets/nightsky/equatorial_band.asset b/data/assets/nightsky/equatorial_band.asset new file mode 100644 index 0000000000..d3344c6732 --- /dev/null +++ b/data/assets/nightsky/equatorial_band.asset @@ -0,0 +1,75 @@ +local transforms = asset.require("scene/solarsystem/sun/transforms") + +local equatorialRotationMatrix = { + -0.05487554, 0.4941095, -0.8676661, + -0.8734371, -0.4448296, -0.1980764, + -0.483835, 0.7469823, 0.4559838 +} + +local line = { + Identifier = "EquatorialLine", + Parent = transforms.SolarSystemBarycenter.Name, + Transform = { + Scale = { + Type = "StaticScale", + Scale = 4.28601E17; + }, + Rotation = { + Type = "StaticRotation", + Rotation = equatorialRotationMatrix + } + }, + Renderable = { + Type = "RenderableRadialGrid", + Opacity = 0.8, + Color = { 1.0, 1.0, 1.0 }, + LineWidth = 3.0, + GridSegments = { 1, 1 }, + Radii = { 0.5, 0.5 }, + Enabled = asset.enabled + }, + GUI = { + Name = "Equatorial Line", + Path = "/Other/Lines" + } +} + +local showLineAction = { + Identifier = "os.nightsky.show_equatorial_line", + Name = "Show equatorial line", + Command = [[ + openspace.setPropertyValueSingle('Scene.EquatorialLine.Renderable.Fade', 0.0); + openspace.setPropertyValueSingle('Scene.EquatorialLine.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.EquatorialLine.Renderable.Fade', 1.0, 1.0); + ]], + Documentation = "Shows the equatorial line", + GuiPath = "/Night Sky/Lines and Grids", + IsLocal = false +} + +local hideLineAction = { + Identifier = "os.nightsky.hide_equatorial_line", + Name = "Hide equatorial line", + Command = [[ + openspace.setPropertyValueSingle('Scene.EquatorialLine.Renderable.Fade', 0.0, 1.0); + ]], + Documentation = "Hides the equatorial line", + GuiPath = "/Night Sky/Lines and Grids", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(line) + openspace.action.registerAction(showLineAction) + openspace.action.registerAction(hideLineAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(hideLineAction) + openspace.action.removeAction(showLineAction) + openspace.removeSceneGraphNode(line) +end) + +asset.export(line) +asset.export(showLineAction) +asset.export(hideLineAction) diff --git a/data/assets/nightsky/galactic_band.asset b/data/assets/nightsky/galactic_band.asset new file mode 100644 index 0000000000..ab1389b258 --- /dev/null +++ b/data/assets/nightsky/galactic_band.asset @@ -0,0 +1,65 @@ +local transforms = asset.require("scene/solarsystem/sun/transforms") + +local band = { + Identifier = "GalacticBand", + Parent = transforms.SolarSystemBarycenter.Name, + Transform = { + Scale = { + Type = "StaticScale", + Scale = 9.46377307652E18; + } + }, + Renderable = { + Type = "RenderableRadialGrid", + Opacity = 0.8, + Color = { 1.0, 1.0, 1.0 }, + LineWidth = 3.0, + GridSegments = { 1, 1 }, + Radii = { 0.5, 0.5 }, + Enabled = asset.enabled + }, + GUI = { + Name = "Galactic Band", + Path = "/Other/Lines" + } +} + +local showAction = { + Identifier = "os.nightsky.show_galactic_band", + Name = "Show galactic band", + Command = [[ + openspace.setPropertyValueSingle('Scene.GalacticBand.Renderable.Fade', 0.0); + openspace.setPropertyValueSingle('Scene.GalacticBand.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.GalacticBand.Renderable.Fade', 1.0, 1.0); + ]], + Documentation = "Shows the galactic band", + GuiPath = "/Night Sky/Lines and Grids", + IsLocal = false +} + +local hideAction = { + Identifier = "os.nightsky.hide_galactic_band", + Name = "Hide galactic band", + Command = [[ + openspace.setPropertyValueSingle('Scene.GalacticBand.Renderable.Fade', 0.0, 1.0); + ]], + Documentation = "Hides the galactic band", + GuiPath = "/Night Sky/Lines and Grids", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(band) + openspace.action.registerAction(showAction) + openspace.action.registerAction(hideAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(hideAction) + openspace.action.removeAction(showAction) + openspace.removeSceneGraphNode(band) +end) + +asset.export(band) +asset.export(showAction) +asset.export(hideAction) diff --git a/data/assets/nightsky/ground_panoramas.asset b/data/assets/nightsky/ground_panoramas.asset new file mode 100644 index 0000000000..9d91853e75 --- /dev/null +++ b/data/assets/nightsky/ground_panoramas.asset @@ -0,0 +1,186 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') + +local textures = asset.syncedResource({ + Name = "Ground Panorama Textures", + Type = "UrlSynchronization", + Identifier = "ground_panorama_textures", + Url = { + "https://wms.openspace.amnh.org/static/sync/url/panos/0.png", + "https://wms.openspace.amnh.org/static/sync/url/panos/1.png", + "https://wms.openspace.amnh.org/static/sync/url/panos/2.png", + "https://wms.openspace.amnh.org/static/sync/url/panos/3.png", + "https://wms.openspace.amnh.org/static/sync/url/panos/4.png", + "https://wms.openspace.amnh.org/static/sync/url/panos/5.png", + "https://wms.openspace.amnh.org/static/sync/url/panos/6.png", + }, + Override = false +}) + +local position = { + Identifier = "GroundPanoPosition", + Parent = earthAsset.Earth.Identifier, + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = 34.201639, + Longitude = -118.171319, + Altitude = 10.0, + UseCamera = true, + UseCameraAltitude = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = 34.201639, + Longitude = -118.171319, + UseHeightmap = false, + Angle = 270.0 + } + }, + GUI = { + Name = "Ground Pano Position", + Path = "/Other/Night Sky", + Hidden = true + } +} + +local sphere = { + Identifier = "GroundPanoSphere", + Parent = position.Identifier, + Transform = { + Rotation = { + Type = "StaticRotation", + Rotation = { -math.pi/2, 0.0, 0.0 } + }, + }, + Renderable = { + Type = "RenderableSphere", + Size = 8.5, + Segments = 40, + Opacity = 1.0, + Enabled = asset.enabled, + Texture = textures .. "3.png", + Orientation = "Inside", + MirrorTexture = true, + FadeOutThreshold = 1.00, + Background = true, + RenderBinMode = "Overlay" + }, + GUI = { + Name = "Ground Panorama", + Path = "/Other/Night Sky" + } +} + +local showCommand = [[ + local lat, lon, alt = openspace.globebrowsing.getGeoPositionForCamera(); + local camera = openspace.navigation.getNavigationState(); + openspace.setParent('GroundPanoPosition', camera.Anchor) + openspace.setPropertyValueSingle('Scene.GroundPanoPosition.Translation.Globe', camera.Anchor); + openspace.setPropertyValueSingle('Scene.GroundPanoPosition.Translation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.GroundPanoPosition.Translation.Longitude', lon); + openspace.setPropertyValueSingle('Scene.GroundPanoPosition.Translation.Altitude', alt); + openspace.setPropertyValueSingle('Scene.GroundPanoPosition.Rotation.Globe', camera.Anchor); + openspace.setPropertyValueSingle('Scene.GroundPanoPosition.Rotation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.GroundPanoPosition.Rotation.Longitude', lon); + openspace.setPropertyValueSingle('Scene.GroundPanoSphere.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.GroundPanoSphere.Renderable.Fade', 0.0); + openspace.setPropertyValueSingle('Scene.GroundPanoSphere.Renderable.Fade', 1.0, 1.0); +]] + +local setTextureCommand = function(scene) + local command = 'openspace.setPropertyValueSingle("Scene.GroundPanoSphere.Renderable.Texture", "' + command = command .. textures + if (scene == "forest") then + command = command .. "1" + elseif (scene == 'city') then + command = command .. "2" + elseif (scene == 'backyard') then + command = command .. "3" + elseif (scene == 'desert') then + command = command .. "4" + else + openspace.printDebug("unknown scene") + end + command = command .. '.png")' + command = command:gsub( "\\", "\\\\") + return command +end + +local showForestAction = { + Identifier = "os.nightsky.show_forest_pano", + Name = "Show forest panorama", + Command = setTextureCommand("forest") .. showCommand, + Documentation = "Shows the panorama sphere with a forest scene", + GuiPath = "/Night Sky/Panoramas", + IsLocal = false +} + +local showCityAction = { + Identifier = "os.nightsky.show_city_pano", + Name = "Show city panorama", + Command = setTextureCommand("city") .. showCommand, + Documentation = "Shows the panorama sphere with a city scene", + GuiPath = "/Night Sky/Panoramas", + IsLocal = false +} + +local showBackyardAction = { + Identifier = "os.nightsky.show_backyard_pano", + Name = "Show backyard panorama", + Command = setTextureCommand("backyard") .. showCommand, + Documentation = "Shows the panorama sphere with a backyard scene", + GuiPath = "/Night Sky/Panoramas", + IsLocal = false +} + +local showDesertAction = { + Identifier = "os.nightsky.show_desert_pano", + Name = "Show desert panorama", + Command = setTextureCommand("desert") .. showCommand, + Documentation = "Shows the panorama sphere with a desert scene", + GuiPath = "/Night Sky/Panoramas", + IsLocal = false +} + +local hideAction = { + Identifier = "os.nightsky.hide_ground_pano", + Name = "Hide ground panorama", + Command = [[ + -- same position as above + openspace.setPropertyValueSingle('Scene.GroundPanoSphere.Renderable.Fade', 0.0, 0.5); + ]], + Documentation = "Hides the ground panorama", + GuiPath = "/Night Sky/Panoramas", + IsLocal = false +} + + +asset.onInitialize(function() + openspace.addSceneGraphNode(position) + openspace.addSceneGraphNode(sphere) + openspace.action.registerAction(hideAction) + openspace.action.registerAction(showForestAction) + openspace.action.registerAction(showCityAction) + openspace.action.registerAction(showBackyardAction) + openspace.action.registerAction(showDesertAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(showForestAction) + openspace.action.removeAction(showCityAction) + openspace.action.removeAction(showBackyardAction) + openspace.action.removeAction(showDesertAction) + openspace.action.removeAction(hideAction) + openspace.removeSceneGraphNode(sphere) + openspace.removeSceneGraphNode(position) +end) + +asset.export(position) +asset.export(sphere) +asset.export(hideAction) +asset.export(showForestAction) +asset.export(showCityAction) +asset.export(showBackyardAction) +asset.export(showDesertAction) diff --git a/data/assets/nightsky/light_pollution.asset b/data/assets/nightsky/light_pollution.asset new file mode 100644 index 0000000000..1865286c34 --- /dev/null +++ b/data/assets/nightsky/light_pollution.asset @@ -0,0 +1,248 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') + +local textures = asset.syncedResource({ + Name = "Light Pollution Textures", + Type = "HttpSynchronization", + Identifier = "light_pollution_textures", + Version = 1 +}) + +local sphere = { + Identifier = "LightPollutionSphere", + Parent = earthAsset.Earth.Identifier, + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = 34.201639, + Longitude = -118.171319, + Altitude = 10.0, + UseCamera = true, + UseCameraAltitude = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = 34.201639, + Longitude = -118.171319, + UseHeightmap = false, + Angle = 270.0 + } + }, + Renderable = { + Type = "RenderableSphere", + Size = 8.5, + Segments = 40, + Opacity = 0.0, + Enabled = asset.enabled, + Texture = textures .. "fullsphere.png", + Orientation = "Inside", + MirrorTexture = true, + FadeOutThreshold = 1.00, + Background = true, + RenderBinMode = "PostDeferredTransparent", + Enabled = asset.enabled + }, + GUI = { + Name = "Light Pollution Sphere", + Path = "/Other/Night Sky", + Hidden = false + } +} + +local pollution_1 = { + Identifier = "os.nightsky.set_light_pollution_level_1", + Name = "Set light pollution level 1", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera("LightPollutionSphere", true) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Fade', 1.0); + openspace.setPropertyValueSingle("Scene.MilkyWay.Renderable.Fade", 0.9, 0.3) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Opacity', 0.01, 0.5); + openspace.setPropertyValueSingle('Scene.Stars.Renderable.ParametersOwner.MagnitudeExponent', 6.1, 0.3); + ]], + Documentation = "Adds a light pollution sphere and lowers the level of the stars by 0.1", + GuiPath = "/Night Sky/Light Pollution", + IsLocal = false +} + +local pollution_2 = { + Identifier = "os.nightsky.set_light_pollution_level_2", + Name = "Set light pollution level 2", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera("LightPollutionSphere", true) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Fade', 1.0); + openspace.setPropertyValueSingle("Scene.MilkyWay.Renderable.Fade", 0.8, 0.3) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Opacity', 0.02, 0.5); + openspace.setPropertyValueSingle('Scene.Stars.Renderable.ParametersOwner.MagnitudeExponent', 6.0, 0.3); + ]], + Documentation = "Adds a light pollution sphere and lowers the level of the stars by 0.2", + GuiPath = "/Night Sky/Light Pollution", + IsLocal = false +} + +local pollution_3 = { + Identifier = "os.nightsky.set_light_pollution_level_3", + Name = "Set light pollution level 3", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera("LightPollutionSphere", true) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Fade', 1.0); + openspace.setPropertyValueSingle("Scene.MilkyWay.Renderable.Fade", 0.7, 0.3) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Opacity', 0.03, 0.5); + openspace.setPropertyValueSingle('Scene.Stars.Renderable.ParametersOwner.MagnitudeExponent', 5.9, 0.3); + ]], + Documentation = "Adds a light pollution sphere and lowers the level of the stars by 0.3", + GuiPath = "/Night Sky/Light Pollution", + IsLocal = false +} + +local pollution_4 = { + Identifier = "os.nightsky.set_light_pollution_level_4", + Name = "Set light pollution level 4", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera("LightPollutionSphere", true) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Fade', 1.0); + openspace.setPropertyValueSingle("Scene.MilkyWay.Renderable.Fade", 0.6, 0.3) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Opacity', 0.04, 0.5); + openspace.setPropertyValueSingle('Scene.Stars.Renderable.ParametersOwner.MagnitudeExponent', 5.8, 0.3); + ]], + Documentation = "Adds a light pollution sphere and lowers the level of the stars by 0.4", + GuiPath = "/Night Sky/Light Pollution", + IsLocal = false +} + +local pollution_5 = { + Identifier = "os.nightsky.set_light_pollution_level_5", + Name = "Set light pollution level 5", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera("LightPollutionSphere", true) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Fade', 1.0); + openspace.setPropertyValueSingle("Scene.MilkyWay.Renderable.Fade", 0.5, 0.3) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Opacity', 0.05, 0.5); + openspace.setPropertyValueSingle('Scene.Stars.Renderable.ParametersOwner.MagnitudeExponent', 5.8, 0.4); + ]], + Documentation = "Adds a light pollution sphere and lowers the level of the stars by 0.5", + GuiPath = "/Night Sky/Light Pollution", + IsLocal = false +} + +local pollution_6 = { + Identifier = "os.nightsky.set_light_pollution_level_6", + Name = "Set light pollution level 6", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera("LightPollutionSphere", true) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Fade', 1.0); + openspace.setPropertyValueSingle("Scene.MilkyWay.Renderable.Fade", 0.4, 0.3) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Opacity', 0.06, 0.5); + openspace.setPropertyValueSingle('Scene.Stars.Renderable.ParametersOwner.MagnitudeExponent', 5.7, 0.4); + ]], + Documentation = "Adds a light pollution sphere and lowers the level of the stars by 0.6", + GuiPath = "/Night Sky/Light Pollution", + IsLocal = false +} + +local pollution_7 = { + Identifier = "os.nightsky.set_light_pollution_level_7", + Name = "Set light pollution level 7", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera("LightPollutionSphere", true) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Fade', 1.0); + openspace.setPropertyValueSingle("Scene.MilkyWay.Renderable.Fade", 0.3, 0.3) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Opacity', 0.07, 0.5); + openspace.setPropertyValueSingle('Scene.Stars.Renderable.ParametersOwner.MagnitudeExponent', 5.6, 0.4); + ]], + Documentation = "Adds a light pollution sphere and lowers the level of the stars by 0.7", + GuiPath = "/Night Sky/Light Pollution", + IsLocal = false +} + +local pollution_8 = { + Identifier = "os.nightsky.set_light_pollution_level_8", + Name = "Set light pollution level 8", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera("LightPollutionSphere", true) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Fade', 1.0); + openspace.setPropertyValueSingle("Scene.MilkyWay.Renderable.Fade", 0.2, 0.3) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Opacity', 0.08, 0.5); + openspace.setPropertyValueSingle('Scene.Stars.Renderable.ParametersOwner.MagnitudeExponent', 5.5, 0.4); + ]], + Documentation = "Adds a light pollution sphere and lowers the level of the stars by 0.8", + GuiPath = "/Night Sky/Light Pollution", + IsLocal = false +} + +local pollution_9 = { + Identifier = "os.nightsky.set_light_pollution_level_9", + Name = "Set light pollution level 9", + Command = [[ + openspace.globebrowsing.setNodePositionFromCamera("LightPollutionSphere", true) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Enabled', true) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Fade', 1.0) + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Opacity', 0.09, 0.5) + openspace.setPropertyValueSingle("Scene.MilkyWay.Renderable.Fade", 0.1, 0.3) + openspace.setPropertyValueSingle('Scene.Stars.Renderable.ParametersOwner.MagnitudeExponent', 5.4, 0.4) + ]], + Documentation = "Adds a light pollution sphere and lowers the level of the stars by 0.9", + GuiPath = "/Night Sky/Light Pollution", + IsLocal = false +} + +local hideAction = { + Identifier = "os.nightsky.undo_light_pollution", + Name = "Undo light pollution", + Command = [[ + openspace.setPropertyValueSingle('Scene.LightPollutionSphere.Renderable.Fade', 0.0, 0.3) + openspace.setPropertyValueSingle('Scene.Stars.Renderable.ParametersOwner.MagnitudeExponent', 6.2, 0.3) + openspace.setPropertyValueSingle("Scene.MilkyWay.Renderable.Fade", 1.0, 0.3) + ]], + Documentation = "Hides the light pollution sphere and resets the stars", + GuiPath = "/Night Sky/Light Pollution", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(sphere) + openspace.action.registerAction(hideAction) + openspace.action.registerAction(pollution_1) + openspace.action.registerAction(pollution_2) + openspace.action.registerAction(pollution_3) + openspace.action.registerAction(pollution_4) + openspace.action.registerAction(pollution_5) + openspace.action.registerAction(pollution_6) + openspace.action.registerAction(pollution_7) + openspace.action.registerAction(pollution_8) + openspace.action.registerAction(pollution_9) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(pollution_9) + openspace.action.removeAction(pollution_8) + openspace.action.removeAction(pollution_7) + openspace.action.removeAction(pollution_6) + openspace.action.removeAction(pollution_5) + openspace.action.removeAction(pollution_4) + openspace.action.removeAction(pollution_3) + openspace.action.removeAction(pollution_2) + openspace.action.removeAction(pollution_1) + openspace.action.removeAction(hideAction) + openspace.removeSceneGraphNode(sphere) +end) + +asset.export(sphere) +asset.export(hideAction) +asset.export(pollution_1) +asset.export(pollution_2) +asset.export(pollution_3) +asset.export(pollution_4) +asset.export(pollution_5) +asset.export(pollution_6) +asset.export(pollution_7) +asset.export(pollution_8) +asset.export(pollution_9) diff --git a/data/assets/nightsky/meredian.asset b/data/assets/nightsky/meredian.asset new file mode 100644 index 0000000000..448ff2726c --- /dev/null +++ b/data/assets/nightsky/meredian.asset @@ -0,0 +1,105 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') + +local position = { + Identifier = "MeridianPosition", + Parent = earthAsset.Earth.Identifier, + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = 0.0, + Longitude = 0.0, + Altitude = 0.0, + UseCamera = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = 0.0, + Longitude = 0.0, + UseCamera = true + } + }, + GUI = { + Name = "Local Meridian Position", + Path = "/Other/Lines", + Hidden = true + } +} + +local plane = { + Identifier = "Meridian", + Parent = position.Identifier, + Transform = { + Scale = { + Type = "StaticScale", + Scale = 1000000 + }, + }, + Renderable = { + Type = "RenderableRadialGrid", + Opacity = 0.8, + Color = { 1.0, 1.0, 1.0 }, + LineWidth = 3.0, + GridSegments = { 1, 1 }, + Radii = { 0.5, 0.5 }, + Enabled = asset.enabled, + RenderBinMode = "PostDeferredTransparent" + }, + GUI = { + Name = "Local Meridian", + Path = "/Other/Lines" + } +} + +local showAction = { + Identifier = "os.nightsky.show_meridian", + Name = "Show local meridian", + Command = [[ + local lat, lon, alt = openspace.globebrowsing.getGeoPositionForCamera(); + local camera = openspace.navigation.getNavigationState(); + openspace.setParent('MeridianPosition', camera.Anchor) + openspace.setPropertyValueSingle('Scene.MeridianPosition.Translation.Globe', camera.Anchor); + openspace.setPropertyValueSingle('Scene.MeridianPosition.Translation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.MeridianPosition.Translation.Longitude', lon); + openspace.setPropertyValueSingle('Scene.MeridianPosition.Rotation.Globe', camera.Anchor); + openspace.setPropertyValueSingle('Scene.MeridianPosition.Rotation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.MeridianPosition.Rotation.Longitude', lon); + openspace.setPropertyValueSingle('Scene.Meridian.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.Meridian.Renderable.Fade', 0.0); + openspace.setPropertyValueSingle('Scene.Meridian.Renderable.Fade', 1.0, 1.0); + ]], + Documentation = "Shows a line for the local meridian", + GuiPath = "/Night Sky/Lines and Grids", + IsLocal = false +} + +local hideAction = { + Identifier = "os.nightsky.hide_meridian", + Name = "Hide local meridian", + Command = [[ + openspace.setPropertyValueSingle('Scene.Meridian.Renderable.Fade', 0.0, 1.0); + ]], + Documentation = "Hides the line for the local meridian", + GuiPath = "/Night Sky/Lines and Grids", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(position) + openspace.addSceneGraphNode(plane) + openspace.action.registerAction(hideAction) + openspace.action.registerAction(showAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(showAction) + openspace.action.removeAction(hideAction) + openspace.removeSceneGraphNode(plane) + openspace.removeSceneGraphNode(position) +end) + +asset.export(position) +asset.export(plane) +asset.export(hideAction) +asset.export(showAction) diff --git a/data/assets/nightsky/nightsky.asset b/data/assets/nightsky/nightsky.asset new file mode 100644 index 0000000000..3e2b15e3c7 --- /dev/null +++ b/data/assets/nightsky/nightsky.asset @@ -0,0 +1,12 @@ +asset.require("./altaz", false) +asset.require("./cardinal_directions", false) +asset.require("./ecliptic_band", false) +asset.require("./equatorial_band", false) +asset.require("./galactic_band", false) +asset.require("./ground_panoramas", false) +asset.require("./meredian", false) +asset.require("./light_pollution", false) +asset.require("./zenith", false) +asset.require("./planets", false) +asset.require("actions/nightsky/camera", false) +asset.require("actions/nightsky/daytime", false) diff --git a/data/assets/nightsky/planets.asset b/data/assets/nightsky/planets.asset new file mode 100644 index 0000000000..4a81bbf9bd --- /dev/null +++ b/data/assets/nightsky/planets.asset @@ -0,0 +1,173 @@ +local mercury = asset.require('scene/solarsystem/planets/mercury/transforms') +local venus = asset.require('scene/solarsystem/planets/venus/transforms') +local mars = asset.require('scene/solarsystem/planets/mars/transforms') +local jupiter = asset.require('scene/solarsystem/planets/jupiter/transforms') +local saturn = asset.require('scene/solarsystem/planets/saturn/transforms') + +local textures = asset.syncedResource({ + Name = "Night Sky Planet Textures", + Type = "HttpSynchronization", + Identifier = "night_sky_planet_textures", + Version = 1 +}) + +local Mercury = { + Identifier = "NightSkyMercury", + Parent = mercury.MercuryBarycenter.Identifier, + Renderable = { + Type = "RenderablePlaneImageLocal", + Billboard = true, + Enabled = asset.enabled, + Size = 2439700 * 500, + Texture = textures .. "glare.png", + MultiplyColor = { 0.608, 0.604, 0.455 }, + DimInAtmosphere = true, + RenderBinMode = "PostDeferredTransparent" + }, + Tag = { "nightsky_billboard"}, + GUI = { + Name = "Night Sky Mercury", + Path = "/Other/Night Sky/Planets" + } +} + +local Venus = { + Identifier = "NightSkyVenus", + Parent = venus.VenusBarycenter.Identifier, + Renderable = { + Type = "RenderablePlaneImageLocal", + Enabled = asset.enabled, + Billboard = true, + Size = 6051900 * 500, + Texture = textures .. "glare.png", + MultiplyColor = { 0.608, 0.604, 0.455 }, + DimInAtmosphere = true, + RenderBinMode = "PostDeferredTransparent" + }, + Tag = { "nightsky_billboard"}, + GUI = { + Name = "Night Sky Venus", + Path = "/Other/Night Sky/Planets" + } +} + +local Mars = { + Identifier = "NightSkyMars", + Parent = mars.MarsBarycenter.Identifier, + Renderable = { + Type = "RenderablePlaneImageLocal", + Enabled = asset.enabled, + Billboard = true, + Size = 3396190 * 1000, + Texture = textures .. "glare.png", + MultiplyColor = { 0.756, 0.267, 0.054 }, + DimInAtmosphere = true, + RenderBinMode = "PostDeferredTransparent" + }, + Tag = { "nightsky_billboard"}, + GUI = { + Name = "Night Sky Mars", + Path = "/Other/Night Sky/Planets" + } +} + +local Jupiter = { + Identifier = "NightSkyJupiter", + Parent = jupiter.JupiterBarycenter.Identifier, + Renderable = { + Type = "RenderablePlaneImageLocal", + Enabled = asset.enabled, + Billboard = true, + Size = 71492000 * 400, + Texture = textures .. "glare.png", + MultiplyColor = { 0.608, 0.604, 0.455 }, + DimInAtmosphere = true, + RenderBinMode = "PostDeferredTransparent" + }, + Tag = { "nightsky_billboard"}, + GUI = { + Name = "Night Sky Jupiter", + Path = "/Other/Night Sky/Planets" + } +} + +local Saturn = { + Identifier = "NightSkySaturn", + Parent = saturn.SaturnBarycenter.Identifier, + Renderable = { + Type = "RenderablePlaneImageLocal", + Enabled = asset.enabled, + Billboard = true, + Size = 60268000 * 500, + Texture = textures .. "glare.png", + MultiplyColor = { 0.608, 0.604, 0.455 }, + DimInAtmosphere = true, + RenderBinMode = "PostDeferredTransparent" + }, + Tag = { "nightsky_billboard"}, + GUI = { + Name = "Night Sky Saturn", + Path = "/Other/Night Sky/Planets" + } +} + +local showAction = { + Identifier = "os.nightsky.show_night_sky_planets", + Name = "Show night sky planets", + Command = [[ + openspace.setPropertyValueSingle('Scene.NightSkyMercury.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.NightSkyVenus.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.NightSkyMars.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.NightSkyJupiter.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.NightSkySaturn.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.NightSkyMercury.Renderable.Fade', 0.0); + openspace.setPropertyValueSingle('Scene.NightSkyVenus.Renderable.Fade', 0.0); + openspace.setPropertyValueSingle('Scene.NightSkyMars.Renderable.Fade', 0.0); + openspace.setPropertyValueSingle('Scene.NightSkyJupiter.Renderable.Fade', 0.0); + openspace.setPropertyValueSingle('Scene.NightSkySaturn.Renderable.Fade', 0.0); + openspace.setPropertyValueSingle('Scene.NightSkyMercury.Renderable.Fade', 1.0, 0.25); + openspace.setPropertyValueSingle('Scene.NightSkyVenus.Renderable.Fade', 1.0, 0.25); + openspace.setPropertyValueSingle('Scene.NightSkyMars.Renderable.Fade', 1.0, 0.25); + openspace.setPropertyValueSingle('Scene.NightSkyJupiter.Renderable.Fade', 1.0, 0.25); + openspace.setPropertyValueSingle('Scene.NightSkySaturn.Renderable.Fade', 1.0, 0.25); + ]], + Documentation = "Show night sky versions of the planets", + GuiPath = "/Night Sky/Planets", + IsLocal = false +} + +local hideAction = { + Identifier = "os.nightsky.hide_night_sky_planets", + Name = "Hide night sky planets", + Command = [[ + openspace.setPropertyValueSingle('Scene.NightSkyMercury.Renderable.Fade', 0.0, 1.0); + openspace.setPropertyValueSingle('Scene.NightSkyVenus.Renderable.Fade', 0.0, 1.0); + openspace.setPropertyValueSingle('Scene.NightSkyMars.Renderable.Fade', 0.0, 1.0); + openspace.setPropertyValueSingle('Scene.NightSkyJupiter.Renderable.Fade', 0.0, 1.0); + openspace.setPropertyValueSingle('Scene.NightSkySaturn.Renderable.Fade', 0.0, 1.0); + ]], + Documentation = "Hides night sky versions of the planets", + GuiPath = "/Night Sky/Planets", + IsLocal = false +} + + +asset.onInitialize(function() + openspace.addSceneGraphNode(Mercury) + openspace.addSceneGraphNode(Venus) + openspace.addSceneGraphNode(Mars) + openspace.addSceneGraphNode(Jupiter) + openspace.addSceneGraphNode(Saturn) + openspace.action.registerAction(showAction) + openspace.action.registerAction(hideAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(hideAction) + openspace.action.removeAction(showAction) + openspace.removeSceneGraphNode(Saturn) + openspace.removeSceneGraphNode(Jupiter) + openspace.removeSceneGraphNode(Mars) + openspace.removeSceneGraphNode(Venus) + openspace.removeSceneGraphNode(Mercury) +end) diff --git a/data/assets/nightsky/zenith.asset b/data/assets/nightsky/zenith.asset new file mode 100644 index 0000000000..9f7ddad5cd --- /dev/null +++ b/data/assets/nightsky/zenith.asset @@ -0,0 +1,112 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') + +local textures = asset.syncedResource({ + Name = "Zenith Textures", + Type = "HttpSynchronization", + Identifier = "zenith_textures", + Version = 1 +}) + +local position = { + Identifier = "ZenithPosition", + Parent = earthAsset.Earth.Identifier, + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = 0.0, + Longitude = 0.0, + Altitude = 100000000.0, + UseCamera = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = 0.0, + Longitude = 0.0, + UseHeightmap = false, + UseCamera = true + } + }, + GUI = { + Name = "Zenith Position", + Path = "/Other/Points", + Hidden = true + } +} + +local plane = { + Identifier = "ZenithDot", + Parent = position.Identifier, + Transform = { + Rotation = { + Type = "StaticRotation", + Rotation = { -math.pi, 0.0, 0.0 } + }, + }, + Renderable = { + Type = "RenderablePlaneImageLocal", + Enabled = asset.enabled, + Size = 1000000, + Origin = "Center", + Billboard = true, + Texture = textures .. "point3A.png", + BlendMode = "Additive" + }, + GUI = { + Name = "Zenith", + Path = "/Other/Points" + } +} + +local showAction = { + Identifier = "os.nightsky.show_zenith", + Name = "Show local zenith", + Command = [[ + local lat, lon, alt = openspace.globebrowsing.getGeoPositionForCamera(); + local camera = openspace.navigation.getNavigationState(); + openspace.setParent('ZenithPosition', camera.Anchor) + openspace.setPropertyValueSingle('Scene.ZenithPosition.Translation.Globe', camera.Anchor); + openspace.setPropertyValueSingle('Scene.ZenithPosition.Translation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.ZenithPosition.Translation.Longitude', lon); + openspace.setPropertyValueSingle('Scene.ZenithPosition.Rotation.Globe', camera.Anchor); + openspace.setPropertyValueSingle('Scene.ZenithPosition.Rotation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.ZenithPosition.Rotation.Longitude', lon); + openspace.setPropertyValueSingle('Scene.ZenithDot.Renderable.Enabled', true); + openspace.setPropertyValueSingle('Scene.ZenithDot.Renderable.Fade', 0.0); + openspace.setPropertyValueSingle('Scene.ZenithDot.Renderable.Fade', 1.0, 1.0); + ]], + Documentation = "Shows a dot for the local zenith", + GuiPath = "/Night Sky/Lines and Grids", + IsLocal = false +} + +local hideAction = { + Identifier = "os.nightsky.hide_zenith", + Name = "Hide local zenith", + Command = [[ + openspace.setPropertyValueSingle('Scene.ZenithDot.Renderable.Fade', 0.0, 1.0); + ]], + Documentation = "Hides the dot for the local zenith", + GuiPath = "/Night Sky/Lines and Grids", + IsLocal = false +} + +asset.onInitialize(function() + openspace.addSceneGraphNode(position) + openspace.addSceneGraphNode(plane) + openspace.action.registerAction(hideAction) + openspace.action.registerAction(showAction) +end) + +asset.onDeinitialize(function() + openspace.action.removeAction(showAction) + openspace.action.removeAction(hideAction) + openspace.removeSceneGraphNode(plane) + openspace.removeSceneGraphNode(position) +end) + +asset.export(position) +asset.export(plane) +asset.export(hideAction) +asset.export(showAction) diff --git a/data/assets/scene/digitaluniverse/constellations.asset b/data/assets/scene/digitaluniverse/constellations.asset index 785ba2adce..96cb6694fa 100644 --- a/data/assets/scene/digitaluniverse/constellations.asset +++ b/data/assets/scene/digitaluniverse/constellations.asset @@ -55,8 +55,9 @@ local constellations = { NamesFile = speck .. "constellations.dat", Colors = { { 0.6, 0.4, 0.4 }, { 0.8, 0.0, 0.0 }, { 0.0, 0.3, 0.8 } }, Unit = "pc", - -- Selection = zodiacs + DimInAtmosphere = true }, + Tag = {"daytime_hidden"}, GUI = { Name = "Constellations", Path = "/Milky Way/Constellations", diff --git a/data/assets/scene/digitaluniverse/milkyway_sphere.asset b/data/assets/scene/digitaluniverse/milkyway_sphere.asset index 9094724bd9..08a1ad91a2 100644 --- a/data/assets/scene/digitaluniverse/milkyway_sphere.asset +++ b/data/assets/scene/digitaluniverse/milkyway_sphere.asset @@ -18,7 +18,7 @@ local sphere = { Type = "RenderableSphere", Size = 9.2E21, Segments = 40, - Opacity = 0.35, + Opacity = 0.25, Texture = sphereTextures .. "DarkUniverse_mellinger_4k.jpg", Orientation = "Inside", MirrorTexture = true, @@ -26,6 +26,7 @@ local sphere = { Background = true, DimInAtmosphere = true, }, + Tag = {"daytime_hidden"}, GUI = { Name = "Milky Way Sphere", Path = "/Milky Way", diff --git a/data/assets/scene/digitaluniverse/stars.asset b/data/assets/scene/digitaluniverse/stars.asset index 11a7df0414..075faad1f3 100644 --- a/data/assets/scene/digitaluniverse/stars.asset +++ b/data/assets/scene/digitaluniverse/stars.asset @@ -50,6 +50,7 @@ local stars = { }, DimInAtmosphere = true, }, + Tag = {"daytime_hidden"}, GUI = { Name = "Stars", Path = "/Milky Way/Stars", diff --git a/data/assets/scene/milkyway/constellations/constellation_art.asset b/data/assets/scene/milkyway/constellations/constellation_art.asset index 9b08ac96e0..a0f50c2644 100644 --- a/data/assets/scene/milkyway/constellations/constellation_art.asset +++ b/data/assets/scene/milkyway/constellations/constellation_art.asset @@ -75,9 +75,10 @@ local createConstellations = function (baseIdentifier, guiPath, constellationfil LazyLoading = true, Texture = images .. imageName, BlendMode = "Additive", - Opacity = 0.1 + Opacity = 0.1, + DimInAtmosphere = true }, - Tag = { "ImageConstellation", group }, + Tag = { "ImageConstellation", group, "daytime_hidden" }, GUI = { Name = name .. " Image", Path = "/Milky Way/" .. guiPath, @@ -148,7 +149,7 @@ local hide_zodiac_art = { Command = [[ openspace.fadeOut("{zodiac}") ]], - Documentation = "fades down zodiac art work", + Documentation = "Fades down zodiac art work", GuiPath = "/Constellations/Art", IsLocal = false } diff --git a/data/assets/scene/solarsystem/planets/earth/default_layers.asset b/data/assets/scene/solarsystem/planets/earth/default_layers.asset index 166432848e..fb89ddcecf 100644 --- a/data/assets/scene/solarsystem/planets/earth/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/earth/default_layers.asset @@ -8,6 +8,7 @@ asset.require("./layers/colorlayers/aqua_modis_temporal", false) asset.require("./layers/colorlayers/terra_modis_temporal", false) asset.require("./layers/colorlayers/bmng_utah", false) asset.require("./layers/colorlayers/bmng_sweden", false) +asset.require("./layers/colorlayers/bmng_newyork", false) asset.require("./layers/colorlayers/amsr2_gcom_w1_sea_ice_concentration_temporal", false) asset.require("./layers/colorlayers/modis_terra_chlorophyll_a_temporal", false) asset.require("./layers/colorlayers/ghrsst_l4_mur_sea_surface_temperature_temporal", false) @@ -31,6 +32,7 @@ asset.require("./layers/overlays/size_reference", false) -- Watermasks asset.require("./layers/watermasks/gebco_sweden", false) asset.require("./layers/watermasks/gebco_utah", false) +asset.require("./layers/watermasks/gebco_newyork", false) asset.require("./layers/watermasks/modis_water_mask", true) diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_newyork.asset b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_newyork.asset new file mode 100644 index 0000000000..95e9a5367b --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_newyork.asset @@ -0,0 +1,31 @@ +local globeIdentifier = asset.require("../../earth").Earth.Identifier + +local layer = { + Identifier = "BMNG_NewYork", + Name = "BMNG [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("bmng_newyork.wms"), + Description = [[Web loaded full resolution map of Blue Marble Next Generation. This map + is hosted on the OpenSpace servers in New York]], +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + +asset.meta = { + Name = "Blue Marble Next Generation (New York)", + Version = "1.1", + Description = [[Web loaded full resolution map of Blue Marble Next Generation. This map + is hosted on the OpenSpace servers in New York]], + Author = "OpenSpace Team", + URL = "https://visibleearth.nasa.gov/collection/1484/blue-marble", + License = "NASA" +} diff --git a/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_newyork.wms b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_newyork.wms new file mode 100644 index 0000000000..6a0760ce48 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/layers/colorlayers/bmng_newyork.wms @@ -0,0 +1,21 @@ + + + http://wms.openspace.amnh.org/Earth/Bmng/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 86400 + 43200 + 8 + top + + EPSG:4326 + 240 + 240 + 3 + 10 + 5 + diff --git a/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_newyork.asset b/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_newyork.asset new file mode 100644 index 0000000000..92dc076610 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_newyork.asset @@ -0,0 +1,29 @@ +local globeIdentifier = asset.require("../../earth").Earth.Identifier + +local layer = { + Name = "Gebco [New York]", + Identifier = "Gebco_NewYork", + Enabled = asset.enabled, + FilePath = asset.localResource("gebco_newyork.wms") +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "WaterMasks", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "WaterMasks", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Gebco WaterMask Layer (New York)", + Version = "1.0", + Description = "WaterMask layer for Earth globe", + Author = "OpenSpace Team", + URL = "http://openspaceproject.com", + License = "MIT license" +} diff --git a/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_newyork.wms b/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_newyork.wms new file mode 100644 index 0000000000..49c3091559 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/layers/watermasks/gebco_newyork.wms @@ -0,0 +1,21 @@ + + + http://wms.openspace.amnh.org/Earth/Gebco/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 43200 + 21600 + 6 + top + + EPSG:4326 + 360 + 360 + 1 + 10 + 5 + diff --git a/data/assets/scene/solarsystem/planets/earth/moon/default_layers.asset b/data/assets/scene/solarsystem/planets/earth/moon/default_layers.asset index 986a7f5a86..a37fba1861 100644 --- a/data/assets/scene/solarsystem/planets/earth/moon/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/earth/moon/default_layers.asset @@ -1,20 +1,27 @@ -- Color layers asset.require("./layers/colorlayers/wac_utah", true) asset.require("./layers/colorlayers/wac_sweden", false) +asset.require("./layers/colorlayers/wac_newyork", false) asset.require("./layers/colorlayers/clemuvvis_utah", false) asset.require("./layers/colorlayers/clemuvvis_sweden", false) +asset.require("./layers/colorlayers/clemuvvis_newyork", false) asset.require("./layers/colorlayers/uvvishybrid_utah", false) asset.require("./layers/colorlayers/uvvishybrid_sweden", false) +asset.require("./layers/colorlayers/uvvishybrid_newyork", false) asset.require("./layers/colorlayers/kaguya_utah", false) asset.require("./layers/colorlayers/kaguya_sweden", false) +asset.require("./layers/colorlayers/kaguya_newyork", false) asset.require("./layers/colorlayers/lola_clr_shade_utah", false) asset.require("./layers/colorlayers/lola_clr_shade_sweden", false) +asset.require("./layers/colorlayers/lola_clr_shade_newyork", false) asset.require("./layers/colorlayers/lola_shade_utah", false) asset.require("./layers/colorlayers/lola_shade_sweden", false) +asset.require("./layers/colorlayers/lola_shade_newyork", false) -- Height layers asset.require("./layers/heightlayers/loladem_utah", true) asset.require("./layers/heightlayers/loladem_sweden", false) +asset.require("./layers/heightlayers/loladem_newyork", false) asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/apollo_15_metric_newyork.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/apollo_15_metric_newyork.asset new file mode 100644 index 0000000000..3a950d7236 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/apollo_15_metric_newyork.asset @@ -0,0 +1,42 @@ +local globeIdentifier = asset.require("../../moon").Moon.Identifier + +local layer = { + Identifier = "Apollo15Metric_NewYork", + Name = "Apollo 15 Metric Cam [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("apollo_15_metric_newyork.wms"), + Settings = { + Gamma = 1.0, + Multiplier = 1.0 + }, + Description = [[The Apollo 15 Metric (Mapping) Camera obtained high-quality metric photographs, + on black and white film, with high geometric precision of the lunar surface from lunar orbit + combined with time-correlated stellar photography for selenodetic/cartographic control. + A laser altimeter was operated with it. The Metric Camera also provided supporting + photographic data for the Scientific Instrument Module (SIM) Panoramic Camera and + other Command Service Module (CSM) photographic experiments. The Apollo 15 metric camera + took 3375 frames, some of which were taken over unlighted terrain in support + of the laser altimeter. (Description from NASA PDS)]] +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Kaguya [New York]", + Version = "1.1", + Description = [[Moon SELENE Kaguya TC Global Orthomosaic 474m v2 layer for Moon globe. + This map is hosted on the OpenSpace server in New York]], + Author = "USGS", + URL = "https://trek.nasa.gov/moon/TrekWS/rest/cat/metadata/fgdc/html?label=Apollo15_MetricCam_Mosaic_Global_4096ppd", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/apollo_15_metric_newyork.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/apollo_15_metric_newyork.wms new file mode 100644 index 0000000000..f89b61eb8a --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/apollo_15_metric_newyork.wms @@ -0,0 +1,21 @@ + + + https://wms.openspace.amnh.org/Moon/Apollo15_MetricCam/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 655360 + 327680 + 9 + top + + GEOGCS["GCS_Moon_2000",DATUM["Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400,0]],PRIMEM["Reference_Meridian",0],UNIT["degree",0.0174532925199433]] + 512 + 512 + 1 + 10 + 5 + diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_newyork.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_newyork.asset new file mode 100644 index 0000000000..912092519c --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_newyork.asset @@ -0,0 +1,38 @@ +local globeIdentifier = asset.require("../../moon").Moon.Identifier + +local layer = { + Identifier = "ClemUvvis_NewYork", + Name = "Clem Uvvis [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("clemuvvis_newyork.wms"), + Settings = { + Gamma = 1.14, + Multiplier = 1.4 + }, + Description = [[The Clementine Ultraviolet/Visible (UVVIS) Version 2 mosaic is a + grayscale data set representing the albedo (brightness of the lunar surface) as + measured at the 750 nanometer (nm) wavelength by the UVVIS camera (Lee, et al., 2009). + Resolution of this mosaic is 118 meters per pixel (m)]] +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Clem Uvvis [New York]", + Version = "1.1", + Description = [[Moon Clementine UVVIS Global Mosaic 118m v2 map of the Moon. This map + is hosted on the OpenSpace server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Moon/Clementine/UVVIS/Lunar_Clementine_UVVIS_750nm_Global_Mosaic_118m_v2", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_newyork.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_newyork.wms new file mode 100644 index 0000000000..c1ef12b917 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/clemuvvis_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Moon/Clem_Uvvis/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 92160 + 46080 + 7 + top + + GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 360 + 360 + 1 + 10 + diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_newyork.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_newyork.asset new file mode 100644 index 0000000000..c3031cb7c9 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_newyork.asset @@ -0,0 +1,38 @@ +local globeIdentifier = asset.require("../../moon").Moon.Identifier + +local layer = { + Identifier = "Kaguya_NewYork", + Name = "Kaguya [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("kaguya_newyork.vrt"), + Settings = { + Gamma = 1.0, + Multiplier = 1.23 + }, + Description = [[This near-global mosaic was generated using data from the SELenological + and Engineering Explorer (SELENE) "Kaguya" Terrain Camera (TC) instrument. TC source + data originated as map-projected tiles at ~10 meters per pixel (m) spatial + resolution]] +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Kaguya [New York]", + Version = "1.1", + Description = [[Moon SELENE Kaguya TC Global Orthomosaic 474m v2 layer for Moon globe. + This map is hosted on the OpenSpace server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Moon/Kaguya/TC/Ortho/v02/Lunar_Kaguya_TC_Ortho_Global_64ppd_v02", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_newyork.vrt b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_newyork.vrt new file mode 100644 index 0000000000..9d26f2148d --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_newyork.vrt @@ -0,0 +1,28 @@ + + GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + -1.8000000000000000e+02, 2.4414062500000000e-04, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -2.4414062500000000e-04 + + Gray + + kaguya_newyork.wms + 1 + + + + + + + Alpha + 0 + + kaguya_newyork.wms + 1 + + + + 255 + 0 + 0 + + + diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_newyork.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_newyork.wms new file mode 100644 index 0000000000..e1af3334dc --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/kaguya_newyork.wms @@ -0,0 +1,21 @@ + + + http://wms.openspace.amnh.org/Moon/Kaguya/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 1474560 + 737280 + 11 + top + + GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 360 + 360 + 1 + 10 + 5 + diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lo_mr_mosaic_newyork.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lo_mr_mosaic_newyork.asset new file mode 100644 index 0000000000..6c3d27ba2b --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lo_mr_mosaic_newyork.asset @@ -0,0 +1,35 @@ +local globeIdentifier = asset.require("./../../moon").Moon.Identifier + +local layer = { + Identifier = "LO_MR_Mosaic_NewYork", + Name = "Moon Lunar Orbiter Digital Photographic Global Mosaic 59m v1 [New York]", + Enabled = asset.enabled, + Description = [[This Lunar Orbiter (LO) mosaic of the Moon was constructed using photographs acquired by LO III, IV and V. Work towards constructing the global mosaic spanned over seven years. Earlier work involved scanning and processing more than 30, 000 35-mm film strips from the LO high- and medium-resolution cameras (HR and MR, respectively). + + Digital film strips were cartographically processed to construct more than 200 individual frames and then geodetically corrected using the most recent lunar control network and topographic model (Gaddis et al., 2001). The result of this work is a moderate resolution, near-global, cartographically controlled digital mosaic of the Moon (Becker et al., 2008). The nominal resolution of the mosaic is ~60 meters per pixel (m). + + This represents new Jpeg2000 mosaic which includes a couple updated tiles that were missing from the original March 2008 release. For this image a lossy compression using a quality flag of 10 was used. There should be almost no noticeable loss of data. ]], + FilePath = asset.localResource("lo_mr_mosaic_newyork.wms") +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Moon Lunar Orbiter Digital Photographic Global Mosaic [New York]", + Version = "1.0", + Description = [[Moon Lunar Orbiter Digital Photographic Global Mosaic 59m v1. This + map is hosted on the OpenSpace server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Moon/LMMP/LOLA-derived/Lunar_LRO_LOLA_ClrShade_Global_128ppd_v04", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lo_mr_mosaic_newyork.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lo_mr_mosaic_newyork.wms new file mode 100644 index 0000000000..812261998f --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lo_mr_mosaic_newyork.wms @@ -0,0 +1,21 @@ + + + http://wms.openspace.amnh.org/Moon/LO_MR_Mosaic_Global_59m/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 184320 + 92160 + 8 + top + + GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 512 + 512 + 1 + 10 + 5 + diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_newyork.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_newyork.asset new file mode 100644 index 0000000000..0d6879fe49 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_newyork.asset @@ -0,0 +1,38 @@ +local globeIdentifier = asset.require("./../../moon").Moon.Identifier + +local layer = { + Identifier = "Lola_Clr_Shade_NewYork", + Name = "LRO LOLA Color Shaded Relief 388m v4 [New York]", + Enabled = asset.enabled, + Description = [[This is a colorized shaded-relief of a original polar digital elevation + model (DEM) from the Lunar Orbiter Laser Altimeter (LOLA; Smith et al., 2010), an + instrument on the National Aeronautics and Space Agency (NASA) Lunar Reconnaissance + Orbiter (LRO) spacecraft (Tooley et al., 2010). The DEM is a shape map (radius) of the + Moon at a resolution 100 meters per pixel (m) based on altimetry data acquired through + September, 2011 by the LOLA instrument. The ground tracks were interpolated using the + Generic Mapping Tools programs "surface" and "grdblend". Map values are referred to a + radius of 1,737,400 m]], + FilePath = asset.localResource("lola_clr_shade_newyork.wms") +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Lola Color Shade [New York]", + Version = "1.1", + Description = [[Moon LRO LOLA Color Shaded Relief 388m v4 layer for Moon globe. This + map is hosted on the OpenSpace server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Moon/LMMP/LOLA-derived/Lunar_LRO_LOLA_ClrShade_Global_128ppd_v04", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_newyork.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_newyork.wms new file mode 100644 index 0000000000..5b182ce27c --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_clr_shade_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Moon/Lola_Clr_Shade/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 92160 + 46080 + 7 + top + + GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 360 + 360 + 3 + 10 + diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_newyork.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_newyork.asset new file mode 100644 index 0000000000..efb247d232 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_newyork.asset @@ -0,0 +1,38 @@ +local globeIdentifier = asset.require("../../moon").Moon.Identifier + +local layer = { + Identifier = "Lola_Shade_NewYork", + Name = "Lola Shade [New York]", + Enabled = asset.enabled, + Description = [[This is a shaded-relief of a original polar digital elevation model + (DEM) from the Lunar Orbiter Laser Altimeter (LOLA; Smith et al., 2010), an instrument + on the National Aeronautics and Space Agency (NASA) Lunar Reconnaissance Orbiter (LRO) + spacecraft (Tooley et al., 2010). The DEM is a shape map (radius) of the Moon at a + resolution 100 meters per pixel (m) based on altimetry data acquired through September, + 2011 by the LOLA instrument. The ground tracks were interpolated using the Generic + Mapping Tools programs "surface" and "grdblend". Map values are referred to a radius + of 1,737,400 m]], + FilePath = asset.localResource("lola_shade_newyork.wms") +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Lola Shade [New York]", + Version = "1.1", + Description = [[Moon LRO LOLA Shaded Relief 237m v4 layer for Moon globe. This + map is hosted on the OpenSpace server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Moon/LMMP/LOLA-derived/Lunar_LRO_LOLA_Shade_Global_128ppd_v04", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_newyork.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_newyork.wms new file mode 100644 index 0000000000..6bf2bf3710 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/lola_shade_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Moon/Lola_Shade/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 92160 + 46080 + 7 + top + + GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 360 + 360 + 1 + 10 + diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_newyork.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_newyork.asset new file mode 100644 index 0000000000..a4fff529ba --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_newyork.asset @@ -0,0 +1,43 @@ +local globeIdentifier = asset.require("../../moon").Moon.Identifier + +local layer = { + Identifier = "UvvisHybrid_NewYork", + Name = "Uvvis Hybrid [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("uvvishybrid_newyork.wms"), + Settings = { + Gamma = 0.52, + Multiplier = 0.65 + }, + Description = [[The is a blend (or overlay) of the U.S. Geological Survey (USGS) + Clementine Ultraviolet/Visible (UVVIS) V2 mosaic and the original USGS Lunar Orbiter + mosaic. The Clementine 750 nm Version 2 mosaic is a grayscale data set representing + the albedo (brightness of the lunar surface) as measured at the 750 nm wavelength by + the UVVIS camera. The original base map was radiometrically and geometrically + controlled, photometrically modeled global image mosaic compiled using more than + 43,000 images from the 750 nanometer filter observations of the UVVIS + (Lee et al., 2009)]] +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + + +asset.meta = { + Name = "Uvvis Hybrid [New York]", + Version = "1.1", + Description = [[Moon Lunar Orbiter - Clementine UVVISv2 Hybrid Mosaic 59m v1 map of the + Moon. This map is hosted on the OpenSpace server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Moon/Lunar-Orbiter/Lunar_LO_UVVISv2_Hybrid_Mosaic_Global_59m", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_newyork.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_newyork.wms new file mode 100644 index 0000000000..c36cf7e5a8 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/uvvishybrid_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Moon/Uvvis_Hybrid/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 184320 + 92160 + 8 + top + + GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 360 + 360 + 1 + 10 + diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_newyork.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_newyork.asset new file mode 100644 index 0000000000..a4d7307ba6 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_newyork.asset @@ -0,0 +1,34 @@ +local globeIdentifier = asset.require("../../moon").Moon.Identifier + +local layer = { + Identifier = "WAC_NewYork", + Name = "WAC [New York]", + Enabled = asset.enabled, + Description = [[Lunar Reconnaissance Orbiter Camera (LROC) Wide Angle Camera (WAC) aboard the Lunar Reconnaissance Orbiter (LRO) has allowed the instrument team to create a global mosaic comprised of over 15,000 images acquired between November 2009 and February 2011. The WAC maps the whole Moon in one month, however the solar incidence angle at the equator changes about 28° from the beginning to the end of the month. To even out the incidence angle variations (generally angles between 55-75 degrees), this morphology mosaic (at 643 nm), is comprised of data collected over three periods (1/20/2010 to 1/28/2010, 5/30/2010 to 6/6/2010, 7/24/2010 to 7/31/2010). + + The South Pole mosaic images were acquired 8/10/10 to 9/19/10 and the north polar images 4/22/10 to 5/19/10. Some gores were filled with data taken at other times. The non-polar images were map projected onto the GLD100, WAC-derived 100 meters per pixel (m), while polar images were map projected on the Lunar Orbiter Laser Altimeter (LOLA) shape model (80° to 90° N/S) and the GLD100 (60° to 80° N/S). In addition, the LOLA derived crossover corrected ephemeris and an improved camera pointing provide accurate positioning of each WAC image. Because the polar images were acquired at a different season than the equatorial images, and the lunar photometric function is not perfectly known, there can be a brightness difference where the polar mosaics meet the equatorial mosaics. This has been greatly reduced in version 3 (created in June 2013). (Description from URL)]], + FilePath = asset.localResource("wac_newyork.wms"), + Settings = { Gamma = 0.84 } +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "WAC [New York]", + Version = "2.0", + Description = [[Wide Angle Color map of the Moon. This map is hosted on the OpenSpace + server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Moon/LRO/LROC_WAC/Lunar_LRO_LROC-WAC_Mosaic_global_100m_June2013", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_newyork.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_newyork.wms new file mode 100644 index 0000000000..684a4d18f0 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Moon/WAC3/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 109164 + 54582 + 8 + top + + GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 360 + 360 + 1 + 10 + diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_v1_newyork.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_v1_newyork.asset new file mode 100644 index 0000000000..bb35890818 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_v1_newyork.asset @@ -0,0 +1,40 @@ +local globeIdentifier = asset.require("../../moon").Moon.Identifier + +local layer = { + Identifier = "WAC_V1_NewYork", + Name = "WAC V1 [New York]", + Enabled = asset.enabled, + Description = [[Lunar Reconnaissance Orbiter Camera (LROC) Wide Angle Camera (WAC) + aboard the Lunar Reconnaissance Orbiter (LRO) has allowed the instrument team to + create a global mosaic comprised of over 15,000 images acquired between November 2009 + and February 2011. The WAC maps the whole Moon in one month, however the solar + incidence angle at the equator changes about 28° from the beginning to the end of the + month. To even out the incidence angle variations (generally angles between 55-75 + degrees), this morphology mosaic (at 643 nm), is comprised of data collected over + three periods (1/20/2010 to 1/28/2010, 5/30/2010 to 6/6/2010, 7/24/2010 to 7/31/2010). + (Description from URL)]], + FilePath = asset.localResource("wac_v1_newyork.wms"), + Settings = { Gamma = 0.84 } +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "WAC [New York]", + Version = "1.2", + Description = [[Wide Angle Color map of the Moon. This map is hosted on the OpenSpace + server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Moon/LRO/LROC_WAC/Lunar_LRO_LROC-WAC_Mosaic_global_100m_June2013", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_v1_newyork.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_v1_newyork.wms new file mode 100644 index 0000000000..1a19c8a2c9 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/colorlayers/wac_v1_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Moon/WAC/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 109164 + 54582 + 8 + top + + GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 256 + 256 + 1 + 10 + diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_newyork.asset b/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_newyork.asset new file mode 100644 index 0000000000..3fce115e5a --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_newyork.asset @@ -0,0 +1,38 @@ +local globeIdentifier = asset.require("../../moon").Moon.Identifier + +local layer = { + Identifier = "LolaDem_NewYork", + Name = "Lola DEM [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("loladem_newyork.wms"), + TilePixelSize = 360, + Settings = { Multiplier = 0.5 }, + Description = [[This digital elevation model (DEM) is based on data from the Lunar + Orbiter Laser Altimeter (LOLA; Smith et al., 2010), an instrument on the National + Aeronautics and Space Agency (NASA) Lunar Reconnaissance Orbiter (LRO) spacecraft + (Tooley et al., 2010). The created DEM represents more than 6.5 billion measurements + gathered between July 2009 and July 2013, adjusted for consistency in the coordinate + system described below, and then converted to lunar radii (Mazarico et al., 2012)]] +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "HeightLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "HeightLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Lola DEM [New York]", + Version = "1.1", + Description = [[Moon LRO LOLA DEM 118m v1 layer for Moon globe. This map is hosted on + the OpenSpace server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Moon/LRO/LOLA/Lunar_LRO_LOLA_Global_LDEM_118m_Mar2014", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_newyork.wms b/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_newyork.wms new file mode 100644 index 0000000000..718bfbfe6d --- /dev/null +++ b/data/assets/scene/solarsystem/planets/earth/moon/layers/heightlayers/loladem_newyork.wms @@ -0,0 +1,22 @@ + + + http://wms.openspace.amnh.org/Moon/Lola_Dem/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 92160 + 46080 + 7 + top + + Int16 + GEOGCS["GCS_Moon_2000",DATUM["D_Moon_2000",SPHEROID["Moon_2000_IAU_IAG",1737400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 360 + 360 + 1 + 10 + 5 + diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/default_layers.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/default_layers.asset index 1176e54aba..2c9cc6fa18 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/default_layers.asset @@ -1,7 +1,9 @@ local colorLayersPath = "./layers/colorlayers" asset.require(colorLayersPath .. "/europa_texture", false) -asset.require(colorLayersPath .. "/voyager_global_mosaic_local", true) +asset.require(colorLayersPath .. "/voyager_global_mosaic_local", false) +asset.require(colorLayersPath .. "/voyager_global_mosaic_sweden", false) +asset.require(colorLayersPath .. "/voyager_global_mosaic_newyork", true) asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_newyork.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_newyork.asset new file mode 100644 index 0000000000..7827616721 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_newyork.asset @@ -0,0 +1,39 @@ +local globeIdentifier = asset.require("../../europa").Europa.Identifier + +local layer = { + Identifier = "Voyager_Global_Mosaic_NewYork", + Name = "Voyager Global Mosaic [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("voyager_global_mosaic_newyork.wms"), + BlendMode = "Color", +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Voyager Global Mosaic [New York]", + Version = "1.1", + Description = [[Europa Voyager - Galileo SSI Global Mosaic 500m v2. This global map + base of Europa utilizes the best image quality and moderate resolution coverage + supplied by the Galileo SSI (Solid-State Imaging) instrument and Voyager 1 and 2. + The image data was selected on the basis of overall image quality, reasonable + input resolution (from 20 km/pixel for gap fill to as high as 200 meters per + pixel[m]), and availability of moderate viewing and sun angles for topography. + The map projections are based on a sphere having a radius of 1,562.09 kilometers. + A Simple Cylindrical projection was used at a resolution of 500 m. (Description + from URL)]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Europa/Voyager-Galileo/" .. + "Europa_Voyager_GalileoSSI_global_mosaic_500m", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_newyork.wms b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_newyork.wms new file mode 100644 index 0000000000..582334d413 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Europa/Voyager_GalileoSSI_global_mosaic_500m/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 19631 + 9816 + 7 + top + + EPSG:4326 + 256 + 256 + 1 + 10 + diff --git a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_sweden.asset b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_sweden.asset index 5c1b2dcfd6..dc33d8f08b 100644 --- a/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_sweden.asset +++ b/data/assets/scene/solarsystem/planets/jupiter/europa/layers/colorlayers/voyager_global_mosaic_sweden.asset @@ -1,7 +1,7 @@ local globeIdentifier = asset.require("../../europa").Europa.Identifier local layer = { - Identifier = "Voyager_Global_Mosaic", + Identifier = "Voyager_Global_Mosaic_sweden", Name = "Voyager Global Mosaic [Sweden]", Enabled = asset.enabled, FilePath = asset.localResource("voyager_global_mosaic_sweden.wms"), @@ -21,7 +21,7 @@ asset.export("layer", layer) asset.meta = { - Name = "Voyager Global Mosaic", + Name = "Voyager Global Mosaic [Sweden]", Version = "1.1", Description = [[Europa Voyager - Galileo SSI Global Mosaic 500m v2. This global map base of Europa utilizes the best image quality and moderate resolution coverage diff --git a/data/assets/scene/solarsystem/planets/mars/default_layers.asset b/data/assets/scene/solarsystem/planets/mars/default_layers.asset index f3390997c6..bd52318398 100644 --- a/data/assets/scene/solarsystem/planets/mars/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/mars/default_layers.asset @@ -2,25 +2,32 @@ asset.require("./layers/colorlayers/mars_texture", false) asset.require("./layers/colorlayers/moc_wa_color_utah", true) asset.require("./layers/colorlayers/moc_wa_color_sweden", false) +asset.require("./layers/colorlayers/moc_wa_color_newyork", false) asset.require("./layers/colorlayers/viking_mdim_utah", false) asset.require("./layers/colorlayers/viking_mdim_sweden", false) +asset.require("./layers/colorlayers/viking_mdim_newyork", false) asset.require("./layers/colorlayers/mola_pseudo_color_utah", false) asset.require("./layers/colorlayers/mola_pseudo_color_sweden", false) +asset.require("./layers/colorlayers/mola_pseudo_color_newyork", false) asset.require("./layers/colorlayers/mola_hrsc_utah", false) asset.require("./layers/colorlayers/mola_hrsc_sweden", false) +asset.require("./layers/colorlayers/mola_hrsc_newyork", false) asset.require("./layers/colorlayers/themis_ir_day_utah", false) asset.require("./layers/colorlayers/themis_ir_day_sweden", false) +asset.require("./layers/colorlayers/themis_ir_day_newyork", false) asset.require("./layers/colorlayers/themis_ir_night_utah", false) asset.require("./layers/colorlayers/themis_ir_night_sweden", false) +asset.require("./layers/colorlayers/themis_ir_night_newyork", false) asset.require("./layers/colorlayers/ctx_mosaic_utah", false) asset.require("./layers/colorlayers/ctx_mosaic_sweden", false) +asset.require("./layers/colorlayers/ctx_mosaic_newyork", false) asset.require("./layers/colorlayers/ctx_blended", false) asset.require("./layers/colorlayers/hirise", false) asset.require("./layers/colorlayers/hirisels", false) -- Height layers -asset.require("./layers/heightlayers/mola_sweden", false) asset.require("./layers/heightlayers/mola_utah", false) +asset.require("./layers/heightlayers/mola_sweden", false) asset.require("./layers/heightlayers/MDEM200M", true) asset.require("./layers/heightlayers/hirisels", false) diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_newyork.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_newyork.asset new file mode 100644 index 0000000000..713ee42a53 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_newyork.asset @@ -0,0 +1,31 @@ +local globeIdentifier = asset.require("../../mars").Mars.Identifier + +local layer = { + Identifier = "CTX_Mosaic_NewYork", + Name = "CTX Mosaic [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("ctx_mosaic_newyork.wms"), + BlendMode = "Color" +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "CTX Mosaic [New York]", + Version = "1.0", + Description = [[CTX Mosaic layer for Mars globe. This layer is served from the + OpenSpace servers in New York]], + Author = "OpenSpace Team", + URL = "http://openspaceproject.com", + License = "MIT license" +} diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_newyork.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_newyork.wms new file mode 100644 index 0000000000..0137b7f61f --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/ctx_mosaic_newyork.wms @@ -0,0 +1,23 @@ + + + http://wms.openspace.amnh.org/Mars/CTX/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 4194304 + 2097152 + 13 + top + + GEOGCS["Mars 2000", DATUM["D_Mars_2000", SPHEROID["MARS_2000_IAU_IAG",3396190.0,169.894447222361179]],PRIMEM["Greenwich"0],UNIT["Decimal_Degree",0.0174532925199433]] + 256 + 256 + 2 + 10 + 400,204,404 + true + 5 + diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_newyork.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_newyork.asset new file mode 100644 index 0000000000..4e306bda5c --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_newyork.asset @@ -0,0 +1,38 @@ +local globeIdentifier = asset.require("../../mars").Mars.Identifier + +local layer = { + Identifier = "MOC_WA_Color_NewYork", + Name = "MOC WA Color [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("moc_wa_color_newyork.wms"), + Settings = { + Gamma = 1.6, + Multiplier = 1.07 + }, + Description = [[This map is an AMNH version of the global mossaic produced by the + Mars Global Surveyor Wide Angle Camera. This version has color added and the + shadows subdued based on the MOLA DTM. Data Reference: + https://www.jpl.nasa.gov/spaceimages/details.php?id=PIA03467]] +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "MOC WA Color [New York]", + Version = "1.1", + Description = [[Main color map layer for Mars. This map is hosted + on the OpenSpace server in New York]], + Author = "OpenSpace Team", + URL = "http://www.openspaceproject.com", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_newyork.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_newyork.wms new file mode 100644 index 0000000000..cd9993ab92 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/moc_wa_color_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Mars/Color/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 92160 + 46080 + 7 + top + + GEOGCS["Mars2000",DATUM["D_Mars_2000",SPHEROID["Mars_2000_IAU_IAG",3396190,169.8944472236118]],PRIMEM["Greenwich",0],UNIT["Decimal_Degree",0.0174532925199433]] + 512 + 512 + 3 + 10 + diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_newyork.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_newyork.asset new file mode 100644 index 0000000000..b88c446e41 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_newyork.asset @@ -0,0 +1,34 @@ +local globeIdentifier = asset.require("../../mars").Mars.Identifier + +local layer = { + Identifier = "MOLA_HRSC_NewYork", + Name = "MOLA HRSC [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("mola_hrsc_newyork.wms"), + Description = [[This map layer is colorzied based elevation data from MOLA and HRSC. + Compared to MOLA Psuedo Color, this layer has no terrain shading, which is + suitable for use when combing with other layers. Data Reference: + https://astrogeology.usgs.gov/search/map/Mars/Topography/HRSC_MOLA_Blend/Mars_HRSC_MOLA_BlendDEM_Global_200mp_v2]] +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "MOLA HRSC [New York]", + Version = "1.1", + Description = [[Colorzied elevation data for Mars. This map is hosted on the OpenSpace + server in New York]], + Author = "OpenSpace Team", + URL = "http://www.openspaceproject.com", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_newyork.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_newyork.wms new file mode 100644 index 0000000000..3e1105a173 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_hrsc_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Mars/Mola_HRSC/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 106694 + 53347 + 7 + top + + GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 512 + 512 + 3 + 10 + diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_newyork.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_newyork.asset new file mode 100644 index 0000000000..2e7cd03927 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_newyork.asset @@ -0,0 +1,45 @@ +local globeIdentifier = asset.require("../../mars").Mars.Identifier + +local layer = { + Identifier = "MOLA_Pseudo_Color_NewYork", + Name = "MOLA Pseudo Color [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("mola_pseudo_color_newyork.wms"), + Description = [[This map is based on data from the Mars Orbiter Laser Altimeter (MOLA) + (Smith, et al., 2001), an instrument on NASA's Mars Global Surveyor (MGS) + spacecraft (Albee, et al., 2001). The image used for the base of this map + represents more than 600 million measurements gathered between 1999 and 2001, + adjusted for consistency (Neumann, et al., 2001; Neumann, et al., 2003) and + converted to planetary radii. These have been converted to elevations above the + areoid as determined from a Martian gravity field solution GMM-2B (Lemoine, et + al., 2001), truncated to degree and order 50, and oriented according to current + standards (see below). The average accuracy of each point is originally ~100 + meters in horizontal position and ~1 meter in radius (Neumann, et al., 2001; + Neumann, et al., 2003). However, the total elevation uncertainty is at least ±3 m + due to the global error in the areoid (±1.8 meters; Lemoine, et al., 2001) and + regional uncertainties in its shape (Neumann, 2002). Pixel resolution of this map + is 463 meters per pixel (m). (Description from URL). Data Reference: (See URL)]] +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "MOLA Pseudo Color [New York]", + Version = "1.1", + Description = [[Colorzied elevation data for Mars (with shading). This map is hosted + on the OpenSpace server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Mars/GlobalSurveyor/MOLA/" .. + "Mars_MGS_MOLA_ClrShade_merge_global_463m", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_newyork.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_newyork.wms new file mode 100644 index 0000000000..11470ca681 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/mola_pseudo_color_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Mars/Mola_PseudoColor/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 46080 + 23040 + 6 + top + + GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 360 + 360 + 3 + 10 + diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_newyork.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_newyork.asset new file mode 100644 index 0000000000..b35558da69 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_newyork.asset @@ -0,0 +1,42 @@ +local globeIdentifier = asset.require("../../mars").Mars.Identifier + +local layer = { + Identifier = "Themis_IR_Day_NewYork", + Name = "Themis IR Day [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("themis_ir_day_newyork.wms"), + BlendMode = "Color", + Description = [[This mosaic represents the Thermal Emission Imaging System (THEMIS) + -daytime infrared (IR) 100 meter/pixel mosaic (version 12) released in the summer + of 2014 by Arizona State University. Values represent only a visual representation + of day-time temperatures. The original values have been stretched and blended to + make a more seamless mosaic.

Reference: * Edwards, C. S., K. J. Nowicki, + P. R. Christensen, J. Hill, N. Gorelick, and K. Murray (2011), Mosaicking of + global planetary image datasets: 1. Techniques and data processing for Thermal + Emission Imaging System (THEMIS) multi-spectral data, J. Geophys. Res., 116, + E10008, doi:10.1029/2010JE003755. http://dx.doi.org/10.1029/2010JE003755 + (Description from URL)]] +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Themis IR Day [New York]", + Version = "1.1", + Description = [[Themis Day layer for Mars. This map is hosted on the OpenSpace server + in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Mars/Odyssey/THEMIS-IR-Mosaic-ASU/" .. + "Mars_MO_THEMIS-IR-Day_mosaic_global_100m_v12", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_newyork.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_newyork.wms new file mode 100644 index 0000000000..c4ea426172 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_day_newyork.wms @@ -0,0 +1,20 @@ + + + http:/wms.openspace.amnh.org/Mars/Themis_IR_Day/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 213390 + 106695 + 9 + top + + GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 256 + 256 + 1 + 10 + diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_newyork.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_newyork.asset new file mode 100644 index 0000000000..3559194588 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_newyork.asset @@ -0,0 +1,43 @@ +local globeIdentifier = asset.require("../../mars").Mars.Identifier + +local layer = { + Identifier = "Themis_IR_Night_NewYork", + Name = "Themis IR Night [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("themis_ir_night_newyork.vrt"), + BlendMode = "Color", + Description = [[This mosaic represents the Thermal Emission Imaging System (THEMIS) + -nighttime infrared (IR) 100 meter/pixel mosaic (version 12) released in the + summer of 2014 by Arizona State University. Values represent only a visual + representation of night-time temperatures. The original values have been stretched + and blended to make a more seamless mosaic. Coverage is only from 60N to 60S + latitude.

Reference: * Edwards, C.S., K. J. Nowicki, P. R. Christensen, + J. Hill, N. Gorelick, and K. Murray (2011), Mosaicking of global planetary image + datasets: 1. Techniques and data processing for Thermal Emission Imaging System + (THEMIS) multi-spectral data, J. Geophys. Res., 116, E10008, + doi:10.1029/2010JE003755. http://dx.doi.org/10.1029/2010JE003755 (Description from + URL)]] +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Themis IR Night [New York]", + Version = "1.1", + Description = [[Themis Night layer for Mars. This map is hosted on the OpenSpace + server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Mars/Odyssey/THEMIS-IR-Mosaic-ASU/" .. + "Mars_MO_THEMIS-IR-Night_mosaic_60N60S_100m_v14", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_newyork.vrt b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_newyork.vrt new file mode 100644 index 0000000000..98987e904f --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_newyork.vrt @@ -0,0 +1,26 @@ + + GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + -1.8000000000000000e+02, 1.6870676889047182e-03, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -1.6870518768452129e-03 + + Gray + + themis_ir_night_newyork.wms + 1 + + + + + + + Alpha + + themis_ir_night_newyork.wms + 1 + + + + 255 + 0 + + + diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_newyork.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_newyork.wms new file mode 100644 index 0000000000..86d241d6d3 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/themis_ir_night_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Mars/Themis_IR_Night/tile/${z}/${y}/${x} + + + -180.0 + 60.0 + 180.0 + -60.0 + 213388 + 71130 + 9 + top + + GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 256 + 256 + 1 + 10 + diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_newyork.asset b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_newyork.asset new file mode 100644 index 0000000000..d7b8b2a05c --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_newyork.asset @@ -0,0 +1,50 @@ +local globeIdentifier = asset.require("../../mars").Mars.Identifier + +local layer = { + Identifier = "Viking_MDIM_NewYork", + Name = "Viking MDIM [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("viking_mdim_newyork.wms"), + Description = [[This global image map of Mars has a resolution of 256 pixels/degree + (scale approximately 232 meters per pixel (m) at the equator). The colorized + mosaic was completed by NASA AMES which warped the original Viking colorized + mosaic and blended over the latest black/white Mars Digital Image Model + (MDIM 2.1). The positional accuracy of features in MDIM 2.1 is estimated to be + roughly one pixel (200 m), compared to 3 km for MDIM 2.0 released in 2001 and >6 + km for MDIM 1.0 released in 1991. In addition to relatively imprecise geodetic + control, the previous mosaics were affected by changing definitions of + cartographic parameters (such as the definition of zero longitude), + resulting in an overall longitude shift of as much as 0.2° between the early MDIMs + and other datasets. The new mosaic uses the most recent coordinate system + definitions for Mars. These definitions have been widely adopted by NASA missions + and other users of planetary data and are likely to remain in use for a decade or + more. As a result, MDIM 2.1 not only registers precisely with data from current + missions such as Mars Global Surveyor (MGS) and 2001 Mars Odyssey but will serve + as an accurate basemap on which data from future missions can be plotted. + (Description from URL).

References: Williams, D. R. (2018). Viking + Mission to Mars. https://nssdc.gsfc.nasa.gov/planetary/viking.html Additional + references available here: http://astrogeology.usgs.gov/maps/mdim-2-1]] +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Viking MDIM [New York]", + Version = "1.1", + Description = [[Alternate image layer for Mars. This map is hosted on the OpenSpace + server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Mars/Viking/MDIM21/" .. + "Mars_Viking_MDIM21_ClrMosaic_global_232m", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_newyork.wms b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_newyork.wms new file mode 100644 index 0000000000..30610ec135 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mars/layers/colorlayers/viking_mdim_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Mars/MDIM/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 92160 + 46080 + 7 + top + + GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 360 + 360 + 3 + 10 + diff --git a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_amnh.asset b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_amnh.asset new file mode 100644 index 0000000000..decb71dd19 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_amnh.asset @@ -0,0 +1,46 @@ +local globeIdentifier = asset.require("../../mars").Mars.Identifier + +local layer = { + Identifier = "Mola_AMNH", + Name = "Mola Elevation [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("mola_amnh.wms"), + TilePixelSize = 90, + Description = [[This digital elevation model (DEM) is based on data from the Mars + Orbiter Laser Altimeter (MOLA; Smith et al., 2001), an instrument on NASA's Mars + Global Surveyor (MGS) spacecraft (Albee et al., 2001). The MOLA DEM represents + more than 600 million measurements gathered between 1999 and 2001, adjusted for + consistency (Neumann et al., 2001; Neumann, Smith & Zuber, 2003) and converted to + planetary radii. These have been converted to elevations above the areoid as + determined from a Martian gravity field solution GMM-2B (Lemoine et al., 2001), + truncated to degree and order 50, and oriented according to current standards. + The average accuracy of each point is originally ~100 meters in horizontal + position and ~1 meter in radius (Neumann et al., 2001). However, the total + elevation uncertainty is at least ±3 m due to the global error in the areoid + (±1.8 meters; Neumann et al., 2001) and regional uncertainties in its shape + (Neumann, 2002). Pixel resolution is 463 meters per pixel (m). (Description from + URL). Data Reference: (See URL)]] +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "HeightLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "HeightLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Mola Elevation [New York]", + Version = "1.1", + Description = [[Global elevation layer for Mars. This layer is hosted on the OpenSpace + server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Mars/GlobalSurveyor/MOLA/" .. + "Mars_MGS_MOLA_DEM_mosaic_global_463m", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_amnh.wms b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_amnh.wms new file mode 100644 index 0000000000..d1fd81da77 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mars/layers/heightlayers/mola_amnh.wms @@ -0,0 +1,22 @@ + + + http://wms.openspace.amnh.org/Mars/Mola_Elevation/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 46080 + 23040 + 6 + top + + Int16 + GEOGCS["GCS_Mars_2000_Sphere",DATUM["D_Mars_2000_Sphere",SPHEROID["Mars_2000_Sphere_IAU_IAG",3396190.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 360 + 360 + 1 + 10 + 5 + diff --git a/data/assets/scene/solarsystem/planets/mercury/default_layers.asset b/data/assets/scene/solarsystem/planets/mercury/default_layers.asset index 0b37e5e9f0..46ea0a07e7 100644 --- a/data/assets/scene/solarsystem/planets/mercury/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/mercury/default_layers.asset @@ -1,15 +1,19 @@ --mdis asset.require("./layers/colorlayers/messenger_mdis_utah", false) asset.require("./layers/colorlayers/messenger_mdis_sweden", false) +asset.require("./layers/colorlayers/messenger_mdis_newyork", false) --mossaic asset.require("./layers/colorlayers/messenger_mosaic_utah", false) asset.require("./layers/colorlayers/messenger_mosaic_sweden", false) +asset.require("./layers/colorlayers/messenger_mosaic_newyork", false) --mosaic2 aka 8 color asset.require("./layers/colorlayers/messenger_mosaic2_utah", false) asset.require("./layers/colorlayers/messenger_mosaic2_sweden", false) +asset.require("./layers/colorlayers/messenger_mosaic2_newyork", false) --bdr asset.require("./layers/colorlayers/messenger_bdr_utah", true) asset.require("./layers/colorlayers/messenger_bdr_sweden", false) +asset.require("./layers/colorlayers/messenger_bdr_newyork", false) --mdr asset.require("./layers/colorlayers/messenger_mdr_utah", false) --mp3 @@ -17,15 +21,19 @@ asset.require("./layers/colorlayers/messenger_mp3_utah", false) --hie asset.require("./layers/colorlayers/messenger_hie_utah", false) asset.require("./layers/colorlayers/messenger_hie_sweden", false) +asset.require("./layers/colorlayers/messenger_hie_newyork", false) --hiw asset.require("./layers/colorlayers/messenger_hiw_utah", false) asset.require("./layers/colorlayers/messenger_hiw_sweden", false) +asset.require("./layers/colorlayers/messenger_hiw_newyork", false) --loi asset.require("./layers/colorlayers/messenger_loi_utah", false) asset.require("./layers/colorlayers/messenger_loi_sweden", false) +asset.require("./layers/colorlayers/messenger_loi_newyork", false) --shade asset.require("./layers/colorlayers/messenger_shade_utah", false) asset.require("./layers/colorlayers/messenger_shade_sweden", false) +asset.require("./layers/colorlayers/messenger_shade_newyork", false) --local textures, these are mineral abundance maps asset.require("./layers/colorlayers/alsimap_02122015", false) asset.require("./layers/colorlayers/casimap_02122015", false) diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_newyork.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_newyork.asset new file mode 100644 index 0000000000..22f9257566 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_newyork.asset @@ -0,0 +1,39 @@ +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier + +local layer = { + Identifier = "Messenger_BDR_NewYork", + Name = "Messenger BDR [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("messenger_bdr_newyork.wms"), + TilePixelSize = 360, + Description = [[The Map Projected Basemap RDR (BDR) data set consists of a global + monochrome map of reflectance at a resolution of 256 pixels per degree (~166 m/p). + This edition, version 1, was released May 6, 2016 to the Planetary Data System (PDS) + MESSENGER archive. It is compiled using NAC or WAC 750-nm images from any campaign that + best fit the intended illumination geometry or low emission angle and incidence angle + near 74 degrees. It is controlled and projected onto a global digital elevation model. It uses + a Kasseleinin-Shkuratov photometric model, whose parameters are the same for any given + wavelength band across all MESSENGER end-of-mission map data products]] +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Messenger BDR [New York]", + Version = "1.0", + Description = [[Mercury MESSENGER MDIS Global Basemap BDR 166m layer for Mercury globe. + This map is hosted on the OpenSpace server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Mercury/Messenger/Global/Mercury_MESSENGER_MDIS_Basemap_BDR_Mosaic_Global_166m", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_newyork.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_newyork.wms new file mode 100644 index 0000000000..4b8d221d6b --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_bdr_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Mercury/Messenger_BDR/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 92160 + 46080 + 7 + top + + GEOGCS["GCS_Mercury_2015",DATUM["D_Mercury_2015",SPHEROID["Mercury_2015",2439400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 360 + 360 + 1 + 10 + diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_newyork.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_newyork.asset new file mode 100644 index 0000000000..ccff62c097 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_newyork.asset @@ -0,0 +1,31 @@ +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier + +local layer = { + Identifier = "Messenger_HIE_NewYork", + Name = "Messenger HIE [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("messenger_hie_newyork.wms") +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Messenger HIE [New York]", + Version = "1.0", + Description = [[Mercury HIE layer for Mercury globe. This map is hosted on the OpenSpace + server in New York]], + Author = "USGS", + URL = "", + License = "NASA/PDS" +} + diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_newyork.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_newyork.wms new file mode 100644 index 0000000000..9200b59fa2 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hie_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Mercury/Messenger_HIE/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 92160 + 46080 + 7 + top + + GEOGCS["GCS_Mercury_2015",DATUM["D_Mercury_2015",SPHEROID["Mercury_2015",2439400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 360 + 360 + 1 + 10 + diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_newyork.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_newyork.asset new file mode 100644 index 0000000000..57e0f87a86 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_newyork.asset @@ -0,0 +1,32 @@ +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier + +local layer = { + Identifier = "Messenger_HIW_NewYork", + Name = "Messenger HIW [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("messenger_hiw_newyork.wms") +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Messenger HIW [New York]", + Version = "1.0", + Description = [[Messenger HIW layer for Mercury globe. This map is hosted on the + OpenSpace server in New York]], + Author = "USGS", + URL = "", + License = "NASA/PDS" +} + + diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_newyork.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_newyork.wms new file mode 100644 index 0000000000..435072c8bc --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_hiw_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Mercury/Messenger_HIW/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 92160 + 46080 + 7 + top + + GEOGCS["GCS_Mercury_2015",DATUM["D_Mercury_2015",SPHEROID["Mercury_2015",2439400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 360 + 360 + 1 + 10 + diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_newyork.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_newyork.asset new file mode 100644 index 0000000000..43f9eee4dc --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_newyork.asset @@ -0,0 +1,31 @@ +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier + +local layer = { + Identifier = "Messenger_LOI_NewYork", + Name = "Messenger LOI [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("messenger_loi_newyork.wms") +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Messenger LOI [New York]", + Version = "1.0", + Description = [[Mercury LOI layer for Mercury globe. This map is hosted on the OpenSpace + server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Mercury/Messenger/Global/Mercury_MESSENGER_MDIS_Basemap_LOI_Mosaic_Global_166m", + License = "NASA/PDS" +} + diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_newyork.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_newyork.wms new file mode 100644 index 0000000000..9bce4af3ec --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_loi_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Mercury/Messenger_LOI/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 92160 + 46080 + 7 + top + + GEOGCS["GCS_Mercury_2015",DATUM["D_Mercury_2015",SPHEROID["Mercury_2015",2439400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 360 + 360 + 1 + 10 + diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_newyork.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_newyork.asset new file mode 100644 index 0000000000..3bb80e148d --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_newyork.asset @@ -0,0 +1,40 @@ +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier + +local layer = { + Identifier = "Messenger_MDIS_NewYork", + Name = "Messenger MDIS [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("messenger_mdis_newyork.wms"), + Description = [[This May 2013 basemap is a combination of the following mosaics; (1) + The 2013-05-10 version of the monochrome global mosaic, made from Applied Coherent + Technology (ACT) Corporation tiles, (2) An average north polar mosaic from 90N to 82.5N, + composed of images from many campaigns, made by C. Ernst, and (3) An average south + polar mosaic from 90S to 85S, composed of images from the south polar monitoring + campaign from the primary mission, made by N. Chabot. To fill minor areas of missing + data, the 2013-05-10 version of the high-incidence global mosaic was underlain. This + monochrome mosaic is composed of Mercury Dual Imaging System (MDIS) Narrow Angle + Camera (NAC) images and Wide Angle Camers (WAC) images acquired in the filter centered + at 750 nm. The resolution of this mosaic is 250 meters per pixel (m)]] +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Messenger MDIS [New York]", + Version = "1.0", + Description = [[Messenger MDIS layer for Mercury globe. This map is hosted on the + OpenSpace server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Mercury/Messenger/Global/Mercury_MESSENGER_MDIS_mosaic_global_250m_2013", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_newyork.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_newyork.wms new file mode 100644 index 0000000000..4c2c76b327 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mdis_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Mercury/Messenger_MDIS/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 61324 + 30662 + 7 + top + + GEOGCS["GCS_Mercury_2015",DATUM["D_Mercury_2015",SPHEROID["Mercury_2015",2439400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 256 + 256 + 1 + 10 + diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_newyork.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_newyork.asset new file mode 100644 index 0000000000..f45a06a83e --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_newyork.asset @@ -0,0 +1,30 @@ +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier + +local layer = { + Identifier = "Messenger_Mosaic2_NewYork", + Name = "Messenger Mosaic2 [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("messenger_mosaic2_newyork.wms") +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Messenger Mosaic2 [New York]", + Version = "1.0", + Description = [[Mercury Messenger Mosaic2 layer for Mercury globe. This map is hosted on + the OpenSpace server in New York]], + Author = "USGS", + URL = "", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_newyork.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_newyork.wms new file mode 100644 index 0000000000..1db5e653e2 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic2_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Mercury/Messenger_Mosaic_2/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 23040 + 11520 + 5 + top + + GEOGCS["GCS_Mercury_2015",DATUM["D_Mercury_2015",SPHEROID["Mercury_2015",2439400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 360 + 360 + 3 + 10 + diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_newyork.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_newyork.asset new file mode 100644 index 0000000000..11969fd37b --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_newyork.asset @@ -0,0 +1,30 @@ +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier + +local layer = { + Identifier = "Messenger_Mosaic_NewYork", + Name = "Messenger Mosaic [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("messenger_mosaic_newyork.wms") +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Messenger Mosaic [New York]", + Version = "1.0", + Description = [[Mercury Messenger Mosaic layer for Mercury globe. This map is hosted on + the OpenSpace server in New York]], + Author = "USGS", + URL = "", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_newyork.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_newyork.wms new file mode 100644 index 0000000000..b46f9714ab --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_mosaic_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Mercury/Messenger_Mosaic/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 23054 + 11527 + 6 + top + + GEOGCS["GCS_Mercury_2015",DATUM["D_Mercury_2015",SPHEROID["Mercury_2015",2439400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 256 + 256 + 3 + 10 + diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_newyork.asset b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_newyork.asset new file mode 100644 index 0000000000..4bbcd59b9d --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_newyork.asset @@ -0,0 +1,35 @@ +local globeIdentifier = asset.require("../../mercury").Mercury.Identifier + +local layer = { + Identifier = "Messenger_SHADE_NewYork", + Name = "Messenger SHADE [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("messenger_shade_newyork.wms"), + Settings = { + Gamma = 1.33, + Multiplier = 1.15 + }, + BlendMode = "Multiply" +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Messenger SHADE [New York]", + Version = "1.0", + Description = [[Mercury SHADE layer for Mercury globe. This map is hosted on the + OpenSpace server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Mercury/Topography/MESSENGER/Mercury_Messenger_USGS_ClrShade_Global_2km", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_newyork.wms b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_newyork.wms new file mode 100644 index 0000000000..47d1804e76 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/mercury/layers/colorlayers/messenger_shade_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Mercury/Messenger_Shade/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 7664 + 3832 + 4 + top + + GEOGCS["GCS_Mercury_2015",DATUM["D_Mercury_2015",SPHEROID["Mercury_2015",2439400.0,0.0]],PRIMEM["Reference_Meridian",0.0],UNIT["Degree",0.0174532925199433]] + 360 + 360 + 3 + 10 + diff --git a/data/assets/scene/solarsystem/planets/neptune/major_moons.asset b/data/assets/scene/solarsystem/planets/neptune/major_moons.asset index 2d5ad03546..db51e5b43b 100644 --- a/data/assets/scene/solarsystem/planets/neptune/major_moons.asset +++ b/data/assets/scene/solarsystem/planets/neptune/major_moons.asset @@ -1,4 +1,5 @@ asset.require("./triton/triton") +asset.require("./triton/default_layers") asset.require("./nereid/nereid") diff --git a/data/assets/scene/solarsystem/planets/neptune/triton/default_layers.asset b/data/assets/scene/solarsystem/planets/neptune/triton/default_layers.asset new file mode 100644 index 0000000000..a74daed072 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/neptune/triton/default_layers.asset @@ -0,0 +1,11 @@ +asset.require("./layers/colorlayers/Triton_Voyager2_ClrMosaic_GlobalFill_600m_newyork", true) + + +asset.meta = { + Name = "Default Triton Layers", + Version = "1.0", + Description = "Default Triton layers are: Voyager2 Mosaic", + Author = "OpenSpace Team", + URL = "http://openspaceproject.com", + License = "MIT license" +} diff --git a/data/assets/scene/solarsystem/planets/neptune/triton/layers/colorlayers/Triton_Voyager2_ClrMosaic_GlobalFill_600m_newyork.asset b/data/assets/scene/solarsystem/planets/neptune/triton/layers/colorlayers/Triton_Voyager2_ClrMosaic_GlobalFill_600m_newyork.asset new file mode 100644 index 0000000000..7d7eb0c5a9 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/neptune/triton/layers/colorlayers/Triton_Voyager2_ClrMosaic_GlobalFill_600m_newyork.asset @@ -0,0 +1,36 @@ +local globeIdentifier = asset.require("scene/solarsystem/planets/neptune/triton/triton").Triton.Identifier + +local layer = { + Identifier = "Triton_Voyager2_ClrMosaic_GlobalFill_600m_newyork", + Name = "Triton Voyager2 Mosaic [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("Triton_Voyager2_ClrMosaic_GlobalFill_600m_newyork.vrt"), + Description = [[Voyager 2 data was used to construct the best-ever global color map of Triton. + This map has a resolution of 1,970 feet (600 meters per pixel [m]). Color was synthesized by + combining high-resolution images taken through orange, violet, and ultraviolet filters; these + images were displayed as red, green, and blue images and combined to create this + color version (Smith et al., 1989).]], +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Triton Voyager2 Mosaic", + Version = "1.0", + Description = [[Voyager2 mosaic of Triton. This layer is hosted on the + OpenSpace server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Triton/Mosaic/" .. + "Triton_Voyager2_ClrMosaic_GlobalFill_600m/", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/neptune/triton/layers/colorlayers/Triton_Voyager2_ClrMosaic_GlobalFill_600m_newyork.vrt b/data/assets/scene/solarsystem/planets/neptune/triton/layers/colorlayers/Triton_Voyager2_ClrMosaic_GlobalFill_600m_newyork.vrt new file mode 100644 index 0000000000..6d515a9f0e --- /dev/null +++ b/data/assets/scene/solarsystem/planets/neptune/triton/layers/colorlayers/Triton_Voyager2_ClrMosaic_GlobalFill_600m_newyork.vrt @@ -0,0 +1,47 @@ + + GEOGCS["WGS 84",DATUM["WGS_1984",SPHEROID["WGS 84",6378137,298.257223563,AUTHORITY["EPSG","7030"]],AUTHORITY["EPSG","6326"]],PRIMEM["Greenwich",0,AUTHORITY["EPSG","8901"]],UNIT["degree",0.0174532925199433,AUTHORITY["EPSG","9122"]],AXIS["Latitude",NORTH],AXIS["Longitude",EAST],AUTHORITY["EPSG","4326"]] + -1.8000000000000000e+02, 2.5463290422973548e-02, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -2.5463290422973548e-02 + + Red + + Triton_Voyager2_ClrMosaic_GlobalFill_600m_newyork.wms + 1 + + + + + + + Green + + Triton_Voyager2_ClrMosaic_GlobalFill_600m_newyork.wms + 2 + + + + + + + Blue + + Triton_Voyager2_ClrMosaic_GlobalFill_600m_newyork.wms + 3 + + + + + + + Alpha + 0 + + Triton_Voyager2_ClrMosaic_GlobalFill_600m_newyork.wms + 1 + + + + 255 + 0 + + + diff --git a/data/assets/scene/solarsystem/planets/neptune/triton/layers/colorlayers/Triton_Voyager2_ClrMosaic_GlobalFill_600m_newyork.wms b/data/assets/scene/solarsystem/planets/neptune/triton/layers/colorlayers/Triton_Voyager2_ClrMosaic_GlobalFill_600m_newyork.wms new file mode 100644 index 0000000000..f29f9f14b9 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/neptune/triton/layers/colorlayers/Triton_Voyager2_ClrMosaic_GlobalFill_600m_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Triton/Triton_Voyager2_ClrMosaic_GlobalFill_600m/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 14138 + 7069 + 5 + top + + EPSG:4326 + 512 + 512 + 4 + 10 + diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/default_layers.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/default_layers.asset index 730ad4c732..a5032d1034 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/default_layers.asset @@ -1,5 +1,6 @@ asset.require("./layers/colorlayers/enceladus_texture", false) -asset.require("./layers/colorlayers/global_mosaic_100m_hpf", true) +asset.require("./layers/colorlayers/global_mosaic_100m_hpf_sweden", false) +asset.require("./layers/colorlayers/global_mosaic_100m_hpf_newyork", true) asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf_newyork.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf_newyork.asset new file mode 100644 index 0000000000..eb7880b565 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf_newyork.asset @@ -0,0 +1,37 @@ +local globeIdentifier = asset.require("../../enceladus").Enceladus.Identifier + +local layer = { + Identifier = "Global_Mosaic_100m_HPF_NewYork", + Name = "Cassini Global Mosaic 100m HPF [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("global_mosaic_100m_hpf_newyork.wms"), + Description = [[This mosaic represents the completion of a global control network of + Enceladus containing Cassini Imaging Science Subsystem (ISS) images. A total of + 586 images in CLR, GRN, UV3, and IR3 filters were selected for the control + network. The image selection criteria were based on coverage, quality, and a + spatial resolution between 50 and 500 meters per pixel (m) with phase angles less + than 120 degrees. (Description from URL)]] +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Cassini Global Mosaic 100m HPF [New York]", + Version = "1.0", + Description = [[Cassini Global mosaic for Enceladus. This map is hosted on the OpenSpace + server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Enceladus/Cassini/" .. + "Enceladus_Cassini_ISS_Global_Mosaic_100m_HPF", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf_newyork.wms b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf_newyork.wms new file mode 100644 index 0000000000..f2ee17ed72 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Enceladus/Cassini_ISS_Global_Mosaic_100m_HPF/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 15840 + 7920 + 5 + top + + EPSG:4326 + 512 + 512 + 1 + 10 + diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf.asset b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf_sweden.asset similarity index 83% rename from data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf.asset rename to data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf_sweden.asset index 5d890f73ed..21cad872eb 100644 --- a/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf.asset +++ b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf_sweden.asset @@ -1,10 +1,10 @@ local globeIdentifier = asset.require("../../enceladus").Enceladus.Identifier local layer = { - Identifier = "Global_Mosaic_100m_HPF", - Name = "Cassini Global Mosaic 100m HPF", + Identifier = "Global_Mosaic_100m_HPF_Sweden", + Name = "Cassini Global Mosaic 100m HPF [Sweden]", Enabled = asset.enabled, - FilePath = asset.localResource("global_mosaic_100m_hpf.wms"), + FilePath = asset.localResource("global_mosaic_100m_hpf_sweden.wms"), Description = [[This mosaic represents the completion of a global control network of Enceladus containing Cassini Imaging Science Subsystem (ISS) images. A total of 586 images in CLR, GRN, UV3, and IR3 filters were selected for the control @@ -26,7 +26,7 @@ asset.export("layer", layer) asset.meta = { - Name = "Cassini Global Mosaic 100m HPF", + Name = "Cassini Global Mosaic 100m HPF [Sweden]", Version = "1.0", Description = [[Cassini Global mosaic for Enceladus. This map is hosted on the OpenSpace server in Sweden]], diff --git a/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf.wms b/data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf_sweden.wms similarity index 100% rename from data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf.wms rename to data/assets/scene/solarsystem/planets/saturn/enceladus/layers/colorlayers/global_mosaic_100m_hpf_sweden.wms diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_newyork.asset b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_newyork.asset new file mode 100644 index 0000000000..74ec160f2c --- /dev/null +++ b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_newyork.asset @@ -0,0 +1,39 @@ +local globeIdentifier = asset.require("../../titan").Titan.Identifier + +local layer = { + Identifier = "Cassini_ISS_Global_Mosaic_4km_NewYork", + Name = "Cassini ISS Global Mosaic [New York]", + Enabled = asset.enabled, + FilePath = asset.localResource("cassini_iss_global_mosaic_4km_newyork.wms"), + Description = [[This global digital map of Saturn's moon Titan was created using + images taken by the Cassini spacecraft's Imaging Science Subsystem (ISS). The map + was produced in June 2015 using data collected through Cassini's flyby on April 7, + 2014, known as "T100". The mean radius of Titan used for projection of this map is + 1,600 miles (2,575 kilometers). Pixel resolution is 4005 meters per pixel (m). + Titan is assumed to be spherical until a control network -- a model of the moon's + shape based on multiple images tied together at defined points on the surface -- + is created at some point in the future. (Description from URL)]], +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Cassini ISS Global Mosaic [New York]", + Version = "1.1", + Description = [[Cassini global image layer for Titan. This layer is hosted on the + OpenSpace server in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Titan/Cassini/Global-Mosaic/" .. + "Titan_ISS_P19658_Mosaic_Global_4km", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_newyork.wms b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_newyork.wms new file mode 100644 index 0000000000..f4bc448017 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/saturn/titan/layers/colorlayers/cassini_iss_global_mosaic_4km_newyork.wms @@ -0,0 +1,20 @@ + + + http://wms.openspace.amnh.org/Titan/ISS_P19658_Mosaic_Global_4km/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 4040 + 2020 + 4 + top + + EPSG:4326 + 256 + 256 + 1 + 10 + diff --git a/data/assets/scene/solarsystem/planets/venus/default_layers.asset b/data/assets/scene/solarsystem/planets/venus/default_layers.asset index 6b1354b149..738c5da7cf 100644 --- a/data/assets/scene/solarsystem/planets/venus/default_layers.asset +++ b/data/assets/scene/solarsystem/planets/venus/default_layers.asset @@ -1,10 +1,13 @@ -- Color layers asset.require("./layers/colorlayers/magellan_mosaic_utah", false) +asset.require("./layers/colorlayers/magellan_mosaic_newyork", false) asset.require("./layers/colorlayers/venus_texture", false) asset.require("./layers/colorlayers/clouds_magellan_combo", true) +asset.require("./layers/colorlayers/clouds_magellan_combo_newyork", false) -- Height layers asset.require("./layers/heightlayers/magellan_utah", true) +asset.require("./layers/heightlayers/magellan_newyork", false) asset.meta = { diff --git a/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/clouds_magellan_combo_newyork.asset b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/clouds_magellan_combo_newyork.asset new file mode 100644 index 0000000000..e0f298053c --- /dev/null +++ b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/clouds_magellan_combo_newyork.asset @@ -0,0 +1,48 @@ +local globeIdentifier = asset.require("../../venus").Venus.Identifier + + +local texturesPath = asset.syncedResource({ + Name = "Venus Textures", + Type = "HttpSynchronization", + Identifier = "venus_textures", + Version = 2 +}) + +local combo = { + Identifier = "Clouds_Magellan_Combo_NewYork", + Name = "Clouds Magellan Combo [New York]", + Enabled = asset.enabled, + Type = "ByLevelTileLayer", + LevelTileProviders = { + { + MaxLevel = 4, + TileProvider = { + Identifier = "Clouds", + Name = "Clouds", + FilePath = texturesPath .. "venus_clouds.jpg" + } + }, + { + MaxLevel = 7, + TileProvider = { + Identifier = "Magellan_Mosaic_NewYork", + Name = "Magellan Mosaic [New York]", + FilePath = asset.localResource("magellan_mosaic_newyork.vrt"), + BlendMode = "Color", + Settings = { + Gamma = 2.0 + } + } + }, + }, +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", combo) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", combo) +end) + +asset.export(combo) diff --git a/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_newyork.asset b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_newyork.asset new file mode 100644 index 0000000000..4751cb85cf --- /dev/null +++ b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_newyork.asset @@ -0,0 +1,51 @@ +local globeIdentifier = asset.require("../../venus").Venus.Identifier + +local layer = { + Identifier = "Magellan_Mosaic_NewYork", + Name = "Magellan Mosaic [New York]", + Enabled = asset.enabled, + Description = [[Color layer for Venus. This mosaic was created from the Magellan + F-BIDRs, (Full resolution Basic Image Data Records), the highest resolution + radar images of the Venus surface (~75 m/pixel). Because Venus is shrouded by a + dense, opaque atmosphere, conventional optical cameras cannot be used to image + its surface. Instead, Magellan's imaging radar uses bursts of microwave energy + somewhat like a camera flash to illuminate the planet's surface. The radar pulses + are not sent directly downward but rather at a slight angle to the side of the + spacecraft--the radar is thus called "side-looking radar." In addition, special + processing techniques are used on the radar data to result in higher resolution + as if the radar had a larger antenna, or "aperture"; the technique is thus often + called "synthetic aperture radar," or SAR. The Magellan SAR is a side-looking + radar system. Radar pulses are not sent directly downward but rather at a slight + angle to the side of the spacecraft. In the case of Left-Look Magellan SAR data, + the radar system was sending signals to the left of the spacecraft. The SAR + operated in this left-looking mode during cycles 1 and 3 of the mission. + (Description from USGS)]], + FilePath = asset.localResource("magellan_mosaic_newyork.vrt"), + BlendMode = "Color", + Settings = { + Gamma = 2.0 + } +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Venus Magellan Mosaic", + Version = "1.0", + Description = [[Map layer for Venus containting Venus Magellan Mosaic from the USGS. + Hosted on the OpenSpace servers in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Venus/Magellan/" .. + "Venus_Magellan_LeftLook_mosaic_global_75m", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_newyork.vrt b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_newyork.vrt new file mode 100644 index 0000000000..1c31e4eeca --- /dev/null +++ b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_newyork.vrt @@ -0,0 +1,28 @@ + + GEOGCS["GCS_Venus",DATUM["D_Venus",SPHEROID["Venus_localRadius",6051000,0]],PRIMEM["Reference_Meridian",0],UNIT["Degree",0.0174532925199433]] + -1.8000000000000000e+02, 7.1016002272512077e-04, 0.0000000000000000e+00, 9.0000000000000000e+01, 0.0000000000000000e+00, -7.1011656303583486e-04 + + Gray + + magellan_mosaic_newyork.wms + 1 + + + + + + + Alpha + 0 + + magellan_mosaic_newyork.wms + 1 + + + + 255 + 0 + 0 + + + diff --git a/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_newyork.wms b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_newyork.wms new file mode 100644 index 0000000000..f05ee7602c --- /dev/null +++ b/data/assets/scene/solarsystem/planets/venus/layers/colorlayers/magellan_mosaic_newyork.wms @@ -0,0 +1,21 @@ + + + http://wms.openspace.amnh.org/Venus/Magellan_Mosaic/tile/${z}/${y}/${x} + + + -180.0 + 84.0 + 180.0 + -80.0 + 506928 + 230948 + 9 + top + + GEOGCS["GCS_Venus",DATUM["D_Venus",SPHEROID["Venus_localRadius",6051000,0]],PRIMEM["Reference_Meridian",0],UNIT["Degree",0.0174532925199433]] + 512 + 512 + 1 + 10 + 5 + diff --git a/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan_newyork.asset b/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan_newyork.asset new file mode 100644 index 0000000000..6a388fb4cd --- /dev/null +++ b/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan_newyork.asset @@ -0,0 +1,46 @@ +local globeIdentifier = asset.require("../../venus").Venus.Identifier + +local layer = { + Identifier = "MagellanElevation_NewYork", + Name = "Magellan Elevation [New York]", + Enabled = asset.enabled, + Description = [[Elevation layer for Venus. The represents the version 2 + (1997 release) of the Global Topographic Data Record (GTDR-SINUS.3;2). + The range to surface is derived by fitting altimeter echoes from the fan-beam + altimetry antenna as a function of time to Hagfors' radar backscatter model + templates. The ranges are subtracted from the spacecraft radial + coordinate (derived from Doppler tracking), yielding measurements of + planetary radius. The data are filtered to remove low-frequency errors in + the in-plane elements of each spacecraft orbit, and then originally re-sampled + into sinusoidal, Mercator, and north and south polar stereographic projections + at a resolution of 5 kilometers per pixel (4641 meters per pixel [m])]], + FilePath = asset.localResource("magellan_newyork.wms"), + TilePixelSize = 256, + Settings = { + Gamma = 1.72, + Multiplier = 1.1 + } +} + +asset.onInitialize(function() + openspace.globebrowsing.addLayer(globeIdentifier, "HeightLayers", layer) +end) + +asset.onDeinitialize(function() + openspace.globebrowsing.deleteLayer(globeIdentifier, "HeightLayers", layer) +end) + +asset.export("layer", layer) + + + +asset.meta = { + Name = "Venus Magellan DEM", + Version = "1.0", + Description = [[Map layer for Venus containting Venus Magellan DEM from the USGS. + Hosted on the OpenSpace servers in New York]], + Author = "USGS", + URL = "https://astrogeology.usgs.gov/search/map/Venus/Magellan/RadarProperties" .. + "/Venus_Magellan_Topography_Global_4641m_v02", + License = "NASA/PDS" +} diff --git a/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan_newyork.wms b/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan_newyork.wms new file mode 100644 index 0000000000..0e8a5fcb94 --- /dev/null +++ b/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan_newyork.wms @@ -0,0 +1,21 @@ + + + http://wms.openspace.amnh.org/Venus/Magellan_DEM/tile/${z}/${y}/${x} + + + -180.0 + 90.0 + 180.0 + -90.0 + 8192 + 4096 + 4 + top + + GEOGCS["GCS_Venus",DATUM["D_Venus",SPHEROID["Venus",6051000,0]],PRIMEM["Reference_Meridian",0],UNIT["Degree",0.0174532925199433]] + 256 + 256 + 1 + 10 + 5 + diff --git a/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan_utah.asset b/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan_utah.asset index 59aaad0fdc..1997b25c5f 100644 --- a/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan_utah.asset +++ b/data/assets/scene/solarsystem/planets/venus/layers/heightlayers/magellan_utah.asset @@ -1,7 +1,7 @@ local globeIdentifier = asset.require("../../venus").Venus.Identifier local layer = { - Identifier = "Magellan", + Identifier = "MagellanElevation_Utah", Name = "Magellan Elevation [Utah]", Enabled = asset.enabled, Description = [[Elevation layer for Venus. The represents the version 2 diff --git a/data/assets/util/launcher_images.asset b/data/assets/util/launcher_images.asset index d2fd2efe90..01a474b765 100644 --- a/data/assets/util/launcher_images.asset +++ b/data/assets/util/launcher_images.asset @@ -2,6 +2,6 @@ local DataPath = asset.syncedResource({ Name = "Launcher Images", Type = "HttpSynchronization", Identifier = "launcher_images", - Version = 2 + Version = 3 }) asset.export("DataPath", DataPath) diff --git a/data/assets/util/scale_model_helper.asset b/data/assets/util/scale_model_helper.asset new file mode 100644 index 0000000000..6f728c79b7 --- /dev/null +++ b/data/assets/util/scale_model_helper.asset @@ -0,0 +1,111 @@ +local earthAsset = asset.require('scene/solarsystem/planets/earth/earth') +local sunAsset = asset.require('scene/solarsystem/sun/sun') + +local createModelFolder = function(name, syncFolder) + + local folder = asset.syncedResource({ + Name = "Scale Model " .. name, + Type = "HttpSynchronization", + Identifier = syncFolder, + Version = 1 + }) + + return folder +end + +local createModel = function(identifier, lat, lon, altitude, scale, modelScale, + rotationVector, name, modelFolder, modelFile) + + local model = { + Identifier = identifier, + Parent = earthAsset.Earth.Identifier, + --Note: Lat/Lon/Scale values comes from alignment with Esri World Imagery 2D layer + Transform = { + Translation = { + Type = "GlobeTranslation", + Globe = earthAsset.Earth.Identifier, + Latitude = lat, + Longitude = lon, + Altitude = altitude, + UseHeightmap = true + }, + Rotation = { + Type = "GlobeRotation", + Globe = earthAsset.Earth.Identifier, + Latitude = lat, + Longitude = lon, + UseHeightmap = false + }, + Scale = { + Type = "StaticScale", + Scale = scale + } + }, + Renderable = { + Type = "RenderableModel", + GeometryFile = modelFolder .. modelFile, + RotationVector = rotationVector, + ModelScale = modelScale, + LightSources = { sunAsset.LightSource } + }, + GUI = { + Name = name, + Path = "/Scale Objects" + } + } + + return model +end + +local createDropAction = function(identifier, name, guiPath) + local updatePositionAction = { + Identifier = "os.drop_" .. identifier, + Name = "Drop " .. name .. " Building under camera", + Command = [[ + local lat, lon, alt = openspace.globebrowsing.getGeoPositionForCamera(); + local camera = openspace.navigation.getNavigationState(); + openspace.setParent(']] .. identifier .. [[', camera.Anchor) + openspace.setPropertyValueSingle('Scene.]] .. identifier .. [[.Translation.Globe', camera.Anchor); + openspace.setPropertyValueSingle('Scene.]] .. identifier .. [[.Translation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.]] .. identifier .. [[.Translation.Longitude', lon); + openspace.setPropertyValueSingle('Scene.]] .. identifier .. [[.Rotation.Globe', camera.Anchor); + openspace.setPropertyValueSingle('Scene.]] .. identifier .. [[.Rotation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.]] .. identifier .. [[.Rotation.Longitude', lon); + ]], + Documentation = "Updates the " .. name .. " position based on the globe location of the camera", + GuiPath = "/" .. guiPath, + IsLocal = false + } + + return updatePositionAction +end + +local createResetAction = function(identifier, name, lat, lon, guiPath) + local resetPositionAction = { + Identifier = "os.reset_" .. identifier, + Name = "Reset " .. name .. " position", + Command = [[ + -- same position as above + local lat = ]] .. lat .. [[ + local lon = ]] .. lon .. [[ + local globe = ']] .. earthAsset.Earth.Identifier .. [[' + openspace.setParent(']] .. identifier .. [[', globe) + openspace.setPropertyValueSingle('Scene.]] .. identifier .. [[.Translation.Globe', globe); + openspace.setPropertyValueSingle('Scene.]] .. identifier .. [[.Translation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.]] .. identifier .. [[.Translation.Longitude', lon); + openspace.setPropertyValueSingle('Scene.]] .. identifier .. [[.Rotation.Globe', globe); + openspace.setPropertyValueSingle('Scene.]] .. identifier .. [[.Rotation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.]] .. identifier .. [[.Rotation.Longitude', lon); + ]], + Documentation = "Updates the " .. name .. " position based on the globe location of the camera", + GuiPath = "/" .. guiPath, + IsLocal = false + } + + return resetPositionAction +end + +asset.export("createModelFolder", createModelFolder) +asset.export("createModel", createModel) +asset.export("createDropAction", createDropAction) +asset.export("createResetAction", createResetAction) diff --git a/data/globe_pin.png b/data/globe_pin.png new file mode 100644 index 0000000000..3d530d9744 Binary files /dev/null and b/data/globe_pin.png differ diff --git a/data/profiles/nightsky.profile b/data/profiles/nightsky.profile new file mode 100644 index 0000000000..706c0a5160 --- /dev/null +++ b/data/profiles/nightsky.profile @@ -0,0 +1,71 @@ +{ + "additional_scripts": [ + "openspace.action.triggerAction(\"os.nightsky.level_horizon_pitch\")" + ], + "assets": [ + "base", + "base_keybindings", + "events/toggle_sun", + "scene/solarsystem/planets/earth/earth", + "scene/solarsystem/planets/earth/satellites/satellites" + ], + "camera": { + "altitude": 50.0, + "anchor": "Earth", + "latitude": 58.5877, + "longitude": 16.1652, + "type": "goToGeo" + }, + "delta_times": [ + 1.0, + 5.0, + 10.0, + 30.0, + 60.0, + 120.0, + 300.0, + 600.0, + 900.0, + 1800.0, + 3600.0, + 7200.0, + 14400.0 + ], + "mark_nodes": [ + "Earth", + "Mars", + "Moon", + "Sun", + "Venus", + "ISS" + ], + "meta": { + "author": "OpenSpace Team", + "description": "A profile starting at night on the surface of earth looking out at the horizon. The city lights map has been disabled.", + "license": "MIT License", + "name": "Default", + "url": "https://www.openspaceproject.com", + "version": "1.0" + }, + "properties": [ + { + "name": "{earth_satellites}.Renderable.Enabled", + "type": "setPropertyValue", + "value": "false" + }, + { + "name": "Scene.Earth.Renderable.Layers.NightLayers.Earth_at_Night_2012.Enabled", + "type": "setPropertyValueSingle", + "value": "false" + } + ], + "time": { + "is_paused": false, + "type": "absolute", + "value": "2023-04-13T19:40:00" + }, + "version": { + "major": 1, + "minor": 2 + } +} \ No newline at end of file diff --git a/deploy.bat b/deploy.bat new file mode 100644 index 0000000000..6f05c1eb1a --- /dev/null +++ b/deploy.bat @@ -0,0 +1,98 @@ +@echo off + +echo ### Removing old folders +if exist bin-old rmdir /S /Q bin-old +if exist build-deploy rmdir /S /Q build-deploy +if exist pdbs.zip del pdbs.zip +if exist OpenSpace.zip del OpenSpace.zip +if exist OpenSpace-minimal.zip del OpenSpace-minimal.zip + +echo ### Moving existing folders out of the way +if exist bin move bin bin-old + + + +echo ### Run CMake into the 'build-deploy' folder +cmake^ + -D SGCT_BUILD_TESTS=OFF^ + -D GHOUL_HIGH_DEBUG_MODE=OFF^ + -D GHOUL_HAVE_TESTS=OFF^ + -D OPENSPACE_HAVE_TESTS=OFF^ + -D OPENSPACE_ENABLE_ALL_MODULES=ON^ + -S .^ + -B build-deploy + + + +echo ### Build OpenSpace in RelWithDebInfo mode +cmake^ + --build build-deploy^ + --config RelWithDebInfo^ + --target OpenSpace^ + --parallel^ + -- /p:CL_MPcount=16 + +if %ERRORLEVEL% NEQ 0 EXIT /B + +echo ### Save the PDB files +"C:\Program Files\7-Zip\7z.exe" a pdbs.zip bin/RelWithDebInfo/*.pdb + + +echo ### Dealing with some files +:: Remove unnecessary files of our own making +del bin\RelWithDebInfo\*.pdb +del bin\RelWithDebInfo\codegen.exe +del bin\RelWithDebInfo\Qt6Svg.dll + +:: Remove unnecessary Qt files +rmdir /S /Q bin\RelWithDebInfo\iconengines +rmdir /S /Q bin\RelWithDebInfo\imageformats +rmdir /S /Q bin\RelWithDebInfo\networkinformation + +:: Reset the documentation back to the master as it will have been updated locally +cd documentation +copy documentationData.js .. +git checkout HEAD -- documentationData.js +cd .. + +:: The binary files are created in the RelWithDebInfo subdirectory and we want them in bin +robocopy bin\\RelWithDebInfo bin /E /MOV +rmdir /S /Q bin\\RelWithDebInfo + +:: Download the Microsoft redistributable +curl "http://aka.ms/vs/17/release/vc_redist.x64.exe" --output vc_redist.x64.exe -L + + +echo ### Create main zip file +:: Need to manually add any new weird paths that don't match the wildcards below +"C:\Program Files\7-Zip\7z.exe" a -tzip -mx=9 -mfb=257 -mpass=15 OpenSpace.zip^ + bin/*^ + config/*^ + data/*^ + documentation/*^ + scripts/*^ + shaders/*^ + ACKNOWLEDGMENTS.md^ + CITATION.cff^ + CODE_OF_CONDUCT.md^ + COMMIT.md^ + CREDITS.md^ + LICENSE.md^ + openspace.cfg^ + README.md^ + vc_redist.x64.exe^ + ^ + modules/*/shaders/*^ + modules/*/scripts/*^ + modules/globebrowsing/gdal_data/*^ + modules/webgui/ext/nodejs/node.exe^ + ^ + -x!documentation/.git + + +echo ### Clean up +rmdir /S /Q bin +del vc_redist.x64.exe +if exist bin-old move bin-old bin +if exist build-deploy rmdir /S /Q build-deploy +move documentationData.js documentation diff --git a/ext/CMakeLists.txt b/ext/CMakeLists.txt index 3bb558417a..be0d33f15d 100644 --- a/ext/CMakeLists.txt +++ b/ext/CMakeLists.txt @@ -46,7 +46,9 @@ endif () # Ghoul add_subdirectory(ghoul) -set_target_properties(GhoulTest PROPERTIES FOLDER "Unit Tests") +if (TARGET GhoulTest) + set_target_properties(GhoulTest PROPERTIES FOLDER "Unit Tests") +endif () # Spice begin_dependency("Spice") diff --git a/include/openspace/engine/configuration.h b/include/openspace/engine/configuration.h index d63fbc5086..ae69611030 100644 --- a/include/openspace/engine/configuration.h +++ b/include/openspace/engine/configuration.h @@ -25,6 +25,7 @@ #ifndef __OPENSPACE_CORE___CONFIGURATION___H__ #define __OPENSPACE_CORE___CONFIGURATION___H__ +#include #include #include #include @@ -47,6 +48,11 @@ struct Configuration { std::string windowConfiguration = "${CONFIG}/single.xml"; std::string asset; std::string profile; + + properties::Property::Visibility propertyVisibility = + properties::Property::Visibility::User; + + std::vector readOnlyWindowConfigs; std::vector readOnlyProfiles; std::vector globalCustomizationScripts; std::map pathTokens = { diff --git a/include/openspace/events/event.h b/include/openspace/events/event.h index 06ba981ddc..08f15512d9 100644 --- a/include/openspace/events/event.h +++ b/include/openspace/events/event.h @@ -79,6 +79,7 @@ struct Event { RenderableDisabled, CameraPathStarted, CameraPathFinished, + CameraMovedPosition, Custom }; constexpr explicit Event(Type type_) : type(type_) {} @@ -560,6 +561,18 @@ struct EventCameraPathFinished : public Event { const tstring destination; }; +/** + * This event is created when the a camera moves location + */ +struct EventCameraMovedPosition : public Event { + static constexpr Type Type = Event::Type::CameraMovedPosition; + + /** + * Creates an instance of an EventCameraMovedPosition event. + */ + EventCameraMovedPosition(); +}; + /** * A custom event type that can be used in a pinch when no explicit event type is * available. This should only be used in special circumstances and it should be diff --git a/include/openspace/interaction/camerainteractionstates.h b/include/openspace/interaction/camerainteractionstates.h index 979899fb0f..b220db6115 100644 --- a/include/openspace/interaction/camerainteractionstates.h +++ b/include/openspace/interaction/camerainteractionstates.h @@ -58,7 +58,7 @@ public: * Returns true if any of the velocities are larger than zero, * i.e. wether an interaction happened */ - bool hasNonZeroVelocities(); + bool hasNonZeroVelocities(bool checkOnlyMovement = false); protected: struct InteractionState { diff --git a/include/openspace/mission/mission.h b/include/openspace/mission/mission.h index 1cdb13f32a..6ea8adf84c 100644 --- a/include/openspace/mission/mission.h +++ b/include/openspace/mission/mission.h @@ -27,7 +27,7 @@ #include #include - +#include #include #include diff --git a/include/openspace/navigation/orbitalnavigator.h b/include/openspace/navigation/orbitalnavigator.h index 4cd6628cf6..b269eb79a9 100644 --- a/include/openspace/navigation/orbitalnavigator.h +++ b/include/openspace/navigation/orbitalnavigator.h @@ -98,6 +98,8 @@ public: void tickIdleBehaviorTimer(double deltaTime); void triggerIdleBehavior(std::string_view choice = ""); + void tickMovementTimer(float deltaTime); + Camera* camera() const; void setCamera(Camera* camera); void clearPreviousState(); @@ -253,6 +255,8 @@ private: IdleBehavior _idleBehavior; float _idleBehaviorTriggerTimer = 0.f; + float _movementTimer = 0.f; + /** * Decomposes the camera's rotation in to a global and a local rotation defined by * CameraRotationDecomposition. The global rotation defines the rotation so that the diff --git a/include/openspace/properties/property.h b/include/openspace/properties/property.h index 4dbe290e07..4a5fc2a18c 100644 --- a/include/openspace/properties/property.h +++ b/include/openspace/properties/property.h @@ -72,6 +72,8 @@ public: User = 2, ///< Visible in User mode NoviceUser = 1, ///< Visible in Novice User mode Always = 0, ///< Visible for all types, no matter what + + Default = Always ///< The default visibility for properties }; /** @@ -102,7 +104,7 @@ public: /// The user facing description of this Property const char* description; /// Determines the visibility of this Property in the user interface - Visibility visibility = Visibility::Always; + Visibility visibility = Visibility::Default; }; /// An OnChangeHandle is returned by the onChange method to uniquely identify an diff --git a/include/openspace/rendering/fadeable.h b/include/openspace/rendering/fadeable.h index 5caf218e00..7ded6d8b1b 100644 --- a/include/openspace/rendering/fadeable.h +++ b/include/openspace/rendering/fadeable.h @@ -32,7 +32,7 @@ namespace openspace { /** * This class is an interface for all things fadeable in the software; things that need * a fade and opacity property, which will be combined into a final opacity value - * + * * A Fadeable can also be dependent on the fade value from a specified parent fadeable, * so that it fades out together with the parent */ diff --git a/include/openspace/rendering/helper.h b/include/openspace/rendering/helper.h index 6631b7ccf8..0770617383 100644 --- a/include/openspace/rendering/helper.h +++ b/include/openspace/rendering/helper.h @@ -32,6 +32,11 @@ namespace ghoul::opengl { class Texture; } // namespace ghoul::opengl +namespace openspace { + class LightSource; + struct RenderData; +} // namespace openspace + namespace openspace::rendering::helper { enum class Anchor { @@ -109,6 +114,11 @@ struct VertexXYZ { GLfloat xyz[3]; }; +struct VertexXYZNormal { + GLfloat xyz[3]; + GLfloat normal[3]; +}; + VertexXYZ convertToXYZ(const Vertex& v); std::vector convert(std::vector v); @@ -119,6 +129,20 @@ std::vector createRing(int nSegments, float radius, std::pair, std::vector> createSphere(int nSegments, glm::vec3 radii, glm::vec4 colors = glm::vec4(1.f)); +/** + * Data structure that can be used for rendering using multiple light directions + */ +struct LightSourceRenderData { + unsigned int nLightSources = 0; + + // Buffers for uniform uploading + std::vector intensitiesBuffer; + std::vector directionsViewSpaceBuffer; + + void updateBasedOnLightSources(const RenderData& renderData, + const std::vector>& sources); +}; + } // namespace openspace::rendering::helper #endif // __OPENSPACE_CORE___HELPER___H__ diff --git a/include/openspace/rendering/renderable.h b/include/openspace/rendering/renderable.h index 42566c50f6..38f94f62a3 100644 --- a/include/openspace/rendering/renderable.h +++ b/include/openspace/rendering/renderable.h @@ -141,8 +141,6 @@ protected: // An optional renderbin that renderables can use for certain components, in cases // where all parts of the renderable should not be rendered in the same bin std::optional _secondaryRenderBin; - - void registerUpdateRenderBinFromOpacity(); private: double _boundingSphere = 0.0; @@ -152,6 +150,8 @@ private: bool _automaticallyUpdateRenderBin = true; bool _hasOverrideRenderBin = false; + void registerUpdateRenderBinFromOpacity(); + // We only want the SceneGraphNode to be able manipulate the parent, so we don't want // to provide a set method for this. Otherwise, anyone might mess around with our // parentage and that's no bueno diff --git a/modules/CMakeLists.txt b/modules/CMakeLists.txt index 14f425a5d0..5c5ec9409c 100644 --- a/modules/CMakeLists.txt +++ b/modules/CMakeLists.txt @@ -162,7 +162,7 @@ endfunction () - +option(OPENSPACE_ENABLE_ALL_MODULES "If this is ON, all modules will be enabled by default") set(OPENSPACE_EXTERNAL_MODULES_PATHS "" CACHE STRING "List of external modules") set(internal_module_path "${PROJECT_SOURCE_DIR}/modules") set(all_enabled_modules "") @@ -209,7 +209,11 @@ foreach(val RANGE ${all_module_names_count}) get_module_attribute_default(${path} is_default_module) create_option_name(${name} optionName) - option(${optionName} "Build ${path} Module" ${is_default_module}) + if (${OPENSPACE_ENABLE_ALL_MODULES}) + option(${optionName} "Build ${path} Module" ON) + else () + option(${optionName} "Build ${path} Module" ${is_default_module}) + endif () if (${optionName}) list(APPEND enabled_module_names ${name}) diff --git a/modules/atmosphere/rendering/renderableatmosphere.cpp b/modules/atmosphere/rendering/renderableatmosphere.cpp index e6bd488770..e46c6e2956 100644 --- a/modules/atmosphere/rendering/renderableatmosphere.cpp +++ b/modules/atmosphere/rendering/renderableatmosphere.cpp @@ -41,7 +41,8 @@ namespace { constexpr openspace::properties::Property::PropertyInfo AtmosphereHeightInfo = { "AtmosphereHeight", "Atmosphere Height (KM)", - "The thickness of the atmosphere in km" + "The thickness of the atmosphere in km", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AverageGroundReflectanceInfo = @@ -49,59 +50,70 @@ namespace { "AverageGroundReflectance", "Average Ground Reflectance (%)", "Average percentage of light reflected by the ground during the pre-calculation " - "phase" + "phase", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo GroundRadianceEmissionInfo = { "GroundRadianceEmission", "Percentage of initial radiance emitted from ground", - "Multiplier of the ground radiance color during the rendering phase" + "Multiplier of the ground radiance color during the rendering phase", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RayleighHeightScaleInfo = { "RayleighHeightScale", "Rayleigh Scale Height (KM)", "It is the vertical distance over which the density and pressure fall by a " - "constant factor" + "constant factor", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RayleighScatteringCoeffInfo = { "RayleighScatteringCoeff", "Rayleigh Scattering Coeff", - "Rayleigh sea-level scattering coefficients in meters" + "Rayleigh sea-level scattering coefficients in meters", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo OzoneLayerInfo = { "Ozone", "Ozone Layer Enabled", - "Enables/Disable Ozone Layer during pre-calculation phase" + "Enables/Disable Ozone Layer during pre-calculation phase", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo OzoneHeightScaleInfo = { "OzoneLayerHeightScale", "Ozone Scale Height (KM)", "It is the vertical distance over which the density and pressure fall by a " - "constant factor" + "constant factor", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo OzoneLayerCoeffInfo = { "OzoneLayerCoeff", "Ozone Layer Extinction Coeff", - "Ozone scattering coefficients in meters" + "Ozone scattering coefficients in meters", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MieHeightScaleInfo = { "MieHeightScale", "Mie Scale Height (KM)", "It is the vertical distance over which the density and pressure fall by a " - "constant factor" + "constant factor", + // @VISIBILITY(3.2) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MieScatteringCoeffInfo = { "MieScatteringCoeff", "Mie Scattering Coeff", - "Mie sea-level scattering coefficients in meters" + "Mie sea-level scattering coefficients in meters", + // @VISIBILITY(3.2) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo @@ -109,19 +121,25 @@ namespace { { "MieScatteringExtinctionPropCoefficient", "Mie Scattering/Extinction Proportion Coefficient (%)", - "Mie Scattering/Extinction Proportion Coefficient (%)" + "Mie Scattering/Extinction Proportion Coefficient (%)", + // @VISIBILITY(3.2) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MieAsymmetricFactorGInfo = { "MieAsymmetricFactorG", "Mie Asymmetric Factor G", - "Averaging of the scattering angle over a high number of scattering events" + "Averaging of the scattering angle over a high number of scattering events", + // @VISIBILITY(3.2) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SunIntensityInfo = { "SunIntensity", "Sun Intensity", - "Unitless for now" + "Unitless for now", + // @VISIBILITY(2.6) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo @@ -129,26 +147,31 @@ namespace { { "SunFollowingCamera", "Enable Sun On Camera Position", - "When selected the Sun is artificially positioned behind the observer all times" + "When selected the Sun is artificially positioned behind the observer all times", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo EclipseHardShadowsInfo = { "EclipseHardShadowsInfo", "Enable Hard Shadows for Eclipses", - "Enable/Disables hard shadows through the atmosphere" + "Enable/Disables hard shadows through the atmosphere", + // @VISIBILITY(2.8) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo AtmosphereDimmingHeightInfo ={ "AtmosphereDimmingHeight", "Atmosphere Dimming Height", - "Percentage of the atmosphere where other objects, such as the stars, are faded" + "Percentage of the atmosphere where other objects, such as the stars, are faded", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SunsetAngleInfo = { "AtmosphereDimmingSunsetAngle", "Atmosphere Dimming Sunset Angle", "The angle (degrees) between the Camera and the Sun where the sunset starts, and " - "the atmosphere starts to fade in objects such as the stars" + "the atmosphere starts to fade in objects such as the stars", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderableAtmosphere)]] Parameters { diff --git a/modules/base/dashboard/dashboarditemangle.cpp b/modules/base/dashboard/dashboarditemangle.cpp index 9557f92524..12217ef19d 100644 --- a/modules/base/dashboard/dashboarditemangle.cpp +++ b/modules/base/dashboard/dashboarditemangle.cpp @@ -50,7 +50,9 @@ namespace { "SourceType", "Source Type", "The type of position that is used as the triangle apex used to calculate the " - "angle. The default value is 'Camera'" + "angle. The default value is 'Camera'", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo SourceNodeNameInfo = { @@ -59,7 +61,9 @@ namespace { "If a scene graph node is selected as type, this value specifies the name of the " "node that is to be used as the apex of the triangle used to calculate the " "angle. The computed angle is the incident angle to Source in the triangle (" - "Source, Reference, Destination)" + "Source, Reference, Destination)", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ReferenceTypeInfo = { @@ -67,14 +71,18 @@ namespace { "Reference Type", "The type of position that is used as the destination of the reference line used " "to calculate the angle. The computed angle is the incident angle to Source in " - "the triangle (Source, Reference, Destination)" + "the triangle (Source, Reference, Destination)", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ReferenceNodeNameInfo = { "ReferenceNodeName", "Reference Node Name", "If a scene graph node is selected as type, this value specifies the name of the " - "node that is to be used as the reference direction to compute the angle" + "node that is to be used as the reference direction to compute the angle", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo DestinationTypeInfo = { @@ -82,14 +90,18 @@ namespace { "Destination Type", "The type of position that is used as the destination to calculate the angle. " "The computed angle is the incident angle to Source in the triangle (" - "Source, Reference, Destination). The default value for this is 'Focus'" + "Source, Reference, Destination). The default value for this is 'Focus'", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo DestinationNodeNameInfo = { "DestinationNodeName", "Destination Node Name", "If a scene graph node is selected as type, this value specifies the name of the " - "node that is to be used as the destination for computing the angle" + "node that is to be used as the destination for computing the angle", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(DashboardItemAngle)]] Parameters { diff --git a/modules/base/dashboard/dashboarditemdate.cpp b/modules/base/dashboard/dashboarditemdate.cpp index f5fc9d29ee..cca8844985 100644 --- a/modules/base/dashboard/dashboarditemdate.cpp +++ b/modules/base/dashboard/dashboarditemdate.cpp @@ -40,7 +40,8 @@ namespace { "FormatString", "Format String", "The format text describing how this dashboard item renders its text. This text " - "must contain exactly one {} which is a placeholder that will contain the date" + "must contain exactly one {} which is a placeholder that will contain the date", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TimeFormatInfo = { @@ -49,7 +50,9 @@ namespace { "The format string used for formatting the date/time before being passed to the " "string in FormatString. See " "https://naif.jpl.nasa.gov/pub/naif/toolkit_docs/C/cspice/timout_c.html for full " - "information about how to structure this format" + "information about how to structure this format", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(DashboardItemDate)]] Parameters { diff --git a/modules/base/dashboard/dashboarditemdistance.cpp b/modules/base/dashboard/dashboarditemdistance.cpp index fd99b8814e..895c6dbf4a 100644 --- a/modules/base/dashboard/dashboarditemdistance.cpp +++ b/modules/base/dashboard/dashboarditemdistance.cpp @@ -52,28 +52,36 @@ namespace { "SourceType", "Source Type", "The type of position that is used as the source to calculate the distance. The " - "default value is 'Camera'" + "default value is 'Camera'", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo SourceNodeNameInfo = { "SourceNodeName", "Source Node Name", "If a scene graph node is selected as type, this value specifies the name of the " - "node that is to be used as the source for computing the distance" + "node that is to be used as the source for computing the distance", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo DestinationTypeInfo = { "DestinationType", "Destination Type", "The type of position that is used as the destination to calculate the distance. " - "The default value for this is 'Focus'" + "The default value for this is 'Focus'", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo DestinationNodeNameInfo = { "DestinationNodeName", "Destination Node Name", "If a scene graph node is selected as type, this value specifies the name of the " - "node that is to be used as the destination for computing the distance" + "node that is to be used as the destination for computing the distance", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo SimplificationInfo = { @@ -81,7 +89,8 @@ namespace { "Simplification", "If this value is enabled, the distance is displayed in nuanced units, such as " "km, AU, light years, parsecs, etc. If this value is disabled, the unit can be " - "explicitly requested" + "explicitly requested", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo RequestedUnitInfo = { @@ -96,7 +105,8 @@ namespace { "Format String", "The format string that is used for formatting the distance string. This format " "receives four parameters: The name of the source, the name of the destination " - "the value of the distance and the unit of the distance" + "the value of the distance and the unit of the distance", + openspace::properties::Property::Visibility::AdvancedUser }; std::vector unitList() { diff --git a/modules/base/dashboard/dashboarditemelapsedtime.cpp b/modules/base/dashboard/dashboarditemelapsedtime.cpp index 6406bf97e8..295ad646f5 100644 --- a/modules/base/dashboard/dashboarditemelapsedtime.cpp +++ b/modules/base/dashboard/dashboarditemelapsedtime.cpp @@ -41,14 +41,17 @@ namespace { "Format String", "The format text describing how this dashboard item renders its text. This text " "must contain exactly one {} which is a placeholder that will contain the value " - "of the elapsed time." + "of the elapsed time.", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ReferenceTimeInfo = { "ReferenceTime", "Reference Time", "The reference time relative to which the elapsed time is specified. The format " - "must be an ISO 8601-compliant date string" + "must be an ISO 8601-compliant date string", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo SimplifyTimeInfo = { @@ -56,14 +59,18 @@ namespace { "Simplify Time", "If this value is enabled, the elapsed time will be simplified into seconds, " "minutes, hours, etc. If the value is disabled, the elapsed time is always " - "presented in seconds. The default value for this is 'true'." + "presented in seconds. The default value for this is 'true'.", + // @VISIBILITY(2.25) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LowestTimeUnitInfo = { "LowestTimeUnit", "Lowest Time Unit when Simplifying", "If 'SimplifyTime' is enabled, this is the lowest time unit that will be shown. " - "All finer grained timesteps will be ignored." + "All finer grained timesteps will be ignored.", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(DashboardItemElapsedTime)]] Parameters { diff --git a/modules/base/dashboard/dashboarditemframerate.cpp b/modules/base/dashboard/dashboarditemframerate.cpp index 6380dbfa9b..1ef866c87b 100644 --- a/modules/base/dashboard/dashboarditemframerate.cpp +++ b/modules/base/dashboard/dashboarditemframerate.cpp @@ -48,14 +48,17 @@ namespace { constexpr openspace::properties::Property::PropertyInfo FrametimeInfo = { "FrametimeType", "Type of the frame time display", - "This value determines the units in which the frame time is displayed" + "This value determines the units in which the frame time is displayed", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ClearCacheInfo = { "ClearCache", "Clear Cache", "Clears the cache of this DashboardItemFramerate item. If the selected option " - "does not use any caching, this trigger does not do anything" + "does not use any caching, this trigger does not do anything", + openspace::properties::Property::Visibility::AdvancedUser }; [[ nodiscard ]] char* formatDt(std::vector& buffer) { diff --git a/modules/base/dashboard/dashboarditeminputstate.cpp b/modules/base/dashboard/dashboarditeminputstate.cpp index d3b0210e17..ea0758154e 100644 --- a/modules/base/dashboard/dashboarditeminputstate.cpp +++ b/modules/base/dashboard/dashboarditeminputstate.cpp @@ -37,31 +37,41 @@ namespace { constexpr openspace::properties::Property::PropertyInfo ShowWhenEnabledInfo = { "ShowWhenEnabled", "Show when enabled", - "Show text when the input is enabled" + "Show text when the input is enabled", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ShowWhenDisabledInfo = { "ShowWhenDisabled", "Show when disabled", - "Show text when the input is disabled" + "Show text when the input is disabled", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ShowKeyboardInfo = { "ShowKeyboard", "Show Keyboard information", - "Display the state of the keyboard input" + "Display the state of the keyboard input", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ShowMouseInfo = { "ShowMouse", "Show Mouse information", - "Display the state of the mouse input" + "Display the state of the mouse input", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ShowJoystickInfo = { "ShowJoystick", "Show Joystick information", - "Display the state of the joystick input" + "Display the state of the joystick input", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(DashboardItemPropertyValue)]] Parameters { diff --git a/modules/base/dashboard/dashboarditempropertyvalue.cpp b/modules/base/dashboard/dashboarditempropertyvalue.cpp index cd8706bf63..2d24893547 100644 --- a/modules/base/dashboard/dashboarditempropertyvalue.cpp +++ b/modules/base/dashboard/dashboarditempropertyvalue.cpp @@ -38,7 +38,9 @@ namespace { constexpr openspace::properties::Property::PropertyInfo PropertyUriInfo = { "URI", "Property URI", - "The URI of the property that is displayed in this dashboarditem" + "The URI of the property that is displayed in this dashboarditem", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo DisplayStringInfo = { @@ -46,7 +48,9 @@ namespace { "Display String", "The String that is being displayed. It must either be empty (in which case only " "the value itself will be displayed), or it must contain extact one instance of " - "{}, which will be replaced with the value of the property during rendering" + "{}, which will be replaced with the value of the property during rendering", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(DashboardItemPropertyValue)]] Parameters { diff --git a/modules/base/dashboard/dashboarditemsimulationincrement.cpp b/modules/base/dashboard/dashboarditemsimulationincrement.cpp index 69f38c65c8..6e007cd93d 100644 --- a/modules/base/dashboard/dashboarditemsimulationincrement.cpp +++ b/modules/base/dashboard/dashboarditemsimulationincrement.cpp @@ -41,14 +41,18 @@ namespace { "Time Simplification", "If this value is enabled, the time is displayed in nuanced units, such as " "minutes, hours, days, years, etc. If this value is disabled, it is always " - "displayed in seconds" + "displayed in seconds", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo RequestedUnitInfo = { "RequestedUnit", "Requested Unit", "If the simplification is disabled, this time unit is used as a destination to " - "convert the seconds into" + "convert the seconds into", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo TransitionFormatInfo = { @@ -59,7 +63,8 @@ namespace { "delta time. This format gets five parameters in this order: The target delta " "time value, the target delta time unit, the string 'Paused' if the delta time " "is paused or the empty string otherwise, the current delta time value, and the " - "current delta time unit" + "current delta time unit", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RegularFormatInfo = { @@ -68,7 +73,8 @@ namespace { "The format string used to format the text if the target delta time is the same " "as the current delta time. This format gets three parameters in this order: " "The target delta value, the target delta unit, and the string 'Paused' if the " - "delta time is paused or the empty string otherwise" + "delta time is paused or the empty string otherwise", + openspace::properties::Property::Visibility::AdvancedUser }; std::vector unitList() { diff --git a/modules/base/dashboard/dashboarditemspacing.cpp b/modules/base/dashboard/dashboarditemspacing.cpp index 75f9a4a346..806fb95c71 100644 --- a/modules/base/dashboard/dashboarditemspacing.cpp +++ b/modules/base/dashboard/dashboarditemspacing.cpp @@ -33,7 +33,9 @@ namespace { "Spacing", "Spacing", "This value determines the spacing (in pixels) that this item represents. The " - "default value is 15" + "default value is 15", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(DashboardItemSpacing)]] Parameters { diff --git a/modules/base/dashboard/dashboarditemtext.cpp b/modules/base/dashboard/dashboarditemtext.cpp index 7dea51bd91..6b7b3cbead 100644 --- a/modules/base/dashboard/dashboarditemtext.cpp +++ b/modules/base/dashboard/dashboarditemtext.cpp @@ -37,7 +37,8 @@ namespace { constexpr openspace::properties::Property::PropertyInfo TextInfo = { "Text", "Text", - "The text to be displayed" + "The text to be displayed", + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(DashboardItemText)]] Parameters { diff --git a/modules/base/dashboard/dashboarditemvelocity.cpp b/modules/base/dashboard/dashboarditemvelocity.cpp index 599e67b837..b1911c1e7b 100644 --- a/modules/base/dashboard/dashboarditemvelocity.cpp +++ b/modules/base/dashboard/dashboarditemvelocity.cpp @@ -45,14 +45,16 @@ namespace { "Simplification", "If this value is enabled, the velocity is displayed in nuanced units, such as " "m/s, AU/s, light years / s etc. If this value is disabled, the unit can be " - "explicitly requested" + "explicitly requested", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo RequestedUnitInfo = { "RequestedUnit", "Requested Unit", "If the simplification is disabled, this distance unit is used for the velocity " - "display" + "display", + openspace::properties::Property::Visibility::User }; std::vector unitList() { diff --git a/modules/base/lightsource/cameralightsource.cpp b/modules/base/lightsource/cameralightsource.cpp index 65e2a59531..f20751a951 100644 --- a/modules/base/lightsource/cameralightsource.cpp +++ b/modules/base/lightsource/cameralightsource.cpp @@ -33,7 +33,9 @@ namespace { constexpr openspace::properties::Property::PropertyInfo IntensityInfo = { "Intensity", "Intensity", - "The intensity of this light source" + "The intensity of this light source", + // @VISIBILITY(1.75) + openspace::properties::Property::Visibility::NoviceUser }; struct [[codegen::Dictionary(CameraLightSource)]] Parameters { diff --git a/modules/base/lightsource/scenegraphlightsource.cpp b/modules/base/lightsource/scenegraphlightsource.cpp index 1844919d23..29bdb62cda 100644 --- a/modules/base/lightsource/scenegraphlightsource.cpp +++ b/modules/base/lightsource/scenegraphlightsource.cpp @@ -37,13 +37,16 @@ namespace { constexpr openspace::properties::Property::PropertyInfo IntensityInfo = { "Intensity", "Intensity", - "The intensity of this light source" + "The intensity of this light source", + // @VISIBILITY(1.75) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo NodeInfo = { "Node", "Node", - "The identifier of the scene graph node to follow" + "The identifier of the scene graph node to follow", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(SceneGraphLightSource)]] Parameters { diff --git a/modules/base/rendering/grids/renderableboxgrid.cpp b/modules/base/rendering/grids/renderableboxgrid.cpp index 4bb4b6e182..2a54b6d064 100644 --- a/modules/base/rendering/grids/renderableboxgrid.cpp +++ b/modules/base/rendering/grids/renderableboxgrid.cpp @@ -39,19 +39,23 @@ namespace { constexpr openspace::properties::Property::PropertyInfo ColorInfo = { "Color", "Color", - "This value determines the color of the grid lines that are rendered" + "This value determines the color of the grid lines that are rendered", + // @VISIBILITY(1.17) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = { "LineWidth", "Line Width", - "This value specifies the line width of the spherical grid" + "This value specifies the line width of the spherical grid", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo SizeInfo = { "Size", "Grid Size", - "This value species the size of each dimensions of the box" + "This value species the size of each dimensions of the box", + openspace::properties::Property::Visibility::AdvancedUser }; static const openspace::properties::PropertyOwner::PropertyOwnerInfo LabelsInfo = { diff --git a/modules/base/rendering/grids/renderablegrid.cpp b/modules/base/rendering/grids/renderablegrid.cpp index 018436726b..a855a2b441 100644 --- a/modules/base/rendering/grids/renderablegrid.cpp +++ b/modules/base/rendering/grids/renderablegrid.cpp @@ -39,20 +39,26 @@ namespace { constexpr openspace::properties::Property::PropertyInfo ColorInfo = { "Color", "Color", - "This value determines the color of the grid lines that are rendered" + "This value determines the color of the grid lines that are rendered", + // @VISIBILITY(1.25) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo HighlightColorInfo = { "HighlightColor", "Highlight Color", - "This value determines the color of the highlighted lines in the grid" + "This value determines the color of the highlighted lines in the grid", + // @VISIBILITY(1.25) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo SegmentsInfo = { "Segments", "Number of Segments", "This value specifies the number of segments that are used to render the " - "grid in each direction" + "grid in each direction", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo HighlightRateInfo = { @@ -60,25 +66,30 @@ namespace { "Highlight Rate", "The rate that the columns and rows are highlighted, counted with respect to the " "center of the grid. If the number of segments in the grid is odd, the " - "highlighting might be offset from the center." + "highlighting might be offset from the center.", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = { "LineWidth", "Line Width", - "This value specifies the line width of the grid" + "This value specifies the line width of the grid", + // @VISIBILITY(1.5) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo HighlightLineWidthInfo = { "HighlightLineWidth", "Highlight Line Width", - "This value specifies the line width of the highlighted lines in the grid" + "This value specifies the line width of the highlighted lines in the grid", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo SizeInfo = { "Size", "Grid Size", - "This value species the size of each dimensions of the grid" + "This value species the size of each dimensions of the grid", + openspace::properties::Property::Visibility::User }; static const openspace::properties::PropertyOwner::PropertyOwnerInfo LabelsInfo = { diff --git a/modules/base/rendering/grids/renderableradialgrid.cpp b/modules/base/rendering/grids/renderableradialgrid.cpp index ccd3a83f74..fa1f2c4d5e 100644 --- a/modules/base/rendering/grids/renderableradialgrid.cpp +++ b/modules/base/rendering/grids/renderableradialgrid.cpp @@ -40,27 +40,34 @@ namespace { constexpr openspace::properties::Property::PropertyInfo ColorInfo = { "Color", "Color", - "This value determines the color of the grid lines that are rendered" + "This value determines the color of the grid lines that are rendered", + // @VISIBILITY(1.25) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo GridSegmentsInfo = { "GridSegments", "Number of Grid Segments", "Specifies the number of segments for the grid, in the radial and angular " - "direction respectively" + "direction respectively", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo CircleSegmentsInfo = { "CircleSegments", "Number of Circle Segments", "This value specifies the number of segments that is used to render each circle " - "in the grid" + "in the grid", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = { "LineWidth", "Line Width", - "This value specifies the line width of the spherical grid" + "This value specifies the line width of the spherical grid", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo RadiiInfo = { @@ -68,7 +75,9 @@ namespace { "Inner and Outer Radius", "The radii values that determine the size of the circular grid. The first value " "is the radius of the inmost ring and the second is the radius of the outmost " - "ring" + "ring", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; static const openspace::properties::PropertyOwner::PropertyOwnerInfo LabelsInfo = { diff --git a/modules/base/rendering/grids/renderablesphericalgrid.cpp b/modules/base/rendering/grids/renderablesphericalgrid.cpp index 4c520cad00..bc261d6078 100644 --- a/modules/base/rendering/grids/renderablesphericalgrid.cpp +++ b/modules/base/rendering/grids/renderablesphericalgrid.cpp @@ -39,20 +39,26 @@ namespace { constexpr openspace::properties::Property::PropertyInfo ColorInfo = { "Color", "Color", - "This value determines the color of the grid lines that are rendered" + "This value determines the color of the grid lines that are rendered", + // @VISIBILITY(1.25) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo SegmentsInfo = { "Segments", "Number of Segments", "This value specifies the number of segments that are used to render the " - "surrounding sphere" + "surrounding sphere", + // @VISIBILITY(2.25) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = { "LineWidth", "Line Width", - "This value specifies the line width of the spherical grid" + "This value specifies the line width of the spherical grid", + // @VISIBILITY(1.67) + openspace::properties::Property::Visibility::NoviceUser }; static const openspace::properties::PropertyOwner::PropertyOwnerInfo LabelsInfo = { diff --git a/modules/base/rendering/renderablecartesianaxes.cpp b/modules/base/rendering/renderablecartesianaxes.cpp index 9d0b53e7d6..e93e18d107 100644 --- a/modules/base/rendering/renderablecartesianaxes.cpp +++ b/modules/base/rendering/renderablecartesianaxes.cpp @@ -40,19 +40,25 @@ namespace { constexpr openspace::properties::Property::PropertyInfo XColorInfo = { "XColor", "X Color", - "This value determines the color of the x axis" + "This value determines the color of the x axis", + // @VISIBILITY(1.5) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo YColorInfo = { "YColor", "Y Color", - "This value determines the color of the y axis" + "This value determines the color of the y axis", + // @VISIBILITY(1.5) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo ZColorInfo = { "ZColor", "Z Color", - "This value determines the color of the z axis" + "This value determines the color of the z axis", + // @VISIBILITY(1.5) + openspace::properties::Property::Visibility::NoviceUser }; struct [[codegen::Dictionary(RenderableCartesianAxes)]] Parameters { diff --git a/modules/base/rendering/renderabledisc.cpp b/modules/base/rendering/renderabledisc.cpp index 3e40f356c1..f09ae1dbfd 100644 --- a/modules/base/rendering/renderabledisc.cpp +++ b/modules/base/rendering/renderabledisc.cpp @@ -47,13 +47,17 @@ namespace { "Texture", "Texture", "This value is the path to a texture on disk that contains a one-dimensional " - "texture to be used for the color" + "texture to be used for the color", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo SizeInfo = { "Size", "Size", - "This value specifies the outer radius of the disc in meter" + "This value specifies the outer radius of the disc in meter", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo WidthInfo = { @@ -61,7 +65,8 @@ namespace { "Width", "This value is used to set the width of the disc. The actual width is set " "based on the given size and this value should be set between 0 and 1. A value " - "of 1 results in a full circle and 0.5 a disc with an inner radius of 0.5*size" + "of 1 results in a full circle and 0.5 a disc with an inner radius of 0.5*size", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderableDisc)]] Parameters { diff --git a/modules/base/rendering/renderablelabel.cpp b/modules/base/rendering/renderablelabel.cpp index b0d8cfd437..f11f5bd89f 100644 --- a/modules/base/rendering/renderablelabel.cpp +++ b/modules/base/rendering/renderablelabel.cpp @@ -92,55 +92,71 @@ namespace { constexpr openspace::properties::Property::PropertyInfo BlendModeInfo = { "BlendMode", "Blending Mode", - "This determines the blending mode that is applied to the renderable" + "This determines the blending mode that is applied to the renderable", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ColorInfo = { "Color", "Color", - "The label text color" + "The label text color", + // @VISIBILITY(1.33) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo FontSizeInfo = { "FontSize", "Font Size", - "The font size (in points) for the label" + "The font size (in points) for the label", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo SizeInfo = { "Size", "Size", - "This value affects the size scale of the label" + "This value affects the size scale of the label", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo TextInfo = { "Text", "Text", - "The text that will be displayed on screen" + "The text that will be displayed on screen", + // @VISIBILITY(1.8) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo MinMaxSizeInfo = { "MinMaxSize", "Min and Max Size", - "The minimum and maximum size (in pixels) of the label" + "The minimum and maximum size (in pixels) of the label", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TransformationMatrixInfo = { "TransformationMatrix", "Transformation Matrix", - "Transformation matrix to be applied to the label" + "Transformation matrix to be applied to the label", + // @VISIBILITY(3.6) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo OrientationOptionInfo = { "OrientationOption", "Orientation Option", - "Label orientation rendering mode" + "Label orientation rendering mode", + // @VISIBILITY(2.8) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo EnableFadingEffectInfo = { "EnableFading", "Enable/Disable Fade-in Effect", - "Enable/Disable the Fade-in effect" + "Enable/Disable the Fade-in effect", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo FadeWidthsInfo = { @@ -150,20 +166,23 @@ namespace { "The first value is the distance before the closest distance and the second " "the one after the furthest distance. For example, with the unit Parsec (pc), " "a value of {1, 2} will make the label being fully faded out 1 Parsec before " - "the closest distance and 2 Parsec away from the furthest distance" + "the closest distance and 2 Parsec away from the furthest distance", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FadeDistancesInfo = { "FadeDistances", "Fade Distances", "The distance range in which the labels should be fully opaque, specified in " - "the chosen unit. The distance from the position of the label to the camera" + "the chosen unit. The distance from the position of the label to the camera", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FadeUnitOptionInfo = { "FadeUnit", "Fade Distance Unit", - "Distance unit for fade-in/-out distance calculations. Defaults to \"au\"" + "Distance unit for fade-in/-out distance calculations. Defaults to \"au\"", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderableLabel)]] Parameters { diff --git a/modules/base/rendering/renderablemodel.cpp b/modules/base/rendering/renderablemodel.cpp index c90f7ffbaf..707089cf9d 100644 --- a/modules/base/rendering/renderablemodel.cpp +++ b/modules/base/rendering/renderablemodel.cpp @@ -88,70 +88,85 @@ namespace { constexpr openspace::properties::Property::PropertyInfo EnableAnimationInfo = { "EnableAnimation", "Enable Animation", - "Enable or disable the animation for the model if it has any" + "Enable or disable the animation for the model if it has any", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo AmbientIntensityInfo = { "AmbientIntensity", "Ambient Intensity", - "A multiplier for ambient lighting" + "A multiplier for ambient lighting", + // @VISIBILITY(2.4) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo DiffuseIntensityInfo = { "DiffuseIntensity", "Diffuse Intensity", - "A multiplier for diffuse lighting" + "A multiplier for diffuse lighting", + // @VISIBILITY(2.4) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo SpecularIntensityInfo = { "SpecularIntensity", "Specular Intensity", - "A multiplier for specular lighting" + "A multiplier for specular lighting", + // @VISIBILITY(2.4) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ShadingInfo = { "PerformShading", "Perform Shading", "This value determines whether this model should be shaded by using the position " - "of the Sun" + "of the Sun", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo EnableFaceCullingInfo = { "EnableFaceCulling", "Enable Face Culling", - "Enable OpenGL automatic face culling optimization" + "Enable OpenGL automatic face culling optimization", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ModelTransformInfo = { "ModelTransform", "Model Transform", "This value specifies the model transform that is applied to the model before " - "all other transformations are applied" + "all other transformations are applied", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo RotationVecInfo = { "RotationVector", "Rotation Vector", - "Rotation Vector using degrees" + "Rotation Vector using degrees", + // @VISIBILITY(3.75) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo LightSourcesInfo = { "LightSources", "Light Sources", - "A list of light sources that this model should accept light from" + "A list of light sources that this model should accept light from", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo EnableDepthTestInfo = { "EnableDepthTest", "Enable Depth Test", - "Enable Depth Testing for the Model" + "Enable Depth Testing for the Model", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo BlendingOptionInfo = { "BlendingOption", "Blending Options", "Changes the blending function used to calculate the colors of the model with " - "respect to the opacity" + "respect to the opacity", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderableModel)]] Parameters { diff --git a/modules/base/rendering/renderablenodeline.cpp b/modules/base/rendering/renderablenodeline.cpp index 5d6944bfdb..6f61e2b3cc 100644 --- a/modules/base/rendering/renderablenodeline.cpp +++ b/modules/base/rendering/renderablenodeline.cpp @@ -45,26 +45,31 @@ namespace { "StartNode", "Start Node", "The identifier of the node the line starts from. Defaults to 'Root' if not " - "specified." + "specified.", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo EndNodeInfo = { "EndNode", "End Node", "The identifier of the node the line ends at. Defaults to 'Root' if not " - "specified." + "specified.", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LineColorInfo = { "Color", "Color", - "This value determines the RGB color for the line" + "This value determines the RGB color for the line", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = { "LineWidth", "Line Width", - "This value specifies the line width" + "This value specifies the line width", + // @VISIBILITY(1.75) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo StartOffsetInfo = { diff --git a/modules/base/rendering/renderableplane.cpp b/modules/base/rendering/renderableplane.cpp index ab0d2dc5d1..67c8d1326c 100644 --- a/modules/base/rendering/renderableplane.cpp +++ b/modules/base/rendering/renderableplane.cpp @@ -54,7 +54,8 @@ namespace { "Billboard mode", "This value specifies whether the plane is a billboard, which means that it is " "always facing the camera. If this is false, it can be oriented using other " - "transformations" + "transformations", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MirrorBacksideInfo = { @@ -62,13 +63,16 @@ namespace { "Mirror backside of image plane", "If this value is set to false, the image plane will not be mirrored when " "looking from the backside. This is usually desirable when the image shows " - "data at a specific location, but not if it is displaying text for example" + "data at a specific location, but not if it is displaying text for example", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo SizeInfo = { "Size", "Size (in meters)", - "This value specifies the size of the plane in meters" + "This value specifies the size of the plane in meters", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AutoScaleInfo = { @@ -81,14 +85,16 @@ namespace { constexpr openspace::properties::Property::PropertyInfo BlendModeInfo = { "BlendMode", "Blending Mode", - "This determines the blending mode that is applied to this plane" + "This determines the blending mode that is applied to this plane", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MultiplyColorInfo = { "MultiplyColor", "Multiply Color", "If set, the plane's texture is multiplied with this color. Useful for applying " - "a color grayscale images" + "a color grayscale images", + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(RenderablePlane)]] Parameters { diff --git a/modules/base/rendering/renderableplaneimagelocal.cpp b/modules/base/rendering/renderableplaneimagelocal.cpp index 401aa60c0f..8280dfcee0 100644 --- a/modules/base/rendering/renderableplaneimagelocal.cpp +++ b/modules/base/rendering/renderableplaneimagelocal.cpp @@ -42,7 +42,9 @@ namespace { "Texture", "Texture", "This value specifies an image that is loaded from disk and is used as a texture " - "that is applied to this plane. This image has to be square" + "that is applied to this plane. This image has to be square", + // @VISIBILITY(2.25) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(RenderablePlaneImageLocal)]] Parameters { diff --git a/modules/base/rendering/renderableplaneimageonline.cpp b/modules/base/rendering/renderableplaneimageonline.cpp index bd127bef94..65c9f4ffb1 100644 --- a/modules/base/rendering/renderableplaneimageonline.cpp +++ b/modules/base/rendering/renderableplaneimageonline.cpp @@ -39,7 +39,9 @@ namespace { "Image URL", "Sets the URL of the texture that is displayed on this screen space plane. If " "this value is changed, the image at the new path will automatically be loaded " - "and displayed" + "and displayed", + // @VISIBILITY(2.25) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(RenderablePlaneImageOnline)]] Parameters { diff --git a/modules/base/rendering/renderableplanetimevaryingimage.cpp b/modules/base/rendering/renderableplanetimevaryingimage.cpp index c63add8148..27c93f371a 100644 --- a/modules/base/rendering/renderableplanetimevaryingimage.cpp +++ b/modules/base/rendering/renderableplanetimevaryingimage.cpp @@ -45,14 +45,17 @@ namespace { "SourceFolder", "Source Folder", "This value specifies the image directory that is loaded from disk and " - "is used as a texture that is applied to this plane" + "is used as a texture that is applied to this plane", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RenderTypeInfo = { "RenderType", "Render Type", "This value specifies if the plane should be rendered in the Background, " - "Opaque, Transparent, or Overlay rendering step" + "Opaque, Transparent, or Overlay rendering step", + // @VISIBILITY(3.67) + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderablePlaneTimeVaryingImage)]] Parameters { diff --git a/modules/base/rendering/renderableprism.cpp b/modules/base/rendering/renderableprism.cpp index a6d357de10..308391b9c3 100644 --- a/modules/base/rendering/renderableprism.cpp +++ b/modules/base/rendering/renderableprism.cpp @@ -43,45 +43,59 @@ namespace { constexpr openspace::properties::Property::PropertyInfo SegmentsInfo = { "Segments", "Segments", - "The number of segments the shape of the prism should have" + "The number of segments the shape of the prism should have", + // @VISIBILITY(2.8) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LinesInfo = { "NumLines", "Number of Lines", "The number of lines connecting the two shapes of the prism. They will be evenly " - "distributed around the bounding circle that makes up the shape of the prism" + "distributed around the bounding circle that makes up the shape of the prism", + // @VISIBILITY(2.8) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo RadiusInfo = { "Radius", "Radius", - "The radius of the prism's shape in meters" + "The radius of the prism's shape in meters", + // @VISIBILITY(2.8) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo BaseRadiusInfo = { "BaseRadius", "Base Radius", "The radius of the base of the prism's shape, in meters. By default it is given " - "the same radius as the outer shape" + "the same radius as the outer shape", + // @VISIBILITY(2.8) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = { "LineWidth", "Line Width", - "This value specifies the line width" + "This value specifies the line width", + // @VISIBILITY(2.0) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LineColorInfo = { "Color", "Color", - "This value determines the RGB color for the line" + "This value determines the RGB color for the line", + // @VISIBILITY(1.2) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo LengthInfo = { "Length", "Length", - "The length of the prism in meters" + "The length of the prism in meters", + // @VISIBILITY(2.8) + openspace::properties::Property::Visibility::User }; // Generate vertices around the unit circle on the XY-plane diff --git a/modules/base/rendering/renderablesphere.cpp b/modules/base/rendering/renderablesphere.cpp index 743c436bcd..90896dd370 100644 --- a/modules/base/rendering/renderablesphere.cpp +++ b/modules/base/rendering/renderablesphere.cpp @@ -57,32 +57,39 @@ namespace { "Texture", "This value specifies an image that is loaded from disk and is used as a texture " "that is applied to this sphere. This image is expected to be an equirectangular " - "projection" + "projection", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo MirrorTextureInfo = { "MirrorTexture", "Mirror Texture", - "Mirror the texture along the x-axis" + "Mirror the texture along the x-axis", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo OrientationInfo = { "Orientation", "Orientation", "Specifies whether the texture is applied to the inside of the sphere, the " - "outside of the sphere, or both" + "outside of the sphere, or both", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SegmentsInfo = { "Segments", "Number of Segments", - "This value specifies the number of segments that the sphere is separated in" + "This value specifies the number of segments that the sphere is separated in", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo SizeInfo = { "Size", "Size (in meters)", - "This value specifies the radius of the sphere in meters" + "This value specifies the radius of the sphere in meters", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FadeOutThresholdInfo = { @@ -90,7 +97,8 @@ namespace { "Fade-Out Threshold", "This value determines percentage of the sphere that is visible before starting " "to fade it out. A negative or zero value means no fading out will happen. This " - "is also the default" + "is also the default", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FadeInThresholdInfo = { @@ -99,13 +107,15 @@ namespace { "This value determines the distance from center of MilkyWay from where the " "astronomical object starts to fade in, given as a percentage of the size of " "the object. A negative or zero value means no fading in will happen. This is " - "also the default" + "also the default", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DisableFadeInOutInfo = { "DisableFadeInOut", "Disable Fade-In/Fade-Out effects", - "Enables/Disables the fade in and out effects" + "Enables/Disables the fade in and out effects", + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(RenderableSphere)]] Parameters { diff --git a/modules/base/rendering/renderabletimevaryingsphere.cpp b/modules/base/rendering/renderabletimevaryingsphere.cpp index fdb33a8e7a..634db73cc8 100644 --- a/modules/base/rendering/renderabletimevaryingsphere.cpp +++ b/modules/base/rendering/renderabletimevaryingsphere.cpp @@ -59,52 +59,62 @@ namespace { "Texture Source", "This value specifies a directory of images that are loaded from disk and is " "used as a texture that is applied to this sphere. The images are expected to " - "be an equirectangular projection" + "be an equirectangular projection", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MirrorTextureInfo = { "MirrorTexture", "Mirror Texture", - "Mirror the texture along the x-axis" + "Mirror the texture along the x-axis", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo OrientationInfo = { "Orientation", "Orientation", "Specifies whether the texture is applied to the inside of the sphere, the " - "outside of the sphere, or both" + "outside of the sphere, or both", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SegmentsInfo = { "Segments", "Number of Segments", - "This value specifies the number of segments that the sphere is separated in" + "This value specifies the number of segments that the sphere is separated in", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo SizeInfo = { "Size", "Size (in meters)", - "This value specifies the radius of the sphere in meters" + "This value specifies the radius of the sphere in meters", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FadeOutThresholdInfo = { "FadeOutThreshold", "Fade-Out Threshold", "This value determines percentage of the sphere is visible before starting " - "fading-out it" + "fading-out it", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FadeInThresholdInfo = { "FadeInThreshold", "Fade-In Threshold", "Distance from center of MilkyWay from where the astronomical object starts to " - "fade in" + "fade in", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DisableFadeInOutInfo = { "DisableFadeInOut", "Disable Fade-In/Fade-Out effects", - "Enables/Disables the Fade-In/Out effects" + "Enables/Disables the Fade-In/Out effects", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(RenderableTimeVaryingSphere)]] Parameters { diff --git a/modules/base/rendering/renderabletrail.cpp b/modules/base/rendering/renderabletrail.cpp index 66c391b146..873b8d17c6 100644 --- a/modules/base/rendering/renderabletrail.cpp +++ b/modules/base/rendering/renderabletrail.cpp @@ -71,7 +71,9 @@ namespace { constexpr openspace::properties::Property::PropertyInfo LineColorInfo = { "Color", "Color", - "This value determines the RGB main color for the lines and points of the trail" + "This value determines the RGB main color for the lines and points of the trail", + // @VISIBILITY(1.2) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo EnableFadeInfo = { @@ -79,7 +81,9 @@ namespace { "Enable line fading of old points", "Toggles whether the trail should fade older points out. If this value is " "'true', the 'Fade' parameter determines the speed of fading. If this value is " - "'false', the entire trail is rendered at full opacity and color" + "'false', the entire trail is rendered at full opacity and color", + // @VISIBILITY(1.25) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo FadeInfo = { @@ -87,7 +91,9 @@ namespace { "Line fade", "The fading factor that is applied to the trail if the 'EnableFade' value is " "'true'. If it is 'false', this setting has no effect. The higher the number, " - "the less fading is applied" + "the less fading is applied", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = { @@ -95,7 +101,9 @@ namespace { "Line Width", "This value specifies the line width of the trail if the selected rendering " "method includes lines. If the rendering mode is set to Points, this value is " - "ignored" + "ignored", + // @VISIBILITY(2.4) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo PointSizeInfo = { @@ -104,7 +112,9 @@ namespace { "This value specifies the base size of the points along the line if the selected " "rendering method includes points. If the rendering mode is set the Lines, this " "value is ignored. If a subsampling of the values is performed, the subsampled " - "values are half this size" + "values are half this size", + // @VISIBILITY(2.4) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo RenderingModeInfo = { @@ -112,7 +122,8 @@ namespace { "Rendering Mode", "Determines how the trail should be rendered to the screen. If 'Lines' is " "selected, only the line part is visible, if 'Points' is selected, only the " - "corresponding points (and subpoints) are shown. 'Lines+Points' shows both parts" + "corresponding points (and subpoints) are shown. 'Lines+Points' shows both parts", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderableTrail)]] Parameters { diff --git a/modules/base/rendering/renderabletrailorbit.cpp b/modules/base/rendering/renderabletrailorbit.cpp index 4444122868..722859556d 100644 --- a/modules/base/rendering/renderabletrailorbit.cpp +++ b/modules/base/rendering/renderabletrailorbit.cpp @@ -93,7 +93,8 @@ namespace { "The objects period, i.e. the length of its orbit around the parent object given " "in (Earth) days. In the case of Earth, this would be a sidereal year " "(=365.242 days). If this values is specified as multiples of the period, it is " - "possible to show the effects of precession" + "possible to show the effects of precession", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ResolutionInfo = { @@ -102,14 +103,17 @@ namespace { "The number of samples along the orbit. This determines the resolution of the " "trail; the tradeoff being that a higher resolution is able to resolve more " "detail, but will take more resources while rendering, too. The higher, the " - "smoother the trail, but also more memory will be used" + "smoother the trail, but also more memory will be used", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RenderableTypeInfo = { "RenderableType", "RenderableType", "This value specifies if the orbit should be rendered in the Background," - "Opaque, Transparent, or Overlay rendering step. Default is Transparent" + "Opaque, Transparent, or Overlay rendering step. Default is Transparent", + // @VISIBILITY(3.25) + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderableTrailOrbit)]] Parameters { diff --git a/modules/base/rendering/renderabletrailtrajectory.cpp b/modules/base/rendering/renderabletrailtrajectory.cpp index d6141007b9..f67cb04f2d 100644 --- a/modules/base/rendering/renderabletrailtrajectory.cpp +++ b/modules/base/rendering/renderabletrailtrajectory.cpp @@ -48,14 +48,16 @@ namespace { "StartTime", "Start Time", "The start time for the range of this trajectory. The date must be in ISO 8601 " - "format: YYYY MM DD HH:mm:ss.xxx" + "format: YYYY MM DD HH:mm:ss.xxx", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo EndTimeInfo = { "EndTime", "End Time", "The end time for the range of this trajectory. The date must be in ISO 8601 " - "format: YYYY MM DD HH:mm:ss.xxx" + "format: YYYY MM DD HH:mm:ss.xxx", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SampleIntervalInfo = { @@ -64,7 +66,8 @@ namespace { "The interval between samples of the trajectory. This value (together with " "'TimeStampSubsampleFactor') determines how far apart (in time) the samples are " "spaced along the trajectory. The time interval between 'StartTime' and " - "'EndTime' is split into 'SampleInterval' * 'TimeStampSubsampleFactor' segments" + "'EndTime' is split into 'SampleInterval' * 'TimeStampSubsampleFactor' segments", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TimeSubSampleInfo = { @@ -73,14 +76,17 @@ namespace { "The factor that is used to create subsamples along the trajectory. This value " "(together with 'SampleInterval') determines how far apart (in time) the samples " "are spaced along the trajectory. The time interval between 'StartTime' and " - "'EndTime' is split into 'SampleInterval' * 'TimeStampSubsampleFactor' segments" + "'EndTime' is split into 'SampleInterval' * 'TimeStampSubsampleFactor' segments", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RenderFullPathInfo = { "ShowFullTrail", "Render Full Trail", "If this value is set to 'true', the entire trail will be rendered; if it is " - "'false', only the trail until the current time in the application will be shown" + "'false', only the trail until the current time in the application will be shown", + // @VISIBILITY(1.25) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo SweepChunkSizeInfo = { @@ -88,7 +94,9 @@ namespace { "Sweep Chunk Size", "The number of vertices that will be calculated each frame whenever the trail " "needs to be recalculated. " - "A greater value will result in more calculations per frame." + "A greater value will result in more calculations per frame.", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderableTrailTrajectory)]] Parameters { diff --git a/modules/base/rendering/screenspacedashboard.cpp b/modules/base/rendering/screenspacedashboard.cpp index 35a5bdc657..8bbc2f2f9b 100644 --- a/modules/base/rendering/screenspacedashboard.cpp +++ b/modules/base/rendering/screenspacedashboard.cpp @@ -41,7 +41,8 @@ namespace { "UseMainDashboard", "Use main dashboard", "If this value is set to 'true', this ScreenSpaceDashboard will use the " - "main dashboard instead of creating an independent one" + "main dashboard instead of creating an independent one", + openspace::properties::Property::Visibility::Developer }; struct [[codegen::Dictionary(ScreenSpaceDashboard)]] Parameters { diff --git a/modules/base/rendering/screenspaceframebuffer.cpp b/modules/base/rendering/screenspaceframebuffer.cpp index 42da3e2383..b6cf74bf62 100644 --- a/modules/base/rendering/screenspaceframebuffer.cpp +++ b/modules/base/rendering/screenspaceframebuffer.cpp @@ -36,7 +36,9 @@ namespace { constexpr openspace::properties::Property::PropertyInfo SizeInfo = { "Size", "Size", - "This value explicitly specifies the size of the screen space plane" + "This value explicitly specifies the size of the screen space plane", + // @VISIBILITY(3.75) + openspace::properties::Property::Visibility::AdvancedUser }; } // namespace diff --git a/modules/base/rendering/screenspaceimagelocal.cpp b/modules/base/rendering/screenspaceimagelocal.cpp index 7b302a9068..d84cf9b011 100644 --- a/modules/base/rendering/screenspaceimagelocal.cpp +++ b/modules/base/rendering/screenspaceimagelocal.cpp @@ -42,7 +42,9 @@ namespace { "Sets the path of the texture that is displayed on this screen space plane. If " "this value is changed, the image at the new path will automatically be loaded " "and displayed. The size of the image will also automatically set the default " - "size of this plane" + "size of this plane", + // @VISIBILITY(2.4) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(ScreenSpaceImageLocal)]] Parameters { diff --git a/modules/base/rendering/screenspaceimageonline.cpp b/modules/base/rendering/screenspaceimageonline.cpp index c5cb15a5e1..71160a3eb2 100644 --- a/modules/base/rendering/screenspaceimageonline.cpp +++ b/modules/base/rendering/screenspaceimageonline.cpp @@ -42,7 +42,9 @@ namespace { "Sets the URL of the texture that is displayed on this screen space plane. If " "this value is changed, the image at the new path will automatically be loaded " "and displayed. The size of the image will also automatically set the default " - "size of this plane" + "size of this plane", + // @VISIBILITY(2.4) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(ScreenSpaceImageOnline)]] Parameters { diff --git a/modules/base/rotation/constantrotation.cpp b/modules/base/rotation/constantrotation.cpp index 2b5481057d..71949103e2 100644 --- a/modules/base/rotation/constantrotation.cpp +++ b/modules/base/rotation/constantrotation.cpp @@ -34,13 +34,17 @@ namespace { constexpr openspace::properties::Property::PropertyInfo RotationInfo = { "RotationAxis", "Rotation Axis", - "This value is the rotation axis around which the object will rotate" + "This value is the rotation axis around which the object will rotate", + // @VISIBILITY(3.33) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RotationRateInfo = { "RotationRate", "Rotation Rate", - "This value determines the number of revolutions per in-game second" + "This value determines the number of revolutions per in-game second", + // @VISIBILITY(3.33) + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(ConstantRotation)]] Parameters { diff --git a/modules/base/rotation/fixedrotation.cpp b/modules/base/rotation/fixedrotation.cpp index b480b5c60e..ab69accaf7 100644 --- a/modules/base/rotation/fixedrotation.cpp +++ b/modules/base/rotation/fixedrotation.cpp @@ -42,7 +42,9 @@ namespace { "Enabled", "If this value is 'true', all the machinery of this rotation is used, of it is " "'false', it provides the ability to change its attributes without risking some " - "undefined behavior" + "undefined behavior", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo XAxisTypeInfo = { @@ -51,7 +53,8 @@ namespace { "This value specifies how this axis is being specified, that is whether it is " "referencing another object, specifying an absolute vector, or whether it is " "using the right handed coordinate system completion based off the other two " - "vectors" + "vectors", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo YAxisTypeInfo = { @@ -60,7 +63,8 @@ namespace { "This value specifies how this axis is being specified, that is whether it is " "referencing another object, specifying an absolute vector, or whether it is " "using the right handed coordinate system completion based off the other two " - "vectors" + "vectors", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ZAxisTypeInfo = { @@ -69,7 +73,8 @@ namespace { "This value specifies how this axis is being specified, that is whether it is " "referencing another object, specifying an absolute vector, or whether it is " "using the right handed coordinate system completion based off the other two " - "vectors" + "vectors", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo XAxisObjectInfo = { @@ -77,7 +82,8 @@ namespace { "xAxis: Focus Object", "This is the object that the axis will focus on. This object must name an " "existing scene graph node in the currently loaded scene and the rotation will " - "stay fixed to the current position of that object" + "stay fixed to the current position of that object", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo YAxisObjectInfo = { @@ -85,7 +91,8 @@ namespace { "yAxis: Focus Object", "This is the object that the axis will focus on. This object must name an " "existing scene graph node in the currently loaded scene and the rotation will " - "stay fixed to the current position of that object" + "stay fixed to the current position of that object", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ZAxisObjectInfo = { @@ -93,7 +100,8 @@ namespace { "zAxis: Focus Object", "This is the object that the axis will focus on. This object must name an " "existing scene graph node in the currently loaded scene and the rotation will " - "stay fixed to the current position of that object" + "stay fixed to the current position of that object", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo XAxisInvertObjectInfo = { @@ -101,7 +109,8 @@ namespace { "xAxis: Invert Object Point Direction", "If this value is set to 'true', and the type is set to 'Object', the inverse of " "the pointing direction is used, causing the object to point away from the " - "referenced object" + "referenced object", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo YAxisInvertObjectInfo = { @@ -109,7 +118,8 @@ namespace { "yAxis: Invert Object Point Direction", "If this value is set to 'true', and the type is set to 'Object', the inverse of " "the pointing direction is used, causing the object to point away from the " - "referenced object" + "referenced object", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ZAxisInvertObjectInfo = { @@ -117,25 +127,32 @@ namespace { "zAxis: Invert Object Point Direction", "If this value is set to 'true', and the type is set to 'Object', the inverse of " "the pointing direction is used, causing the object to point away from the " - "referenced object" + "referenced object", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo XAxisVectorInfo = { "xAxisVector", "xAxis: Direction vector", - "This value specifies a static direction vector that is used for a fixed rotation" + "This value specifies a static direction vector that is used for a fixed " + "rotation", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo YAxisVectorInfo = { "yAxisVector", "yAxis: Direction vector", - "This value specifies a static direction vector that is used for a fixed rotation" + "This value specifies a static direction vector that is used for a fixed " + "rotation", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ZAxisVectorInfo = { "zAxisVector", "zAxis: Direction vector", - "This value specifies a static direction vector that is used for a fixed rotation" + "This value specifies a static direction vector that is used for a fixed " + "rotation", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo XAxisOrthogonalVectorInfo = { @@ -143,7 +160,8 @@ namespace { "xAxis: Vector is orthogonal", "This value determines whether the vector specified is used directly, or whether " "it is used together with another non-coordinate system completion vector to " - "construct an orthogonal vector instead" + "construct an orthogonal vector instead", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo YAxisOrthogonalVectorInfo = { @@ -151,7 +169,8 @@ namespace { "yAxis: Vector is orthogonal", "This value determines whether the vector specified is used directly, or whether " "it is used together with another non-coordinate system completion vector to " - "construct an orthogonal vector instead" + "construct an orthogonal vector instead", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ZAxisOrthogonalVectorInfo = { @@ -159,7 +178,8 @@ namespace { "zAxis: Vector is orthogonal", "This value determines whether the vector specified is used directly, or whether " "it is used together with another non-coordinate system completion vector to " - "construct an orthogonal vector instead" + "construct an orthogonal vector instead", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AttachedInfo = { @@ -167,7 +187,8 @@ namespace { "Attached Node", "This is the name of the node that this rotation is attached to, this value is " "only needed if any of the three axis uses the Object type. In this case, the " - "location of the attached node is required to compute the relative direction" + "location of the attached node is required to compute the relative direction", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(FixedRotation)]] Parameters { diff --git a/modules/base/rotation/luarotation.cpp b/modules/base/rotation/luarotation.cpp index 3e1e7c8e96..83dc48fa7a 100644 --- a/modules/base/rotation/luarotation.cpp +++ b/modules/base/rotation/luarotation.cpp @@ -43,7 +43,9 @@ namespace { "'rotation' that takes the current simulation time in seconds past the J2000 " "epoch as the first argument, the current wall time as milliseconds past the " "J2000 epoch as the second argument and computes the rotation returned as 9 " - "values" + "values", + // @VISIBILITY(3.25) + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(LuaRotation)]] Parameters { diff --git a/modules/base/rotation/staticrotation.cpp b/modules/base/rotation/staticrotation.cpp index cb0ef831f3..3b4acc4208 100644 --- a/modules/base/rotation/staticrotation.cpp +++ b/modules/base/rotation/staticrotation.cpp @@ -32,7 +32,9 @@ namespace { "Rotation", "Rotation", "This value is the used as a 3x3 rotation matrix that is applied to the scene " - "graph node that this transformation is attached to relative to its parent" + "graph node that this transformation is attached to relative to its parent", + // @VISIBILITY(3.0) + openspace::properties::Property::Visibility::AdvancedUser }; // Conversion from rotation matrix to euler angles, given that the rotation is a pure diff --git a/modules/base/rotation/timelinerotation.cpp b/modules/base/rotation/timelinerotation.cpp index ac40c6e750..ce881f6a5d 100644 --- a/modules/base/rotation/timelinerotation.cpp +++ b/modules/base/rotation/timelinerotation.cpp @@ -35,7 +35,9 @@ namespace { "ShouldInterpolate", "Should Interpolate", "If this value is set to 'true', an interpolation is applied between the given " - "keyframes. If this value is set to 'false', the interpolation is not applied" + "keyframes. If this value is set to 'false', the interpolation is not applied", + // @VISIBILITY(3.2) + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(TimelineRotation)]] Parameters { diff --git a/modules/base/scale/luascale.cpp b/modules/base/scale/luascale.cpp index 215daeecf6..92450a067e 100644 --- a/modules/base/scale/luascale.cpp +++ b/modules/base/scale/luascale.cpp @@ -42,7 +42,9 @@ namespace { "scaling factor for this transformation. The script needs to define a function " "'scale' that takes the current simulation time in seconds past the J2000 epoch " "as the first argument, the current wall time as milliseconds past the J2000 " - "epoch the second argument and computes the three scaling factors" + "epoch the second argument and computes the three scaling factors", + // @VISIBILITY(3.25) + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(LuaScale)]] Parameters { diff --git a/modules/base/scale/nonuniformstaticscale.cpp b/modules/base/scale/nonuniformstaticscale.cpp index 5e393a0ba3..d6c4148b2d 100644 --- a/modules/base/scale/nonuniformstaticscale.cpp +++ b/modules/base/scale/nonuniformstaticscale.cpp @@ -32,7 +32,8 @@ namespace { "Scale", "Scale", "These values are used as scaling factors for the scene graph node that this " - "transformation is attached to relative to its parent" + "transformation is attached to relative to its parent", + openspace::properties::Property::Visibility::NoviceUser }; struct [[codegen::Dictionary(NonUniformStaticScale)]] Parameters { diff --git a/modules/base/scale/staticscale.cpp b/modules/base/scale/staticscale.cpp index c951c9068b..0317709275 100644 --- a/modules/base/scale/staticscale.cpp +++ b/modules/base/scale/staticscale.cpp @@ -32,7 +32,8 @@ namespace { "Scale", "Scale", "This value is used as a scaling factor for the scene graph node that this " - "transformation is attached to relative to its parent" + "transformation is attached to relative to its parent", + openspace::properties::Property::Visibility::NoviceUser }; struct [[codegen::Dictionary(StaticScale)]] Parameters { diff --git a/modules/base/scale/timedependentscale.cpp b/modules/base/scale/timedependentscale.cpp index 02c6d4eae8..3511658936 100644 --- a/modules/base/scale/timedependentscale.cpp +++ b/modules/base/scale/timedependentscale.cpp @@ -37,14 +37,18 @@ namespace { "The date at which this scale will be 0. The current value of the scale is " "computed by taking the difference between the current time and the reference " "date and multiplying it by the speed. This field must be formatted as: " - "YYYY-MM-DDThh:mm:ss.uuu where h is a 24h clock and u microseconds" + "YYYY-MM-DDThh:mm:ss.uuu where h is a 24h clock and u microseconds", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo SpeedInfo = { "Speed", "Speed", "The speed at which the value grows or shrinks. The units for this are meters " - "per second. The default value is 1 m/s" + "per second. The default value is 1 m/s", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ClampToPositiveInfo = { @@ -52,7 +56,8 @@ namespace { "Clamp to Positive", "If this value is true, the velocity computation will never result in any " "negative values. This is useful for instantaneous events that only propagate " - "forwards. The default value is 'true'" + "forwards. The default value is 'true'", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(TimeDependentScale)]] Parameters { diff --git a/modules/base/timeframe/timeframeinterval.cpp b/modules/base/timeframe/timeframeinterval.cpp index 204aee2d9b..36a16eee2c 100644 --- a/modules/base/timeframe/timeframeinterval.cpp +++ b/modules/base/timeframe/timeframeinterval.cpp @@ -34,25 +34,33 @@ namespace { constexpr openspace::properties::Property::PropertyInfo HasStartInfo = { "HasStart", "Has Start", - "If enabled, this TimeFrame will be inactive before the Start" + "If enabled, this TimeFrame will be inactive before the Start", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo StartInfo = { "Start", "Start", - "Specifies the time when this TimeFrame becomes active" + "Specifies the time when this TimeFrame becomes active", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo HasEndInfo = { "HasEnd", "Has End", - "If enabled, this TimeFrame will be inactive after the End" + "If enabled, this TimeFrame will be inactive after the End", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo EndInfo = { "End", "End", - "Specifies the time when this TimeFrame becomes inactive" + "Specifies the time when this TimeFrame becomes inactive", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(TimeFrameInterval)]] Parameters { diff --git a/modules/base/timeframe/timeframeunion.cpp b/modules/base/timeframe/timeframeunion.cpp index 1e7c12b301..656a0d0daf 100644 --- a/modules/base/timeframe/timeframeunion.cpp +++ b/modules/base/timeframe/timeframeunion.cpp @@ -35,7 +35,9 @@ namespace { "TimeFrames", "Time Frames", "A vector of time frames to combine into one. The time frame is active when any " - "of the contained time frames are, but not in gaps between contained time frames" + "of the contained time frames are, but not in gaps between contained time frames", + // @VISIBILITY(3.75) + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(TimeFrameUnion)]] Parameters { diff --git a/modules/base/translation/luatranslation.cpp b/modules/base/translation/luatranslation.cpp index 26bb77a690..4bdda55028 100644 --- a/modules/base/translation/luatranslation.cpp +++ b/modules/base/translation/luatranslation.cpp @@ -43,7 +43,9 @@ namespace { "translation for this transformation. The script needs to define a function " "'translate' that takes the current simulation time in seconds past the J2000 " "epoch as the first argument, the current wall time as milliseconds past the " - "J2000 epoch as the second argument and computes the translation" + "J2000 epoch as the second argument and computes the translation", + // @VISIBILITY(3.75) + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(LuaTranslation)]] Parameters { diff --git a/modules/base/translation/statictranslation.cpp b/modules/base/translation/statictranslation.cpp index 16a2007a82..80bad2af5a 100644 --- a/modules/base/translation/statictranslation.cpp +++ b/modules/base/translation/statictranslation.cpp @@ -32,7 +32,9 @@ namespace { "Position", "Position", "This value is used as a static offset (in meters) that is applied to the scene " - "graph node that this transformation is attached to relative to its parent" + "graph node that this transformation is attached to relative to its parent", + // @VISIBILITY(2.25) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(StaticTranslation)]] Parameters { diff --git a/modules/base/translation/timelinetranslation.cpp b/modules/base/translation/timelinetranslation.cpp index 5347d60a3d..d64bebe79a 100644 --- a/modules/base/translation/timelinetranslation.cpp +++ b/modules/base/translation/timelinetranslation.cpp @@ -35,7 +35,8 @@ namespace { "ShouldInterpolate", "Should Interpolate", "If this value is set to 'true', an interpolation is applied between the given " - "keyframes. If this value is set to 'false', the interpolation is not applied" + "keyframes. If this value is set to 'false', the interpolation is not applied", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(TimelineTranslation)]] Parameters { diff --git a/modules/cefwebgui/cefwebguimodule.cpp b/modules/cefwebgui/cefwebguimodule.cpp index ef6372f448..d6a0c8fa73 100644 --- a/modules/cefwebgui/cefwebguimodule.cpp +++ b/modules/cefwebgui/cefwebguimodule.cpp @@ -41,31 +41,39 @@ namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { "Enabled", "Is Enabled", - "This setting determines whether the browser should be enabled or not" + "This setting determines whether the browser should be enabled or not", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ReloadInfo = { "Reload", "Reload", - "Trigger this property to reload the browser" + "Trigger this property to reload the browser", + // @VISIBILITY(2.2) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo VisibleInfo = { "Visible", "Is Visible", - "This setting determines whether the browser should be visible or not" + "This setting determines whether the browser should be visible or not", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo GuiUrlInfo = { "GuiUrl", "GUI URL", - "The URL of the webpage that is used to load the WebGUI from" + "The URL of the webpage that is used to load the WebGUI from", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo GuiScaleInfo = { "GuiScale", "Gui Scale", - "GUI scale multiplier" + "GUI scale multiplier", + openspace::properties::Property::Visibility::Always }; } // namespace diff --git a/modules/debugging/rendering/renderabledebugplane.cpp b/modules/debugging/rendering/renderabledebugplane.cpp index b57a2741b4..97f780de47 100644 --- a/modules/debugging/rendering/renderabledebugplane.cpp +++ b/modules/debugging/rendering/renderabledebugplane.cpp @@ -51,7 +51,9 @@ namespace { constexpr openspace::properties::Property::PropertyInfo TextureInfo = { "Texture", "Texture", - "The OpenGL name of the texture that is displayed on this plane" + "The OpenGL name of the texture that is displayed on this plane", + // @VISIBILITY(3.75) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo BillboardInfo = { @@ -59,19 +61,25 @@ namespace { "Billboard mode", "This value specifies whether the plane is a billboard, which means that it is " "always facing the camera. If this is false, it can be oriented using other " - "transformations" + "transformations", + // @VISIBILITY(3.75) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SizeInfo = { "Size", "Size (in meters)", - "This value specifies the size of the plane in meters" + "This value specifies the size of the plane in meters", + // @VISIBILITY(3.75) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo OriginInfo = { "Origin", "Texture Coordinate Origin", - "The origin of the texture coorinate system" + "The origin of the texture coorinate system", + // @VISIBILITY(3.75) + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderableDebugPlane)]] Parameters { diff --git a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp index 1946ca5183..2414994f05 100644 --- a/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp +++ b/modules/digitaluniverse/rendering/renderablebillboardscloud.cpp @@ -70,14 +70,17 @@ namespace { constexpr openspace::properties::Property::PropertyInfo SpriteTextureInfo = { "Texture", "Point Sprite Texture", - "The path to the texture that should be used as the point sprite" + "The path to the texture that should be used as the point sprite", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ScaleFactorInfo = { "ScaleFactor", "Scale Factor", "This value is used as a multiplicative factor that is applied to the apparent " - "size of each point" + "size of each point", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo UseColorMapInfo = { @@ -85,25 +88,32 @@ namespace { "Use Color Map", "If this value is set to 'true', the provided color map is used (if one was " "provided in the configuration). If no color map was provided, changing this " - "setting does not do anything" + "setting does not do anything", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ColorInfo = { "Color", "Color", - "This value is used to define the color of the astronomical object" + "This value is used to define the color of the astronomical object", + // @VISIBILITY(1.5) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo ColorMapInfo = { "ColorMap", "Color Map File", - "The path to the color map file of the astronomical object" + "The path to the color map file of the astronomical object", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DrawElementsInfo = { "DrawElements", "Draw Elements", - "Enables/Disables the drawing of the astronomical objects" + "Enables/Disables the drawing of the astronomical objects", + // @VISIBILITY(1.25) + openspace::properties::Property::Visibility::NoviceUser }; static const openspace::properties::PropertyOwner::PropertyOwnerInfo LabelsInfo = { @@ -116,27 +126,31 @@ namespace { "ColorOption", "Color Option", "This value determines which paramenter is used for default color of the " - "astronomical objects" + "astronomical objects", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo OptionColorRangeInfo = { "OptionColorRange", "Option Color Range", - "This value changes the range of values to be mapped with the current color map" + "This value changes the range of values to be mapped with the current color map", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SizeOptionInfo = { "SizeOption", "Size Option Variable", "This value determines which paramenter (datavar) is used for scaling of the " - "astronomical objects" + "astronomical objects", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RenderOptionInfo = { "RenderOption", "Render Option", "Option wether the billboards should face the camera or not. Used for non-linear " - "display envierments such as fisheye." + "display environments such as fisheye.", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FadeInDistancesInfo = { @@ -144,27 +158,32 @@ namespace { "Fade-In Start and End Distances", "These values determine the initial and final distances from the center of " "our galaxy from which the astronomical object will start and end " - "fading-in" + "fading-in", + // @VISIBILITY(3.25) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DisableFadeInInfo = { "DisableFadeIn", "Disable Fade-in Effect", - "Enables/Disables the Fade-in effect" + "Enables/Disables the Fade-in effect", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo PixelSizeControlInfo = { "EnablePixelSizeControl", "Enable Pixel Size Control", "Enable pixel size control for rectangular projections. If set to true, the " - "billboard size is restricted by the min/max size in pixels property" + "billboard size is restricted by the min/max size in pixels property", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo BillboardMinMaxSizeInfo = { "BillboardMinMaxSize", "Billboard Min/Max Size in Pixels", "The minimum and maximum size (in pixels) for the billboard representing the " - "astronomical object" + "astronomical object", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo @@ -172,26 +191,31 @@ namespace { { "CorrectionSizeEndDistance", "Distance in 10^X meters where correction size stops acting", - "Distance in 10^X meters where correction size stops acting" + "Distance in 10^X meters where correction size stops acting", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo CorrectionSizeFactorInfo = { "CorrectionSizeFactor", "Control variable for distance size", - "" + "", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo UseLinearFiltering = { "UseLinearFiltering", "Use Linear Filtering", "Determines whether the provided color map should be sampled nearest neighbor " - "(=off) or linearly (=on)" + "(=off) or linearly (=on)", + // @VISIBILITY(3.25) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SetRangeFromData = { "SetRangeFromData", "Set Data Range from Data", - "Set the data range based on the available data" + "Set the data range based on the available data", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderableBillboardsCloud)]] Parameters { diff --git a/modules/digitaluniverse/rendering/renderabledumeshes.cpp b/modules/digitaluniverse/rendering/renderabledumeshes.cpp index f3442c998a..96b4f4fd39 100644 --- a/modules/digitaluniverse/rendering/renderabledumeshes.cpp +++ b/modules/digitaluniverse/rendering/renderabledumeshes.cpp @@ -61,64 +61,76 @@ namespace { constexpr openspace::properties::Property::PropertyInfo TextColorInfo = { "TextColor", "Text Color", - "The text color for the astronomical object" + "The text color for the astronomical object", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo TextOpacityInfo = { "TextOpacity", "Text Opacity", "Determines the transparency of the text label, where 1 is completely opaque " - "and 0 fully transparent" + "and 0 fully transparent", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo TextSizeInfo = { "TextSize", "Text Size", - "The text size for the astronomical object labels" + "The text size for the astronomical object labels", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LabelFileInfo = { "LabelFile", "Label File", "The path to the label file that contains information about the astronomical " - "objects being rendered" + "objects being rendered", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo LabelMinMaxSizeInfo = { "TextMinMaxSize", "Text Min/Max Size", "The minimum and maximum size (in pixels) of the text for the labels for the " - "astronomical objects being rendered" + "astronomical objects being rendered", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = { "LineWidth", "Line Width", - "If the DU mesh is of wire type, this value determines the width of the lines" + "If the DU mesh is of wire type, this value determines the width of the lines", + // @VISIBILITY(1.75) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo DrawElementsInfo = { "DrawElements", "Draw Elements", - "Enables/Disables the drawing of the astronomical objects" + "Enables/Disables the drawing of the astronomical objects", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo DrawLabelInfo = { "DrawLabels", "Draw Labels", - "Determines whether labels should be drawn or hidden" + "Determines whether labels should be drawn or hidden", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo MeshColorInfo = { "MeshColor", "Meshes colors", - "The defined colors for the meshes to be rendered" + "The defined colors for the meshes to be rendered", + // @VISIBILITY(1.25) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo RenderOptionInfo = { "RenderOption", "Render Option", - "Debug option for rendering of billboards and texts" + "Debug option for rendering of billboards and texts", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderableDUMeshes)]] Parameters { diff --git a/modules/digitaluniverse/rendering/renderableplanescloud.cpp b/modules/digitaluniverse/rendering/renderableplanescloud.cpp index 05820844c2..060023baf9 100644 --- a/modules/digitaluniverse/rendering/renderableplanescloud.cpp +++ b/modules/digitaluniverse/rendering/renderableplanescloud.cpp @@ -62,11 +62,12 @@ namespace { "ScaleFactor", "Scale Factor", "This value is used as a multiplicative factor that is applied to the apparent " - "size of each point" + "size of each point", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; - static const openspace::properties::PropertyOwner::PropertyOwnerInfo LabelsInfo = - { + static const openspace::properties::PropertyOwner::PropertyOwnerInfo LabelsInfo = { "Labels", "Labels", "The labels for the astronomical objects" @@ -75,62 +76,74 @@ namespace { constexpr openspace::properties::Property::PropertyInfo DrawElementsInfo = { "DrawElements", "Draw Elements", - "Enables/Disables the drawing of the astronomical objects" + "Enables/Disables the drawing of the astronomical objects", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo TransformationMatrixInfo = { "TransformationMatrix", "Transformation Matrix", - "Transformation matrix to be applied to each astronomical object" + "Transformation matrix to be applied to each astronomical object", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo BlendModeInfo = { "BlendMode", "Blending Mode", - "This determines the blending mode that is applied to this plane" + "This determines the blending mode that is applied to this plane", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TexturePathInfo = { "TexturePath", "Texture Path", - "This value specifies the path for the textures in disk" + "This value specifies the path for the textures in disk", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo LuminosityInfo = { "Luminosity", "Luminosity variable", - "Datavar variable to control the luminosity/size of the astronomical objects" + "Datavar variable to control the luminosity/size of the astronomical objects", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ScaleLuminosityInfo = { "ScaleLuminosity", "ScaleLuminosity variable", - "Scaling control for the luminosity/size of the astronomical objects" + "Scaling control for the luminosity/size of the astronomical objects", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo RenderOptionInfo = { "RenderOption", "Render Option", - "Debug option for rendering of billboards and texts" + "Debug option for rendering of billboards and texts", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FadeInDistancesInfo = { "FadeInDistances", "Fade-In Start and End Distances", "These values determine the initial and final distances from the center of " - "our galaxy from which the astronomical object will start and end fading-in" + "our galaxy from which the astronomical object will start and end fading-in", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DisableFadeInInfo = { "DisableFadeIn", "Disable Fade-in effect", - "Enables/Disables the Fade-in effect" + "Enables/Disables the Fade-in effect", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo PlaneMinSizeInfo = { "PlaneMinSize", "Plane Min Size in Pixels", - "The min size (in pixels) for the plane representing the astronomical object" + "The min size (in pixels) for the plane representing the astronomical object", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderablePlanesCloud)]] Parameters { @@ -196,7 +209,7 @@ documentation::Documentation RenderablePlanesCloud::Documentation() { RenderablePlanesCloud::RenderablePlanesCloud(const ghoul::Dictionary& dictionary) : Renderable(dictionary) - , _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 300000.f) + , _scaleFactor(ScaleFactorInfo, 1.f, 0.f, 1000.f) , _drawElements(DrawElementsInfo, true) , _blendMode(BlendModeInfo, properties::OptionProperty::DisplayType::Dropdown) , _fadeInDistances( diff --git a/modules/digitaluniverse/rendering/renderablepoints.cpp b/modules/digitaluniverse/rendering/renderablepoints.cpp index 650539d36b..1a7d76acd5 100644 --- a/modules/digitaluniverse/rendering/renderablepoints.cpp +++ b/modules/digitaluniverse/rendering/renderablepoints.cpp @@ -57,26 +57,30 @@ namespace { constexpr openspace::properties::Property::PropertyInfo SpriteTextureInfo = { "Texture", "Point Sprite Texture", - "The path to the texture that should be used as the point sprite" + "The path to the texture that should be used as the point sprite", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ScaleFactorInfo = { "ScaleFactor", "Scale Factor", "This value is used as a multiplicative factor that is applied to the apparent " - "size of each point" + "size of each point", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ColorInfo = { "Color", "Color", - "This value is used to define the color of the astronomical object" + "This value is used to define the color of the astronomical object", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo ColorMapInfo = { "ColorMap", "Color Map File", - "The path to the color map file of the astronomical object" + "The path to the color map file of the astronomical object", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderablePoints)]] Parameters { diff --git a/modules/exoplanets/exoplanetsmodule.cpp b/modules/exoplanets/exoplanetsmodule.cpp index 68c78ca25f..8747c43a26 100644 --- a/modules/exoplanets/exoplanetsmodule.cpp +++ b/modules/exoplanets/exoplanetsmodule.cpp @@ -53,81 +53,96 @@ namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { "Enabled", "Enabled", - "Decides if the GUI for this module should be enabled" + "Decides if the GUI for this module should be enabled", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DataFolderInfo = { "DataFolder", "Data Folder", - "The path to the folder containing the exoplanets data and lookup table" + "The path to the folder containing the exoplanets data and lookup table", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo BvColorMapInfo = { "BvColormap", "B-V Colormap", - "The path to a cmap file that maps a B-V color index to an RGB color" + "The path to a cmap file that maps a B-V color index to an RGB color", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo StarTextureInfo = { "StarTexture", "Star Texture", - "The path to a grayscale image that is used for the host star surfaces" + "The path to a grayscale image that is used for the host star surfaces", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo StarGlareTextureInfo = { "StarGlareTexture", "Star Glare Texture", "The path to a grayscale image that is used for the glare effect of the " - "host stars" + "host stars", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo NoDataTextureInfo = { "NoDataTexture", "No Data Star Texture", "A path to a texture that is used to represent that there is missing data about " - "the star. For example no color information" + "the star. For example no color information", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo OrbitDiscTextureInfo = { "OrbitDiscTexture", "Orbit Disc Texture", "A path to a 1-dimensional image used as a transfer function for the " - "exoplanets' orbit uncertainty disc" + "exoplanets' orbit uncertainty disc", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo HabitableZoneTextureInfo = { "HabitableZoneTexture", "Habitable Zone Texture", "A path to a 1-dimensional image used as a transfer function for the " - "habitable zone disc" + "habitable zone disc", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ShowComparisonCircleInfo = { "ShowComparisonCircle", "Show Comparison Circle", "If true, the 1 AU size comparison circle is enabled per default when an " - "exoplanet system is created" + "exoplanet system is created", + // @VISIBILITY(1.8) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo ShowHabitableZoneInfo = { "ShowHabitableZone", "Show Habitable Zone", "If true, the habitable zone disc is enabled per default when an exoplanet " - "system is created" + "system is created", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo UseOptimisticZoneInfo = { "UseOptimisticZone", "Use Optimistic Zone Boundaries", "If true, the habitable zone is computed with optimistic boundaries per default " - "when an exoplanet system is created" + "when an exoplanet system is created", + // @VISIBILITY(2.8) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo HabitableZoneOpacityInfo = { "HabitableZoneOpacity", "Habitable Zone Opacity", "The opacity value used for the habitable zone renderable for a created " - "exoplanet system" + "exoplanet system", + // @VISIBILITY(1.5) + openspace::properties::Property::Visibility::NoviceUser }; constexpr std::string_view ExoplanetsDataFileName = "exoplanets_data.bin"; diff --git a/modules/exoplanets/rendering/renderableorbitdisc.cpp b/modules/exoplanets/rendering/renderableorbitdisc.cpp index ff817e548f..dddb81f391 100644 --- a/modules/exoplanets/rendering/renderableorbitdisc.cpp +++ b/modules/exoplanets/rendering/renderableorbitdisc.cpp @@ -49,20 +49,23 @@ namespace { "Texture", "Texture", "This value is the path to a texture on disk that contains a one-dimensional " - "texture which is used for the color" + "texture which is used for the color", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SizeInfo = { "Size", "Size", - "This value specifies the semi-major axis of the orbit, in meter" + "This value specifies the semi-major axis of the orbit, in meter", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo EccentricityInfo = { "Eccentricity", "Eccentricity", "This value determines the eccentricity, that is the deviation from a perfect " - "sphere, for this orbit" + "sphere, for this orbit", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo OffsetInfo = { @@ -71,14 +74,17 @@ namespace { "This property determines the width of the disc. The values specify the lower " "and upper deviation from the semi major axis, respectively. The values are " "relative to the size of the semi-major axis. That is, 0 means no deviation " - "from the semi-major axis and 1 is a whole semi-major axis's worth of deviation" + "from the semi-major axis and 1 is a whole semi-major axis's worth of deviation", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MultiplyColorInfo = { "MultiplyColor", "Multiply Color", "If set, the disc's texture is multiplied with this color. Useful for applying a " - "color grayscale images" + "color grayscale images", + // @VISIBILITY(1.5) + openspace::properties::Property::Visibility::NoviceUser }; struct [[codegen::Dictionary(RenderableOrbitDisc)]] Parameters { diff --git a/modules/fieldlines/rendering/renderablefieldlines.cpp b/modules/fieldlines/rendering/renderablefieldlines.cpp index be47d6cc4a..220a68a6b8 100644 --- a/modules/fieldlines/rendering/renderablefieldlines.cpp +++ b/modules/fieldlines/rendering/renderablefieldlines.cpp @@ -72,31 +72,37 @@ namespace { "Stepsize", //"StepSize", "Fieldline Step Size", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo Classification = { "Classification", "Fieldline Classification", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FieldlineColorInfo = { "FieldlineColor", "Fieldline Color", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SeedPointSourceInfo = { "Source", "SeedPoint Source", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SeedPointFileInfo = { "SourceFile", "SeedPoint File", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; } // namespace diff --git a/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp b/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp index 990feb5693..37405e993b 100644 --- a/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp +++ b/modules/fieldlinessequence/rendering/renderablefieldlinessequence.cpp @@ -52,88 +52,111 @@ namespace { "ColorMethod", "Color Method", "Color lines uniformly or using color tables based on extra quantities like, for " - "examples, temperature or particle density" + "examples, temperature or particle density", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ColorQuantityInfo = { "ColorQuantity", "Quantity to Color By", - "Quantity used to color lines if the 'By Quantity' color method is selected" + "Quantity used to color lines if the 'By Quantity' color method is selected", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ColorMinMaxInfo = { "ColorQuantityMinMax", "ColorTable Min Value", - "Value to map to the lowest and highest end of the color table" + "Value to map to the lowest and highest end of the color table", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ColorTablePathInfo = { "ColorTablePath", "Path to Color Table", - "Color Table/Transfer Function to use for 'By Quantity' coloring" + "Color Table/Transfer Function to use for 'By Quantity' coloring", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ColorUniformInfo = { "Color", "Uniform Line Color", - "The uniform color of lines shown when 'Color Method' is set to 'Uniform'" + "The uniform color of lines shown when 'Color Method' is set to 'Uniform'", + // @VISIBILITY(1.67) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo ColorUseABlendingInfo = { "ABlendingEnabled", "Additive Blending", - "Activate/deactivate additive blending" + "Activate/deactivate additive blending", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DomainEnabledInfo = { "DomainEnabled", "Domain Limits", - "Enable/Disable domain limits" + "Enable/Disable domain limits", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo DomainXInfo = { "LimitsX", "X-limits", - "Valid range along the X-axis. [Min, Max]" + "Valid range along the X-axis. [Min, Max]", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DomainYInfo = { "LimitsY", "Y-limits", - "Valid range along the Y-axis. [Min, Max]" + "Valid range along the Y-axis. [Min, Max]", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DomainZInfo = { "LimitsZ", "Z-limits", - "Valid range along the Z-axis. [Min, Max]" + "Valid range along the Z-axis. [Min, Max]", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DomainRInfo = { "LimitsR", "Radial limits", - "Valid radial range. [Min, Max]" + "Valid radial range. [Min, Max]", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FlowColorInfo = { "FlowColor", "Flow Color", - "Color of particles flow direction indication" + "Color of particles flow direction indication", + // @VISIBILITY(1.33) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo FlowEnabledInfo = { "FlowEnabled", "Flow Direction", "Toggles the rendering of moving particles along the lines. Can, for example, " - "illustrate magnetic flow" + "illustrate magnetic flow", + // @VISIBILITY(1.67) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo FlowReversedInfo = { "Reversed", "Reversed Flow", - "Toggle to make the flow move in the opposite direction" + "Toggle to make the flow move in the opposite direction", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo FlowParticleSizeInfo = { "ParticleSize", "Particle Size", - "Size of the particles" + "Size of the particles", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo FlowParticleSpacingInfo = { "ParticleSpacing", "Particle Spacing", - "Spacing inbetween particles" + "Spacing inbetween particles", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo FlowSpeedInfo = { "Speed", "Speed", - "Speed of the flow" + "Speed of the flow", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo MaskingEnabledInfo = { "MaskingEnabled", @@ -141,27 +164,33 @@ namespace { "Enable/disable masking. Use masking to show lines where a given quantity is " "within a given range, for example, if you only want to see where the " "temperature is between 10 and 20 degrees. Also used for masking out line " - "topologies like solar wind & closed lines" + "topologies like solar wind & closed lines", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MaskingMinMaxInfo = { "MaskingMinLimit", "Lower Limit", - "Lower and upper limit of the valid masking range" + "Lower and upper limit of the valid masking range", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MaskingQuantityInfo = { "MaskingQuantity", "Quantity used for Masking", - "Quantity used for masking" + "Quantity used for masking", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = { "LineWidth", "Line Width", - "This value specifies the line width of the fieldlines" + "This value specifies the line width of the fieldlines", + // @VISIBILITY(1.33) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo TimeJumpButtonInfo = { "TimeJumpToStart", "Jump to Start Of Sequence", - "Performs a time jump to the start of the sequence" + "Performs a time jump to the start of the sequence", + openspace::properties::Property::Visibility::NoviceUser }; struct [[codegen::Dictionary(RenderableFieldlinesSequence)]] Parameters { diff --git a/modules/gaia/rendering/renderablegaiastars.cpp b/modules/gaia/rendering/renderablegaiastars.cpp index ff15d62bae..2b83ce82c0 100644 --- a/modules/gaia/rendering/renderablegaiastars.cpp +++ b/modules/gaia/rendering/renderablegaiastars.cpp @@ -57,7 +57,8 @@ namespace { constexpr openspace::properties::Property::PropertyInfo FilePathInfo = { "File", "File Path", - "The path to the file with data for the stars to be rendered" + "The path to the file with data for the stars to be rendered", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FileReaderOptionInfo = { @@ -70,7 +71,9 @@ namespace { "data, construct an Octree and render it. 'BinaryOctree' will read a constructed " "Octree from binary file and render full data. 'StreamOctree' will read an index " "file with full Octree structure and then stream nodes during runtime. (This " - "option is suited for bigger datasets)" + "option is suited for bigger datasets)", + // @VISIBILITY(3.67) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RenderModeInfo = { @@ -78,7 +81,8 @@ namespace { "Render Mode", "This value determines which predefined columns to use in rendering. If " "'Static' only the position of the stars is used. 'Color' uses position + color " - "parameters and 'Motion' uses pos, color as well as velocity for the stars" + "parameters and 'Motion' uses pos, color as well as velocity for the stars", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ShaderOptionInfo = { @@ -89,28 +93,34 @@ namespace { "filter. If 'Billboard_*' is chosen then the geometry shaders will generate " "screen-faced billboards for all stars. For '*_SSBO' the data will be stored in " "Shader Storage Buffer Objects while '*_VBO' uses Vertex Buffer Objects for the " - "streaming. OBS! SSBO won't work on Apple" + "streaming. OBS! SSBO won't work on Apple", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo PsfTextureInfo = { "Texture", "Point Spread Function Texture", "The path to the texture that should be used as a point spread function for the " - "stars" + "stars", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo LuminosityMultiplierInfo = { "LuminosityMultiplier", "Luminosity Multiplier", "Factor by which to multiply the luminosity with. [Works in Color and Motion " - "modes]" + "modes]", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo MagnitudeBoostInfo = { "MagnitudeBoost", "Magnitude Boost", "Sets what percent of the star magnitude that will be used as boost to star " - "size. [Works only with billboards in Color and Motion modes]" + "size. [Works only with billboards in Color and Motion modes]", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo CutOffThresholdInfo = { @@ -118,40 +128,49 @@ namespace { "Cut Off Threshold", "Set threshold for when to cut off star rendering. Stars closer than this " "threshold are given full opacity. Farther away, stars dim proportionally to the " - "4-logarithm of their distance" + "4-logarithm of their distance", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo SharpnessInfo = { "Sharpness", "Sharpness", - "Adjust star sharpness. [Works only with billboards]" + "Adjust star sharpness. [Works only with billboards]", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo BillboardSizeInfo = { "BillboardSize", "Billboard Size", - "Set the billboard size of all stars. [Works only with billboards]" + "Set the billboard size of all stars. [Works only with billboards]", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo CloseUpBoostDistInfo = { "CloseUpBoostDist", "Close-Up Boost Distance [pc]", "Set the distance where stars starts to increase in size. Unit is Parsec [Works " - "only with billboards]" + "only with billboards]", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TmPointFilterSizeInfo = { "FilterSize", "Filter Size [px]", "Set the filter size in pixels used in tonemapping for point splatting rendering" - "[Works only with points]" + "[Works only with points]", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TmPointSigmaInfo = { "Sigma", "Normal Distribution Sigma", "Set the normal distribution sigma used in tonemapping for point splatting " - "rendering. [Works only with points]" + "rendering. [Works only with points]", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AdditionalNodesInfo = { @@ -160,7 +179,8 @@ namespace { "Determines how many additional nodes around the camera that will be fetched " "from disk. The first value determines how many additional layers of parents " "that will be fetched. The second value determines how many layers of descendant " - "that will be fetched from the found parents" + "that will be fetched from the found parents", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TmPointPxThresholdInfo = { @@ -169,14 +189,16 @@ namespace { "Set the threshold for how big the elliptic weight of a pixel has to be to " "contribute to the final elliptic shape. A smaller value gives a more visually " "pleasing result while a bigger value will speed up the rendering on skewed " - "frustums (aka Domes)" + "frustums (aka Domes)", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ColorTextureInfo = { "ColorMap", "Color Texture", "The path to the texture that is used to convert from the magnitude of the star " - "to its color. The texture is used as a one dimensional lookup function" + "to its color. The texture is used as a one dimensional lookup function", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FirstRowInfo = { @@ -184,7 +206,8 @@ namespace { "First Row to Read", "Defines the first row that will be read from the specified FITS file No need to " "define if data already has been processed. [Works only with " - "FileReaderOption::Fits]" + "FileReaderOption::Fits]", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo LastRowInfo = { @@ -192,7 +215,8 @@ namespace { "Last Row to Read", "Defines the last row that will be read from the specified FITS file; has to be " "equal to or greater than FirstRow. No need to define if data already has been " - "processed. [Works only with FileReaderOption::Fits]" + "processed. [Works only with FileReaderOption::Fits]", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ColumnNamesInfo = { @@ -200,46 +224,60 @@ namespace { "Column Names", "A list of strings with the names of all the columns that are to be read from " "the specified FITS file. No need to define if data already has been processed. " - "[Works only with FileReaderOption::Fits]" + "[Works only with FileReaderOption::Fits]", + // @VISIBILITY(3.67) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo NumRenderedStarsInfo = { "NumRenderedStars", "Rendered Stars", - "The number of rendered stars in the current frame" + "The number of rendered stars in the current frame", + // @VISIBILITY(3.67) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo CpuRamBudgetInfo = { "CpuRamBudget", "CPU RAM Budget", - "Current remaining budget (bytes) on the CPU RAM for loading more node data files" + "Current remaining budget (bytes) on the CPU RAM for loading more node data " + "files", + // @VISIBILITY(3.33) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo GpuStreamBudgetInfo = { "GpuStreamBudget", "GPU Stream Budget", "Current remaining memory budget [in number of chunks] on the GPU for streaming " - "additional stars" + "additional stars", + // @VISIBILITY(3.67) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo LodPixelThresholdInfo = { "LodPixelThreshold", "LOD Pixel Threshold", "The number of total pixels a nodes AABB can have in clipping space before its " - "parent is fetched as LOD cache" + "parent is fetched as LOD cache", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MaxGpuMemoryPercentInfo = { "MaxGpuMemoryPercent", "Max GPU Memory", - "Sets the max percent of existing GPU memory budget that the streaming will use" + "Sets the max percent of existing GPU memory budget that the streaming will use", + // @VISIBILITY(3.33) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MaxCpuMemoryPercentInfo = { "MaxCpuMemoryPercent", "Max CPU Memory", "Sets the max percent of existing CPU memory budget that the streaming of files " - "will use" + "will use", + // @VISIBILITY(3.33) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FilterPosXInfo = { @@ -247,7 +285,8 @@ namespace { "PosX Threshold", "If defined then only stars with Position X values between [min, max] will be " "rendered (if min is set to 0.0 it is read as -Inf, if max is set to 0.0 it is " - "read as +Inf). Measured in kiloParsec" + "read as +Inf). Measured in kiloParsec", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FilterPosYInfo = { @@ -255,7 +294,8 @@ namespace { "PosY Threshold", "If defined then only stars with Position Y values between [min, max] will be " "rendered (if min is set to 0.0 it is read as -Inf, if max is set to 0.0 it is " - "read as +Inf). Measured in kiloParsec" + "read as +Inf). Measured in kiloParsec", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FilterPosZInfo = { @@ -263,7 +303,8 @@ namespace { "PosZ Threshold", "If defined then only stars with Position Z values between [min, max] will be " "rendered (if min is set to 0.0 it is read as -Inf, if max is set to 0.0 it is " - "read as +Inf). Measured in kiloParsec" + "read as +Inf). Measured in kiloParsec", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FilterGMagInfo = { @@ -272,7 +313,8 @@ namespace { "If defined then only stars with G mean magnitude values between [min, max] will " "be rendered (if min is set to 20.0 it is read as -Inf, if max is set to 20.0 it " "is read as +Inf). If min = max then all values equal min|max will be filtered " - "away" + "away", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FilterBpRpInfo = { @@ -280,7 +322,8 @@ namespace { "Bp-Rp Threshold", "If defined then only stars with Bp-Rp color values between [min, max] will be " "rendered (if min is set to 0.0 it is read as -Inf, if max is set to 0.0 it is " - "read as +Inf). If min = max then all values equal min|max will be filtered away" + "read as +Inf). If min = max then all values equal min|max will be filtered away", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FilterDistInfo = { @@ -288,13 +331,16 @@ namespace { "Dist Threshold", "If defined then only stars with Distances values between [min, max] will be " "rendered (if min is set to 0.0 it is read as -Inf, if max is set to 0.0 it is " - "read as +Inf). Measured in kParsec" + "read as +Inf). Measured in kParsec", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ReportGlErrorsInfo = { "ReportGlErrors", "Report GL Errors", - "If set to true, any OpenGL errors will be reported if encountered" + "If set to true, any OpenGL errors will be reported if encountered", + // @VISIBILITY(3.67) + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderableGaiaStars)]] Parameters { @@ -418,7 +464,7 @@ RenderableGaiaStars::RenderableGaiaStars(const ghoul::Dictionary& dictionary) , _filePath(FilePathInfo) , _pointSpreadFunctionTexturePath(PsfTextureInfo) , _colorTexturePath(ColorTextureInfo) - , _luminosityMultiplier(LuminosityMultiplierInfo, 35.f, 1.f, 1000.f) + , _luminosityMultiplier(LuminosityMultiplierInfo, 35.f, 1.f, 250.f) , _magnitudeBoost(MagnitudeBoostInfo, 25.f, 0.f, 100.f) , _cutOffThreshold(CutOffThresholdInfo, 38.f, 0.f, 50.f) , _sharpness(SharpnessInfo, 1.45f, 0.f, 5.f) diff --git a/modules/galaxy/rendering/renderablegalaxy.cpp b/modules/galaxy/rendering/renderablegalaxy.cpp index 45ebc77f92..164ff7f11c 100644 --- a/modules/galaxy/rendering/renderablegalaxy.cpp +++ b/modules/galaxy/rendering/renderablegalaxy.cpp @@ -77,14 +77,16 @@ namespace { "VolumeRenderingEnabled", "Volume Rendering", "If this value is enabled, the volume rendering component of the galaxy " - "rendering is turned on. Otherwise, the volume rendering is skipped" + "rendering is turned on. Otherwise, the volume rendering is skipped", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo StarRenderingEnabledInfo = { "StarRenderingEnabled", "Star Rendering", "If this value is enabled, the point-based star rendering component of the " - "galaxy rendering is turned on. Otherwise, the volume rendering is skipped" + "galaxy rendering is turned on. Otherwise, the volume rendering is skipped", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo StepSizeInfo = { @@ -92,7 +94,8 @@ namespace { "Step Size", "Determines the distance between steps taken in the volume rendering. The lower " "the number is, the better the rendering looks, but also takes more " - "computational resources to render" + "computational resources to render", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AbsorptionMultiplyInfo = { @@ -100,14 +103,18 @@ namespace { "Absorption Multiplier", "A unit-less scale factor for the probability of dust absorbing a light " "particle. The amount of absorption determines the spectrum of the light that is " - "emitted from the galaxy" + "emitted from the galaxy", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo EmissionMultiplyInfo = { "EmissionMultiply", "Emission Multiplier", "A unit-less scale factor for the amount of light being emitted by dust in the " - "galaxy" + "galaxy", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo RotationInfo = { @@ -121,7 +128,8 @@ namespace { "StarRenderingMethod", "Star Rendering Method", "This value determines which rendering method is used for visualization of the " - "stars" + "stars", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo EnabledPointsRatioInfo = { @@ -130,21 +138,25 @@ namespace { "The ratio of point-like stars that are rendered to produce the overall galaxy " "image. At a value of 0, no stars are rendered, at a value of 1 all points " "contained in the dataset are rendered. The specific value chosen is a " - "compromise between image fidelity and rendering performance" + "compromise between image fidelity and rendering performance", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DownscaleVolumeRenderingInfo = { "Downscale", "Downscale Factor Volume Rendering", - "This value sets the downscaling factor when rendering the current volume" + "This value sets the downscaling factor when rendering the current volume", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo NumberOfRayCastingStepsInfo = { "Steps", "Number of RayCasting Steps", - "This value set the number of integration steps during the raycasting procedure" + "This value set the number of integration steps during the raycasting procedure", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderableGalaxy)]] Parameters { diff --git a/modules/globebrowsing/CMakeLists.txt b/modules/globebrowsing/CMakeLists.txt index c299869ea1..ada26b0819 100644 --- a/modules/globebrowsing/CMakeLists.txt +++ b/modules/globebrowsing/CMakeLists.txt @@ -60,6 +60,11 @@ set(HEADER_FILES src/tiletextureinitdata.h src/tilecacheproperties.h src/timequantizer.h + src/geojson/geojsoncomponent.h + src/geojson/geojsonmanager.h + src/geojson/geojsonproperties.h + src/geojson/globegeometryfeature.h + src/geojson/globegeometryhelper.h src/tileprovider/defaulttileprovider.h src/tileprovider/imagesequencetileprovider.h src/tileprovider/singleimagetileprovider.h @@ -101,6 +106,11 @@ set(SOURCE_FILES src/tileloadjob.cpp src/tiletextureinitdata.cpp src/timequantizer.cpp + src/geojson/geojsoncomponent.cpp + src/geojson/geojsonmanager.cpp + src/geojson/geojsonproperties.cpp + src/geojson/globegeometryfeature.cpp + src/geojson/globegeometryhelper.cpp src/tileprovider/defaulttileprovider.cpp src/tileprovider/imagesequencetileprovider.cpp src/tileprovider/singleimagetileprovider.cpp @@ -119,6 +129,11 @@ set(SHADER_FILES shaders/advanced_rings_vs.glsl shaders/advanced_rings_fs.glsl shaders/blending.glsl + shaders/geojson_fs.glsl + shaders/geojson_points_fs.glsl + shaders/geojson_points_gs.glsl + shaders/geojson_points_vs.glsl + shaders/geojson_vs.glsl shaders/globalrenderer_vs.glsl shaders/localrenderer_vs.glsl shaders/renderer_fs.glsl @@ -163,3 +178,8 @@ else (WIN32) target_link_libraries(openspace-module-globebrowsing PRIVATE ${GDAL_LIBRARY}) mark_as_advanced(GDAL_CONFIG GDAL_INCLUDE_DIR GDAL_LIBRARY) endif () # WIN32 + +begin_dependency("GEOS") +add_subdirectory(ext/geos SYSTEM) +target_link_libraries(openspace-module-globebrowsing PRIVATE geos) +end_dependency("GEOS") diff --git a/modules/globebrowsing/ext/geos b/modules/globebrowsing/ext/geos new file mode 160000 index 0000000000..bc93e4c523 --- /dev/null +++ b/modules/globebrowsing/ext/geos @@ -0,0 +1 @@ +Subproject commit bc93e4c523e92baee3c92608b1309a31453ece06 diff --git a/modules/globebrowsing/globebrowsingmodule.cpp b/modules/globebrowsing/globebrowsingmodule.cpp index bbc90b60bf..42d5adabb6 100644 --- a/modules/globebrowsing/globebrowsingmodule.cpp +++ b/modules/globebrowsing/globebrowsingmodule.cpp @@ -28,6 +28,9 @@ #include #include #include +#include +#include +#include #include #include #include @@ -94,19 +97,30 @@ namespace { constexpr openspace::properties::Property::PropertyInfo TileCacheSizeInfo = { "TileCacheSize", "Tile Cache Size", - "The maximum size of the MemoryAwareTileCache, on the CPU and GPU" + "The maximum size of the MemoryAwareTileCache, on the CPU and GPU", + openspace::properties::Property::Visibility::AdvancedUser + }; + + constexpr openspace::properties::Property::PropertyInfo + DefaultGeoPointTextureInfo = + { + "DefaultGeoPointTexture", + "Default Geo Point Texture", + "A path to a texture to use as default for GeoJson points" }; constexpr openspace::properties::Property::PropertyInfo MRFCacheEnabledInfo = { "MRFCacheEnabled", "MRF Cache Enabled", - "Determines whether automatic caching of globe browsing data is enabled." + "Determines whether automatic caching of globe browsing data is enabled.", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MRFCacheLocationInfo = { "MRFCacheLocation", "MRF Cache Location", - "The location of the root folder for the MRF cache of globe browsing data." + "The location of the root folder for the MRF cache of globe browsing data.", + openspace::properties::Property::Visibility::AdvancedUser }; openspace::GlobeBrowsingModule::Capabilities @@ -170,6 +184,9 @@ namespace { // [[codegen::verbatim(TileCacheSizeInfo.description)]] std::optional tileCacheSize; + // [[codegen::verbatim(DefaultGeoPointTextureInfo.description)]] + std::optional defaultGeoPointTexture; + // [[codegen::verbatim(MRFCacheEnabledInfo.description)]] std::optional mrfCacheEnabled [[codegen::key("MRFCacheEnabled")]]; @@ -184,10 +201,14 @@ namespace openspace { GlobeBrowsingModule::GlobeBrowsingModule() : OpenSpaceModule(Name) , _tileCacheSizeMB(TileCacheSizeInfo, 1024) + , _defaultGeoPointTexturePath(DefaultGeoPointTextureInfo) , _mrfCacheEnabled(MRFCacheEnabledInfo, false) , _mrfCacheLocation(MRFCacheLocationInfo, "${BASE}/cache_mrf") { addProperty(_tileCacheSizeMB); + + addProperty(_defaultGeoPointTexturePath); + addProperty(_mrfCacheEnabled); addProperty(_mrfCacheLocation); } @@ -197,6 +218,28 @@ void GlobeBrowsingModule::internalInitialize(const ghoul::Dictionary& dict) { const Parameters p = codegen::bake(dict); _tileCacheSizeMB = p.tileCacheSize.value_or(_tileCacheSizeMB); + + _defaultGeoPointTexturePath.onChange([this]() { + if (_defaultGeoPointTexturePath.value().empty()) { + _hasDefaultGeoPointTexture = false; + return; + } + std::filesystem::path path = _defaultGeoPointTexturePath.value(); + if (std::filesystem::exists(path)) { + _hasDefaultGeoPointTexture = true; + } + else { + LWARNINGC("GlobeBrowsingModule", fmt::format( + "The provided texture file {} for the default geo point texture " + "does not exist", path + )); + } + }); + + if (p.defaultGeoPointTexture.has_value()) { + _defaultGeoPointTexturePath = absPath(*p.defaultGeoPointTexture).string(); + } + _mrfCacheEnabled = p.mrfCacheEnabled.value_or(_mrfCacheEnabled); _mrfCacheLocation = p.mrfCacheLocation.value_or(_mrfCacheLocation); @@ -295,6 +338,9 @@ std::vector GlobeBrowsingModule::documentations() globebrowsing::TemporalTileProvider::Documentation(), globebrowsing::TileProviderByIndex::Documentation(), globebrowsing::TileProviderByLevel::Documentation(), + globebrowsing::GeoJsonManager::Documentation(), + globebrowsing::GeoJsonComponent::Documentation(), + globebrowsing::GeoJsonProperties::Documentation(), GlobeLabelsComponent::Documentation(), RingsComponent::Documentation(), ShadowComponent::Documentation() @@ -631,6 +677,14 @@ const std::string GlobeBrowsingModule::mrfCacheLocation() const { return _mrfCacheLocation; } +bool GlobeBrowsingModule::hasDefaultGeoPointTexture() const { + return _hasDefaultGeoPointTexture; +} + +std::string_view GlobeBrowsingModule::defaultGeoPointTexture() const { + return _defaultGeoPointTexturePath; +} + scripting::LuaLibrary GlobeBrowsingModule::luaLibrary() const { return { .name = "globebrowsing", @@ -648,10 +702,14 @@ scripting::LuaLibrary GlobeBrowsingModule::luaLibrary() const { codegen::lua::GetGeoPositionForCamera, codegen::lua::LoadWMSCapabilities, codegen::lua::RemoveWMSServer, - codegen::lua::CapabilitiesWMS + codegen::lua::CapabilitiesWMS, + codegen::lua::AddGeoJson, + codegen::lua::DeleteGeoJson, + codegen::lua::AddGeoJsonFromFile, }, .scripts = { - absPath("${MODULE_GLOBEBROWSING}/scripts/layer_support.lua") + absPath("${MODULE_GLOBEBROWSING}/scripts/layer_support.lua"), + absPath("${MODULE_GLOBEBROWSING}/scripts/node_support.lua") } }; } diff --git a/modules/globebrowsing/globebrowsingmodule.h b/modules/globebrowsing/globebrowsingmodule.h index 3902e5b663..783e027f2c 100644 --- a/modules/globebrowsing/globebrowsingmodule.h +++ b/modules/globebrowsing/globebrowsingmodule.h @@ -95,6 +95,9 @@ public: bool isMRFCachingEnabled() const; const std::string mrfCacheLocation() const; + bool hasDefaultGeoPointTexture() const; + std::string_view defaultGeoPointTexture() const; + protected: void internalInitialize(const ghoul::Dictionary&) override; @@ -113,6 +116,7 @@ private: properties::UIntProperty _tileCacheSizeMB; + properties::StringProperty _defaultGeoPointTexturePath; properties::BoolProperty _mrfCacheEnabled; properties::StringProperty _mrfCacheLocation; @@ -124,6 +128,8 @@ private: std::map _capabilitiesMap; std::multimap _urlList; + + bool _hasDefaultGeoPointTexture = false; }; } // namespace openspace diff --git a/modules/globebrowsing/globebrowsingmodule_lua.inl b/modules/globebrowsing/globebrowsingmodule_lua.inl index 9881a65fe0..21268feb04 100644 --- a/modules/globebrowsing/globebrowsingmodule_lua.inl +++ b/modules/globebrowsing/globebrowsingmodule_lua.inl @@ -530,6 +530,122 @@ getGeoPositionForCamera(bool useEyePosition = false) return res; } +/** + * Add a GeoJson layer specified by the given table to the globe specified by the + * 'globeName' argument + */ +[[codegen::luawrap]] void addGeoJson(std::string globeName, ghoul::Dictionary table) +{ + using namespace openspace; + using namespace globebrowsing; + + // Get the node and make sure it exists + SceneGraphNode* n = global::renderEngine->scene()->sceneGraphNode(globeName); + if (!n) { + throw ghoul::lua::LuaError("Unknown globe name: " + globeName); + } + + // Get the renderable globe + RenderableGlobe* globe = dynamic_cast(n->renderable()); + if (!globe) { + throw ghoul::lua::LuaError("Renderable is not a globe: " + globeName); + } + + // Get the dictionary defining the layer + globe->geoJsonManager().addGeoJsonLayer(table); +} + +/** + * Remove the GeoJson layer specified by the given table or string identifier from the + * globe specified by the 'globeName' argument + */ +[[codegen::luawrap]] void deleteGeoJson(std::string globeName, + std::variant tableOrIdentifier) +{ + using namespace openspace; + using namespace globebrowsing; + + // Get the node and make sure it exists + SceneGraphNode* n = global::renderEngine->scene()->sceneGraphNode(globeName); + if (!n) { + throw ghoul::lua::LuaError("Unknown globe name: " + globeName); + } + + // Get the renderable globe + RenderableGlobe* globe = dynamic_cast(n->renderable()); + if (!globe) { + throw ghoul::lua::LuaError("Renderable is not a globe: " + globeName); + } + + std::string identifier; + if (std::holds_alternative(tableOrIdentifier)) { + identifier = std::get(tableOrIdentifier); + } + else { + ghoul::Dictionary d = std::get(tableOrIdentifier); + if (!d.hasValue("Identifier")) { + throw ghoul::lua::LuaError( + "Table passed to deleteLayer does not contain an Identifier" + ); + } + identifier = d.value("Identifier"); + } + + globe->geoJsonManager().deleteLayer(identifier); +} + +/** + * Add a GeoJson layer from the given file name and add it to the current anchor node, + * if it is a globe. Note that you might have to increase the height offset for the + * added feature to be visible on the globe, if using a height map + */ +[[codegen::luawrap]] void addGeoJsonFromFile(std::string filename, + std::optional name) +{ + using namespace openspace; + using namespace globebrowsing; + + std::filesystem::path path = absPath(filename); + if (!std::filesystem::is_regular_file(path)) { + throw ghoul::lua::LuaError(fmt::format( + "Could not find the provided file: '{}'", filename + )); + } + + if (path.extension() != ".geojson") { + throw ghoul::lua::LuaError(fmt::format( + "Unexpected file type: '{}'. Expected '.geojson' file", filename + )); + } + + SceneGraphNode* n = global::renderEngine->scene()->sceneGraphNode( + global::navigationHandler->anchorNode()->identifier() + ); + if (!n) { + throw ghoul::lua::LuaError("Invalid anchor node"); + } + + RenderableGlobe* globe = dynamic_cast(n->renderable()); + if (!globe) { + throw ghoul::lua::LuaError( + "Current anchor is not a globe (Expected 'RenderableGlobe')" + ); + } + + // Make a minimal dictionary to represent the geojson component + ghoul::Dictionary d; + + std::string identifier = makeIdentifier(name.value_or(path.stem().string())); + d.setValue("Identifier", identifier); + d.setValue("File", path.string()); + if (name.has_value()) { + d.setValue("Name", *name); + } + + // Get the dictionary defining the layer + globe->geoJsonManager().addGeoJsonLayer(d); +} + #include "globebrowsingmodule_lua_codegen.cpp" } // namespace diff --git a/modules/globebrowsing/scripts/node_support.lua b/modules/globebrowsing/scripts/node_support.lua new file mode 100644 index 0000000000..800f6df164 --- /dev/null +++ b/modules/globebrowsing/scripts/node_support.lua @@ -0,0 +1,50 @@ +openspace.globebrowsing.documentation = { + { + Name = "setNodePosition", + Arguments = { nodeIdentifer = "String", globeIdentifier = "String", latitude = "Number", longitude = "Number", altitude = "Number" }, + Documentation = + "Sets the position of a SceneGraphNode that has GlobeTranslation/GlobeRotations. " .. + "Usage: openspace.globebrowsing.setNodePosition(" .. + "\"Scale_StatueOfLiberty\", \"Earth\", 40.000, -117.5, optionalAltitude)" + }, + { + Name = "setNodePositionFromCamera", + Arguments = { nodeIdentifer = "String", useAltitude = "Boolean" }, + Documentation = + "Sets the position of a SceneGraphNode that has GlobeTranslation/GlobeRotations" .. + " to match the camera. Only uses camera position not rotation. If useAltitude" .. + " is true, then the position will also be updated to the camera's altitude." .. + "Usage: openspace.globebrowsing.setNodePositionFromCamera(" .. + "\"Scale_StatueOfLiberty\", optionalUseAltitude)" + } +} + +openspace.globebrowsing.setNodePosition = function (node_identifer, globe_identifier, lat, lon, altitude) + openspace.setParent(node_identifer, globe_identifier) + openspace.setPropertyValueSingle('Scene.' .. node_identifer .. '.Translation.Globe', globe_identifier); + openspace.setPropertyValueSingle('Scene.' .. node_identifer .. '.Translation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.' .. node_identifer .. '.Translation.Longitude', lon); + openspace.setPropertyValueSingle('Scene.' .. node_identifer .. '.Rotation.Globe', globe_identifier); + openspace.setPropertyValueSingle('Scene.' .. node_identifer .. '.Rotation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.' .. node_identifer .. '.Rotation.Longitude', lon); + if (altitude) then + openspace.setPropertyValueSingle('Scene.' .. node_identifer .. '.Translation.Altitude', altitude); + openspace.setPropertyValueSingle('Scene.' .. node_identifer .. '.Translation.Altitude', altitude); + end +end + +openspace.globebrowsing.setNodePositionFromCamera = function (node_identifer, use_altitude) + local lat, lon, alt = openspace.globebrowsing.getGeoPositionForCamera(); + local camera = openspace.navigation.getNavigationState(); + openspace.setParent(node_identifer, camera.Anchor) + openspace.setPropertyValueSingle('Scene.' .. node_identifer .. '.Translation.Globe', camera.Anchor); + openspace.setPropertyValueSingle('Scene.' .. node_identifer .. '.Translation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.' .. node_identifer .. '.Translation.Longitude', lon); + openspace.setPropertyValueSingle('Scene.' .. node_identifer .. '.Rotation.Globe', camera.Anchor); + openspace.setPropertyValueSingle('Scene.' .. node_identifer .. '.Rotation.Latitude', lat); + openspace.setPropertyValueSingle('Scene.' .. node_identifer .. '.Rotation.Longitude', lon); + if (use_altitude) then + openspace.setPropertyValueSingle('Scene.' .. node_identifer .. '.Translation.Altitude', alt); + openspace.setPropertyValueSingle('Scene.' .. node_identifer .. '.Translation.Altitude', alt); + end +end diff --git a/modules/globebrowsing/shaders/geojson_fs.glsl b/modules/globebrowsing/shaders/geojson_fs.glsl new file mode 100644 index 0000000000..7cb33a3825 --- /dev/null +++ b/modules/globebrowsing/shaders/geojson_fs.glsl @@ -0,0 +1,76 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2023 * + * * + * 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 "fragment.glsl" + +in float vs_depth; +flat in vec3 vs_normal; +in vec4 vs_positionViewSpace; + +uniform vec3 color; +uniform float opacity; + +uniform float ambientIntensity = 0.2; +uniform float diffuseIntensity = 0.8; +uniform bool performShading = true; + +uniform unsigned int nLightSources; +uniform vec3 lightDirectionsViewSpace[8]; +uniform float lightIntensities[8]; + +const vec3 LightColor = vec3(1.0); + +Fragment getFragment() { + Fragment frag; + + if (opacity == 0.0) { + discard; + } + frag.color = vec4(color, opacity); + + // Simple diffuse phong shading based on light sources + if (performShading && nLightSources > 0) { + // @TODO: Fix faulty triangle normals. This should not have to be inverted + vec3 n = -normalize(vs_normal); + + // Ambient color + vec3 shadedColor = ambientIntensity * color; + + for (int i = 0; i < nLightSources; ++i) { + vec3 l = lightDirectionsViewSpace[i]; + + // Diffuse + vec3 diffuseColor = diffuseIntensity * max(dot(n,l), 0.0) * color; + + // Light contribution + shadedColor += lightIntensities[i] * (LightColor * diffuseColor); + } + frag.color.xyz = shadedColor; + } + + frag.depth = vs_depth; + frag.gPosition = vs_positionViewSpace; + frag.gNormal = vec4(0.0, 0.0, 0.0, 1.0); + return frag; +} diff --git a/modules/globebrowsing/shaders/geojson_points_fs.glsl b/modules/globebrowsing/shaders/geojson_points_fs.glsl new file mode 100644 index 0000000000..8ec728cb34 --- /dev/null +++ b/modules/globebrowsing/shaders/geojson_points_fs.glsl @@ -0,0 +1,62 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2023 * + * * + * 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 "fragment.glsl" + +flat in float vs_screenSpaceDepth; +in vec4 vs_positionViewSpace; +flat in vec3 vs_normal; // TODO: not needed for shading, remove somehow +in vec2 texCoord; + +uniform sampler2D pointTexture; +uniform bool hasTexture; +uniform vec3 color; +uniform float opacity; + +// Can be used to preserve the whites in a point texture +bool preserveWhite = true; + +Fragment getFragment() { + Fragment frag; + + if (hasTexture) { + frag.color = texture(pointTexture, texCoord); + if (!preserveWhite || frag.color.r * frag.color.g * frag.color.b < 0.95) { + frag.color.rgb *= color; + } + frag.color.a *= opacity; + } + else { + frag.color = vec4(color * vs_normal, opacity); + } + + if (frag.color.a < 0.01) { + discard; + } + + frag.depth = vs_screenSpaceDepth; + frag.gPosition = vs_positionViewSpace; + frag.gNormal = vec4(0.0, 0.0, 0.0, 1.0); + return frag; +} diff --git a/modules/globebrowsing/shaders/geojson_points_gs.glsl b/modules/globebrowsing/shaders/geojson_points_gs.glsl new file mode 100644 index 0000000000..9eda63fa98 --- /dev/null +++ b/modules/globebrowsing/shaders/geojson_points_gs.glsl @@ -0,0 +1,158 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2023 * + * * + * 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. * + ****************************************************************************************/ + +#version __CONTEXT__ + +#include "PowerScaling/powerScalingMath.hglsl" + +layout(points) in; +flat in vec3 normal[]; // Point normals correspond to globe out direction, model space +flat in float dynamicHeight[]; + +layout(triangle_strip, max_vertices = 4) out; +out vec2 texCoord; +flat out float vs_screenSpaceDepth; +out vec4 vs_positionViewSpace; +flat out vec3 vs_normal; + +// General settings +uniform dmat4 modelTransform; +uniform dmat4 viewTransform; +uniform dmat4 projectionTransform; + +uniform float heightOffset; +uniform bool useHeightMapData; + +// Camera information +uniform vec3 cameraUp; +uniform vec3 cameraRight; +uniform dvec3 cameraPosition; // world coordinates +uniform vec3 cameraLookUp; + +// Render mode +uniform int renderMode; +// OBS! Keep in sync with option property options +const int RenderOptionCameraDir = 0; +const int RenderOptionCameraPos = 1; +const int RenderOptionGlobeNormal = 2; +const int RenderOptionGlobeSurface = 3; + +uniform float pointSize; +uniform float textureWidthFactor; + +// If false, use the center +uniform bool useBottomAnchorPoint = true; + +const vec2 corners[4] = vec2[4]( + vec2(0.0, 0.0), + vec2(1.0, 0.0), + vec2(1.0, 1.0), + vec2(0.0, 1.0) +); + +void main() { + vec4 pos = gl_in[0].gl_Position; + vs_normal = normal[0]; + dvec4 dpos = dvec4(dvec3(pos.xyz), 1.0); + + // Offset position based on height information + if (length(pos.xyz) > 0) { + dvec3 outDirection = normalize(dvec3(dpos)); + float height = heightOffset; + if (useHeightMapData) { + height += dynamicHeight[0]; + } + dpos += dvec4(outDirection * double(height), 0.0); + } + // World coordinates + dpos = modelTransform * dpos; + vec3 worldNormal = normalize(mat3(modelTransform) * vs_normal); + + // Set up and right directions based on render mode. + // renderMode 0 is default + vec3 right = cameraRight; + vec3 up = cameraUp; + vec3 cameraToPosDir = vec3(normalize(cameraPosition - dpos.xyz)); + + // Update right and up based on render mode + if (renderMode == RenderOptionCameraPos) { + right = normalize(cross(cameraLookUp, cameraToPosDir)); + up = normalize(cross(cameraToPosDir, right)); + } + else if (renderMode == RenderOptionGlobeNormal) { + up = worldNormal; + right = normalize(cross(up, cameraToPosDir)); + } + else if (renderMode == RenderOptionGlobeSurface) { + // Compute up to be orthogonal to globe normal and camera right direction + up = normalize(cross(worldNormal, right)); + // Recompute right to be orthognal to globe normal + right = cross(up, worldNormal); + } + + dvec4 scaledRight = pointSize * dvec4(right, 0.0) * 0.5; + dvec4 scaledUp = pointSize * dvec4(up, 0.0) * 0.5; + + dmat4 cameraViewProjectionMatrix = projectionTransform * viewTransform; + + vec4 dposClip = vec4(cameraViewProjectionMatrix * dpos); + vec4 scaledRightClip = textureWidthFactor * vec4(cameraViewProjectionMatrix * scaledRight); + vec4 scaledUpClip = vec4(cameraViewProjectionMatrix * scaledUp); + + // Place anchor point at the bottom + vec4 bottomLeft = z_normalization(dposClip - scaledRightClip); + vec4 bottomRight = z_normalization(dposClip + scaledRightClip); + vec4 topRight = z_normalization(dposClip + 2 * scaledUpClip + scaledRightClip); + vec4 topLeft = z_normalization(dposClip + 2 * scaledUpClip - scaledRightClip); + + if (!useBottomAnchorPoint) { + // Place anchor point at the center + bottomLeft = z_normalization(dposClip - scaledRightClip - scaledUpClip); + bottomRight = z_normalization(dposClip + scaledRightClip - scaledUpClip); + topRight = z_normalization(dposClip + scaledUpClip + scaledRightClip); + topLeft = z_normalization(dposClip + scaledUpClip - scaledRightClip); + } + + vs_screenSpaceDepth = bottomLeft.w; + vs_positionViewSpace = vec4(viewTransform * dpos); + + // Build primitive + texCoord = corners[0]; + gl_Position = bottomLeft; + EmitVertex(); + + texCoord = corners[1]; + gl_Position = bottomRight; + EmitVertex(); + + texCoord = corners[3]; + gl_Position = topLeft; + EmitVertex(); + + texCoord = corners[2]; + gl_Position = topRight; + EmitVertex(); + + EndPrimitive(); +} diff --git a/modules/globebrowsing/shaders/geojson_points_vs.glsl b/modules/globebrowsing/shaders/geojson_points_vs.glsl new file mode 100644 index 0000000000..65f2b13780 --- /dev/null +++ b/modules/globebrowsing/shaders/geojson_points_vs.glsl @@ -0,0 +1,38 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2023 * + * * + * 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. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout(location = 0) in vec3 in_position; +layout(location = 1) in vec3 in_normal; +layout(location = 2) in float in_height; + +out vec3 normal; +out float dynamicHeight; + +void main() { + gl_Position = vec4(in_position, 1.0); + normal = in_normal; + dynamicHeight = in_height; +} diff --git a/modules/globebrowsing/shaders/geojson_vs.glsl b/modules/globebrowsing/shaders/geojson_vs.glsl new file mode 100644 index 0000000000..f414fac371 --- /dev/null +++ b/modules/globebrowsing/shaders/geojson_vs.glsl @@ -0,0 +1,64 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2023 * + * * + * 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. * + ****************************************************************************************/ + +#version __CONTEXT__ + +layout(location = 0) in vec3 in_position; +layout(location = 1) in vec3 in_normal; +layout(location = 2) in float in_height; + +out float vs_depth; +out vec3 vs_normal; +out vec4 vs_positionViewSpace; + +uniform dmat4 modelTransform; +uniform dmat4 viewTransform; +uniform dmat4 projectionTransform; +uniform mat3 normalTransform; + +uniform float heightOffset; +uniform bool useHeightMapData; + +void main() { + dvec4 modelPos = dvec4(in_position, 1.0); + + // Offset model pos based on height info + if (length(in_position) > 0) { + dvec3 outDirection = normalize(dvec3(in_position)); + float height = heightOffset; + if (useHeightMapData) { + height += in_height; + } + modelPos += dvec4(outDirection * double(height), 0.0); + } + + vs_positionViewSpace = vec4(viewTransform * modelTransform * modelPos); + vec4 positionScreenSpace = vec4(projectionTransform * vs_positionViewSpace); + vs_depth = positionScreenSpace.w; + vs_normal = normalize(normalTransform * in_normal); + gl_Position = positionScreenSpace; + + // Set z to 0 to disable near and far plane, unique handling for perspective in space + gl_Position.z = 0.0; +} diff --git a/modules/globebrowsing/src/dashboarditemglobelocation.cpp b/modules/globebrowsing/src/dashboarditemglobelocation.cpp index cbbfaff0dc..e6b49d161e 100644 --- a/modules/globebrowsing/src/dashboarditemglobelocation.cpp +++ b/modules/globebrowsing/src/dashboarditemglobelocation.cpp @@ -45,13 +45,16 @@ namespace { constexpr openspace::properties::Property::PropertyInfo DisplayFormatInfo = { "DisplayFormat", "Display Format", - "Choosing the format in which the camera location is displayed" + "Choosing the format in which the camera location is displayed", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SignificantDigitsInfo = { "SignificantDigits", "Significant Digits", - "Determines the number of significant digits that are shown in the location text" + "Determines the number of significant digits that are shown in the location text", + // @VISIBILITY(3.25) + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(DashboardItemGlobeLocation)]] Parameters { diff --git a/modules/globebrowsing/src/gdalwrapper.cpp b/modules/globebrowsing/src/gdalwrapper.cpp index 5e2019342d..980bddbcb3 100644 --- a/modules/globebrowsing/src/gdalwrapper.cpp +++ b/modules/globebrowsing/src/gdalwrapper.cpp @@ -41,14 +41,16 @@ namespace { "LogGdalErrors", "Log GDAL errors", "If this value is enabled, any error that is raised by GDAL will be logged using " - "the logmanager. If this value is disabled, any error will be ignored" + "the logmanager. If this value is disabled, any error will be ignored", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo GdalMaximumCacheInfo = { "GdalMaximumCacheSize", "GDAL maximum cache size", "This function sets the maximum amount of RAM memory in MB that GDAL is " - "permitted to use for caching" + "permitted to use for caching", + openspace::properties::Property::Visibility::AdvancedUser }; void gdalErrorHandler(CPLErr eErrClass, int, const char* msg) { diff --git a/modules/globebrowsing/src/geojson/geojsoncomponent.cpp b/modules/globebrowsing/src/geojson/geojsoncomponent.cpp new file mode 100644 index 0000000000..4b8387e35c --- /dev/null +++ b/modules/globebrowsing/src/geojson/geojsoncomponent.cpp @@ -0,0 +1,799 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2023 * + * * + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace geos_nlohmann = nlohmann; +#include +#include +#include + +namespace { + constexpr std::string_view _loggerCat = "GeoJsonComponent"; + + constexpr std::string_view KeyIdentifier = "Identifier"; + constexpr std::string_view KeyName = "Name"; + constexpr std::string_view KeyDesc = "Description"; + + constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { + "Enabled", + "Is Enabled", + "This setting determines whether this object will be visible or not", + openspace::properties::Property::Visibility::NoviceUser + }; + + constexpr openspace::properties::Property::PropertyInfo FileInfo = { + "File", + "File", + "Path to the GeoJSON file to base the rendering on", + openspace::properties::Property::Visibility::AdvancedUser + }; + + constexpr openspace::properties::Property::PropertyInfo HeightOffsetInfo = { + "HeightOffset", + "Height Offset", + "A height offset value, in meters. Useful for moving a feature closer to or " + "farther away from the surface", + openspace::properties::Property::Visibility::NoviceUser + }; + + constexpr openspace::properties::Property::PropertyInfo CoordinateOffsetInfo = { + "CoordinateOffset", + "Geographic Coordinate Offset", + "A latitude and longitude offset value, in decimal degrees. Can be used to " + "move the object on the surface and correct potential mismatches with other " + "renderings. Note that changing it during runtime leads to all positions being " + "recomputed", + openspace::properties::Property::Visibility::AdvancedUser + }; + + constexpr openspace::properties::Property::PropertyInfo DrawWireframeInfo = { + "DrawWireframe", + "Wireframe", + "If true, draw the wire frame of the polygons. Used for testing and to " + "investigate tessellation results", + openspace::properties::Property::Visibility::Developer + }; + + constexpr openspace::properties::Property::PropertyInfo PreventHeightUpdateInfo = { + "PreventHeightUpdate", + "Prevent Update From Heightmap", + "If true, the polygon mesh will not be automatically updated based on the " + "heightmap, even if the 'RelativeToGround' altitude option is set and the " + "heightmap updates. The data can still be force updated", + openspace::properties::Property::Visibility::AdvancedUser + }; + + constexpr openspace::properties::Property::PropertyInfo ForceUpdateHeightDataInfo = { + "ForceUpdateHeightData", + "Force Update Height Data", + "Triggering this leads to a recomputation of the heights based on the globe " + "height map value at the geometry's positions", + openspace::properties::Property::Visibility::AdvancedUser + }; + + constexpr openspace::properties::Property::PropertyInfo PointRenderModeInfo = { + "PointRenderMode", + "Points Aligned to", + "Decides how the billboards for the points should be rendered in terms of up " + "direction and whether the plane should face the camera. See details on the " + "different options in the wiki", + openspace::properties::Property::Visibility::User + }; + + constexpr openspace::properties::Property::PropertyInfo FlyToFeatureInfo = { + "FlyToFeature", + "Fly To Feature", + "Triggering this leads to the camera flying to a position that show the GeoJson " + "feature. The flight will account for any lat, long or height offset", + openspace::properties::Property::Visibility::NoviceUser + }; + + constexpr openspace::properties::Property::PropertyInfo CentroidCoordinateInfo = { + "CentroidCoordinate", + "Centroid Coordinate", + "The lat long coordinate of the centroid position of the read geometry. Note " + "that this value does not incude the offset", + openspace::properties::Property::Visibility::AdvancedUser + }; + + constexpr openspace::properties::Property::PropertyInfo BoundingBoxInfo = { + "BoundingBox", + "Bounding Box", + "The lat long coordinates of the lower and upper corner of the bounding box of " + "the read geometry. Note that this value does not incude the offset", + openspace::properties::Property::Visibility::AdvancedUser + }; + + constexpr openspace::properties::Property::PropertyInfo PointSizeScaleInfo = { + "PointSizeScale", + "Point Size Scale", + "An extra scale value that can be used to increase or decrease the scale of any " + "rendered points in the component, even if a value is set from the GeoJson file", + openspace::properties::Property::Visibility::NoviceUser + }; + + constexpr openspace::properties::Property::PropertyInfo LineWidthScaleInfo = { + "LineWidthScale", + "Line Width Scale", + "An extra scale value that can be used to increase or decrease the width of any " + "rendered lines in the component, even if a value is set from the GeoJson file. " + "Note that there is a max limit for how wide lines can be.", + openspace::properties::Property::Visibility::NoviceUser + }; + + struct [[codegen::Dictionary(GeoJsonComponent)]] Parameters { + // The unique identifier for this layer. May not contain '.' or spaces + std::string identifier; + + // A human-readable name for the user interface. If this is omitted, the + // identifier is used instead + std::optional name; + + // [[codegen::verbatim(EnabledInfo.description)]] + std::optional enabled; + + // The opacity of the component + std::optional opacity [[codegen::inrange(0.0, 1.0)]]; + + // A human-readable description of the layer to be used in informational texts + // presented to the user + std::optional description; + + // If true, ignore any height values that are given in the file. Coordinates with + // three values will then be treated as coordinates with only two values + std::optional ignoreHeights; + + // [[codegen::verbatim(PreventHeightUpdateInfo.description)]] + std::optional preventHeightUpdate; + + // [[codegen::verbatim(FileInfo.description)]] + std::filesystem::path file; + + // [[codegen::verbatim(HeightOffsetInfo.description)]] + std::optional heightOffset; + + // [[codegen::verbatim(PointSizeScaleInfo.description)]] + std::optional pointSizeScale; + + // [[codegen::verbatim(LineWidthScaleInfo.description)]] + std::optional lineWidthScale; + + // [[codegen::verbatim(CoordinateOffsetInfo.description)]] + std::optional coordinateOffset; + + enum class [[codegen::map(openspace::globebrowsing::GlobeGeometryFeature::PointRenderMode)]] PointRenderMode { + AlignToCameraDir [[codegen::key("Camera Direction")]], + AlignToCameraPos [[codegen::key("Camera Position")]], + AlignToGlobeNormal [[codegen::key("Globe Normal")]], + AlignToGlobeSurface [[codegen::key("Globe Surface")]] + }; + // [[codegen::verbatim(PointRenderModeInfo.description)]] + std::optional pointRenderMode; + + // [[codegen::verbatim(DrawWireframeInfo.description)]] + std::optional drawWireframe; + + // These properties will be used as default values for the geoJson rendering, + // meaning that they will be used when there is no value given for the + // individual geoJson features + std::optional defaultProperties + [[codegen::reference("globebrowsing_geojsonproperties")]]; + + // A list of light sources that this object should accept light from + std::optional> lightSources + [[codegen::reference("core_light_source")]]; + }; +#include "geojsoncomponent_codegen.cpp" +} // namespace + +namespace openspace::globebrowsing { + +documentation::Documentation GeoJsonComponent::Documentation() { + return codegen::doc("globebrowsing_geojsoncomponent"); +} + +GeoJsonComponent::SubFeatureProps::SubFeatureProps( + properties::PropertyOwner::PropertyOwnerInfo info) + : properties::PropertyOwner(info) + , enabled(EnabledInfo, true) + , flyToFeature(FlyToFeatureInfo) + , centroidLatLong( + CentroidCoordinateInfo, + glm::vec2(0.f), + glm::vec2(-90.f, -180.f), + glm::vec2(90.f, 180.f) + ) + , boundingboxLatLong( + BoundingBoxInfo, + glm::vec4(0.f), + glm::vec4(-90.f, -180.f, -90.f, -180.f), + glm::vec4(90.f, 180.f, 90.f, 180.f) + ) +{ + _opacity.setVisibility(openspace::properties::Property::Visibility::AdvancedUser); + addProperty(Fadeable::_opacity); + addProperty(Fadeable::_fade); + + addProperty(enabled); + + addProperty(flyToFeature); + + centroidLatLong.setReadOnly(true); + addProperty(centroidLatLong); + + boundingboxLatLong.setReadOnly(true); + addProperty(boundingboxLatLong); +} + +GeoJsonComponent::GeoJsonComponent(const ghoul::Dictionary& dictionary, + RenderableGlobe& globe) + : properties::PropertyOwner({ + dictionary.value(KeyIdentifier), + dictionary.hasKey(KeyName) ? dictionary.value(KeyName) : "", + dictionary.hasKey(KeyDesc) ? dictionary.value(KeyDesc) : "" + }) + , _enabled(EnabledInfo, true) + , _globeNode(globe) + , _geoJsonFile(FileInfo) + , _heightOffset(HeightOffsetInfo, 10.f, -1e12f, 1e12f) + , _latLongOffset( + CoordinateOffsetInfo, + glm::vec2(0.f), + glm::vec2(-90.0), + glm::vec2(90.f) + ) + , _pointSizeScale(PointSizeScaleInfo, 1.f, 0.01f, 100.f) + , _lineWidthScale(LineWidthScaleInfo, 1.f, 0.01f, 10.f) + , _drawWireframe(DrawWireframeInfo, false) + , _preventUpdatesFromHeightMap(PreventHeightUpdateInfo, false) + , _forceUpdateHeightData(ForceUpdateHeightDataInfo) + , _lightSourcePropertyOwner({ "LightSources", "Light Sources" }) + , _featuresPropertyOwner({ "Features", "Features" }) + , _pointRenderModeOption( + PointRenderModeInfo, + properties::OptionProperty::DisplayType::Dropdown + ) + , _centerLatLong( + CentroidCoordinateInfo, + glm::vec2(0.f), + glm::vec2(-90.f, -180.f), + glm::vec2(90.f, 180.f) + ) + , _flyToFeature(FlyToFeatureInfo) +{ + const Parameters p = codegen::bake(dictionary); + + _enabled = p.enabled.value_or(_enabled); + addProperty(_enabled); + + _opacity = p.opacity.value_or(_opacity); + addProperty(_opacity); + addProperty(_fade); + + _geoJsonFile = p.file.string(); + _geoJsonFile.setReadOnly(true); + addProperty(_geoJsonFile); + + _ignoreHeightsFromFile = p.ignoreHeights.value_or(_ignoreHeightsFromFile); + + const float minGlobeRadius = static_cast( + _globeNode.ellipsoid().minimumRadius() + ); + + _heightOffset = p.heightOffset.value_or(_heightOffset); + _heightOffset.onChange([this]() { _heightOffsetIsDirty = true; }); + constexpr float MinRadiusFactor = -0.9f; + constexpr float MaxRadiusFactor = 5.f; + _heightOffset.setMinValue(MinRadiusFactor * minGlobeRadius); + _heightOffset.setMaxValue(MaxRadiusFactor * minGlobeRadius); + addProperty(_heightOffset); + + _latLongOffset = p.coordinateOffset.value_or(_latLongOffset); + _latLongOffset.onChange([this]() { _dataIsDirty = true; }); + addProperty(_latLongOffset); + + _pointSizeScale = p.pointSizeScale.value_or(_pointSizeScale); + addProperty(_pointSizeScale); + + _lineWidthScale = p.lineWidthScale.value_or(_lineWidthScale); + addProperty(_lineWidthScale); + + if (p.defaultProperties.has_value()) { + _defaultProperties.createFromDictionary(*p.defaultProperties, _globeNode); + } + addPropertySubOwner(_defaultProperties); + + _defaultProperties.pointTexture.onChange([this]() { + std::filesystem::path texturePath = _defaultProperties.pointTexture.value(); + // Not ethat an empty texture is also valid => use default texture from module + if (std::filesystem::is_regular_file(texturePath) || texturePath.empty()) { + _textureIsDirty = true; + } + else { + LERROR(fmt::format( + "Provided texture file does not exist: '{}'", + _defaultProperties.pointTexture + )); + } + }); + + _defaultProperties.tessellation.enabled.onChange([this]() { _dataIsDirty = true; }); + _defaultProperties.tessellation.useLevel.onChange([this]() { _dataIsDirty = true; }); + _defaultProperties.tessellation.level.onChange([this]() { _dataIsDirty = true; }); + _defaultProperties.tessellation.distance.onChange([this]() { + _dataIsDirty = true; + }); + + _forceUpdateHeightData.onChange([this]() { + for (GlobeGeometryFeature& f : _geometryFeatures) { + f.updateHeightsFromHeightMap(); + } + }); + addProperty(_forceUpdateHeightData); + + _preventUpdatesFromHeightMap = + p.preventHeightUpdate.value_or(_preventUpdatesFromHeightMap); + addProperty(_preventUpdatesFromHeightMap); + + _drawWireframe = p.drawWireframe.value_or(_drawWireframe); + addProperty(_drawWireframe); + + using PointRenderMode = GlobeGeometryFeature::PointRenderMode; + _pointRenderModeOption.addOptions({ + { static_cast(PointRenderMode::AlignToCameraDir), "Camera Direction"}, + { static_cast(PointRenderMode::AlignToCameraPos), "Camera Position"}, + { static_cast(PointRenderMode::AlignToGlobeNormal), "Globe Normal"}, + { static_cast(PointRenderMode::AlignToGlobeSurface), "Globe Surface"} + }); + if (p.pointRenderMode.has_value()) { + _pointRenderModeOption = + static_cast(codegen::map(*p.pointRenderMode)); + } + addProperty(_pointRenderModeOption); + + _centerLatLong.setReadOnly(true); + addProperty(_centerLatLong); + + _flyToFeature.onChange([this]() { flyToFeature(); }); + addProperty(_flyToFeature); + + readFile(); + + if (p.lightSources.has_value()) { + std::vector lightsources = *p.lightSources; + + for (const ghoul::Dictionary& lsDictionary : lightsources) { + std::unique_ptr lightSource = + LightSource::createFromDictionary(lsDictionary); + _lightSourcePropertyOwner.addPropertySubOwner(lightSource.get()); + _lightSources.push_back(std::move(lightSource)); + } + } + else { + // If no light source provided, add a deafult light source from the camera + using namespace std::string_literals; + ghoul::Dictionary defaultLightSourceDict; + defaultLightSourceDict.setValue("Identifier", "Camera"s); + defaultLightSourceDict.setValue("Type", "CameraLightSource"s); + defaultLightSourceDict.setValue("Intensity", 1.0); + _lightSources.push_back( + LightSource::createFromDictionary(defaultLightSourceDict) + ); + _lightSourcePropertyOwner.addPropertySubOwner(_lightSources.back().get()); + } + addPropertySubOwner(_lightSourcePropertyOwner); + addPropertySubOwner(_featuresPropertyOwner); +} + +GeoJsonComponent::~GeoJsonComponent() {} + +bool GeoJsonComponent::enabled() const { + return _enabled; +} + +void GeoJsonComponent::initialize() { + ZoneScoped; + + for (const std::unique_ptr& ls : _lightSources) { + ls->initialize(); + } +} + +void GeoJsonComponent::initializeGL() { + ZoneScoped; + + _linesAndPolygonsProgram = global::renderEngine->buildRenderProgram( + "GeoLinesAndPolygonProgram", + absPath("${MODULE_GLOBEBROWSING}/shaders/geojson_vs.glsl"), + absPath("${MODULE_GLOBEBROWSING}/shaders/geojson_fs.glsl") + ); + + _pointsProgram = global::renderEngine->buildRenderProgram( + "GeoPointsProgram", + absPath("${MODULE_GLOBEBROWSING}/shaders/geojson_points_vs.glsl"), + absPath("${MODULE_GLOBEBROWSING}/shaders/geojson_points_fs.glsl"), + absPath("${MODULE_GLOBEBROWSING}/shaders/geojson_points_gs.glsl") + ); + + for (GlobeGeometryFeature& g : _geometryFeatures) { + g.initializeGL(_pointsProgram.get(), _linesAndPolygonsProgram.get()); + } +} + +void GeoJsonComponent::deinitializeGL() { + for (GlobeGeometryFeature& g : _geometryFeatures) { + g.deinitializeGL(); + } + + global::renderEngine->removeRenderProgram(_linesAndPolygonsProgram.get()); + _linesAndPolygonsProgram = nullptr; + + global::renderEngine->removeRenderProgram(_pointsProgram.get()); + _pointsProgram = nullptr; +} + +bool GeoJsonComponent::isReady() const { + bool isReady = std::all_of( + std::begin(_geometryFeatures), + std::end(_geometryFeatures), + std::mem_fn(&GlobeGeometryFeature::isReady) + ); + return isReady && _linesAndPolygonsProgram && _pointsProgram; +} + +void GeoJsonComponent::render(const RenderData& data) { + if (!_enabled || !isVisible()) { + return; + } + + // @TODO (2023-03-17, emmbr): Once the light source for the globe can be configured, + // this code should use the same light source as the globe + _lightsourceRenderData.updateBasedOnLightSources(data, _lightSources); + + // Change GL state: + glBlendFunc(GL_SRC_ALPHA, GL_ONE_MINUS_SRC_ALPHA); + glEnable(GL_BLEND); + glEnable(GL_DEPTH_TEST); + + if (_drawWireframe) { + glPolygonMode(GL_FRONT_AND_BACK, GL_LINE); + } + + using PointRenderMode = GlobeGeometryFeature::PointRenderMode; + PointRenderMode pointRenderMode = + static_cast(_pointRenderModeOption.value()); + + // Compose extra data from relevant properties to pass to the individual features + const GlobeGeometryFeature::ExtraRenderData extraRenderdata = { + _pointSizeScale, + _lineWidthScale, + pointRenderMode, + _lightsourceRenderData + }; + + // Do two render passes, to properly render opacity of overlaying objects + for (int renderPass = 0; renderPass < 2; ++renderPass) { + for (size_t i = 0; i < _geometryFeatures.size(); ++i) { + if (_features[i]->enabled && _features[i]->isVisible()) { + _geometryFeatures[i].render( + data, + renderPass, + opacity() * _features[i]->opacity(), + extraRenderdata + ); + } + } + } + + if (_drawWireframe) { + glPolygonMode(GL_FRONT_AND_BACK, GL_FILL); + } + + glBindVertexArray(0); + + // Restore GL State + global::renderEngine->openglStateCache().resetPolygonAndClippingState(); + global::renderEngine->openglStateCache().resetBlendState(); + global::renderEngine->openglStateCache().resetDepthState(); + global::renderEngine->openglStateCache().resetLineState(); +} + +void GeoJsonComponent::update() { + if (!_enabled || !isVisible()) { + return; + } + + glm::vec3 offsets = glm::vec3(_latLongOffset.value(), _heightOffset); + + for (size_t i = 0; i < _geometryFeatures.size(); ++i) { + if (!_features[i]->enabled) { + continue; + } + GlobeGeometryFeature& g = _geometryFeatures[i]; + + if (_dataIsDirty || _heightOffsetIsDirty) { + g.setOffsets(offsets); + } + + if (_textureIsDirty) { + g.updateTexture(); + } + + g.update(_dataIsDirty, _preventUpdatesFromHeightMap); + } + + _textureIsDirty = false; + _dataIsDirty = false; +} + +void GeoJsonComponent::readFile() { + std::ifstream file(_geoJsonFile); + + if (!file.good()) { + LERROR(fmt::format("Failed to open GeoJSON file: {}", _geoJsonFile)); + return; + } + + _geometryFeatures.clear(); + + std::string content( + (std::istreambuf_iterator(file)), + (std::istreambuf_iterator()) + ); + + // Parse GeoJSON string into GeoJSON objects + using namespace geos::io; + GeoJSONReader reader; + + try { + GeoJSONFeatureCollection fc = reader.readFeatures(content); + + for (const GeoJSONFeature& feature : fc.getFeatures()) { + parseSingleFeature(feature); + } + + if (_geometryFeatures.empty()) { + LWARNING(fmt::format( + "No GeoJson features could be successfully created for GeoJson layer " + "with identifier '{}'. Disabling layer.", identifier() + )); + _enabled = false; + } + } + catch (const geos::util::GEOSException& e) { + LERROR(fmt::format( + "Error creating GeoJson layer with identifier '{}'. Problem reading " + "GeoJson file '{}'. Error: '{}'", identifier(), _geoJsonFile, e.what() + )); + } + + computeMainFeatureMetaPropeties(); +} + +void GeoJsonComponent::parseSingleFeature(const geos::io::GeoJSONFeature& feature) { + // Read the geometry + const geos::geom::Geometry* geom = feature.getGeometry(); + ghoul_assert(geom, "No geometry found"); + + // Read the properties + GeoJsonOverrideProperties propsFromFile = propsFromGeoJson(feature); + + std::vector geomsToAdd; + if (geom->isPuntal()) { + // If points, handle all point features as one feature, even multi-points + geomsToAdd = { geom }; + } + else { + size_t nGeom = geom->getNumGeometries(); + geomsToAdd.reserve(nGeom); + for (size_t i = 0; i < nGeom; ++i) { + geomsToAdd.push_back(geom->getGeometryN(i)); + } + } + + // Split other collection features into multiple individual rendered components + + for (const geos::geom::Geometry* geometry : geomsToAdd) { + const int index = static_cast(_geometryFeatures.size()); + try { + GlobeGeometryFeature g(_globeNode, _defaultProperties, propsFromFile); + g.createFromSingleGeosGeometry(geometry, index, _ignoreHeightsFromFile); + g.initializeGL(_pointsProgram.get(), _linesAndPolygonsProgram.get()); + _geometryFeatures.push_back(std::move(g)); + + std::string name = _geometryFeatures.back().key(); + properties::PropertyOwner::PropertyOwnerInfo info = { + makeIdentifier(name), + name + // @TODO: Use description from file, if any + }; + _features.push_back(std::make_unique(info)); + + addMetaPropertiesToFeature(*_features.back(), index, geometry); + + _featuresPropertyOwner.addPropertySubOwner(_features.back().get()); + } + catch (const ghoul::MissingCaseException&) { + LERROR(fmt::format( + "Error creating GeoJson layer with identifier '{}'. Problem reading " + "feature {} in GeoJson file '{}'.", identifier(), index, _geoJsonFile + )); + // Do nothing + } + } +} + +void GeoJsonComponent::addMetaPropertiesToFeature(SubFeatureProps& feature, int index, + const geos::geom::Geometry* geometry) +{ + std::unique_ptr centroid = geometry->getCentroid(); + geos::geom::CoordinateXY centroidCoord = *centroid->getCoordinate(); + glm::vec2 centroidLatLong = glm::vec2(centroidCoord.y, centroidCoord.x); + feature.centroidLatLong = centroidLatLong; + + std::unique_ptr boundingbox = geometry->getEnvelope(); + std::unique_ptr coords = boundingbox->getCoordinates(); + glm::vec4 boundingboxLatLong; + if (boundingbox->isRectangle()) { + // A rectangle has 5 coordinates, where the first and third are two corners + boundingboxLatLong = glm::vec4( + (*coords)[0].y, + (*coords)[0].x, + (*coords)[2].y, + (*coords)[2].x + ); + } + else { + // Invalid boundingbox. Can happen e.g. for single points. + // Just add a degree to every direction from the centroid + boundingboxLatLong = glm::vec4( + centroidLatLong.x - 1.f, + centroidLatLong.y - 1.f, + centroidLatLong.x + 1.f, + centroidLatLong.y + 1.f + ); + } + + feature.boundingboxLatLong = boundingboxLatLong; + + // Compute the diagonal distance of the bounding box + Geodetic2 pos0 = { + glm::radians(boundingboxLatLong.x), + glm::radians(boundingboxLatLong.y) + }; + + Geodetic2 pos1 = { + glm::radians(boundingboxLatLong.z), + glm::radians(boundingboxLatLong.w) + }; + feature.boundingBoxDiagonal = static_cast( + std::abs(_globeNode.ellipsoid().greatCircleDistance(pos0, pos1)) + ); + + feature.flyToFeature.onChange([this, index]() { flyToFeature(index); }); +} + +void GeoJsonComponent::computeMainFeatureMetaPropeties() { + if (_features.empty()) { + return; + } + + glm::vec2 bboxLowerCorner = { + _features.front()->boundingboxLatLong.value().x, + _features.front()->boundingboxLatLong.value().y + }; + glm::vec2 bboxUpperCorner = { + _features.front()->boundingboxLatLong.value().z, + _features.front()->boundingboxLatLong.value().w + }; + + for (const std::unique_ptr& f : _features) { + // Update bbox corners + if (f->boundingboxLatLong.value().x < bboxLowerCorner.x) { + bboxLowerCorner.x = f->boundingboxLatLong.value().x; + } + if (f->boundingboxLatLong.value().y < bboxLowerCorner.y) { + bboxLowerCorner.y = f->boundingboxLatLong.value().y; + } + if (f->boundingboxLatLong.value().z > bboxUpperCorner.x) { + bboxUpperCorner.x = f->boundingboxLatLong.value().z; + } + if (f->boundingboxLatLong.value().w > bboxUpperCorner.y) { + bboxUpperCorner.y = f->boundingboxLatLong.value().w; + } + } + + // Identify the bounding box midpoints + _centerLatLong = 0.5f * (bboxLowerCorner + bboxUpperCorner); + + // Compute the diagonal distance (size) of the bounding box + Geodetic2 pos0 = { + glm::radians(bboxLowerCorner.x), + glm::radians(bboxLowerCorner.y) + }; + + Geodetic2 pos1 = { + glm::radians(bboxUpperCorner.x), + glm::radians(bboxUpperCorner.y) + }; + _bboxDiagonalSize = static_cast( + std::abs(_globeNode.ellipsoid().greatCircleDistance(pos0, pos1)) + ); +} + +void GeoJsonComponent::flyToFeature(std::optional index) const { + // General size properties + float diagonal = _bboxDiagonalSize; + float centroidLat = _centerLatLong.value().x; + float centroidLon = _centerLatLong.value().y; + + if (index.has_value()) { + const SubFeatureProps* f = _features[*index].get(); + diagonal = f->boundingBoxDiagonal; + centroidLat = f->centroidLatLong.value().x; + centroidLon = f->centroidLatLong.value().y; + } + + // Compute a good distance to travel to based on the feature's size. + // Assumes 80 degree FOV + constexpr float Angle = glm::radians(40.f); + float d = diagonal / glm::tan(Angle); + d += _heightOffset; + + float lat = centroidLat + _latLongOffset.value().x; + float lon = centroidLon + _latLongOffset.value().y; + + global::scriptEngine->queueScript( + fmt::format( + "openspace.globebrowsing.flyToGeo(\"{}\", {}, {}, {})", + _globeNode.owner()->identifier(), lat, lon, d + ), + scripting::ScriptEngine::RemoteScripting::Yes + ); +} + +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/src/geojson/geojsoncomponent.h b/modules/globebrowsing/src/geojson/geojsoncomponent.h new file mode 100644 index 0000000000..f1569fd38e --- /dev/null +++ b/modules/globebrowsing/src/geojson/geojsoncomponent.h @@ -0,0 +1,164 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2023 * + * * + * 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_GLOBEBROWSING___GEOJSONCOMPONENT___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GEOJSONCOMPONENT___H__ + +#include +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +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; } + +namespace openspace::globebrowsing { + +class RenderableGlobe; + +/** + * A component representing a collection of globe geometry features, whose details + * are read from a GeoJson file + */ +class GeoJsonComponent : public properties::PropertyOwner, public Fadeable { +public: + GeoJsonComponent(const ghoul::Dictionary& dictionary, RenderableGlobe& globe); + virtual ~GeoJsonComponent(); + + void initialize(); + void initializeGL(); + void deinitializeGL(); + + bool isReady() const; + bool enabled() const; + + void render(const RenderData& data); + void update(); + + static documentation::Documentation Documentation(); + +private: + /** + * Small helper class whose purpose is to encapsulate properties related to a + * specific geomoetry feature, and allow things like flying to or fadin out + * individual subfeatures + */ + class SubFeatureProps : public properties::PropertyOwner, public Fadeable { + public: + SubFeatureProps(properties::PropertyOwner::PropertyOwnerInfo info); + + properties::BoolProperty enabled; + properties::Vec2Property centroidLatLong; + properties::Vec4Property boundingboxLatLong; + properties::TriggerProperty flyToFeature; + float boundingBoxDiagonal = 0.f; + }; + + void readFile(); + void parseSingleFeature(const geos::io::GeoJSONFeature& feature); + + /** + * Add meta properties to the feature, to allow things like flying to it, + * identifying its location, etc + */ + void addMetaPropertiesToFeature(SubFeatureProps& feature, int index, + const geos::geom::Geometry* geometry); + + void computeMainFeatureMetaPropeties(); + + /** + * Trigger a flight to a feature in the collection. No index means to fly to an + * overview of all features in the collection. + */ + void flyToFeature(std::optional index = std::nullopt) const; + + std::vector _geometryFeatures; + + properties::BoolProperty _enabled; + properties::StringProperty _geoJsonFile; + properties::FloatProperty _heightOffset; + properties::Vec2Property _latLongOffset; + + properties::FloatProperty _pointSizeScale; + properties::FloatProperty _lineWidthScale; + + GeoJsonProperties _defaultProperties; + + properties::OptionProperty _pointRenderModeOption; + + properties::BoolProperty _drawWireframe; + properties::BoolProperty _preventUpdatesFromHeightMap; + properties::TriggerProperty _forceUpdateHeightData; + + RenderableGlobe& _globeNode; + + bool _ignoreHeightsFromFile = false; + + bool _dataIsDirty = true; + bool _heightOffsetIsDirty = false; + bool _dataIsInitialized = false; + bool _textureIsDirty = false; + + properties::Vec2Property _centerLatLong; + float _bboxDiagonalSize = 0.f; + properties::TriggerProperty _flyToFeature; + + std::vector> _lightSources; + std::unique_ptr _defaultLightSource; + + rendering::helper::LightSourceRenderData _lightsourceRenderData; + + properties::PropertyOwner _lightSourcePropertyOwner; + properties::PropertyOwner _featuresPropertyOwner; + std::vector> _features; + + std::unique_ptr _linesAndPolygonsProgram = nullptr; + std::unique_ptr _pointsProgram = nullptr; +}; + +} // namespace openspace::globebrowsing + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GEOJSONCOMPONENT___H__ diff --git a/modules/globebrowsing/src/geojson/geojsonmanager.cpp b/modules/globebrowsing/src/geojson/geojsonmanager.cpp new file mode 100644 index 0000000000..1b0850f4d2 --- /dev/null +++ b/modules/globebrowsing/src/geojson/geojsonmanager.cpp @@ -0,0 +1,146 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2023 * + * * + * 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 _loggerCat = "GeoJsonManager"; +} // namespace + +namespace openspace::globebrowsing { + +documentation::Documentation GeoJsonManager::Documentation() { + using namespace documentation; + return { + "GeoJsonManager", + "globebrowsing_geojsonmanager", + {} + }; +} + +// TODO: Gui name and description +GeoJsonManager::GeoJsonManager() : properties::PropertyOwner({ "GeoJson" }) {} + +void GeoJsonManager::initialize(RenderableGlobe* globe) { + ghoul_assert(globe, "No globe provided"); + _parentGlobe = globe; +} + +void GeoJsonManager::deinitializeGL() { + for (const std::unique_ptr& g : _geoJsonObjects) { + g->deinitializeGL(); + } +} + +bool GeoJsonManager::isReady() const { + bool isReady = std::all_of( + std::begin(_geoJsonObjects), + std::end(_geoJsonObjects), + [](const std::unique_ptr& g) { + return g->isReady(); + } + ); + return isReady; +} + +void GeoJsonManager::addGeoJsonLayer(const ghoul::Dictionary& layerDict) { + ZoneScoped + + try { + // Parse dictionary + documentation::testSpecificationAndThrow( + GeoJsonComponent::Documentation(), + layerDict, + "GeoJsonComponent" + ); + + std::string identifier = layerDict.value("Identifier"); + if (hasPropertySubOwner(identifier)) { + LERROR("GeoJson layer with identifier '" + identifier + "' already exists"); + return; + } + + // TODO: use owner instead of explicit parent? + std::unique_ptr geo = + std::make_unique(layerDict, *_parentGlobe); + + geo->initializeGL(); + + GeoJsonComponent* ptr = geo.get(); + _geoJsonObjects.push_back(std::move(geo)); + addPropertySubOwner(ptr); + } + catch (const documentation::SpecificationError& e) { + logError(e); + } + catch (const ghoul::RuntimeError& e) { + LERRORC(e.component, e.message); + } +} + +void GeoJsonManager::deleteLayer(const std::string& layerIdentifier) { + ZoneScoped + + for (auto it = _geoJsonObjects.begin(); it != _geoJsonObjects.end(); ++it) { + if (it->get()->identifier() == layerIdentifier) { + // we need to make a copy as the layerIdentifier is only a reference + // which will no longer be valid once it is deleted + std::string id = layerIdentifier; + removePropertySubOwner(it->get()); + (*it)->deinitializeGL(); + _geoJsonObjects.erase(it); + LINFO("Deleted GeoJson layer " + id); + return; + } + } + LERROR("Could not find GeoJson layer " + layerIdentifier); +} + +void GeoJsonManager::update() { + ZoneScoped + + for (std::unique_ptr& obj : _geoJsonObjects) { + if (obj->enabled()) { + obj->update(); + } + } +} + +void GeoJsonManager::render(const RenderData& data) { + ZoneScoped + + for (std::unique_ptr& obj : _geoJsonObjects) { + if (obj->enabled()) { + obj->render(data); + } + } +} + +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/src/geojson/geojsonmanager.h b/modules/globebrowsing/src/geojson/geojsonmanager.h new file mode 100644 index 0000000000..7349f60875 --- /dev/null +++ b/modules/globebrowsing/src/geojson/geojsonmanager.h @@ -0,0 +1,74 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2023 * + * * + * 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_GLOBEBROWSING___GEOJSONMANAGER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GEOJSONMANAGER___H__ + +#include + +#include + +#include +#include +#include + +namespace ghoul { class Dictionary; } +namespace openspace { struct RenderData; } +namespace openspace::documentation { struct Documentation; } + +namespace openspace::globebrowsing { + +class RenderableGlobe; + +/** + * Manages multiple GeoJSON objects of a globe + */ +class GeoJsonManager : public properties::PropertyOwner { +public: + GeoJsonManager(); + + void initialize(RenderableGlobe* globe); + void deinitializeGL(); + + bool isReady() const; + + void addGeoJsonLayer(const ghoul::Dictionary& layerDict); + //void addGeoJsonLayer(const std::string& filePath); // TODO: just add from file + void deleteLayer(const std::string& layerIdentifier); + + void update(); + void render(const RenderData& data); + + //void onChange(std::function callback); + + static documentation::Documentation Documentation(); + +private: + std::vector> _geoJsonObjects; + RenderableGlobe* _parentGlobe = nullptr; +}; + +} // namespace openspace::globebrowsing + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GEOJSONMANAGER___H__ diff --git a/modules/globebrowsing/src/geojson/geojsonproperties.cpp b/modules/globebrowsing/src/geojson/geojsonproperties.cpp new file mode 100644 index 0000000000..871136d132 --- /dev/null +++ b/modules/globebrowsing/src/geojson/geojsonproperties.cpp @@ -0,0 +1,617 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2023 * + * * + * 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 +#include + +// Keys used to read properties from GeoJson files +namespace geojson::propertykeys { + constexpr std::string_view Name = "name"; + constexpr std::string_view Description = "description"; + + constexpr std::string_view Opacity = "opacity"; + + constexpr std::array Color = { "color", "stroke" }; + constexpr std::array FillColor = { "fill", "fill-color" }; + constexpr std::string_view FillOpacity = "fill-opacity"; + constexpr std::string_view LineWidth = "stroke-width"; + + constexpr std::string_view PointSize = "point-size"; + constexpr std::array Texture = { "texture", "sprite", "point-texture" }; + + constexpr std::array PointTextureAnchor = { "point-anchor", "anchor" }; + constexpr std::string_view PointTextureAnchorBottom = "bottom"; + constexpr std::string_view PointTextureAnchorCenter = "center"; + + constexpr std::string_view Extrude = "extrude"; + + constexpr std::string_view PerformShading = "performShading"; + + constexpr std::string_view Tessellate = "tessellate"; + constexpr std::string_view TessellationLevel = "tessellationLevel"; + constexpr std::string_view TessellationMaxDistance = "tessellationDistance"; + + constexpr std::string_view AltitudeMode = "altitudeMode"; + constexpr std::string_view AltitudeModeClamp = "clampToGround"; + constexpr std::string_view AltitudeModeAbsolute = "absolute"; + constexpr std::string_view AltitudeModeRelative = "relativeToGround"; +} // namespace geojson::propertykeys + +namespace { + using PropertyInfo = openspace::properties::Property::PropertyInfo; + + template + bool keyMatches(const std::string_view key, + const std::array& keyAlternativesArray, + std::optional propInfo = std::nullopt) + { + auto it = std::find(keyAlternativesArray.begin(), keyAlternativesArray.end(), key); + if (it != keyAlternativesArray.end()) { + return true; + } + + if (propInfo.has_value() && key == (*propInfo).identifier) { + return true; + } + + return false; + } + + bool keyMatches(const std::string_view key, const std::string_view keyAlternative, + std::optional propInfo = std::nullopt) + { + const std::array array = { keyAlternative }; + return keyMatches(key, array, propInfo); + } + + glm::vec3 hexToRbg(std::string_view hexColor) { + int r, g, b; + // @TODO: Consider using scn::scan instead of sscanf + int ret = std::sscanf(hexColor.data(), "#%02x%02x%02x", &r, &g, &b); + // @TODO: Handle return value to validate color + return (1.f / 255.f) * glm::vec3(r, g, b); + } + + glm::vec3 getColorValue(const geos::io::GeoJSONValue& value) { + glm::vec3 color; + if (value.isArray()) { + const std::vector& val = value.getArray(); + if (val.size() != 3) { + // @TODO: Should add some more information on which file the reading failed for + LERRORC("GeoJson", fmt::format( + "Failed reading color property. Expected 3 values, got {}", val.size() + )); + } + // @TODO Use verifiers to verify color values + // @TODO Parse values given in RGB in ranges 0-255? + color = glm::vec3( + static_cast(val.at(0).getNumber()), + static_cast(val.at(1).getNumber()), + static_cast(val.at(2).getNumber()) + ); + } + else if (value.isString()) { + const std::string hex = value.getString(); + // @TODO Verify color + color = hexToRbg(hex); + } + return color; + }; + + constexpr openspace::properties::Property::PropertyInfo OpacityInfo = { + "Opacity", + "Opacity", + "This value determines the opacity of this object. A value of 0 means " + "completely transparent", + openspace::properties::Property::Visibility::NoviceUser + }; + + constexpr openspace::properties::Property::PropertyInfo ColorInfo = { + "Color", + "Color", + "The color of the rendered geometry. For points it will be used as a multiply" + "color for any provided texture", + openspace::properties::Property::Visibility::NoviceUser + }; + + constexpr openspace::properties::Property::PropertyInfo FillOpacityInfo = { + "FillOpacity", + "Fill Opacity", + "This value determines the opacity of the filled portion of a polygon. Will " + "also be used for extruded features", + openspace::properties::Property::Visibility::NoviceUser + }; + + constexpr openspace::properties::Property::PropertyInfo FillColorInfo = { + "FillColor", + "Fill Color", + "The color of the filled portion of a rendered polygon. Will also be used for " + "extruded features", + openspace::properties::Property::Visibility::NoviceUser + }; + + constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = { + "LineWidth", + "Line Width", + "The width of any rendered lines", + openspace::properties::Property::Visibility::User + }; + + constexpr openspace::properties::Property::PropertyInfo PointSizeInfo = { + "PointSize", + "Point Size", + "The size of any rendered points. The size will be scaled based on the " + "bounding sphere of the globe", + openspace::properties::Property::Visibility::NoviceUser + }; + + constexpr openspace::properties::Property::PropertyInfo PointTextureInfo = { + "PointTexture", + "Point Texture", + "A texture to be used for rendering points. No value means to use the default " + "texture provided by the GlobeBrowsing module. If no texture is provided there " + "either, the point will be rendered as a plane and colored by the color value.", + openspace::properties::Property::Visibility::User + }; + + constexpr openspace::properties::Property::PropertyInfo ExtrudeInfo = { + "Extrude", + "Extrude", + "If true, extrude the mesh or line to intersect the globe", + openspace::properties::Property::Visibility::User + }; + + constexpr openspace::properties::Property::PropertyInfo PerformShadingInfo = { + "PerformShading", + "Perform Shading", + "If true, perform shading on any create meshes, either from polygons or " + "extruded lines. The shading will be computed based on any light sources of the " + "GeoJson component", + openspace::properties::Property::Visibility::User + }; + + constexpr openspace::properties::Property::PropertyInfo AltitudeModeInfo = { + "AltitudeMode", + "Altitude Mode", + "The altitude mode decides how any height values of the geo coordinates should " + "be interpreted. Absolute means that the height is interpreted as the height " + "above the reference ellipsoid, while RelativeToGround takes the height map " + "into account. For coordinates with only two values (latitude and longitude), " + "the height is considered to be equal to zero", + openspace::properties::Property::Visibility::User + }; + + constexpr openspace::properties::Property::PropertyInfo PointAnchorOptionInfo = { + "PointTextureAnchor", + "Point Texture Anchor", + "Decides the placement of the point texture in relation to the position. " + "Default is a the bottom of the texture, but it can also be put at the center", + openspace::properties::Property::Visibility::User + }; + + constexpr openspace::properties::Property::PropertyInfo TessellationEnabledInfo = { + "Enabled", + "Enabled", + "If false, no tessellation to bend the geometry based on the curvature of the " + "planet is performed. This leads to increased performance, but tessellation is " + "neccessary for large geometry that spans a big portion of the globe. Otherwise " + "it may intersect the surface", + openspace::properties::Property::Visibility::User + }; + + constexpr openspace::properties::Property::PropertyInfo UseTessellationLevelInfo = { + "UseTessellationLevel", + "Use Tessellation Level", + "If true, use the 'Tesselation Level' to control the level of detail for the " + "tessellation. The distance used will be the 'Tesselation Distance' divided by " + "the 'Tesselation Level', so the higher the level value, the smaller each " + "segment in the geomoetry will be", + openspace::properties::Property::Visibility::AdvancedUser + }; + + constexpr openspace::properties::Property::PropertyInfo TessellationLevelInfo = { + "TessellationLevel", + "Tessellation Level", + "When manual tessellation is enabled, this value will be used to determine how " + "much tessellation to apply. The resulting distance used for subdividing the " + "geometry will be the 'Tessellation Distance' divided by this value. Zero means " + "to use the 'Tessellation Distance' as is.", + openspace::properties::Property::Visibility::AdvancedUser + }; + + constexpr openspace::properties::Property::PropertyInfo TessellationDistanceInfo = { + "TessellationDistance", + "Tessellation Distance", + "Defult distance to use for tessellation of line and polygon geometry. Anything " + "larger than this distance will be automatically subdivided into smaller pieces " + "matching this distance, while anything smaller will not be subdivided. Per " + "default this will be set to a distance corresponding to about 1 degree " + "longitude on the globe", + openspace::properties::Property::Visibility::AdvancedUser + }; + + struct [[codegen::Dictionary(GeoJsonProperties)]] Parameters { + // [[codegen::verbatim(OpacityInfo.description)]] + std::optional opacity [[codegen::inrange(0.0, 1.0)]]; + + // [[codegen::verbatim(ColorInfo.description)]] + std::optional color [[codegen::color()]]; + + // [[codegen::verbatim(FillOpacityInfo.description)]] + std::optional fillOpacity [[codegen::inrange(0.0, 1.0)]]; + + // [[codegen::verbatim(FillColorInfo.description)]] + std::optional fillColor [[codegen::color()]]; + + // [[codegen::verbatim(LineWidthInfo.description)]] + std::optional lineWidth [[codegen::greater(0.0)]]; + + // [[codegen::verbatim(PointSizeInfo.description)]] + std::optional pointSize [[codegen::greater(0.0)]]; + + // [[codegen::verbatim(PointTextureInfo.description)]] + std::optional pointTexture; + + // [[codegen::verbatim(ExtrudeInfo.description)]] + std::optional extrude; + + // [[codegen::verbatim(PerformShadingInfo.description)]] + std::optional performShading; + + enum class [[codegen::map(openspace::globebrowsing::GeoJsonProperties::AltitudeMode)]] AltitudeMode { + Absolute, + RelativeToGround + }; + // [[codegen::verbatim(AltitudeModeInfo.description)]] + std::optional altitudeMode; + + enum class [[codegen::map(openspace::globebrowsing::GeoJsonProperties::PointTextureAnchor)]] PointTextureAnchor { + Bottom, + Center + }; + // [[codegen::verbatim(PointAnchorOptionInfo.description)]] + std::optional pointTextureAnchor; + + struct Tessellation { + // [[codegen::verbatim(TessellationEnabledInfo.description)]] + std::optional ebabled; + + // [[codegen::verbatim(UseTessellationLevelInfo.description)]] + std::optional useTessellationLevel; + + // [[codegen::verbatim(TessellationLevelInfo.description)]] + std::optional tessellationLevel; + + // [[codegen::verbatim(TessellationDistanceInfo.description)]] + std::optional tessellationDistance; + }; + std::optional tessellation; + }; +#include "geojsonproperties_codegen.cpp" +} // namespace + +namespace openspace::globebrowsing { + +documentation::Documentation GeoJsonProperties::Documentation() { + return codegen::doc("globebrowsing_geojsonproperties"); +} + +GeoJsonProperties::Tessellation::Tessellation() + : properties::PropertyOwner({ "Tessellation" }) + , enabled(TessellationEnabledInfo, true) + , useLevel(UseTessellationLevelInfo, false) + , level(TessellationLevelInfo, 10, 0, 100) + , distance(TessellationDistanceInfo, 100000.f, 0.f, 1e12f) +{ + addProperty(enabled); + addProperty(distance); + addProperty(level); + addProperty(useLevel); +} + +GeoJsonProperties::GeoJsonProperties() + : properties::PropertyOwner({ "DefaultProperties" }) + , opacity(OpacityInfo, 1.f, 0.f, 1.f) + , color(ColorInfo, glm::vec3(1.f), glm::vec3(0.f), glm::vec3(1.f)) + , fillOpacity(FillOpacityInfo, 0.7f, 0.f, 1.f) + , fillColor(FillColorInfo, glm::vec3(0.5f), glm::vec3(0.f), glm::vec3(1.f)) + , lineWidth(LineWidthInfo, 2.f, 0.01f, 10.f) + , pointSize(PointSizeInfo, 10.f, 0.01f, 100.f) + , pointTexture(PointTextureInfo) + , extrude(ExtrudeInfo, false) + , performShading(PerformShadingInfo, false) + , altitudeModeOption( + AltitudeModeInfo, + properties::OptionProperty::DisplayType::Dropdown + ) + , pointAnchorOption( + PointAnchorOptionInfo, + properties::OptionProperty::DisplayType::Dropdown + ) +{ + addProperty(opacity); + color.setViewOption(properties::Property::ViewOptions::Color); + addProperty(color); + addProperty(fillOpacity); + fillColor.setViewOption(properties::Property::ViewOptions::Color); + addProperty(fillColor); + + addProperty(lineWidth); + + addProperty(pointSize); + addProperty(pointTexture); + + addProperty(extrude); + addProperty(performShading); + + altitudeModeOption.addOptions({ + { static_cast(AltitudeMode::Absolute), "Absolute"}, + { static_cast(AltitudeMode::RelativeToGround), "Relative to Ground" } + //{ static_cast(AltitudeMode::ClampToGround), "Clamp to Ground" } / TODO: add ClampToGround + }); + addProperty(altitudeModeOption); + + pointAnchorOption.addOptions({ + { static_cast(PointTextureAnchor::Bottom), "Bottom"}, + { static_cast(PointTextureAnchor::Center), "Center" } + }); + addProperty(pointAnchorOption); + + addPropertySubOwner(tessellation); +} + +void GeoJsonProperties::createFromDictionary(const ghoul::Dictionary& dictionary, + const RenderableGlobe& globe) +{ + const Parameters p = codegen::bake(dictionary); + opacity = p.opacity.value_or(opacity); + color = p.color.value_or(color); + + fillOpacity = p.fillOpacity.value_or(fillOpacity); + fillColor = p.fillColor.value_or(fillColor); + + lineWidth = p.lineWidth.value_or(lineWidth); + + pointSize = p.pointSize.value_or(pointSize); + + if (p.pointTexture.has_value()) { + pointTexture = *p.pointTexture; + } + + if (p.pointTextureAnchor.has_value()) { + pointAnchorOption = static_cast(codegen::map( + *p.pointTextureAnchor + )); + } + + extrude = p.extrude.value_or(extrude); + performShading = p.performShading.value_or(performShading); + + if (p.altitudeMode.has_value()) { + altitudeModeOption = static_cast(codegen::map(*p.altitudeMode)); + } + + // Set up default value and max value for tessellation distance based on globe size. + // Distances are computed based on a certain lat/long angle size + constexpr float DefaultAngle = glm::radians(1.f); + constexpr float MaxAngle = glm::radians(45.f); + float defaultDistance = globe.ellipsoid().longitudalDistance(0.f, 0.f, DefaultAngle); + float maxDistance = globe.ellipsoid().longitudalDistance(0.f, 0.f, MaxAngle); + tessellation.distance = defaultDistance; + tessellation.distance.setMaxValue(maxDistance); + + if (p.tessellation.has_value()) { + const Parameters::Tessellation pTess = (*p.tessellation); + tessellation.enabled = pTess.useTessellationLevel.value_or(tessellation.enabled); + tessellation.useLevel = + pTess.useTessellationLevel.value_or(tessellation.useLevel); + tessellation.level = pTess.tessellationLevel.value_or(tessellation.level); + tessellation.distance = + pTess.tessellationDistance.value_or(tessellation.distance); + } +} + +GeoJsonProperties::AltitudeMode GeoJsonProperties::altitudeMode() const { + return static_cast(altitudeModeOption.value()); +} + +GeoJsonProperties::PointTextureAnchor GeoJsonProperties::pointTextureAnchor() const { + return static_cast(pointAnchorOption.value()); +} + +GeoJsonOverrideProperties propsFromGeoJson(const geos::io::GeoJSONFeature& feature) { + const std::map& props = feature.getProperties(); + GeoJsonOverrideProperties result; + + auto parseProperty = [&result](const std::string_view key, + const geos::io::GeoJSONValue& value) + { + using namespace geojson; + + if (keyMatches(key, propertykeys::Name)) { + result.name = value.getString(); + } + else if (keyMatches(key, propertykeys::Opacity, OpacityInfo)) { + result.opacity = static_cast(value.getNumber()); + } + else if (keyMatches(key, propertykeys::Color, ColorInfo)) { + result.color = getColorValue(value); + } + else if (keyMatches(key, propertykeys::FillOpacity, FillOpacityInfo)) { + result.fillOpacity = static_cast(value.getNumber()); + } + else if (keyMatches(key, propertykeys::FillColor, FillColorInfo)) { + result.fillColor = getColorValue(value); + } + else if (keyMatches(key, propertykeys::LineWidth, LineWidthInfo)) { + result.lineWidth = static_cast(value.getNumber()); + } + else if (keyMatches(key, propertykeys::PointSize, PointSizeInfo)) { + result.pointSize = static_cast(value.getNumber()); + } + else if (keyMatches(key, propertykeys::Texture, PointTextureInfo)) { + result.pointTexture = value.getString(); + } + else if (keyMatches(key, propertykeys::PointTextureAnchor, PointAnchorOptionInfo)) + { + std::string mode = value.getString(); + + if (mode == propertykeys::PointTextureAnchorBottom) { + result.pointTextureAnchor = GeoJsonProperties::PointTextureAnchor::Bottom; + } + else if (mode == propertykeys::PointTextureAnchorCenter) { + result.pointTextureAnchor = GeoJsonProperties::PointTextureAnchor::Center; + } + else { + LERRORC("GeoJson", fmt::format( + "Point texture anchor mode '{}' not supported", mode + )); + } + } + else if (keyMatches(key, propertykeys::Extrude, ExtrudeInfo)) { + result.extrude = value.getBoolean(); + } + else if (keyMatches(key, propertykeys::AltitudeMode, AltitudeModeInfo)) { + std::string mode = value.getString(); + + if (mode == propertykeys::AltitudeModeAbsolute) { + result.altitudeMode = GeoJsonProperties::AltitudeMode::Absolute; + } + else if (mode == propertykeys::AltitudeModeRelative) { + result.altitudeMode = GeoJsonProperties::AltitudeMode::RelativeToGround; + } + // @TODO Include when support is implemented + //else if (mode == propertykeys::AltitudeModeClamp) { + // result.altitudeMode = GeoJsonProperties::AltitudeMode::ClampToGround; + //} + else { + LERRORC("GeoJson", fmt::format( + "Altitude mode '{}' not supported", mode + )); + } + } + else if (keyMatches(key, propertykeys::Tessellate, TessellationEnabledInfo)) { + result.tessellationEnabled = value.getBoolean(); + } + else if (keyMatches(key, propertykeys::TessellationLevel, TessellationLevelInfo)) { + result.useTessellationLevel = true; + result.tessellationLevel = static_cast(value.getNumber()); + } + else if (keyMatches(key, propertykeys::TessellationMaxDistance, TessellationDistanceInfo)) { + result.tessellationDistance = static_cast(value.getNumber()); + } + }; + + for (auto const& [key, value] : props) { + try { + parseProperty(key, value); + } + catch (const geos::io::GeoJSONValue::GeoJSONTypeError&) { + // @TODO: Should add some more information on which file the reading failed for + LERRORC("GeoJson", fmt::format( + "Error reading GeoJson property '{}'. Value has wrong type", key + )); + } + } + + return result; +} + +float PropertySet::opacity() const { + return overrideValues.opacity.value_or(defaultValues.opacity); +} + +glm::vec3 PropertySet::color() const { + return overrideValues.color.value_or(defaultValues.color); +} + +float PropertySet::fillOpacity() const { + return overrideValues.fillOpacity.value_or(defaultValues.fillOpacity); +} + +glm::vec3 PropertySet::fillColor() const { + return overrideValues.fillColor.value_or(defaultValues.fillColor); +} + +float PropertySet::lineWidth() const { + return overrideValues.lineWidth.value_or(defaultValues.lineWidth); +} + +float PropertySet::pointSize() const { + return overrideValues.pointSize.value_or(defaultValues.pointSize); +} + +std::string PropertySet::pointTexture() const { + return overrideValues.pointTexture.value_or(defaultValues.pointTexture); +} + +GeoJsonProperties::PointTextureAnchor PropertySet::pointTextureAnchor() const { + return overrideValues.pointTextureAnchor.value_or( + defaultValues.pointTextureAnchor() + ); +} + +bool PropertySet::extrude() const { + return overrideValues.extrude.value_or(defaultValues.extrude); +} + +bool PropertySet::performShading() const { + return overrideValues.performShading.value_or(defaultValues.performShading); +} + +GeoJsonProperties::AltitudeMode PropertySet::altitudeMode() const { + return overrideValues.altitudeMode.value_or(defaultValues.altitudeMode()); +} + +bool PropertySet::tessellationEnabled() const { + return overrideValues.tessellationEnabled.value_or(defaultValues.tessellation.enabled); +} + +bool PropertySet::useTessellationLevel() const { + return overrideValues.useTessellationLevel.value_or( + defaultValues.tessellation.useLevel + ); +} + +int PropertySet::tessellationLevel() const { + return overrideValues.tessellationLevel.value_or(defaultValues.tessellation.level); +} + +float PropertySet::tessellationDistance() const { + return overrideValues.tessellationDistance.value_or( + defaultValues.tessellation.distance + ); +} + +bool PropertySet::hasOverrideTexture() const { + return overrideValues.pointTexture.has_value(); +} + +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/src/geojson/geojsonproperties.h b/modules/globebrowsing/src/geojson/geojsonproperties.h new file mode 100644 index 0000000000..de5bab77ee --- /dev/null +++ b/modules/globebrowsing/src/geojson/geojsonproperties.h @@ -0,0 +1,151 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2023 * + * * + * 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_GLOBEBROWSING___GEOJSONPROPERTIES___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GEOJSONPROPERTIES___H__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace geos::io { class GeoJSONFeature; } + +namespace openspace::globebrowsing { + +class RenderableGlobe; + +struct GeoJsonProperties : public properties::PropertyOwner { + GeoJsonProperties(); + void createFromDictionary(const ghoul::Dictionary& dictionary, + const RenderableGlobe& globe); + + static documentation::Documentation Documentation(); + + // These are based on the KML specification + enum class AltitudeMode { + // Compute position as an altitude above the reference ellipsoid + Absolute = 0, + // Compute position using altitude above the height map + RelativeToGround + // Stick to planet surface (TODO: use GDAL to render layer instead and use as default) + //ClampToGround + }; + + enum class PointTextureAnchor { + Bottom = 0, + Center + }; + + struct Tessellation : public properties::PropertyOwner { + Tessellation(); + properties::BoolProperty enabled; + properties::BoolProperty useLevel; + properties::IntProperty level; + properties::FloatProperty distance; + } tessellation; + + AltitudeMode altitudeMode() const; + PointTextureAnchor pointTextureAnchor() const; + + properties::FloatProperty opacity; + properties::Vec3Property color; + properties::FloatProperty fillOpacity; + properties::Vec3Property fillColor; + properties::FloatProperty lineWidth; + + properties::FloatProperty pointSize; + properties::StringProperty pointTexture; + properties::OptionProperty pointAnchorOption; + + properties::BoolProperty extrude; + properties::BoolProperty performShading; + properties::OptionProperty altitudeModeOption; +}; + +// Optional versions of all the properties above, that can be read from a geoJson file +// and used to override any default values +struct GeoJsonOverrideProperties { + std::optional name; + + std::optional opacity; + std::optional color; + std::optional fillOpacity; + std::optional fillColor; + std::optional lineWidth; + + std::optional pointSize; + std::optional pointTexture; + std::optional pointTextureAnchor; + + std::optional extrude; + std::optional performShading; + std::optional altitudeMode; + + std::optional tessellationEnabled; + std::optional useTessellationLevel; + std::optional tessellationLevel; + std::optional tessellationDistance; +}; + +GeoJsonOverrideProperties propsFromGeoJson(const geos::io::GeoJSONFeature& feature); + +struct PropertySet { + // This value set should be a reference to the main component's propertyowner + GeoJsonProperties& defaultValues; + // This is a unique set of properties to use for overriding the default values + GeoJsonOverrideProperties overrideValues; + + float opacity() const; + glm::vec3 color() const; + float fillOpacity() const; + glm::vec3 fillColor() const; + float lineWidth() const; + + float pointSize() const; + std::string pointTexture() const; + GeoJsonProperties::PointTextureAnchor pointTextureAnchor() const; + + bool extrude() const; + bool performShading() const; + GeoJsonProperties::AltitudeMode altitudeMode() const; + + bool tessellationEnabled() const; + bool useTessellationLevel() const; + int tessellationLevel() const; + float tessellationDistance() const; + + bool hasOverrideTexture() const; +}; + +} // namespace openspace::globebrowsing + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GEOJSONPROPERTIES___H__ diff --git a/modules/globebrowsing/src/geojson/globegeometryfeature.cpp b/modules/globebrowsing/src/geojson/globegeometryfeature.cpp new file mode 100644 index 0000000000..d771fc63e8 --- /dev/null +++ b/modules/globebrowsing/src/geojson/globegeometryfeature.cpp @@ -0,0 +1,914 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2023 * + * * + * 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 +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +namespace { + constexpr const char* _loggerCat = "GlobeGeometryFeature"; + + constexpr std::chrono::milliseconds HeightUpdateInterval(10000); +} // namespace + +namespace openspace::globebrowsing { + +void GlobeGeometryFeature::RenderFeature::initializeBuffers() { + if (vaoId == 0) { + glGenVertexArrays(1, &vaoId); + } + if (vboId == 0) { + glGenBuffers(1, &vboId); + } +} + +GlobeGeometryFeature::GlobeGeometryFeature(const RenderableGlobe& globe, + GeoJsonProperties& defaultProperties, + GeoJsonOverrideProperties& overrideProperties) + : _globe(globe) + , _properties({ defaultProperties, overrideProperties }) + , _lastHeightUpdateTime(std::chrono::system_clock::now()) +{} + +std::string GlobeGeometryFeature::key() const { + return _key; +} + +void GlobeGeometryFeature::setOffsets(const glm::vec3& value) { + _offsets = value; +} + +void GlobeGeometryFeature::initializeGL(ghoul::opengl::ProgramObject* pointsProgram, + ghoul::opengl::ProgramObject* linesAndPolygonsProgram) +{ + _pointsProgram = pointsProgram; + _linesAndPolygonsProgram = linesAndPolygonsProgram; + + if (isPoints()) { + updateTexture(true); + } +} + +void GlobeGeometryFeature::deinitializeGL() { + for (const RenderFeature& r : _renderFeatures) { + glDeleteVertexArrays(1, &r.vaoId); + glDeleteBuffers(1, &r.vboId); + } + + _pointTexture = nullptr; +} + +bool GlobeGeometryFeature::isReady() const { + bool shadersAreReady = _linesAndPolygonsProgram && _pointsProgram; + bool textureIsReady = (!_hasTexture) || _pointTexture; + return shadersAreReady && textureIsReady; +} + +bool GlobeGeometryFeature::isPoints() const { + return _type == GeometryType::Point; +} + +bool GlobeGeometryFeature::useHeightMap() const { + return _properties.altitudeMode() == + GeoJsonProperties::AltitudeMode::RelativeToGround; +} + +void GlobeGeometryFeature::updateTexture(bool isInitializeStep) { + std::string texture; + GlobeBrowsingModule* m = global::moduleEngine->module(); + + if (!isInitializeStep && _properties.hasOverrideTexture()) { + // Here we don't necessarily have to update, since it should have been + // created at initialization. Do nothing + return; + } + else if (!_properties.pointTexture().empty()) { + texture = _properties.pointTexture(); + } + else if (m->hasDefaultGeoPointTexture()) { + texture = m->defaultGeoPointTexture(); + } + else { + // No texture => render without texture + _hasTexture = false; + _pointTexture = nullptr; + return; + } + + if (isInitializeStep || !_pointTexture) { + _pointTexture = std::make_unique(2); + _pointTexture->setFilterMode(ghoul::opengl::Texture::FilterMode::AnisotropicMipMap); + _pointTexture->setWrapping(ghoul::opengl::Texture::WrappingMode::ClampToEdge); + } + + std::filesystem::path texturePath = absPath(texture); + if (std::filesystem::is_regular_file(texturePath)) { + _hasTexture = true; + _pointTexture->loadFromFile(texture); + _pointTexture->uploadToGpu(); + } + else { + LERROR(fmt::format( + "Trying to use texture file that does not exist: {} ", texturePath + )); + } +} + +void GlobeGeometryFeature::createFromSingleGeosGeometry(const geos::geom::Geometry* geo, + int index, bool ignoreHeights) +{ + ghoul_assert(geo, "No geometry provided"); + ghoul_assert( + geo->isPuntal() || !geo->isCollection(), + "Non-point geometry can not be a collection" + ); + + switch (geo->getGeometryTypeId()) { + case geos::geom::GEOS_POINT: + case geos::geom::GEOS_MULTIPOINT: { + _geoCoordinates.push_back(geometryhelper::geometryCoordsAsGeoVector(geo)); + _type = GeometryType::Point; + break; + } + case geos::geom::GEOS_LINESTRING: { + _geoCoordinates.push_back(geometryhelper::geometryCoordsAsGeoVector(geo)); + _type = GeometryType::LineString; + break; + } + case geos::geom::GEOS_POLYGON: { + try { + const geos::geom::Polygon* p = dynamic_cast(geo); + + // Triangles + // Note that Constrained Delaunay triangulation supports polygons with holes :) + std::vector triCoords; + TriList triangles; + using geos::triangulate::polygon::ConstrainedDelaunayTriangulator; + ConstrainedDelaunayTriangulator::triangulatePolygon(p, triangles); + + triCoords.reserve(3 * triangles.size()); + + // Add three coordinates per triangle. Note flipped winding order + // (want counter clockwise, but GEOS provides clockwise) + for (const Tri* t : triangles) { + triCoords.push_back(t->getCoordinate(0)); + triCoords.push_back(t->getCoordinate(2)); + triCoords.push_back(t->getCoordinate(1)); + } + _triangleCoordinates = geometryhelper::coordsToGeodetic(triCoords); + + // Boundaries / Lines + + // Normalize to make sure rings have correct orientation + std::unique_ptr pNormalized = p->clone(); + pNormalized->normalize(); + + const geos::geom::LinearRing* outerRing = pNormalized->getExteriorRing(); + std::vector outerBoundsGeoCoords = + geometryhelper::geometryCoordsAsGeoVector(outerRing); + + if (!outerBoundsGeoCoords.empty()) { + int nHoles = static_cast(pNormalized->getNumInteriorRing()); + _geoCoordinates.reserve(nHoles + 1); + + // Outer bounds + _geoCoordinates.push_back(outerBoundsGeoCoords); + + // Inner bounds (holes) + for (int i = 0; i < nHoles; ++i) { + const geos::geom::LinearRing* hole = pNormalized->getInteriorRingN(i); + std::vector ringGeoCoords = + geometryhelper::geometryCoordsAsGeoVector(hole); + + _geoCoordinates.push_back(ringGeoCoords); + } + } + + _type = GeometryType::Polygon; + } + catch (geos::util::IllegalStateException&) { + LERROR("Non-simple (e.g. self-intersecting) polygons not supported yet"); + throw ghoul::MissingCaseException(); + + // TODO: handle self-intersections points + // https://www.sciencedirect.com/science/article/pii/S0304397520304199 + } + break; + } + default: + throw ghoul::MissingCaseException(); + } + + // Reset height values if we don't care about them + if (ignoreHeights) { + for (std::vector& vec : _geoCoordinates) { + for (Geodetic3& coord : vec) { + coord.height = 0.0; + } + } + } + + // Compute reference positions to use for checking if height map changes + geos::geom::Coordinate centroid; + geo->getCentroid(centroid); + Geodetic3 geoCentroid = geometryhelper::coordsToGeodetic({ centroid }).front(); + _heightUpdateReferencePoints.push_back(std::move(geoCentroid)); +; + std::vector envelopeGeoCoords = + geometryhelper::geometryCoordsAsGeoVector(geo->getEnvelope().get()); + + _heightUpdateReferencePoints.insert( + _heightUpdateReferencePoints.end(), + envelopeGeoCoords.begin(), + envelopeGeoCoords.end() + ); + + if (_properties.overrideValues.name.has_value()) { + _key = *_properties.overrideValues.name; + } + else { + _key = fmt::format("Feature {} - {}", index, geo->getGeometryType()); + } +} + +void GlobeGeometryFeature::render(const RenderData& renderData, int pass, + float mainOpacity, + const ExtraRenderData& extraRenderData) +{ + ghoul_assert(pass >= 0 && pass < 2, "Render pass variable out of accepted range"); + + float opacity = mainOpacity * _properties.opacity(); + float fillOpacity = mainOpacity * _properties.fillOpacity(); + + const glm::dmat4 globeModelTransform = _globe.modelTransform(); + const glm::dmat4 modelViewTransform = + renderData.camera.combinedViewMatrix() * globeModelTransform; + + const glm::mat3 normalTransform = glm::mat3( + glm::transpose(glm::inverse(modelViewTransform)) + ); + + const glm::dmat4 projectionTransform = renderData.camera.projectionMatrix(); + +#ifndef __APPLE__ + glLineWidth(_properties.lineWidth() * extraRenderData.lineWidthScale); +#else + glLineWidth(1.f); +#endif + + for (const RenderFeature& r : _renderFeatures) { + if (r.isExtrusionFeature && !_properties.extrude()) { + continue; + } + + bool shouldRenderTwice = r.type == RenderType::Polygon && + fillOpacity < 1.f && _properties.extrude(); + + if (pass > 0 && !shouldRenderTwice) { + continue; + } + + ghoul::opengl::ProgramObject* shader = (r.type == RenderType::Points) ? + _pointsProgram : _linesAndPolygonsProgram; + + shader->activate(); + shader->setUniform("modelTransform", globeModelTransform); + shader->setUniform("viewTransform", renderData.camera.combinedViewMatrix()); + shader->setUniform("projectionTransform", projectionTransform); + + shader->setUniform("heightOffset", _offsets.z); + shader->setUniform("useHeightMapData", useHeightMap()); + + if (shader == _linesAndPolygonsProgram) { + const rendering::helper::LightSourceRenderData& ls = + extraRenderData.lightSourceData; + shader->setUniform("normalTransform", normalTransform); + shader->setUniform("nLightSources", ls.nLightSources); + shader->setUniform("lightIntensities", ls.intensitiesBuffer); + shader->setUniform("lightDirectionsViewSpace", ls.directionsViewSpaceBuffer); + } + + glBindVertexArray(r.vaoId); + + switch (r.type) { + case RenderType::Lines: + shader->setUniform( + "opacity", + r.isExtrusionFeature ? fillOpacity : opacity + ); + renderLines(r); + break; + case RenderType::Points: { + shader->setUniform("opacity", opacity); + float scale = extraRenderData.pointSizeScale; + renderPoints(r, renderData, extraRenderData.pointRenderMode, scale); + break; + } + case RenderType::Polygon: { + shader->setUniform("opacity", fillOpacity); + renderPolygons(r, shouldRenderTwice, pass); + break; + } + default: + throw ghoul::MissingCaseException(); + break; + } + + shader->deactivate(); + } + + glBindVertexArray(0); + + // Reset when we're done rendering all the polygon features + global::renderEngine->openglStateCache().resetPolygonAndClippingState(); +} + +void GlobeGeometryFeature::renderPoints(const RenderFeature& feature, + const RenderData& renderData, + const PointRenderMode& renderMode, + float sizeScale) const +{ + ghoul_assert(feature.type == RenderType::Points, "Trying to render faulty geometry"); + _pointsProgram->setUniform("color", _properties.color()); + + float bs = static_cast(_globe.boundingSphere()); + float size = 0.001f * sizeScale * _properties.pointSize() * bs; + _pointsProgram->setUniform("pointSize", size); + + _pointsProgram->setUniform("renderMode", static_cast(renderMode)); + + using TextureAnchor = GeoJsonProperties::PointTextureAnchor; + _pointsProgram->setUniform( + "useBottomAnchorPoint", + _properties.pointTextureAnchor() != TextureAnchor::Center + ); + + // Points are rendered as billboards + glm::dvec3 cameraViewDirectionWorld = -renderData.camera.viewDirectionWorldSpace(); + glm::dvec3 cameraUpDirectionWorld = renderData.camera.lookUpVectorWorldSpace(); + glm::dvec3 orthoRight = glm::normalize( + glm::cross(cameraUpDirectionWorld, cameraViewDirectionWorld) + ); + if (orthoRight == glm::dvec3(0.0)) { + // For some reason, the up vector and camera view vecter were the same. Use a + // slightly different vector + glm::dvec3 otherVector = glm::vec3( + cameraUpDirectionWorld.y, + cameraUpDirectionWorld.x, + cameraUpDirectionWorld.z + ); + orthoRight = glm::normalize(glm::cross(otherVector, cameraViewDirectionWorld)); + } + glm::dvec3 orthoUp = glm::normalize(glm::cross(cameraViewDirectionWorld, orthoRight)); + + _pointsProgram->setUniform("cameraUp", glm::vec3(orthoUp)); + _pointsProgram->setUniform("cameraRight", glm::vec3(orthoRight)); + + glm::dvec3 cameraPositionWorld = renderData.camera.positionVec3(); + _pointsProgram->setUniform("cameraPosition", cameraPositionWorld); + _pointsProgram->setUniform("cameraLookUp", glm::vec3(cameraUpDirectionWorld)); + + if (_pointTexture && _hasTexture) { + ghoul::opengl::TextureUnit unit; + unit.activate(); + _pointTexture->bind(); + _pointsProgram->setUniform("pointTexture", unit); + _pointsProgram->setUniform("hasTexture", true); + + float widthHeightRatio = static_cast(_pointTexture->texture()->width()) / + static_cast(_pointTexture->texture()->height()); + _pointsProgram->setUniform("textureWidthFactor", widthHeightRatio); + } + else { + glBindTexture(GL_TEXTURE_2D, 0); + _pointsProgram->setUniform("hasTexture", false); + } + + glEnable(GL_PROGRAM_POINT_SIZE); + glDrawArrays(GL_POINTS, 0, static_cast(feature.nVertices)); + glDisable(GL_PROGRAM_POINT_SIZE); +} + +void GlobeGeometryFeature::renderLines(const RenderFeature& feature) const { + ghoul_assert(feature.type == RenderType::Lines, "Trying to render faulty geometry"); + + const glm::vec3 color = feature.isExtrusionFeature ? + _properties.fillColor() : _properties.color(); + + _linesAndPolygonsProgram->setUniform("color", color); + _linesAndPolygonsProgram->setUniform("performShading", false); + + glEnable(GL_LINE_SMOOTH); + glDrawArrays(GL_LINE_STRIP, 0, static_cast(feature.nVertices)); + glDisable(GL_LINE_SMOOTH); +} + +void GlobeGeometryFeature::renderPolygons(const RenderFeature& feature, + bool shouldRenderTwice, int renderPass) const +{ + ghoul_assert(renderPass == 0 || renderPass == 1, "Invalid render pass"); + ghoul_assert( + feature.type == RenderType::Polygon, + "Trying to render faulty geometry" + ); + + _linesAndPolygonsProgram->setUniform("color", _properties.fillColor()); + _linesAndPolygonsProgram->setUniform("performShading", _properties.performShading()); + + if (shouldRenderTwice) { + glEnable(GL_CULL_FACE); + // First draw back faces, then front faces + glCullFace(renderPass == 0 ? GL_FRONT : GL_BACK); + } + else { + glDisable(GL_CULL_FACE); + } + glDrawArrays(GL_TRIANGLES, 0, static_cast(feature.nVertices)); +} + +bool GlobeGeometryFeature::shouldUpdateDueToHeightMapChange() const { + if (_properties.altitudeMode() == GeoJsonProperties::AltitudeMode::RelativeToGround) { + // Cap the update to a given time interval + std::chrono::system_clock::time_point now = std::chrono::system_clock::now(); + if (now - _lastHeightUpdateTime < HeightUpdateInterval) { + return false; + } + + // TODO: Change computation so that we return true immediately if even one height value is different + + // Check if last height values for the control positions have changed + std::vector newHeights = getCurrentReferencePointsHeights(); + + bool isSame = std::equal( + _lastControlHeights.begin(), + _lastControlHeights.end(), + newHeights.begin(), + newHeights.end(), + [](double a, double b) { + return std::abs(a - b) < std::numeric_limits::epsilon(); + } + ); + + if (!isSame) { + return true; + } + } + return false; +} + +void GlobeGeometryFeature::update(bool dataIsDirty, bool preventHeightUpdates) { + if (!preventHeightUpdates && shouldUpdateDueToHeightMapChange()) { + updateHeightsFromHeightMap(); + } + else if (dataIsDirty) { + updateGeometry(); + } + + if (_pointTexture) { + _pointTexture->update(); + } +} + +void GlobeGeometryFeature::updateGeometry() { + // Update vertex data and compute model coordinates based on globe + _renderFeatures.clear(); + + if (_type == GeometryType::Point) { + createPointGeometry(); + } + else { + std::vector> edgeVertices = createLineGeometry(); + createExtrudedGeometry(edgeVertices); + createPolygonGeometry(); + } + + // Compute new heights - to see if height map changed + _lastControlHeights = getCurrentReferencePointsHeights(); +} + +void GlobeGeometryFeature::updateHeightsFromHeightMap() { + // @TODO: do the updating piece by piece, not all in one frame + for (RenderFeature& f : _renderFeatures) { + f.heights = geometryhelper::heightMapHeightsFromGeodetic2List( + _globe, + f.vertices + ); + bufferDynamicHeightData(f); + } + + _lastHeightUpdateTime = std::chrono::system_clock::now(); +} + +std::vector> GlobeGeometryFeature::createLineGeometry() { + std::vector> resultPositions; + resultPositions.reserve(_geoCoordinates.size()); + + for (int i = 0; i < _geoCoordinates.size(); ++i) { + std::vector vertices; + std::vector positions; + vertices.reserve(_geoCoordinates[i].size() * 3); // TODO: this is not correct anymore + positions.reserve(_geoCoordinates[i].size() * 3); // TODO: this is not correct anymore + + glm::dvec3 lastPos = glm::dvec3(0.0); + double lastHeightValue = 0.0; + + bool isFirst = true; + for (const Geodetic3& geodetic : _geoCoordinates[i]) { + glm::dvec3 v = geometryhelper::computeOffsetedModelCoordinate( + geodetic, + _globe, + _offsets.x, + _offsets.y + ); + + auto addLinePos = [&vertices, &positions](glm::vec3 pos) { + vertices.push_back({ pos.x, pos.y, pos.z, 0.f, 0.f, 0.f }); + positions.push_back(pos); + }; + + if (isFirst) { + lastPos = v; + lastHeightValue = geodetic.height; + isFirst = false; + addLinePos(glm::vec3(v)); + continue; + } + + float length = static_cast(glm::distance(lastPos, v)); + + if (_properties.tessellationEnabled()) { + // Tessellate. + // But first, determine the step size for the tessellation (larger + // features will not be tesselated) + float stepSize = tessellationStepSize(); + + std::vector subdividedPositions = + geometryhelper::subdivideLine( + lastPos, + v, + lastHeightValue, + geodetic.height, + stepSize + ); + + // Don't add the first position. Has been added as last in previous step + for (int si = 1; si < subdividedPositions.size(); ++si) { + const geometryhelper::PosHeightPair& pair = subdividedPositions[si]; + addLinePos(glm::vec3(pair.position)); + } + } + else { + // Just add the line point + addLinePos(glm::vec3(v)); + } + + lastPos = v; + lastHeightValue = geodetic.height; + } + + vertices.shrink_to_fit(); + + RenderFeature feature; + feature.nVertices = vertices.size(); + feature.type = RenderType::Lines; + initializeRenderFeature(feature, vertices); + _renderFeatures.push_back(std::move(feature)); + + positions.shrink_to_fit(); + resultPositions.push_back(std::move(positions)); + } + + resultPositions.shrink_to_fit(); + return resultPositions; +} + +void GlobeGeometryFeature::createPointGeometry() { + if (_type != GeometryType::Point) { + return; + } + + for (size_t i = 0; i < _geoCoordinates.size(); ++i) { + std::vector vertices; + vertices.reserve(_geoCoordinates[i].size()); + + std::vector extrudedLineVertices; + extrudedLineVertices.reserve(2 * _geoCoordinates[i].size()); + + for (const Geodetic3& geodetic : _geoCoordinates[i]) { + glm::dvec3 v = geometryhelper::computeOffsetedModelCoordinate( + geodetic, + _globe, + _offsets.x, + _offsets.y + ); + + glm::vec3 vf = static_cast(v); + // Normal is the out direction + glm::vec3 normal = glm::normalize(vf); + + vertices.push_back({ vf.x, vf.y, vf.z, normal.x, normal.y, normal.z }); + + // Lines from center of the globe out to the point + extrudedLineVertices.push_back({ 0.f, 0.f, 0.f, 0.f, 0.f, 0.f }); + extrudedLineVertices.push_back({ vf.x, vf.y, vf.z, 0.f, 0.f, 0.f }); + } + + vertices.shrink_to_fit(); + extrudedLineVertices.shrink_to_fit(); + + RenderFeature feature; + feature.nVertices = vertices.size(); + feature.type = RenderType::Points; + initializeRenderFeature(feature, vertices); + _renderFeatures.push_back(std::move(feature)); + + // Create extrusion feature + RenderFeature extrudeFeature; + extrudeFeature.nVertices = extrudedLineVertices.size(); + extrudeFeature.type = RenderType::Lines; + extrudeFeature.isExtrusionFeature = true; + initializeRenderFeature(extrudeFeature, extrudedLineVertices); + _renderFeatures.push_back(std::move(extrudeFeature)); + } +} + +void GlobeGeometryFeature::createExtrudedGeometry( + const std::vector>& edgeVertices) +{ + if (edgeVertices.empty()) { + return; + } + + std::vector vertices = + geometryhelper::createExtrudedGeometryVertices(edgeVertices); + + RenderFeature feature; + feature.type = RenderType::Polygon; + feature.nVertices = vertices.size(); + feature.isExtrusionFeature = true; + initializeRenderFeature(feature, vertices); + _renderFeatures.push_back(std::move(feature)); +} + +void GlobeGeometryFeature::createPolygonGeometry() { + if (_triangleCoordinates.empty()) { + return; + } + + std::vector polyVertices; + + // Create polygon vertices from the triangle coordinates + int triIndex = 0; + std::array triPositions; + std::array triHeights; + for (const Geodetic3& geodetic : _triangleCoordinates) { + const glm::vec3 vert = geometryhelper::computeOffsetedModelCoordinate( + geodetic, + _globe, + _offsets.x, + _offsets.y + ); + triPositions[triIndex] = vert; + triHeights[triIndex] = geodetic.height; + triIndex++; + + // Once we have a triangle, start subdividing + if (triIndex == 3) { + triIndex = 0; + + const glm::vec3 v0 = triPositions[0]; + const glm::vec3 v1 = triPositions[1]; + const glm::vec3 v2 = triPositions[2]; + + double h0 = triHeights[0]; + double h1 = triHeights[1]; + double h2 = triHeights[2]; + + if (_properties.tessellationEnabled()) { + // First determine the step size for the tessellation (larger features + // will not be tesselated) + float stepSize = tessellationStepSize(); + + std::vector verts = geometryhelper::subdivideTriangle( + v0, v1, v2, + h0, h1, h2, + stepSize, + _globe + ); + polyVertices.insert(polyVertices.end(), verts.begin(), verts.end()); + } + else { + // Just add a triangle consisting of the three vertices + const glm::vec3 n = -glm::normalize(glm::cross(v1 - v0, v2 - v0)); + polyVertices.push_back({ v0.x, v0.y, v0.z, n.x, n.y, n.z }); + polyVertices.push_back({ v1.x, v1.y, v1.z, n.x, n.y, n.z }); + polyVertices.push_back({ v2.x, v2.y, v2.z, n.x, n.y, n.z }); + } + } + } + + RenderFeature triFeature; + triFeature.type = RenderType::Polygon; + triFeature.nVertices = polyVertices.size(); + initializeRenderFeature(triFeature, polyVertices); + _renderFeatures.push_back(std::move(triFeature)); +} + +void GlobeGeometryFeature::initializeRenderFeature(RenderFeature& feature, + const std::vector& vertices) +{ + // Get height map heights + feature.vertices = geometryhelper::geodetic2FromVertexList(_globe, vertices); + feature.heights = geometryhelper::heightMapHeightsFromGeodetic2List( + _globe, + feature.vertices + ); + + // Generate buffers and buffer data + feature.initializeBuffers(); + bufferVertexData(feature, vertices); +} + +float GlobeGeometryFeature::tessellationStepSize() const { + float distance = _properties.tessellationDistance(); + bool shouldDivideDistance = _properties.useTessellationLevel() && + _properties.tessellationLevel() > 0; + + if (shouldDivideDistance) { + distance /= static_cast(_properties.tessellationLevel()); + } + + return distance; +} + +std::vector GlobeGeometryFeature::getCurrentReferencePointsHeights() const { + std::vector newHeights; + newHeights.reserve(_heightUpdateReferencePoints.size()); + for (const Geodetic3& geo : _heightUpdateReferencePoints) { + const glm::dvec3 p = geometryhelper::computeOffsetedModelCoordinate( + geo, + _globe, + _offsets.x, + _offsets.y + ); + const SurfacePositionHandle handle = _globe.calculateSurfacePositionHandle(p); + newHeights.push_back(handle.heightToSurface); + } + return newHeights; +} + +void GlobeGeometryFeature::bufferVertexData(const RenderFeature& feature, + const std::vector& vertexData) +{ + ghoul_assert(_pointsProgram, "Shader program must be initialized"); + ghoul_assert(_linesAndPolygonsProgram, "Shader program must be initialized"); + + ghoul::opengl::ProgramObject* program = _linesAndPolygonsProgram; + if (feature.type == RenderType::Points) { + program = _pointsProgram; + } + + // Reserve space for both vertex and dynamic height information + auto fullBufferSize = vertexData.size() * (sizeof(Vertex) + sizeof(float)); + + glBindVertexArray(feature.vaoId); + glBindBuffer(GL_ARRAY_BUFFER, feature.vboId); + glBufferData( + GL_ARRAY_BUFFER, + fullBufferSize, + nullptr, + GL_STATIC_DRAW + ); + + glBufferSubData( + GL_ARRAY_BUFFER, + 0, // offset + vertexData.size() * sizeof(Vertex), // size + vertexData.data() + ); + + GLint positionAttrib = program->attributeLocation("in_position"); + glEnableVertexAttribArray(positionAttrib); + glVertexAttribPointer( + positionAttrib, + 3, + GL_FLOAT, + GL_FALSE, + sizeof(Vertex), + nullptr + ); + + GLint normalAttrib = program->attributeLocation("in_normal"); + glEnableVertexAttribArray(normalAttrib); + glVertexAttribPointer( + normalAttrib, + 3, + GL_FLOAT, + GL_FALSE, + sizeof(Vertex), + reinterpret_cast(3 * sizeof(float)) + ); + + // Put height data after all vertex data in buffer + unsigned long long endOfVertexData = vertexData.size() * sizeof(Vertex); + glBindVertexArray(feature.vaoId); + glBindBuffer(GL_ARRAY_BUFFER, feature.vboId); + glBufferSubData( + GL_ARRAY_BUFFER, + endOfVertexData, // offset + feature.heights.size() * sizeof(float), // size of all height values + feature.heights.data() + ); + + GLint heightAttrib = program->attributeLocation("in_height"); + glEnableVertexAttribArray(heightAttrib); + glVertexAttribPointer( + heightAttrib, + 1, + GL_FLOAT, + GL_FALSE, + 1 * sizeof(float), // stride (one height value) + reinterpret_cast(endOfVertexData) // start position + ); + + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindVertexArray(0); +}; + +void GlobeGeometryFeature::bufferDynamicHeightData(const RenderFeature& feature) { + ghoul_assert(_pointsProgram, "Shader program must be initialized"); + ghoul_assert(_linesAndPolygonsProgram, "Shader program must be initialized"); + + ghoul::opengl::ProgramObject* program = _linesAndPolygonsProgram; + if (feature.type == RenderType::Points) { + program = _pointsProgram; + } + + // Just update the height data + + glBindVertexArray(feature.vaoId); + glBindBuffer(GL_ARRAY_BUFFER, feature.vboId); + glBufferSubData( + GL_ARRAY_BUFFER, + feature.nVertices * sizeof(Vertex), // offset + feature.heights.size() * sizeof(float), // size + feature.heights.data() + ); + + GLint heightAttrib = program->attributeLocation("in_height"); + glEnableVertexAttribArray(heightAttrib); + glVertexAttribPointer( + heightAttrib, + 1, + GL_FLOAT, + GL_FALSE, + 1 * sizeof(float), // stride + reinterpret_cast(feature.nVertices * sizeof(Vertex)) // start position + ); + + glBindBuffer(GL_ARRAY_BUFFER, 0); + glBindVertexArray(0); +}; + +} // namespace openspace::globebrowsing diff --git a/modules/globebrowsing/src/geojson/globegeometryfeature.h b/modules/globebrowsing/src/geojson/globegeometryfeature.h new file mode 100644 index 0000000000..58247defdd --- /dev/null +++ b/modules/globebrowsing/src/geojson/globegeometryfeature.h @@ -0,0 +1,220 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2023 * + * * + * 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_GLOBEBROWSING___GLOBEGEOMETRYFEATURE___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GLOBEGEOMETRYFEATURE___H__ + +#include + +#include +#include +#include +#include +#include +#include +#include +#include + +namespace openspace::documentation { struct Documentation; } +namespace rendering::helper { + struct LightSourceRenderData; + struct VertexXYZNormal; +} // namespace rendering::helper + +namespace geos::geom { class Geometry; } + +namespace openspace::globebrowsing { + +class RenderableGlobe; + +/** + * This class is responsible for rendering the geomoetry features of globes, + * created e.g. from GeoJson files + */ +class GlobeGeometryFeature { +public: + GlobeGeometryFeature(const RenderableGlobe& globe, + GeoJsonProperties& defaultProperties, + GeoJsonOverrideProperties& overrideProperties); + + using Vertex = rendering::helper::VertexXYZNormal; + + // TODO: Use instead of numbers + //enum class RenderPass { + // GeometryOnly, + // GeometryAndShading + //}; + + enum class PointRenderMode { + AlignToCameraDir = 0, + AlignToCameraPos, + AlignToGlobeNormal, + AlignToGlobeSurface + }; + + enum class GeometryType { + LineString = 0, + Point, + Polygon, + Error + }; + + enum class RenderType { + Lines = 0, + Points, + Polygon, + Uninitialized + }; + + // Each geometry feature might translate into several render features + struct RenderFeature { + void initializeBuffers(); + + RenderType type = RenderType::Uninitialized; + GLuint vaoId = 0; + GLuint vboId = 0; + size_t nVertices = 0; + bool isExtrusionFeature = false; + + // Store the geodetic lat long coordinates of each vertex, so we can quickly recompute + // the height values for these points + std::vector vertices; + + // Keep the heights around + std::vector heights; + }; + + // Some extra data that we need for doing the rendering + struct ExtraRenderData { + float pointSizeScale; + float lineWidthScale; + PointRenderMode& pointRenderMode; + rendering::helper::LightSourceRenderData& lightSourceData; + }; + + std::string key() const; + + void setOffsets(const glm::vec3& offsets); + + void initializeGL(ghoul::opengl::ProgramObject* pointsProgram, + ghoul::opengl::ProgramObject* linesAndPolygonsProgram); + void deinitializeGL(); + bool isReady() const; + bool isPoints() const; + bool useHeightMap() const; + + void updateTexture(bool isInitializeStep = false); + + void createFromSingleGeosGeometry(const geos::geom::Geometry* geo, int index, + bool ignoreHeights); + + // 2 pass rendering to get correct culling for polygons + void render(const RenderData& renderData, int pass, float mainOpacity, + const ExtraRenderData& extraRenderData); + + bool shouldUpdateDueToHeightMapChange() const; + + void update(bool dataIsDirty, bool preventHeightUpdates); + void updateGeometry(); + void updateHeightsFromHeightMap(); + +private: + void renderPoints(const RenderFeature& feature, const RenderData& renderData, + const PointRenderMode& renderMode, float sizeScale) const; + + void renderLines(const RenderFeature& feature) const; + + void renderPolygons(const RenderFeature& feature, bool shouldRenderTwice, + int renderPass) const; + + /** + * Create the vertex information for any line parts of the feature. + * Returns the resulting vertex positions, so we can use them for extrusion + */ + std::vector> createLineGeometry(); + + /** + * Create the vertex information for any point parts of the feature. Also creates + * the features for extruded lines for the points + */ + void createPointGeometry(); + + /** + * Create the triangle geometry for the extruded edges of lines/polygons + */ + void createExtrudedGeometry(const std::vector>& edgeVertices); + + /** + * Create the triangle geometry for the polygon part of the feature (the area + * contained by the shape) + */ + void createPolygonGeometry(); + + void initializeRenderFeature(RenderFeature& feature, + const std::vector& vertices); + + /// Get the distance that shall be used for tesselation, based on the properties + float tessellationStepSize() const; + + /// Compute the heights to the surface at the reference points + std::vector getCurrentReferencePointsHeights() const; + + /// Buffer the static data for the vertices + void bufferVertexData(const RenderFeature& feature, + const std::vector& vertexData); + + /// Buffer the dynamic height data for the vertices, based on the height map + void bufferDynamicHeightData(const RenderFeature& feature); + + GeometryType _type = GeometryType::Error; + const RenderableGlobe& _globe; + + // Coordinates for geometry. For polygons, the first is always the outer ring + // and any following are the inner rings (holes) + std::vector> _geoCoordinates; + + // Coordinates for any triangles representing the geometry (only relevant for polygons) + std::vector _triangleCoordinates; + + std::vector _renderFeatures; + + glm::vec3 _offsets = glm::vec3(0.f); // lat, long, distance (meters). Passed from parent on property change + + std::string _key; + const PropertySet _properties; + + std::vector _heightUpdateReferencePoints; + std::vector _lastControlHeights; + std::chrono::system_clock::time_point _lastHeightUpdateTime; + + bool _hasTexture = false; + std::unique_ptr _pointTexture; + + ghoul::opengl::ProgramObject* _linesAndPolygonsProgram = nullptr; + ghoul::opengl::ProgramObject* _pointsProgram = nullptr; +}; + +} // namespace openspace::globebrowsing + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GLOBEGEOMETRYFEATURE___H__ diff --git a/modules/globebrowsing/src/geojson/globegeometryhelper.cpp b/modules/globebrowsing/src/geojson/globegeometryhelper.cpp new file mode 100644 index 0000000000..190058a571 --- /dev/null +++ b/modules/globebrowsing/src/geojson/globegeometryhelper.cpp @@ -0,0 +1,360 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2023 * + * * + * 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 +#include +#include + +namespace openspace::globebrowsing::geometryhelper { + +Geodetic3 toGeodetic(const geos::geom::Coordinate& c) { + Geodetic3 gd; + gd.geodetic2.lon = glm::radians(c.x); + gd.geodetic2.lat = glm::radians(c.y); + gd.height = std::isnan(c.z) ? 0.0 : c.z; + return gd; +} + +geos::geom::Coordinate toGeosCoord(const Geodetic3& gd) { + geos::geom::Coordinate c; + c.x = glm::degrees(gd.geodetic2.lon); + c.y = glm::degrees(gd.geodetic2.lat); + c.z = gd.height; + return c; +} + +std::vector +coordsToGeodetic(const std::vector& coords) +{ + std::vector res; + res.reserve(coords.size()); + for (const geos::geom::Coordinate& c : coords) { + res.push_back(toGeodetic(c)); + } + return res; +} + +std::vector geometryCoordsAsGeoVector(const geos::geom::Geometry* geometry) { + std::vector coords; + geometry->getCoordinates()->toVector(coords); + return geometryhelper::coordsToGeodetic(coords); +} + +std::vector geodetic2FromVertexList(const RenderableGlobe& globe, + const std::vector& verts) +{ + std::vector res; + res.reserve(verts.size()); + for (const rendering::helper::VertexXYZNormal& v : verts) { + glm::dvec3 cartesian = glm::dvec3(v.xyz[0], v.xyz[1], v.xyz[2]); + res.push_back(globe.ellipsoid().cartesianToGeodetic2(cartesian)); + } + return res; +} + +std::vector heightMapHeightsFromGeodetic2List(const RenderableGlobe& globe, + const std::vector& list) +{ + std::vector res; + res.reserve(list.size()); + for (const Geodetic2& geo : list) { + float h = static_cast(getHeightToReferenceSurface(geo, globe)); + res.push_back(h); + } + return res; +} + +std::vector +createExtrudedGeometryVertices(const std::vector>& edgeVertices) +{ + std::vector vertices; + + size_t nVerts = 0; + for (const std::vector& edge : edgeVertices) { + nVerts += edge.size(); + } + vertices.reserve(nVerts * 3); + + // Extrude polygon + for (size_t nBound = 0; nBound < edgeVertices.size(); ++nBound) { + const std::vector& boundary = edgeVertices[nBound]; + for (int i = 1; i < boundary.size(); ++i) { + glm::vec3 v0 = boundary[i - 1]; + glm::vec3 v1 = boundary[i ]; + + // Vertices close to globe (Based on origin which is the zero point here) + // For now, use center of globe (TODO: allow setting the height) + glm::vec3 vOrigin = glm::vec3(0.f); + + // Outer boundary is the first one + if (nBound == 0) { + glm::vec3 n = glm::vec3(glm::normalize(glm::cross(v1 - vOrigin, v0 - vOrigin))); + vertices.push_back({ vOrigin.x, vOrigin.y, vOrigin.z, n.x, n.y, n.z }); + vertices.push_back({ v1.x, v1.y, v1.z, n.x, n.y, n.z }); + vertices.push_back({ v0.x, v0.y, v0.z, n.x, n.y, n.z }); + } + // Inner boundary + else { + // Flipped winding order and normal for inner rings + glm::vec3 n = glm::normalize(glm::cross(v0 - vOrigin, v1 - vOrigin)); + vertices.push_back({ vOrigin.x, vOrigin.y, vOrigin.z, n.x, n.y, n.z }); + vertices.push_back({ v0.x, v0.y, v0.z, n.x, n.y, n.z }); + vertices.push_back({ v1.x, v1.y, v1.z, n.x, n.y, n.z }); + } + + // TODO: Fix faulty triangle directions and draw triangles with correct shading on + // both sides of the mesh + } + } + + vertices.shrink_to_fit(); + return vertices; + + // TODO: extrude lines as a box shape +} + +double getHeightToReferenceSurface(const Geodetic2& geo, const RenderableGlobe& globe) { + // Compute model space coordinate, and potentially account for height map + glm::dvec3 posModelSpaceZeroHeight = + globe.ellipsoid().cartesianSurfacePosition(geo); + + const SurfacePositionHandle posHandle = + globe.calculateSurfacePositionHandle(posModelSpaceZeroHeight); + + return posHandle.heightToSurface; +} + +glm::dvec3 computeOffsetedModelCoordinate(const Geodetic3& geo, + const RenderableGlobe& globe, + float latOffset, float lonOffset) +{ + // Account for lat long offset + double offsetLatRadians = glm::radians(latOffset); + double offsetLonRadians = glm::radians(lonOffset); + + Geodetic3 adjusted = geo; + adjusted.geodetic2.lat += offsetLatRadians; + adjusted.geodetic2.lon += offsetLonRadians; + + return globe.ellipsoid().cartesianPosition(adjusted); +} + +std::vector subdivideLine(const glm::dvec3& v0, const glm::dvec3& v1, + double h0, double h1, double maxDistance) +{ + double edgeLength = glm::distance(v1, v0); + int nSegments = static_cast(std::ceil(edgeLength / maxDistance)); + + std::vector positions; + positions.reserve(nSegments + 1); + + // If step distance is too big, just add first position + if (nSegments == 0) { + positions.push_back({ glm::vec3(v0), h0 }); + } + + for (int seg = 0; seg < nSegments; ++seg) { + double t = static_cast(seg) / static_cast(nSegments); + + // Interpolate both position and height value + glm::dvec3 newV = glm::mix(v0, v1, t); + double newHeight = glm::mix(h0, h1, t); + double heightDiff = newHeight - h0; + + // Compute position along arc between v0 and v1, with adjusted height value + glm::vec3 newVf = static_cast( + (glm::length(v0) + heightDiff) * glm::normalize(newV) + ); + positions.push_back({ newVf, newHeight }); + } + + // Add final position + positions.push_back({ static_cast(v1), h1 }); + + positions.shrink_to_fit(); + return positions; +} + +std::vector +subdivideTriangle(const glm::vec3& v0, const glm::vec3& v1, const glm::vec3& v2, + double h0, double h1, double h2, double maxDistance, + const RenderableGlobe& globe) +{ + std::vector vertices; + + // Subdivide edges + std::vector edge01 = geometryhelper::subdivideLine( + v0, v1, + h0, h1, + maxDistance + ); + + std::vector edge02 = geometryhelper::subdivideLine( + v0, v2, + h0, h2, + maxDistance + ); + + std::vector edge12 = geometryhelper::subdivideLine( + v1, v2, + h1, h2, + maxDistance + ); + + size_t nSteps01 = edge01.size(); + size_t nSteps02 = edge02.size(); + size_t nSteps12 = edge12.size(); + size_t maxSteps = std::max(std::max(nSteps01, nSteps02), nSteps12); + vertices.reserve(maxSteps * maxSteps); + + // Add points inside the triangle + std::vector pointCoords; + pointCoords.reserve(3 * maxSteps + 1); + + const float lengthEdge01 = glm::length(v1 - v0); + const float lengthEdge02 = glm::length(v2 - v0); + for (size_t i = 1; i < nSteps01; ++i) { + for (size_t j = 1; j < nSteps02; ++j) { + glm::vec3 comp01 = edge01[i].position - v0; + glm::vec3 comp02 = edge02[j].position - v0; + + double hComp01 = edge01[i].height - h0; + double hComp02 = edge02[j].height - h0; + + float w1 = glm::length(comp01) / lengthEdge01; + float w2 = glm::length(comp02) / lengthEdge02; + + if (w1 + w2 > 1.f - std::numeric_limits::epsilon()) { + continue; // Sum larger than 1.0 => Outside of triangle + } + + glm::vec3 pos = v0 + comp01 + comp02; + double height = h0 + hComp01 + hComp02; + + Geodetic2 geo2 = globe.ellipsoid().cartesianToGeodetic2(pos); + Geodetic3 geo3 = { geo2, height }; + pointCoords.push_back(geometryhelper::toGeosCoord(geo3)); + } + } + + // Add egde positions + for (size_t i = 0; i < maxSteps; ++i) { + if (i < edge01.size() - 1) { + Geodetic2 geo2 = globe.ellipsoid().cartesianToGeodetic2(edge01[i].position); + Geodetic3 geo3 = { geo2, edge01[i].height }; + pointCoords.push_back(geometryhelper::toGeosCoord(geo3)); + } + if (i < edge02.size() - 1) { + Geodetic2 geo2 = globe.ellipsoid().cartesianToGeodetic2(edge02[i].position); + Geodetic3 geo3 = { geo2, edge02[i].height }; + pointCoords.push_back(geometryhelper::toGeosCoord(geo3)); + } + if (i < edge12.size() - 1) { + Geodetic2 geo2 = globe.ellipsoid().cartesianToGeodetic2(edge12[i].position); + Geodetic3 geo3 = { geo2, edge12[i].height }; + pointCoords.push_back(geometryhelper::toGeosCoord(geo3)); + } + } + + // Also add the final position (not part of the subdivide step above) + Geodetic2 geo2 = globe.ellipsoid().cartesianToGeodetic2(v2); + glm::dvec3 centerToEllipsoidSurface = globe.ellipsoid().geodeticSurfaceProjection(v2); + double height = glm::length(glm::dvec3(v2) - centerToEllipsoidSurface); + Geodetic3 geo3 = { geo2, height }; + pointCoords.push_back(geometryhelper::toGeosCoord(geo3)); + + pointCoords.shrink_to_fit(); + + using namespace geos::geom; + + GeometryFactory::Ptr geometryFactory = GeometryFactory::create(); + std::unique_ptr points = geometryFactory->createMultiPoint(pointCoords); + + // Create triangulation of points + geos::triangulate::DelaunayTriangulationBuilder builder; + builder.setSites(*points->getCoordinates()); + + // Returns a list of triangles, as geos polygons + GeometryCollection* triangleGeoms = builder.getTriangles(*geometryFactory).release(); + std::vector triCoords; + triangleGeoms->getCoordinates()->toVector(triCoords); + + vertices.reserve(vertices.size() + triCoords.size() + 1); + + int count = 0; + for (const Coordinate& coord : triCoords) { + count++; + if (count == 4) { + // Skip every 4th coord, as polygons have one extra coord per triangle. + // Also, reset the counting at this point. + count = 0; + continue; + } + Geodetic3 geodetic = geometryhelper::toGeodetic(coord); + + // Note that offset should already have been applied to the coordinates. Use + // zero offset => just get model coordinate + glm::vec3 v = + geometryhelper::computeOffsetedModelCoordinate(geodetic, globe, 0.f, 0.f); + + vertices.push_back({ v.x, v.y, v.z, 0.f, 0.f, 0.f }); + + // Every third set of coordinates is a triangle => update normal of previous + // triangle vertices + if (count == 3) { + // Find previous vertices + size_t lastIndex = vertices.size() - 1; + rendering::helper::VertexXYZNormal& vert0 = vertices[lastIndex - 2]; + rendering::helper::VertexXYZNormal& vert1 = vertices[lastIndex - 1]; + rendering::helper::VertexXYZNormal& vert2 = vertices[lastIndex]; + + const glm::vec3 v0_pos = glm::vec3(vert0.xyz[0], vert0.xyz[1], vert0.xyz[2]); + const glm::vec3 v1_pos = glm::vec3(vert1.xyz[0], vert1.xyz[1], vert1.xyz[2]); + const glm::vec3 n = -glm::normalize(glm::cross(v1_pos - v0_pos, v - v0_pos)); + + vert0.normal[0] = n.x; + vert0.normal[1] = n.y; + vert0.normal[2] = n.z; + + vert1.normal[0] = n.x; + vert1.normal[1] = n.y; + vert1.normal[2] = n.z; + + vert2.normal[0] = n.x; + vert2.normal[1] = n.y; + vert2.normal[2] = n.z; + } + } + + vertices.shrink_to_fit(); + return vertices; +} + +} // namespace openspace::globebrowsing::geometryhelper diff --git a/modules/globebrowsing/src/geojson/globegeometryhelper.h b/modules/globebrowsing/src/geojson/globegeometryhelper.h new file mode 100644 index 0000000000..736347bdbe --- /dev/null +++ b/modules/globebrowsing/src/geojson/globegeometryhelper.h @@ -0,0 +1,109 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2023 * + * * + * 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_GLOBEBROWSING___GLOBEGEOMETRYHELPER___H__ +#define __OPENSPACE_MODULE_GLOBEBROWSING___GLOBEGEOMETRYHELPER___H__ + +#include +#include + +namespace openspace::globebrowsing { + struct Geodetic2; + struct Geodetic3; + class RenderableGlobe; +} // namespace openspace::globebrowsing + +namespace openspace::rendering::helper { + struct VertexXYZNormal; +} // namespace openspace::rendering::helper + +namespace geos::geom { + class Coordinate; + class Geometry; +} // namespace geos::geom + +namespace openspace::globebrowsing::geometryhelper { + +Geodetic3 toGeodetic(const geos::geom::Coordinate& c); + +geos::geom::Coordinate toGeosCoord(const Geodetic3& gd); + +std::vector coordsToGeodetic( + const std::vector& coords); + +std::vector geometryCoordsAsGeoVector(const geos::geom::Geometry* geometry); + +std::vector geodetic2FromVertexList(const RenderableGlobe& globe, + const std::vector& verts); + +std::vector heightMapHeightsFromGeodetic2List(const RenderableGlobe& globe, + const std::vector& list); + + +/** + * Create triangle geometry for the extruded edge, given the provided edge vertices + */ +std::vector createExtrudedGeometryVertices( + const std::vector>& edgeVertices); + +/** + * Get height contribution from reference surface of the globe, based on the height map + */ +double getHeightToReferenceSurface(const Geodetic2& geo, const RenderableGlobe& globe); + +/** + * Compute model space cordinate from geodetic coordinate, and account for lat, long + * offsets + */ +glm::dvec3 computeOffsetedModelCoordinate(const Geodetic3& geo, + const RenderableGlobe& globe, float latOffset, float lonOffset); + + +struct PosHeightPair { + glm::vec3 position; + double height; +}; + +/** + * Subdivide line between position v0 and v1 so that it fullfils the maxDistance + * criteria. Interpolate the height value from * h0 to h1, as well as add the + * given offset and account for the height map if that should be done. + * + * Returns pairs of position and height values + */ +std::vector subdivideLine(const glm::dvec3& v0, const glm::dvec3& v1, + double h0, double h1, double maxDistance); + +/** + * Subdivide triangle consisting of vertex positions v0, v1 and v2, with height values + * h0, h1 and h2 into smaller triangles. maxDistance specifies tha maximum distance + * between two vertices in the subdivided mesh + */ +std::vector subdivideTriangle( + const glm::vec3& v0, const glm::vec3& v1, const glm::vec3& v2, + double h0, double h1, double h2, double maxDistance, const RenderableGlobe& globe); + +} // namespace openspace::globebrowsing::geometryhelper + +#endif // __OPENSPACE_MODULE_GLOBEBROWSING___GLOBEGEOMETRYHELPER___H__ diff --git a/modules/globebrowsing/src/globelabelscomponent.cpp b/modules/globebrowsing/src/globelabelscomponent.cpp index 47d82ea24d..88c1a8a787 100644 --- a/modules/globebrowsing/src/globelabelscomponent.cpp +++ b/modules/globebrowsing/src/globelabelscomponent.cpp @@ -63,38 +63,48 @@ namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { "Enabled", "Enabled", - "Enables and disables labels' rendering" + "Enables and disables labels' rendering", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo FontSizeInfo = { "FontSize", "Font Size", - "Font size for the rendering labels. This is different fromt text size" + "Font size for the rendering labels. This is different fromt text size", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo MinMaxSizeInfo = { "MinMaxSize", "Min/Max Text Size", - "Minimum and maximum label size, in pixels" + "Minimum and maximum label size, in pixels", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SizeInfo = { "LabelsSize", "Labels Size", - "This value affects the size scale of the labels" + "This value affects the size scale of the labels", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo HeightOffsetInfo = { "HeightOffset", "Height Offset", "This value moves the label away from the globe surface by the specified " - "distance (in meters)" + "distance (in meters)", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ColorInfo = { "Color", "Color", - "The text color of the labels" + "The text color of the labels", + // @VISIBILITY(1.2) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo FadeDistancesInfo = { @@ -102,39 +112,46 @@ namespace { "Fade-In Distances", "The distances above the globe's surface at which the labels start fading in or " "out, given in meters. The final distances are also adjusted by the specified " - "height offset" + "height offset", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FadeInEnabledInfo = { "FadeInEnabled", "Fade In Enabled", "Sets whether the labels fade in when approaching the globe from a distance. If " - "false, no fading happens and the labels immediately has full opacity" + "false, no fading happens and the labels immediately has full opacity", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo FadeOutEnabledInfo = { "FadeOutEnabled", "Fade Out Enabled", "Sets whether the labels fade out when approaching the surface of the globe. If " - "false, no fading happens and the labels stays in full opacity" + "false, no fading happens and the labels stays in full opacity", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo DisableCullingInfo = { "DisableCulling", "Culling Disabled", - "Labels culling disabled" + "Labels culling disabled", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo DistanceEPSInfo = { "DistanceEPS", "Culling Distance", - "Labels culling distance from globe's center" + "Labels culling distance from globe's center", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo AlignmentOptionInfo = { "AlignmentOption", "Alignment Option", - "Labels are aligned horizontally or circularly related to the planet" + "Labels are aligned horizontally or circularly related to the planet", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(GlobeLabelsComponent)]] Parameters { diff --git a/modules/globebrowsing/src/globerotation.cpp b/modules/globebrowsing/src/globerotation.cpp index be621a2642..9e8d595f47 100644 --- a/modules/globebrowsing/src/globerotation.cpp +++ b/modules/globebrowsing/src/globerotation.cpp @@ -40,7 +40,9 @@ namespace { constexpr openspace::properties::Property::PropertyInfo GlobeInfo = { "Globe", "Attached Globe", - "The globe on which the longitude/latitude is specified" + "The globe on which the longitude/latitude is specified", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LatitudeInfo = { @@ -48,7 +50,9 @@ namespace { "Latitude", "The latitude of the location on the globe's surface. The value can range from " "-90 to 90, with negative values representing the southern hemisphere of the " - "globe. The default value is 0.0" + "globe. The default value is 0.0", + // @VISIBILITY(2.25) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LongitudeInfo = { @@ -56,14 +60,17 @@ namespace { "Longitude", "The longitude of the location on the globe's surface. The value can range from " "-180 to 180, with negative values representing the western hemisphere of the " - "globe. The default value is 0.0" + "globe. The default value is 0.0", + // @VISIBILITY(2.25) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo AngleInfo = { "Angle", "Angle", "A rotation angle that can be used to rotate the object around its own y-axis, " - "which will be pointing out of the globe's surface" + "which will be pointing out of the globe's surface", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo UseHeightmapInfo = { @@ -71,7 +78,17 @@ namespace { "Use Heightmap", "If set to true, the heightmap will be used when computing the surface normal. " "This means that the object will be rotated to lay flat on the surface at the " - "given coordinate and follow the shape of the landscape" + "given coordinate and follow the shape of the landscape", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User + }; + + constexpr openspace::properties::Property::PropertyInfo UseCameraInfo = { + "UseCamera", + "Use Camera", + "If this value is 'true', the lat and lon are updated to match the camera", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(GlobeRotation)]] Parameters { @@ -90,6 +107,9 @@ namespace { // [[codegen::verbatim(UseHeightmapInfo.description)]] std::optional useHeightmap; + + // [[codegen::verbatim(UseCameraInfo.description)]] + std::optional useCamera; }; #include "globerotation_codegen.cpp" } // namespace @@ -106,6 +126,7 @@ GlobeRotation::GlobeRotation(const ghoul::Dictionary& dictionary) , _longitude(LongitudeInfo, 0.0, -180.0, 180.0) , _angle(AngleInfo, 0.0, 0.0, 360.0) , _useHeightmap(UseHeightmapInfo, false) + , _useCamera(UseCameraInfo, false) { const Parameters p = codegen::bake(dictionary); @@ -131,6 +152,11 @@ GlobeRotation::GlobeRotation(const ghoul::Dictionary& dictionary) _angle = p.angle.value_or(_angle); _angle.onChange([this]() { setUpdateVariables(); }); addProperty(_angle); + + _useCamera = p.useCamera.value_or(_useCamera); + _useCamera.onChange([this]() { setUpdateVariables(); }); + addProperty(_useCamera); + } void GlobeRotation::findGlobe() { @@ -180,7 +206,7 @@ glm::vec3 GlobeRotation::computeSurfacePosition(double latitude, double longitud } void GlobeRotation::update(const UpdateData& data) { - if (_useHeightmap) { + if (_useHeightmap || _useCamera) { // If we use the heightmap, we have to compute the height every frame setUpdateVariables(); } @@ -202,21 +228,31 @@ glm::dmat3 GlobeRotation::matrix(const UpdateData&) const { return _matrix; } + double lat = _latitude; + double lon = _longitude; + + if (_useCamera) { + GlobeBrowsingModule* mod = global::moduleEngine->module(); + glm::dvec3 position = mod->geoPosition(); + lat = position.x; + lon = position.y; + } + // Compute vector that points out of globe surface glm::dvec3 yAxis = glm::dvec3(0.0); if (_useHeightmap) { const double angleDiff = 0.00001; // corresponds to a meter-ish - const glm::vec3 posCenter = computeSurfacePosition(_latitude, _longitude); - const glm::vec3 pos1 = computeSurfacePosition(_latitude, _longitude + angleDiff); - const glm::vec3 pos2 = computeSurfacePosition(_latitude + angleDiff, _longitude); + const glm::vec3 posCenter = computeSurfacePosition(lat, lon); + const glm::vec3 pos1 = computeSurfacePosition(lat, lon + angleDiff); + const glm::vec3 pos2 = computeSurfacePosition(lat + angleDiff, lon); const glm::vec3 v1 = pos1 - posCenter; const glm::vec3 v2 = pos2 - posCenter; yAxis = glm::dvec3(glm::cross(v1, v2)); } else { - float latitudeRad = glm::radians(static_cast(_latitude)); - float longitudeRad = glm::radians(static_cast(_longitude)); + float latitudeRad = glm::radians(static_cast(lat)); + float longitudeRad = glm::radians(static_cast(lon)); yAxis = _globeNode->ellipsoid().geodeticSurfaceNormal( { latitudeRad, longitudeRad } ); diff --git a/modules/globebrowsing/src/globerotation.h b/modules/globebrowsing/src/globerotation.h index 4324950f5a..912574c73a 100644 --- a/modules/globebrowsing/src/globerotation.h +++ b/modules/globebrowsing/src/globerotation.h @@ -54,6 +54,7 @@ private: properties::DoubleProperty _longitude; properties::DoubleProperty _angle; properties::BoolProperty _useHeightmap; + properties::BoolProperty _useCamera; RenderableGlobe* _globeNode = nullptr; diff --git a/modules/globebrowsing/src/globetranslation.cpp b/modules/globebrowsing/src/globetranslation.cpp index ded1ec46aa..7e09b18bed 100644 --- a/modules/globebrowsing/src/globetranslation.cpp +++ b/modules/globebrowsing/src/globetranslation.cpp @@ -39,7 +39,9 @@ namespace { constexpr openspace::properties::Property::PropertyInfo GlobeInfo = { "Globe", "Attached Globe", - "The globe on which the longitude/latitude is specified" + "The globe on which the longitude/latitude is specified", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LatitudeInfo = { @@ -47,7 +49,9 @@ namespace { "Latitude", "The latitude of the location on the globe's surface. The value can range from " "-90 to 90, with negative values representing the southern hemisphere of the " - "globe. The default value is 0.0" + "globe. The default value is 0.0", + // @VISIBILITY(2.25) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LongitudeInfo = { @@ -55,7 +59,9 @@ namespace { "Longitude", "The longitude of the location on the globe's surface. The value can range from " "-180 to 180, with negative values representing the western hemisphere of the " - "globe. The default value is 0.0" + "globe. The default value is 0.0", + // @VISIBILITY(2.25) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo AltitudeInfo = { @@ -63,7 +69,9 @@ namespace { "Altitude", "The altitude in meters. If the 'UseHeightmap' property is 'true', this is an " "offset from the actual surface of the globe. If not, this is an offset from the " - "reference ellipsoid. The default value is 0.0" + "reference ellipsoid. The default value is 0.0", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo UseHeightmapInfo = { @@ -71,7 +79,25 @@ namespace { "Use Heightmap", "If this value is 'true', the altitude specified in 'Altitude' will be treated " "as an offset from the heightmap. Otherwise, it will be an offset from the " - "globe's reference ellipsoid. The default value is 'false'" + "globe's reference ellipsoid. The default value is 'false'", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User + }; + + constexpr openspace::properties::Property::PropertyInfo UseCameraInfo = { + "UseCamera", + "Use Camera", + "If this value is 'true', the lat and lon are updated to match the camera", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::AdvancedUser + }; + + constexpr openspace::properties::Property::PropertyInfo UseCameraAltitudeInfo = { + "UseCameraAltitude", + "Use Camera Altitude", + "If this value is 'true', the altitude is updated to match the camera", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(GlobeTranslation)]] Parameters { @@ -90,6 +116,12 @@ namespace { // [[codegen::verbatim(UseHeightmapInfo.description)]] std::optional useHeightmap; + + // [[codegen::verbatim(UseCameraInfo.description)]] + std::optional useCamera; + + // [[codegen::verbatim(UseCameraAltitudeInfo.description)]] + std::optional useCameraAltitude; }; #include "globetranslation_codegen.cpp" } // namespace @@ -106,6 +138,8 @@ GlobeTranslation::GlobeTranslation(const ghoul::Dictionary& dictionary) , _longitude(LongitudeInfo, 0.0, -180.0, 180.0) , _altitude(AltitudeInfo, 0.0, -1e12, 1e12) , _useHeightmap(UseHeightmapInfo, false) + , _useCamera(UseCameraInfo, false) + , _useCameraAltitude(UseCameraAltitudeInfo, false) { const Parameters p = codegen::bake(dictionary); @@ -133,6 +167,14 @@ GlobeTranslation::GlobeTranslation(const ghoul::Dictionary& dictionary) _useHeightmap = p.useHeightmap.value_or(_useHeightmap); _useHeightmap.onChange([this]() { setUpdateVariables(); }); addProperty(_useHeightmap); + + _useCamera = p.useCamera.value_or(_useCamera); + _useCamera.onChange([this]() { setUpdateVariables(); }); + addProperty(_useCamera); + + _useCameraAltitude = p.useCameraAltitude.value_or(_useCameraAltitude); + _useCameraAltitude.onChange([this]() { setUpdateVariables(); }); + addProperty(_useCameraAltitude); } void GlobeTranslation::fillAttachedNode() { @@ -158,7 +200,7 @@ void GlobeTranslation::setUpdateVariables() { } void GlobeTranslation::update(const UpdateData& data) { - if (_useHeightmap) { + if (_useHeightmap || _useCamera) { // If we use the heightmap, we have to compute the height every frame setUpdateVariables(); } @@ -182,11 +224,25 @@ glm::dvec3 GlobeTranslation::position(const UpdateData&) const { GlobeBrowsingModule* mod = global::moduleEngine->module(); + double lat = _latitude; + double lon = _longitude; + double alt = _altitude; + + if (_useCamera) { + glm::dvec3 position = mod->geoPosition(); + lat = position.x; + lon = position.y; + if (_useCameraAltitude) { + alt = position.z; + } + } + if (_useHeightmap) { + glm::vec3 groundPos = mod->cartesianCoordinatesFromGeo( *_attachedNode, - _latitude, - _longitude, + lat, + lon, 0.0 ); @@ -195,18 +251,18 @@ glm::dvec3 GlobeTranslation::position(const UpdateData&) const { _position = mod->cartesianCoordinatesFromGeo( *_attachedNode, - _latitude, - _longitude, - h.heightToSurface + _altitude + lat, + lon, + h.heightToSurface + alt ); return _position; } else { _position = mod->cartesianCoordinatesFromGeo( *_attachedNode, - _latitude, - _longitude, - _altitude + lat, + lon, + alt ); _positionIsDirty = false; return _position; diff --git a/modules/globebrowsing/src/globetranslation.h b/modules/globebrowsing/src/globetranslation.h index 759f825696..c372ec671c 100644 --- a/modules/globebrowsing/src/globetranslation.h +++ b/modules/globebrowsing/src/globetranslation.h @@ -53,6 +53,8 @@ private: properties::DoubleProperty _longitude; properties::DoubleProperty _altitude; properties::BoolProperty _useHeightmap; + properties::BoolProperty _useCamera; + properties::BoolProperty _useCameraAltitude; RenderableGlobe* _attachedNode = nullptr; diff --git a/modules/globebrowsing/src/layer.cpp b/modules/globebrowsing/src/layer.cpp index 787278036c..1f159638a9 100644 --- a/modules/globebrowsing/src/layer.cpp +++ b/modules/globebrowsing/src/layer.cpp @@ -48,14 +48,16 @@ namespace { "Type", "Type", "The type of this Layer. This value is a read-only property and thus cannot be " - "changed" + "changed", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo BlendModeInfo = { "BlendMode", "Blend Mode", "This value specifies the blend mode that is applied to this layer. The blend " - "mode determines how this layer is added to the underlying layers beneath" + "mode determines how this layer is added to the underlying layers beneath", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { @@ -63,28 +65,36 @@ namespace { "Enabled", "If this value is enabled, the layer will be used for the final composition of " "the planet. If this value is disabled, the layer will be ignored in the " - "composition" + "composition", + // @VISIBILITY(1.17) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo ResetInfo = { "Reset", "Reset", "If this value is triggered, this layer will be reset. This will delete the " - "local cache for this layer and will trigger a fresh load of all tiles" + "local cache for this layer and will trigger a fresh load of all tiles", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo RemoveInfo = { "Remove", "Remove", "If this value is triggered, a script will be executed that will remove this " - "layer before the next frame" + "layer before the next frame", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ColorInfo = { "Color", "Color", "If the 'Type' of this layer is a solid color, this value determines what this " - "solid color is" + "solid color is", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo GuiDescriptionInfo = { diff --git a/modules/globebrowsing/src/layeradjustment.cpp b/modules/globebrowsing/src/layeradjustment.cpp index 29ce43100d..74d4f5e66e 100644 --- a/modules/globebrowsing/src/layeradjustment.cpp +++ b/modules/globebrowsing/src/layeradjustment.cpp @@ -32,20 +32,23 @@ namespace { constexpr openspace::properties::Property::PropertyInfo ChromaKeyColorInfo = { "ChromaKeyColor", "Chroma Key Color", - "This color is used as the chroma key for the layer that is adjusted" + "This color is used as the chroma key for the layer that is adjusted", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ChromaKeyToleranceInfo = { "ChromaKeyTolerance", "Chroma Key Tolerance", "This value determines the tolerance that is used to determine whether a color " - "is matching the selected Chroma key" + "is matching the selected Chroma key", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TypeInfo = { "Type", "Type", - "The type of layer adjustment that is applied to the underlying layer" + "The type of layer adjustment that is applied to the underlying layer", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(LayerAdjustment)]] Parameters { diff --git a/modules/globebrowsing/src/layergroup.cpp b/modules/globebrowsing/src/layergroup.cpp index 22dbea9ac8..e63d0a8ab5 100644 --- a/modules/globebrowsing/src/layergroup.cpp +++ b/modules/globebrowsing/src/layergroup.cpp @@ -41,7 +41,8 @@ namespace { "If this value is enabled, images between different levels are interpolated, " "rather than switching between levels abruptly. This makes transitions smoother " "and more visually pleasing", - openspace::properties::Property::Visibility::Hidden + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; } // namespace diff --git a/modules/globebrowsing/src/layerrendersettings.cpp b/modules/globebrowsing/src/layerrendersettings.cpp index f50f5a0ee2..bc5f6e4cce 100644 --- a/modules/globebrowsing/src/layerrendersettings.cpp +++ b/modules/globebrowsing/src/layerrendersettings.cpp @@ -29,27 +29,34 @@ namespace { "SetDefault", "Set Default", "If this value is triggered it will reset all of these values to their default " - "values" + "values", + // @VISIBILITY(1.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo GammaInfo = { "Gamma", "Gamma", - "This value is used as an exponent to adjust the color for each tile" + "This value is used as an exponent to adjust the color for each tile", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo MultiplierInfo = { "Multiplier", "Multiplier", "This value is used as a multiplier to adjust the color applied after taking the " - "gamma value as an exponent" + "gamma value as an exponent", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo OffsetInfo = { "Offset", "Offset", "This value is used as an additive modifier to adjust the color applied after " - "the gamma exponent and the multiplier has been performed" + "the gamma exponent and the multiplier has been performed", + openspace::properties::Property::Visibility::AdvancedUser }; } // namespace diff --git a/modules/globebrowsing/src/memoryawaretilecache.cpp b/modules/globebrowsing/src/memoryawaretilecache.cpp index c2bd44296c..1a6287ee12 100644 --- a/modules/globebrowsing/src/memoryawaretilecache.cpp +++ b/modules/globebrowsing/src/memoryawaretilecache.cpp @@ -38,32 +38,37 @@ namespace { "CpuAllocatedTileData", "CPU allocated tile data (MB)", "This value denotes the amount of RAM memory (in MB) that this tile cache is " - "utilizing" + "utilizing", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo GpuAllocatedDataInfo = { "GpuAllocatedTileData", "GPU allocated tile data (MB)", "This value denotes the amount of GPU memory (in MB) that this tile cache is " - "utilizing" + "utilizing", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo TileCacheSizeInfo = { "TileCacheSize", "Tile cache size", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ApplyTileCacheInfo = { "ApplyTileCacheSize", "Apply tile cache size", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ClearTileCacheInfo = { "ClearTileCache", "Clear tile cache", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; GLenum toGlTextureFormat(GLenum glType, ghoul::opengl::Texture::Format format) { diff --git a/modules/globebrowsing/src/renderableglobe.cpp b/modules/globebrowsing/src/renderableglobe.cpp index 1c36d8d4f9..deddea41b8 100644 --- a/modules/globebrowsing/src/renderableglobe.cpp +++ b/modules/globebrowsing/src/renderableglobe.cpp @@ -112,7 +112,8 @@ namespace { "ShowChunkEdges", "Show chunk edges", "If this value is set to 'true', the borders between chunks are shown using a " - "red highlight" + "red highlight", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo LevelProjectedAreaInfo = { @@ -120,14 +121,18 @@ namespace { "Level by projected area (else distance)", "If this value is set to 'true', the tile level is determined by the area " "projected on screen. If it is 'false', the distance to the center of the tile " - "is used instead" + "is used instead", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo ResetTileProviderInfo = { "ResetTileProviders", "Reset tile providers", "If this property is triggered, all tile provides for the globe are reset and " - "data is reloaded from scratch" + "data is reloaded from scratch", + // @VISIBILITY(3.67) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ModelSpaceRenderingInfo = { @@ -136,7 +141,8 @@ namespace { "This value determines the tile level that is used as the cut off between " "rendering tiles using the globe model rendering vs the flat in-game rendering " "method. This value is a tradeoff between not having precision errors in the " - "rendering and represting a tile as flat or curved" + "rendering and represting a tile as flat or curved", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo DynamicLodIterationCountInfo = @@ -145,7 +151,8 @@ namespace { "Data availability checks before LOD factor impact", "The number of checks that have to fail/succeed in a row before the dynamic " "level-of-detail adjusts the actual level-of-detail up or down during a session " - "recording" + "recording", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo PerformShadingInfo = { @@ -153,7 +160,8 @@ namespace { "Perform shading", "This value determines whether there should be lighting applied to the surface " "of the globe. Note that if there is an atmosphere attached to the planet, there " - "is a separate setting to control the shadowing induced by the atmosphere part" + "is a separate setting to control the shadowing induced by the atmosphere part", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo AccurateNormalsInfo = { @@ -161,25 +169,32 @@ namespace { "Use Accurate Normals", "This value determines whether higher-accuracy normals should be used in the " "rendering. These normals are calculated based on the height field information " - "and are thus only available if the planet has a height map" + "and are thus only available if the planet has a height map", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo EclipseInfo = { "Eclipse", "Eclipse", - "Enables/Disable Eclipse shadows" + "Enables/Disable Eclipse shadows", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo EclipseHardShadowsInfo = { "EclipseHardShadows", "Eclipse Hard Shadows", - "Enables the rendering of eclipse shadows using hard shadows" + "Enables the rendering of eclipse shadows using hard shadows", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ShadowMappingInfo = { "ShadowMapping", "Shadow Mapping", - "Enables shadow mapping algorithm. Used by renderable rings too" + "Enables shadow mapping algorithm. Used by renderable rings too", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RenderAtDistanceInfo = { @@ -187,21 +202,25 @@ namespace { "Render at Distance", "Tells the rendering engine not to perform distance based performance culling " "for this globe. Turning this property on will let the globe to be seen at far " - "away distances when normally it would be hidden" + "away distances when normally it would be hidden", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ZFightingPercentageInfo = { "ZFightingPercentage", "Z-Fighting Percentage", "The percentage of the correct distance to the surface being shadowed. Possible " - "values: [0.0, 1.0]" + "values: [0.0, 1.0]", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo NumberShadowSamplesInfo = { "NumberShadowSamples", "Number of Shadow Samples", "The number of samples used during shadow mapping calculation (Percentage Closer " - "Filtering)" + "Filtering)", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo TargetLodScaleFactorInfo = { @@ -209,33 +228,39 @@ namespace { "Target Level of Detail Scale Factor", "Determines the targeted level-of-detail of the tiles for this globe. A higher " "value means that the tiles rendered are a higher resolution for the same " - "distance of the camera to the planet" + "distance of the camera to the planet", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo CurrentLodScaleFactorInfo = { "CurrentLodScaleFactor", "Current Level of Detail Scale Factor (Read Only)", "The currently used scale factor whose target value is deteremined by " - "'TargetLodScaleFactor'" + "'TargetLodScaleFactor'", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo OrenNayarRoughnessInfo = { "OrenNayarRoughness", "orenNayarRoughness", - "The roughness factor that is used for the Oren-Nayar lighting mode" + "The roughness factor that is used for the Oren-Nayar lighting mode", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo AmbientIntensityInfo = { "AmbientIntensity", "Ambient Intensity", - "The intensity factor for the ambient light used for light shading" + "The intensity factor for the ambient light used for light shading", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo NActiveLayersInfo = { "NActiveLayers", "Number of active layers", "This is the number of currently active layers, if this value reaches the " - "maximum, bad things will happen" + "maximum, bad things will happen", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(RenderableGlobe)]] Parameters { @@ -652,6 +677,9 @@ RenderableGlobe::RenderableGlobe(const ghoul::Dictionary& dictionary) _labelsDictionary = p.labels.value_or(_labelsDictionary); + // Init geojson manager + _geoJsonManager.initialize(this); + addPropertySubOwner(_geoJsonManager); // Components _hasRings = p.rings.has_value(); @@ -715,6 +743,8 @@ void RenderableGlobe::deinitializeGL() { _globalRenderer.program = nullptr; } + _geoJsonManager.deinitializeGL(); + _grid.deinitializeGL(); if (_hasRings) { @@ -831,6 +861,10 @@ void RenderableGlobe::renderSecondary(const RenderData& data, RendererTasks&) { catch (const ghoul::opengl::TextureUnit::TextureUnitError& e) { LERROR(fmt::format("Error on drawing globe labels: '{}'", e.message)); } + + if (_geoJsonManager.isReady()) { + _geoJsonManager.render(data); + } } void RenderableGlobe::update(const UpdateData& data) { @@ -911,6 +945,8 @@ void RenderableGlobe::update(const UpdateData& data) { // RenderableGlobe::render() // rendering with the new number of layers but the // // LayerManager hasn't updated yet :o _layerManagerDirty = true; + + _geoJsonManager.update(); } bool RenderableGlobe::renderedWithDesiredData() const { @@ -925,6 +961,14 @@ LayerManager& RenderableGlobe::layerManager() { return _layerManager; } +const GeoJsonManager& RenderableGlobe::geoJsonManager() const { + return _geoJsonManager; +} + +GeoJsonManager& RenderableGlobe::geoJsonManager() { + return _geoJsonManager; +} + const Ellipsoid& RenderableGlobe::ellipsoid() const { return _ellipsoid; } diff --git a/modules/globebrowsing/src/renderableglobe.h b/modules/globebrowsing/src/renderableglobe.h index 32d31c814d..e6ed5c1c61 100644 --- a/modules/globebrowsing/src/renderableglobe.h +++ b/modules/globebrowsing/src/renderableglobe.h @@ -29,6 +29,7 @@ #include #include +#include #include #include #include @@ -114,6 +115,9 @@ public: const Ellipsoid& ellipsoid() const; const LayerManager& layerManager() const; LayerManager& layerManager(); + const GeoJsonManager& geoJsonManager() const; + GeoJsonManager& geoJsonManager(); + const glm::dmat4& modelTransform() const; static documentation::Documentation Documentation(); @@ -252,6 +256,8 @@ private: SkirtedGrid _grid; LayerManager _layerManager; + GeoJsonManager _geoJsonManager; + glm::dmat4 _cachedModelTransform = glm::dmat4(1.0); glm::dmat4 _cachedInverseModelTransform = glm::dmat4(1.0); diff --git a/modules/globebrowsing/src/ringscomponent.cpp b/modules/globebrowsing/src/ringscomponent.cpp index baf9bbe1e3..6e8a3af766 100644 --- a/modules/globebrowsing/src/ringscomponent.cpp +++ b/modules/globebrowsing/src/ringscomponent.cpp @@ -74,55 +74,64 @@ namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { "Enabled", "Enabled", - "Enable/Disable Rings" + "Enable/Disable Rings", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo TextureInfo = { "Texture", "Texture", "This value is the path to a texture on disk that contains a one-dimensional " - "texture which is used for these rings" + "texture which is used for these rings", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TextureFwrdInfo = { "TextureFwrd", "TextureFwrd", "This value is the path to a texture on disk that contains a one-dimensional " - "texture which is used for forward scattering light in these rings" + "texture which is used for forward scattering light in these rings", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TextureBckwrdInfo = { "TextureBckwrd", "TextureBckwrd", "This value is the path to a texture on disk that contains a one-dimensional " - "texture which is used for backward scattering light in these rings" + "texture which is used for backward scattering light in these rings", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TextureUnlitInfo = { "TextureUnlit", "TextureUnlit", "This value is the path to a texture on disk that contains a one-dimensional " - "texture which is used for unlit part in these rings" + "texture which is used for unlit part in these rings", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TextureColorInfo = { "TextureColor", "TextureColor", "This value is the path to a texture on disk that contains a one-dimensional " - "texture color which is used for unlit part in these rings" + "texture color which is used for unlit part in these rings", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TextureTransparencyInfo = { "TextureTransparency", "TextureTransparency", "This value is the path to a texture on disk that contains a one-dimensional " - "texture transparency which is used for unlit part in these rings" + "texture transparency which is used for unlit part in these rings", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SizeInfo = { "Size", "Size", - "This value specifies the radius of the rings in meter" + "This value specifies the radius of the rings in meter", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo OffsetInfo = { @@ -131,7 +140,8 @@ namespace { "This value is used to limit the width of the rings. Each of the two values is " "a value between 0 and 1, where 0 is the center of the ring and 1 is the " "maximum extent at the radius. For example, if the value is {0.5, 1.0}, the " - "ring is only shown between radius/2 and radius. It defaults to {0.0, 1.0}" + "ring is only shown between radius/2 and radius. It defaults to {0.0, 1.0}", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo NightFactorInfo = { @@ -139,28 +149,32 @@ namespace { "Night Factor", "This value is a multiplicative factor that is applied to the side of the rings " "that is facing away from the Sun. If this value is equal to '1', no darkening " - "of the night side occurs" + "of the night side occurs", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ColorFilterInfo = { "ColorFilter", "Color Filter", "This value affects the filtering out of part of the rings depending on the " - "color values of the texture. The higher value, the more rings are filtered out" + "color values of the texture. The higher value, the more rings are filtered out", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ZFightingPercentageInfo = { "ZFightingPercentage", "Z-Fighting Percentage", "The percentage of the correct distance to the surface being shadowed. " - "Possible values: [0.0, 1.0]" + "Possible values: [0.0, 1.0]", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo NumberShadowSamplesInfo = { "NumberShadowSamples", "Number of Shadow Samples", "The number of samples used during shadow mapping calculation " - "(Percentage Closer Filtering)" + "(Percentage Closer Filtering)", + openspace::properties::Property::Visibility::Developer }; struct [[codegen::Dictionary(RingsComponent)]] Parameters { diff --git a/modules/globebrowsing/src/shadowcomponent.cpp b/modules/globebrowsing/src/shadowcomponent.cpp index cdb0067249..b3988b3afe 100644 --- a/modules/globebrowsing/src/shadowcomponent.cpp +++ b/modules/globebrowsing/src/shadowcomponent.cpp @@ -54,23 +54,36 @@ namespace { constexpr std::string_view _loggerCat = "ShadowComponent"; + constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { + "Enabled", + "Enabled", + "Enable/Disable Shadows", + openspace::properties::Property::Visibility::User + }; + constexpr openspace::properties::Property::PropertyInfo SaveDepthTextureInfo = { "SaveDepthTextureInfo", "Save Depth Texture", - "Debug" + "Debug", + // @VISIBILITY(3.67) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DistanceFractionInfo = { "DistanceFraction", "Distance Fraction", "Distance fraction of original distance from light source to the globe to be " - "considered as the new light source distance" + "considered as the new light source distance", + // @VISIBILITY(3.67) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DepthMapSizeInfo = { "DepthMapSize", "Depth Map Size", - "The depth map size in pixels. You must entry the width and height values" + "The depth map size in pixels. You must entry the width and height values", + // @VISIBILITY(3.67) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr GLfloat ShadowBorder[] = { 1.f, 1.f, 1.f, 1.f }; @@ -158,7 +171,7 @@ ShadowComponent::ShadowComponent(const ghoul::Dictionary& dictionary) : properties::PropertyOwner({ "ShadowsComponent" }) , _saveDepthTexture(SaveDepthTextureInfo) , _distanceFraction(DistanceFractionInfo, 20, 1, 10000) - , _enabled({ "Enabled", "Enabled", "Enable/Disable Shadows" }, true) + , _enabled(EnabledInfo, true) { using ghoul::filesystem::File; diff --git a/modules/globebrowsing/src/tileprovider/defaulttileprovider.cpp b/modules/globebrowsing/src/tileprovider/defaulttileprovider.cpp index 4dd907a078..501dd2489a 100644 --- a/modules/globebrowsing/src/tileprovider/defaulttileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/defaulttileprovider.cpp @@ -36,7 +36,8 @@ namespace { "FilePath", "File Path", "The path of the GDAL file or the image file that is to be used in this tile " - "provider" + "provider", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TilePixelSizeInfo = { @@ -45,13 +46,16 @@ namespace { "This value is the preferred size (in pixels) for each tile. Choosing the right " "value is a tradeoff between more efficiency (larger images) and better quality " "(smaller images). The tile pixel size has to be smaller than the size of the " - "complete image if a single image is used" + "complete image if a single image is used", + // @VISIBILITY(3.33) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo CompressionInfo = { "Compression", "Compression Algorithm", - "The compression algorithm to use for MRF cached tiles" + "The compression algorithm to use for MRF cached tiles", + openspace::properties::Property::Visibility::AdvancedUser }; enum class [[codegen::stringify()]] Compression { diff --git a/modules/globebrowsing/src/tileprovider/imagesequencetileprovider.cpp b/modules/globebrowsing/src/tileprovider/imagesequencetileprovider.cpp index 02bce73b58..9d01f0c0c4 100644 --- a/modules/globebrowsing/src/tileprovider/imagesequencetileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/imagesequencetileprovider.cpp @@ -33,20 +33,25 @@ namespace { "Index", "Index", "The index into the list of images that is used to pick the currently displayed " - "image" + "image", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo CurrentImageInfo = { "CurrentImage", "Current Image", - "The read-only value of the currently selected image" + "The read-only value of the currently selected image", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo FolderPathInfo = { "FolderPath", "Folder Path", "The path that is used to look for images for this image provider. The path must " - "point to an existing folder that contains images" + "point to an existing folder that contains images", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(ImageSequenceTileProvider)]] Parameters { diff --git a/modules/globebrowsing/src/tileprovider/singleimagetileprovider.cpp b/modules/globebrowsing/src/tileprovider/singleimagetileprovider.cpp index bbb31b053b..ec98651a06 100644 --- a/modules/globebrowsing/src/tileprovider/singleimagetileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/singleimagetileprovider.cpp @@ -32,7 +32,8 @@ namespace { "FilePath", "File Path", "The file path that is used for this image provider. The file must point to an " - "image that is then loaded and used for all tiles" + "image that is then loaded and used for all tiles", + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(SingleImageProvider)]] Parameters { diff --git a/modules/globebrowsing/src/tileprovider/temporaltileprovider.cpp b/modules/globebrowsing/src/tileprovider/temporaltileprovider.cpp index 1b7752e987..81ebabe395 100644 --- a/modules/globebrowsing/src/tileprovider/temporaltileprovider.cpp +++ b/modules/globebrowsing/src/tileprovider/temporaltileprovider.cpp @@ -51,14 +51,16 @@ namespace { "Use Fixed Time", "If this value is enabled, the time-varying timevarying dataset will always use " "the time that is specified in the 'FixedTime' property, rather than using the " - "actual time from OpenSpace" + "actual time from OpenSpace", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FixedTimeInfo = { "FixedTime", "Fixed Time", "If the 'UseFixedTime' is enabled, this time will be used instead of the actual " - "time taken from OpenSpace for the displayed tiles" + "time taken from OpenSpace for the displayed tiles", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(TemporalTileProvider)]] Parameters { diff --git a/modules/imgui/ext/imgui/imgui_demo.cpp b/modules/imgui/ext/imgui/imgui_demo.cpp index 90e91aa057..34c569c034 100644 --- a/modules/imgui/ext/imgui/imgui_demo.cpp +++ b/modules/imgui/ext/imgui/imgui_demo.cpp @@ -6049,7 +6049,7 @@ void ImGui::ShowStyleEditor(ImGuiStyle* ref) ImGui::EndTooltip(); } ImGui::SameLine(); - HelpMarker("When drawing circle primitives with \"num_segments == 0\" tesselation will be calculated automatically."); + HelpMarker("When drawing circle primitives with \"num_segments == 0\" tessellation will be calculated automatically."); ImGui::DragFloat("Global Alpha", &style.Alpha, 0.005f, 0.20f, 1.0f, "%.2f"); // Not exposing zero here so user doesn't "lose" the UI (zero alpha clips all widgets). But application code could have a toggle to switch between zero and non-zero. ImGui::PopItemWidth(); diff --git a/modules/imgui/imguimodule.cpp b/modules/imgui/imguimodule.cpp index 266ee60910..95492d3efb 100644 --- a/modules/imgui/imguimodule.cpp +++ b/modules/imgui/imguimodule.cpp @@ -55,26 +55,30 @@ namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { "Enabled", "Is Enabled", - "This setting determines whether this object will be visible or not" + "This setting determines whether this object will be visible or not", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo CollapsedInfo = { "Collapsed", "Is Collapsed", - "This setting determines whether this window is collapsed or not" + "This setting determines whether this window is collapsed or not", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo ShowHelpInfo = { "ShowHelpText", "Show tooltip help", "If this value is enabled these kinds of tooltips are shown for most properties " - "explaining what impact they have on the visuals" + "explaining what impact they have on the visuals", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo HelpTextDelayInfo = { "HelpTextDelay", "Tooltip Delay (in s)", - "This value determines the delay in seconds after which the tooltip is shown" + "This value determines the delay in seconds after which the tooltip is shown", + openspace::properties::Property::Visibility::Developer }; } // namespace diff --git a/modules/imgui/src/guicomponent.cpp b/modules/imgui/src/guicomponent.cpp index 9e71cd01d2..09cad8b2ce 100644 --- a/modules/imgui/src/guicomponent.cpp +++ b/modules/imgui/src/guicomponent.cpp @@ -28,13 +28,17 @@ namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { "Enabled", "Is Enabled", - "This setting determines whether this object will be visible or not" + "This setting determines whether this object will be visible or not", + // @VISIBILITY(3.4) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo CollapsedInfo = { "Collapsed", "Is Collapsed", - "This setting determines whether this window is collapsed or not" + "This setting determines whether this window is collapsed or not", + // @VISIBILITY(3.4) + openspace::properties::Property::Visibility::AdvancedUser }; } // namespace diff --git a/modules/imgui/src/guipropertycomponent.cpp b/modules/imgui/src/guipropertycomponent.cpp index 8967d0b464..8f38f0dda8 100644 --- a/modules/imgui/src/guipropertycomponent.cpp +++ b/modules/imgui/src/guipropertycomponent.cpp @@ -42,7 +42,9 @@ namespace { "Use Tree Layout", "If this value is checked, this component will display the properties using a " "tree layout, rather than using a flat map. This value should only be set on " - "property windows that display SceneGraphNodes, or the application might crash" + "property windows that display SceneGraphNodes, or the application might crash", + // @VISIBILITY(3.67) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo OrderingInfo = { @@ -50,7 +52,9 @@ namespace { "Tree Ordering", "This list determines the order of the first tree layer if it is used. Elements " "present in this list will be shown first, with an alphabetical ordering for " - "elements not listed" + "elements not listed", + // @VISIBILITY(3.67) + openspace::properties::Property::Visibility::AdvancedUser }; int nVisibleProperties(const std::vector& props) diff --git a/modules/iswa/rendering/datacygnet.cpp b/modules/iswa/rendering/datacygnet.cpp index 237ba3832a..4c70799064 100644 --- a/modules/iswa/rendering/datacygnet.cpp +++ b/modules/iswa/rendering/datacygnet.cpp @@ -42,43 +42,50 @@ namespace { constexpr openspace::properties::Property::PropertyInfo DataOptionsInfo = { "DataOptions", "Data Options", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo UseLogInfo = { "UseLog", "Use Logarithm", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo UseHistogramInfo = { "UseHistogram", "Auto Contrast", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AutoFilterInfo = { "AutoFilter", "Auto Filter", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo NormalizeValuesInfo = { "NormValues", "Normalize Values", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo BackgroundInfo = { "BackgroundValues", "Background Values", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo TransferFunctionsFile = { "Transferfunctions", "Transfer Functions", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; } // namespace diff --git a/modules/iswa/rendering/iswabasegroup.cpp b/modules/iswa/rendering/iswabasegroup.cpp index 7897a4edc7..a498bd7dc8 100644 --- a/modules/iswa/rendering/iswabasegroup.cpp +++ b/modules/iswa/rendering/iswabasegroup.cpp @@ -34,19 +34,22 @@ namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { "Enabled", "Enabled", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo AlphaInfo = { "Alpha", "Alpha", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo DeleteInfo = { "Delete", "Delete", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; } // namespace diff --git a/modules/iswa/rendering/iswacygnet.cpp b/modules/iswa/rendering/iswacygnet.cpp index 847ca053b0..b8e0f12120 100644 --- a/modules/iswa/rendering/iswacygnet.cpp +++ b/modules/iswa/rendering/iswacygnet.cpp @@ -45,12 +45,14 @@ namespace { constexpr openspace::properties::Property::PropertyInfo DeleteInfo = { "Delete", "Delete", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo AlphaInfo = { "Alpha", "Alpha", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::User }; } // namespace diff --git a/modules/iswa/rendering/iswadatagroup.cpp b/modules/iswa/rendering/iswadatagroup.cpp index 3d87cf7f98..1c44609a11 100644 --- a/modules/iswa/rendering/iswadatagroup.cpp +++ b/modules/iswa/rendering/iswadatagroup.cpp @@ -41,43 +41,50 @@ namespace { constexpr openspace::properties::Property::PropertyInfo UseLogInfo = { "UseLog", "Use Logarithm", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo UseHistogramInfo = { "UseHistogram", "Auto Contrast", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AutoFilterInfo = { "AutoFilter", "Auto Filter", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo NormalizeValues = { "NormValues", "Normalize Values", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo BackgroundInfo = { "BackgroundValues", "Background Values", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo TransferFunctionInfo = { "Transferfunctions", "Transfer Functions", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo DataOptionsInfo = { "DataOptions", "Data Options", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; } // namespace diff --git a/modules/iswa/rendering/iswakameleongroup.cpp b/modules/iswa/rendering/iswakameleongroup.cpp index 3177a01e41..5eb84733fb 100644 --- a/modules/iswa/rendering/iswakameleongroup.cpp +++ b/modules/iswa/rendering/iswakameleongroup.cpp @@ -38,15 +38,16 @@ namespace { constexpr openspace::properties::Property::PropertyInfo ResolutionInfo = { "Resolution", "Resolution", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FieldlineSeedInfo = { "FieldlineSeedsIndexFile", "Fieldline Seedpoints", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; - } // namespace namespace openspace{ diff --git a/modules/iswa/rendering/kameleonplane.cpp b/modules/iswa/rendering/kameleonplane.cpp index 057bf89f87..51cbf6286f 100644 --- a/modules/iswa/rendering/kameleonplane.cpp +++ b/modules/iswa/rendering/kameleonplane.cpp @@ -46,19 +46,22 @@ namespace { constexpr openspace::properties::Property::PropertyInfo FieldLineSeedsInfo = { "FieldlineSeedsIndexFile", "Fieldline Seedpoints", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo ResolutionInfo = { "Resolution", "Resolution%", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SliceInfo = { "Slice", "Slice", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::User }; } // namespace diff --git a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp index f875dcd88d..a4a45dd2f4 100644 --- a/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp +++ b/modules/kameleonvolume/rendering/renderablekameleonvolume.cpp @@ -68,73 +68,87 @@ namespace { constexpr openspace::properties::Property::PropertyInfo DimensionsInfo = { "Dimensions", "Dimensions", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo VariableInfo = { "Variable", "Variable", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LowerDomainBoundInfo = { "LowerDomainBound", "Lower Domain Bound", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo UpperDomainBoundInfo = { "UpperDomainBound", "Upper Domain Bound", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DomainScaleInfo = { "DomainScale", "Domain scale", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LowerValueBoundInfo = { "LowerValueBound", "Lower Value Bound", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(?) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo UpperValueBoundInfo = { "UpperValueBound", "Upper Value Bound", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(?) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo GridTypeInfo = { "GridType", "Grid Type", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo StepSizeInfo = { "StepSize", "Step Size", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SourcePathInfo = { "SourcePath", "Source Path", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TransferFunctionInfo = { "TransferFunctionPath", "Transfer Function Path", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo CacheInfo = { "Cache", "Cache", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; } // namespace diff --git a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp index 1065013bfb..75acfd8237 100644 --- a/modules/multiresvolume/rendering/renderablemultiresvolume.cpp +++ b/modules/multiresvolume/rendering/renderablemultiresvolume.cpp @@ -71,79 +71,97 @@ namespace { constexpr openspace::properties::Property::PropertyInfo StepSizeCoefficientInfo = { "StepSizeCoefficient", "Stepsize Coefficient", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo CurrentTimeInfo = { "CurrentTime", "Current Time", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo MemoryBudgetInfo = { "MemoryBudget", "Memory Budget", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo StreamingBudgetInfo = { "StreamingBudget", "Streaming Budget", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo UseGlobalTimeInfo = { "UseGlobalTime", "Global Time", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LoopInfo = { "Loop", "Loop", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo SelectorNameInfo = { "Selector", "Brick Selector", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo StatsToFileInfo = { "PrintStats", "Print Stats", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo StatsToFileNameInfo = { "PrintStatsFileName", "Stats Filename", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo ScalingExponentInfo = { "ScalingExponent", "Scaling Exponent", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ScalingInfo = { "Scaling", "Scaling", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TranslationInfo = { "Translation", "Translation", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo RotationInfo = { "Rotation", "Euler rotation", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::Developer }; } // namespace diff --git a/modules/server/src/serverinterface.cpp b/modules/server/src/serverinterface.cpp index 7e6db61faa..b236c0e596 100644 --- a/modules/server/src/serverinterface.cpp +++ b/modules/server/src/serverinterface.cpp @@ -40,50 +40,59 @@ namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { "Enabled", "Is Enabled", - "This setting determines whether this server interface is enabled or not" + "This setting determines whether this server interface is enabled or not", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TypeInfo = { "Type", "Type", - "Whether the interface is using a Socket or a WebSocket" + "Whether the interface is using a Socket or a WebSocket", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo PortInfo = { "Port", "Port", - "The network port to use for this sevrer interface" + "The network port to use for this sevrer interface", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DefaultAccessInfo = { "DefaultAccess", "Default Access", - "Sets the default access policy: Allow, RequirePassword or Deny" + "Sets the default access policy: Allow, RequirePassword or Deny", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AllowAddressesInfo = { "AllowAddresses", "Allow Addresses", - "IP addresses or domains that should always be allowed access to this interface" + "IP addresses or domains that should always be allowed access to this interface", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RequirePasswordAddressesInfo = { "RequirePasswordAddresses", "Require Password Addresses", - "IP addresses or domains that should be allowed access if they provide a password" + "IP addresses or domains that should be allowed access if they provide a " + "password", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DenyAddressesInfo = { "DenyAddresses", "Deny Addresses", - "IP addresses or domains that should never be allowed access to this interface" + "IP addresses or domains that should never be allowed access to this interface", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo PasswordInfo = { "Password", "Password", - "Password for connecting to this interface" + "Password for connecting to this interface", + openspace::properties::Property::Visibility::AdvancedUser }; } // namespace diff --git a/modules/skybrowser/skybrowsermodule.cpp b/modules/skybrowser/skybrowsermodule.cpp index c8abcfa5de..b1b661246b 100644 --- a/modules/skybrowser/skybrowsermodule.cpp +++ b/modules/skybrowser/skybrowsermodule.cpp @@ -42,73 +42,90 @@ namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { "Enabled", "Enabled", - "Decides if the GUI for this module should be enabled" + "Decides if the GUI for this module should be enabled", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ShowTitleInGuiBrowserInfo = { "ShowTitleInGuiBrowser", "Show Title in Gui Browser", "If true, the name of the currently selected sky browser is shown in the WebGUI " - "browser" + "browser", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AllowRotationInfo = { "AllowCameraRotation", "Allow Camera Rotation", "Toggles if the camera should rotate to look at the sky target if it is going " - "outside of the current field of view" + "outside of the current field of view", + // @VISIBILITY(1.75) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo CameraRotSpeedInfo = { "CameraRotationSpeed", "Camera Rotation Speed", "The speed of the rotation of the camera when the camera rotates to look at a " - "coordinate which is outside of the field of view" + "coordinate which is outside of the field of view", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo TargetSpeedInfo = { "TargetAnimationSpeed", "Target Animation Speed", - "This determines the speed of the animation of the sky target" + "This determines the speed of the animation of the sky target", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo BrowserSpeedInfo = { "BrowserAnimationSpeed", "Field of View Animation Speed", - "This determines the speed of the animation of the field of view in the browser" + "This determines the speed of the animation of the field of view in the browser", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo HideWithGuiInfo = { "HideTargetsBrowsersWithGui", "Hide Targets and Browsers with GUI", "If checked, the targets and browsers will be disabled when the sky browser " - "panel is minimized" + "panel is minimized", + // @VISIBILITY(2.25) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo InverseZoomInfo = { "InverseZoomDirection", "Inverse Zoom Direction", "If checked, the zoom direction of the scroll over the AAS WWT browser will be " - "inversed" + "inversed", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo SynchronizeAimInfo = { "SynchronizeAim", "Synchronize Aim", - "If checked, the target and the browser will have synchronized aim." + "If checked, the target and the browser will have synchronized aim.", + // @VISIBILITY(3.25) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SpaceCraftTimeInfo = { "SpaceCraftAnimationTime", "Space Craft Animation Time", "Sets the duration (in seconds) of the animation of the space craft when it is " - "pointed to where the target is aiming" + "pointed to where the target is aiming", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ImageCollectionInfo = { "WwtImageCollectionUrl", "AAS WorldWide Telescope Image Collection Url", - "The url of the image collection which is loaded into AAS WorldWide Telescope" + "The url of the image collection which is loaded into AAS WorldWide Telescope", + // @VISIBILITY(3.75) + openspace::properties::Property::Visibility::AdvancedUser }; diff --git a/modules/skybrowser/src/browser.cpp b/modules/skybrowser/src/browser.cpp index e9e6671277..2250c609cc 100644 --- a/modules/skybrowser/src/browser.cpp +++ b/modules/skybrowser/src/browser.cpp @@ -39,19 +39,24 @@ namespace { constexpr openspace::properties::Property::PropertyInfo DimensionsInfo = { "Dimensions", "Browser Dimensions", - "Set the dimensions of the web browser window" + "Set the dimensions of the web browser window", + // @VISIBILITY(3.75) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo UrlInfo = { "Url", "URL", - "The URL to load" + "The URL to load", + // @VISIBILITY(3.25) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ReloadInfo = { "Reload", "Reload", - "Reload the web browser" + "Reload the web browser", + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(Browser)]] Parameters { diff --git a/modules/skybrowser/src/renderableskytarget.cpp b/modules/skybrowser/src/renderableskytarget.cpp index d4bd41ea79..d9cea82983 100644 --- a/modules/skybrowser/src/renderableskytarget.cpp +++ b/modules/skybrowser/src/renderableskytarget.cpp @@ -52,33 +52,41 @@ namespace { constexpr openspace::properties::Property::PropertyInfo crossHairSizeInfo = { "CrosshairSize", "Crosshair Size", - "Determines the size of the crosshair. The size is determined in fov (degrees)" + "Determines the size of the crosshair. The size is determined in fov (degrees)", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo RectangleThresholdInfo = { "RectangleThreshold", "Rectangle Threshold", "When the field of view is larger than the rectangle threshold, a rectangle will " - "be rendered in the target" + "be rendered in the target", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = { "LineWidth", "Line Width", - "The thickness of the line of the target. The larger number, the thicker line" + "The thickness of the line of the target. The larger number, the thicker line", + // @VISIBILITY(1.33) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo VerticalFovInfo = { "VerticalFov", "Vertical Field Of View", - "The vertical field of view of the target." + "The vertical field of view of the target.", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ApplyRollInfo = { "ApplyRoll", "Apply Roll", "Always rotate the target to have it's up direction aligned with the up direction " - "of the camera" + "of the camera", + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(RenderableSkyTarget)]] Parameters { diff --git a/modules/skybrowser/src/screenspaceskybrowser.cpp b/modules/skybrowser/src/screenspaceskybrowser.cpp index 0eb7bee4e4..150dd19ca2 100644 --- a/modules/skybrowser/src/screenspaceskybrowser.cpp +++ b/modules/skybrowser/src/screenspaceskybrowser.cpp @@ -45,7 +45,8 @@ namespace { "Quality of Texture", "A parameter to set the resolution of the texture. 1 is full resolution and " "slower frame rate. Lower value means lower resolution of texture and faster " - "frame rate" + "frame rate", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DisplayCopyInfo = { @@ -54,27 +55,33 @@ namespace { "Display a copy of this sky browser at an additional position. This copy will " "not be interactive. The position is in RAE (Radius, Azimuth, Elevation) " "coordinates or Cartesian, depending on if the browser uses RAE or Cartesian " - "coordinates" + "coordinates", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo DisplayCopyShowInfo = { "ShowDisplayCopy", "Show Display Copy", - "Show the display copy" + "Show the display copy", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo IsHiddenInfo = { "IsHidden", "Is Hidden", "If checked, the browser will be not be displayed. If it is not checked, it will " - "be" + "be", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo PointSpacecraftInfo = { "PointSpacecraft", "Point Spacecraft", "If checked, spacecrafts will point towards the coordinate of an image upon " - "selection." + "selection.", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(ScreenSpaceSkyBrowser)]] Parameters { diff --git a/modules/skybrowser/src/wwtcommunicator.cpp b/modules/skybrowser/src/wwtcommunicator.cpp index 66f7cb41d1..82dbac1a2d 100644 --- a/modules/skybrowser/src/wwtcommunicator.cpp +++ b/modules/skybrowser/src/wwtcommunicator.cpp @@ -121,7 +121,8 @@ namespace { constexpr openspace::properties::Property::PropertyInfo VerticalFovInfo = { "VerticalFov", "Vertical Field Of View", - "The vertical field of view of the target." + "The vertical field of view of the target.", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(WwtCommunicator)]] Parameters { diff --git a/modules/space/labelscomponent.cpp b/modules/space/labelscomponent.cpp index 0cced7f14e..9bbf8ee35e 100644 --- a/modules/space/labelscomponent.cpp +++ b/modules/space/labelscomponent.cpp @@ -43,50 +43,61 @@ namespace { "Enabled", "Is Enabled", "This setting determines whether the labels will be visible or not. They are " - "disabled per default" + "disabled per default", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo FileInfo = { "File", "File", - "The speck label file with the data for the labels" + "The speck label file with the data for the labels", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ColorInfo = { "Color", "Color", - "The color of the labels" + "The color of the labels", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo SizeInfo = { "Size", "Size", - "The size of the labels in pixels" + "The size of the labels in pixels", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo FontSizeInfo = { "FontSize", "Font Size", - "Font size for the labels. This is different from the text size" + "Font size for the labels. This is different from the text size", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo MinMaxInfo = { "MinMaxSize", "Min/Max Size", - "The minimum and maximum size (in pixels) of the labels" + "The minimum and maximum size (in pixels) of the labels", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FaceCameraInfo = { "FaceCamera", "Face Camera", "If enabled, the labels will be rotated to face the camera. For non-linear " - "display rendering (for example fisheye) this should be set to false." + "display rendering (for example fisheye) this should be set to false.", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TransformationMatrixInfo = { "TransformationMatrix", "Transformation Matrix", - "Transformation matrix to be applied to the labels" + "Transformation matrix to be applied to the labels", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::Developer }; struct [[codegen::Dictionary(LabelsComponent)]] Parameters { diff --git a/modules/space/rendering/renderableconstellationbounds.cpp b/modules/space/rendering/renderableconstellationbounds.cpp index 4e9e0181d0..2aa9a6fd81 100644 --- a/modules/space/rendering/renderableconstellationbounds.cpp +++ b/modules/space/rendering/renderableconstellationbounds.cpp @@ -47,14 +47,16 @@ namespace { "File", "Vertex File Path", "The file pointed to with this value contains the vertex locations of the " - "constellations" + "constellations", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ColorInfo = { "Color", "Color of constellation lines", "Specifies the color of the constellation lines. The lines are always drawn at " - "full opacity" + "full opacity", + openspace::properties::Property::Visibility::NoviceUser }; struct [[codegen::Dictionary(RenderableConstellationBounds)]] Parameters { diff --git a/modules/space/rendering/renderableconstellationlines.cpp b/modules/space/rendering/renderableconstellationlines.cpp index 977af886c8..cb4f55cfec 100644 --- a/modules/space/rendering/renderableconstellationlines.cpp +++ b/modules/space/rendering/renderableconstellationlines.cpp @@ -50,26 +50,30 @@ namespace { constexpr openspace::properties::Property::PropertyInfo SpeckInfo = { "File", "Constellation Data File Path", - "The file that contains the data for the constellation lines" + "The file that contains the data for the constellation lines", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DrawElementsInfo = { "DrawElements", "Draw Elements", - "Enables/Disables the drawing of the constellations" + "Enables/Disables the drawing of the constellations", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo UnitInfo = { "Unit", "Unit", - "The distance unit used for the constellation lines data" + "The distance unit used for the constellation lines data", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ColorsInfo = { "Colors", "Constellation Colors", "The defined colors for the constellations to be rendered. There can be several " - "groups of constellaitons that can have distinct colors." + "groups of constellaitons that can have distinct colors.", + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(RenderableConstellationLines)]] Parameters { diff --git a/modules/space/rendering/renderableconstellationsbase.cpp b/modules/space/rendering/renderableconstellationsbase.cpp index d5a45e86ee..ad73cffcf9 100644 --- a/modules/space/rendering/renderableconstellationsbase.cpp +++ b/modules/space/rendering/renderableconstellationsbase.cpp @@ -44,19 +44,24 @@ namespace { "Constellation Names File Path", "Specifies the file that contains the mapping between constellation " "abbreviations and full names of the constellations. If this value is empty, the " - "abbreviations are used as the full names" + "abbreviations are used as the full names", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = { "LineWidth", "Line Width", - "The line width of the constellation" + "The line width of the constellation", + // @VISIBILITY(1.67) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo SelectionInfo = { "ConstellationSelection", "Constellation Selection", - "The constellations that are selected are displayed on the celestial sphere" + "The constellations that are selected are displayed on the celestial sphere", + // @VISIBILITY(1.33) + openspace::properties::Property::Visibility::NoviceUser }; const static openspace::properties::PropertyOwner::PropertyOwnerInfo LabelsInfo = { diff --git a/modules/space/rendering/renderablefluxnodes.cpp b/modules/space/rendering/renderablefluxnodes.cpp index e63f5c4dd4..7a547ae1b1 100644 --- a/modules/space/rendering/renderablefluxnodes.cpp +++ b/modules/space/rendering/renderablefluxnodes.cpp @@ -64,130 +64,154 @@ namespace { "GOES Energy", "Select which energy bin you want to show. GOES = Geostationary Operational " "Environmental Satellites. Emin01 is values > 10 MeV, Default is Emin03 where " - "values > 100 MeV" + "values > 100 MeV", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ColorModeInfo = { "ColorMode", "Color Mode", "Color lines uniformly or using color tables based on specific values on nodes, " - "for examples flux values" + "for examples flux values", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ColorTablePathInfo = { "ColorTablePath", "Path to Color Table", - "Color Table/Transfer Function to use for 'By Flux Value' coloring" + "Color Table/Transfer Function to use for 'By Flux Value' coloring", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo StreamColorInfo = { "Color", "Color", - "Color of particles" + "Color of particles", + // @VISIBILITY(1.5) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo NodeSizeInfo = { "NodeSize", "Size of nodes", - "Change the size of the rendered points of the nodes" + "Change the size of the rendered points of the nodes", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ThresholdFluxInfo = { "ThresholdFlux", "Threshold flux value", - "This value specifies the threshold that will be changed with the flux value" + "This value specifies the threshold that will be changed with the flux value", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FilteringInfo = { "FilterLower", "Filtering Lower Value in AU", - "Use filtering to show nodes within a given range" + "Use filtering to show nodes within a given range", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FilteringUpperInfo = { "FilterUpper", "Filtering Upper Value in AU", - "Use filtering to show nodes within a given range" + "Use filtering to show nodes within a given range", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AmountofNodesInfo = { "AmountOfNodes", "Every nth node to render in", - "Show only every nth node" + "Show only every nth node", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DefaultNodeSkipInfo = { "NodeSkip", "Every nth node to render default", - "Show only every nth node outside of skippingmethod" + "Show only every nth node outside of skippingmethod", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo EarthNodeSkipInfo = { "NodeSkipEarth", "Every nth node to render close to Earth", - "Show only every nth node outside of skippingmethod" + "Show only every nth node outside of skippingmethod", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ScalingmethodInfo = { "ScalingFlux", "Scale the flux value with color table", - "Use scaling to color nodes with a given method" + "Use scaling to color nodes with a given method", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo NodeskipMethodInfo = { "SkippingNodes", "How to select nodes to skip", - "Methods to select nodes to skip" + "Methods to select nodes to skip", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo colorTableRangeInfo = { "ColorTableRange", "Color Table Range", "Valid range for the color table as the exponent, with base 10, of flux values. " - "[Min, Max]" + "[Min, Max]", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DomainZInfo = { "ZLimit", "Z-limits", - "Valid range along the Z-axis. [Min, Max]" + "Valid range along the Z-axis. [Min, Max]", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FluxColorAlphaInfo = { "FluxColorAlpha", "Flux Color Alpha", - "The value of alpha for the flux color mode" + "The value of alpha for the flux color mode", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FluxNodeskipThresholdInfo = { "SkippingNodesByFlux", "Skipping Nodes By Flux", - "Select nodes to skip depending on flux value" + "Select nodes to skip depending on flux value", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RadiusNodeSkipThresholdInfo = { "SkippingNodesByRadius", "Skipping Nodes By Radius", - "Select nodes to skip depending on Radius" + "Select nodes to skip depending on Radius", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DistanceThresholdInfo = { "DistancePlanetThreshold", "Threshold for distance between planet", - "Changes threshold distance for highlighting nodes close to earth" + "Changes threshold distance for highlighting nodes close to earth", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ProximityNodesSizeInfo = { "ProximityNodesSize", "Earths Proximity Nodes Size", - "Changes size of nodes only close to earth" + "Changes size of nodes only close to earth", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MaxNodeDistanceSizeInfo = { "MaxNodeDistanceSize", "Max Node Distance Size", - "The maximum size of the nodes at a certin distance" + "The maximum size of the nodes at a certin distance", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo @@ -195,25 +219,29 @@ namespace { "CameraPerspectiveEnabled", "Use Camera perspective", "Camera perspective changes the size of the nodes dependent on the distance from " - "camera" + "camera", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DrawingCirclesInfo = { "RenderingCircles", "Render as circles", - "Using fragment shader to draw nodes as circles instead of squares" + "Using fragment shader to draw nodes as circles instead of squares", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DrawingHollowInfo = { "RenderingHollowCircles", "Render as hollow circles", - "Using fragment shader to draw nodes as hollow circles" + "Using fragment shader to draw nodes as hollow circles", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo GaussiandAlphaFilterInfo = { "RenderingGaussianAlphaFilter", "Alpha by Gaussian", - "Using fragment shader to draw nodes with Gaussian filter for alpha value" + "Using fragment shader to draw nodes with Gaussian filter for alpha value", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo @@ -221,25 +249,31 @@ namespace { "PerspectiveDistanceFactor", "Perspective Distance factor", "This value decides how far away the camera must be to start impacting the node " - "size" + "size", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MinMaxNodeSizeInfo = { "MinMaxNodeSize", "Min & Max node size", - "The minimum and maximum node size" + "The minimum and maximum node size", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo pulseEnabledInfo = { "PulseEnabled", "Nodes close to Earth pulsate", - "Toggles the pulse for nodes close to Earth" + "Toggles the pulse for nodes close to Earth", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo gaussianPulseEnabledInfo = { "GaussianPulseEnabled", "Nodes close to Earth pulsate with alpha by gaussian", - "Toggles the pulse with alpha by gaussian for nodes close to Earth" + "Toggles the pulse with alpha by gaussian for nodes close to Earth", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(RenderableFluxNodes)]] Parameters { diff --git a/modules/space/rendering/renderablehabitablezone.cpp b/modules/space/rendering/renderablehabitablezone.cpp index 62f4e5046a..03b946631c 100644 --- a/modules/space/rendering/renderablehabitablezone.cpp +++ b/modules/space/rendering/renderablehabitablezone.cpp @@ -49,21 +49,27 @@ namespace { "EffectiveTemperature", "Effective Temperature", "The effective temperature of the corresponding star, in Kelvin. " - "Used to compute the width and size of the disc" + "Used to compute the width and size of the disc", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LuminosityInfo = { "Luminosity", "Luminosity", "The luminosity of the corresponding star, in units of solar luminosities. " - "Used to compute the width and size of the disc" + "Used to compute the width and size of the disc", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo OptimisticInfo = { "Optimistic", "Optimistic" , "If true, the habitable zone disc is rendered with the optimistic boundaries " - "rather than the conservative ones" + "rather than the conservative ones", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo KopparapuTeffIntervalInfo = { @@ -72,7 +78,9 @@ namespace { "The effective temperature interval for which Kopparapu's formula is used for " "the habitable zone computation. For stars with temperatures outside the range, " "a simpler method by Tom E. Harris is used. This method only uses the star " - "luminosity and does not include computation of the optimistic boundaries" + "luminosity and does not include computation of the optimistic boundaries", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(RenderableHabitableZone)]] Parameters { diff --git a/modules/space/rendering/renderableorbitalkepler.cpp b/modules/space/rendering/renderableorbitalkepler.cpp index f381070669..3ccbba24ac 100644 --- a/modules/space/rendering/renderableorbitalkepler.cpp +++ b/modules/space/rendering/renderableorbitalkepler.cpp @@ -48,7 +48,8 @@ namespace { constexpr openspace::properties::Property::PropertyInfo PathInfo = { "Path", "Path", - "The file path to the data file to read" + "The file path to the data file to read", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SegmentQualityInfo = { @@ -57,7 +58,9 @@ namespace { "A segment quality value for the orbital trail. A value from 1 (lowest) to " "10 (highest) that controls the number of line segments in the rendering of the " "orbital trail. This does not control the direct number of segments because " - "these automatically increase according to the eccentricity of the orbit" + "these automatically increase according to the eccentricity of the orbit", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = { @@ -65,32 +68,38 @@ namespace { "Line Width", "This value specifies the line width of the trail if the selected rendering " "method includes lines. If the rendering mode is set to Points, this value is " - "ignored" + "ignored", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo LineColorInfo = { "Color", "Color", - "This value determines the RGB main color for the lines and points of the trail" + "This value determines the RGB main color for the lines and points of the trail", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo TrailFadeInfo = { "TrailFade", "Trail Fade", - "This value determines how fast the trail fades and is an appearance property." + "This value determines how fast the trail fades and is an appearance property.", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo StartRenderIdxInfo = { "StartRenderIdx", "Contiguous Starting Index of Render", "Index of object in renderable group to start rendering (all prior objects will " - "be ignored)" + "be ignored)", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RenderSizeInfo = { "RenderSize", "Contiguous Size of Render Block", - "Number of objects to render sequentially from StartRenderIdx" + "Number of objects to render sequentially from StartRenderIdx", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ContiguousModeInfo = { @@ -99,7 +108,8 @@ namespace { "If enabled, then the contiguous set of objects starting from StartRenderIdx " "of size RenderSize will be rendered. If disabled, then the number of objects " "defined by UpperLimit will rendered from an evenly dispersed sample of the " - "full length of the data file." + "full length of the data file.", + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(RenderableOrbitalKepler)]] Parameters { diff --git a/modules/space/rendering/renderablerings.cpp b/modules/space/rendering/renderablerings.cpp index 7a8e397b03..b2e618dd6b 100644 --- a/modules/space/rendering/renderablerings.cpp +++ b/modules/space/rendering/renderablerings.cpp @@ -48,13 +48,15 @@ namespace { "Texture", "Texture", "This value is the path to a texture on disk that contains a one-dimensional " - "texture which is used for these rings" + "texture which is used for these rings", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SizeInfo = { "Size", "Size", - "This value specifies the radius of the rings in meter" + "This value specifies the radius of the rings in meter", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo OffsetInfo = { @@ -63,7 +65,8 @@ namespace { "This value is used to limit the width of the rings. Each of the two values is " "a value between 0 and 1, where 0 is the center of the ring and 1 is the " "maximum extent at the radius. For example, if the value is {0.5, 1.0}, the " - "ring is only shown between radius/2 and radius. It defaults to {0.0, 1.0}" + "ring is only shown between radius/2 and radius. It defaults to {0.0, 1.0}", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo NightFactorInfo = { @@ -71,14 +74,16 @@ namespace { "Night Factor", "This value is a multiplicative factor that is applied to the side of the rings " "that is facing away from the Sun. If this value is equal to '1', no darkening " - "of the night side occurs" + "of the night side occurs", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ColorFilterInfo = { "ColorFilter", "Color Filter", "This value affects the filtering out of part of the rings depending on the " - "color values of the texture. The higher value, the more rings are filtered out" + "color values of the texture. The higher value, the more rings are filtered out", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderableRings)]] Parameters { diff --git a/modules/space/rendering/renderablestars.cpp b/modules/space/rendering/renderablestars.cpp index b79d2a56f9..87d8ca7d6b 100644 --- a/modules/space/rendering/renderablestars.cpp +++ b/modules/space/rendering/renderablestars.cpp @@ -120,108 +120,124 @@ namespace { constexpr openspace::properties::Property::PropertyInfo SpeckFileInfo = { "SpeckFile", "Speck File", - "The speck file that is loaded to get the data for rendering these stars" + "The speck file that is loaded to get the data for rendering these stars", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ColorTextureInfo = { "ColorMap", "ColorBV Texture", "The path to the texture that is used to convert from the B-V value of the star " - "to its color. The texture is used as a one dimensional lookup function" + "to its color. The texture is used as a one dimensional lookup function", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MappingBvInfo = { "MappingBV", "Mapping (bv-color)", "The name of the variable in the speck file that is used as the b-v color " - "variable" + "variable", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MappingLuminanceInfo = { "MappingLuminance", "Mapping (luminance)", "The name of the variable in the speck file that is used as the luminance " - "variable" + "variable", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MappingAbsMagnitudeInfo = { "MappingAbsMagnitude", "Mapping (absolute magnitude)", "The name of the variable in the speck file that is used as the absolute " - "magnitude variable" + "magnitude variable", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MappingAppMagnitudeInfo = { "MappingAppMagnitude", "Mapping (apparent magnitude)", "The name of the variable in the speck file that is used as the apparent " - "magnitude variable" + "magnitude variable", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MappingVxInfo = { "MappingVx", "Mapping (vx)", "The name of the variable in the speck file that is used as the star velocity " - "along the x-axis" + "along the x-axis", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MappingVyInfo = { "MappingVy", "Mapping (vy)", "The name of the variable in the speck file that is used as the star velocity " - "along the y-axis" + "along the y-axis", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MappingVzInfo = { "MappingVz", "Mapping (vz)", "The name of the variable in the speck file that is used as the star velocity " - "along the z-axis" + "along the z-axis", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MappingSpeedInfo = { "MappingSpeed", "Mapping (speed)", - "The name of the variable in the speck file that is used as the speed" + "The name of the variable in the speck file that is used as the speed", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ColorOptionInfo = { "ColorOption", "Color Option", "This value determines which quantity is used for determining the color of the " - "stars" + "stars", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo OtherDataOptionInfo = { "OtherData", "Other Data Column", - "The index of the speck file data column that is used as the color input" + "The index of the speck file data column that is used as the color input", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo OtherDataValueRangeInfo = { "OtherDataValueRange", "Range of the other data values", "This value is the min/max value range that is used to normalize the other data " - "values so they can be used by the specified color map" + "values so they can be used by the specified color map", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FixedColorInfo = { "FixedColorValue", "Color used for fixed star colors", - "The color that should be used if the 'Fixed Color' value is used" + "The color that should be used if the 'Fixed Color' value is used", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo OtherDataColorMapInfo = { "OtherDataColorMap", "Other Data Color Map", - "The color map that is used if the 'Other Data' rendering method is selected" + "The color map that is used if the 'Other Data' rendering method is selected", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FilterOutOfRangeInfo = { "FilterOutOfRange", "Filter Out of Range", "Determines whether other data values outside the value range should be visible " - "or filtered away" + "or filtered away", + openspace::properties::Property::Visibility::AdvancedUser }; // Old Method @@ -229,7 +245,8 @@ namespace { "Texture", "Point Spread Function Texture", "The path to the texture that should be used as a point spread function for the " - "stars" + "stars", + openspace::properties::Property::Visibility::AdvancedUser }; //constexpr openspace::properties::Property::PropertyInfo ShapeTextureInfo = { @@ -244,13 +261,16 @@ namespace { "Magnitude Exponent", "Adjust star magnitude by 10^MagnitudeExponent. Stars closer than this distance " "are given full opacity. Farther away, stars dim proportionally to the " - "logarithm of their distance" + "logarithm of their distance", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo RenderMethodOptionInfo = { "RenderMethod", "Render Method", - "Render method for the stars" + "Render method for the stars", + openspace::properties::Property::Visibility::AdvancedUser }; const openspace::properties::PropertyOwner::PropertyOwnerInfo @@ -279,31 +299,36 @@ namespace { constexpr openspace::properties::Property::PropertyInfo PSFMethodOptionInfo = { "PSFMethodOptionInfo", "PSF Method Option", - "Debug option for PSF main function: Spencer or Moffat" + "Debug option for PSF main function: Spencer or Moffat", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SizeCompositionOptionInfo = { "SizeComposition", "Size Composition Option", - "Base multiplyer for the final stars' sizes" + "Base multiplyer for the final stars' sizes", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo LumPercentInfo = { "LumPercent", "Luminosity Contribution", - "Luminosity Contribution" + "Luminosity Contribution", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RadiusPercentInfo = { "RadiusPercent", "Radius Contribution", - "Radius Contribution" + "Radius Contribution", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo BrightnessPercentInfo = { "BrightnessPercent", "App Brightness Contribution", - "App Brightness Contribution" + "App Brightness Contribution", + openspace::properties::Property::Visibility::AdvancedUser }; const openspace::properties::PropertyOwner::PropertyOwnerInfo @@ -317,25 +342,29 @@ namespace { constexpr openspace::properties::Property::PropertyInfo P0ParamInfo = { "P0Param", "P0", - "P0 parameter contribution" + "P0 parameter contribution", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo P1ParamInfo = { "P1Param", "P1", - "P1 parameter contribution" + "P1 parameter contribution", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo P2ParamInfo = { "P2Param", "P2", - "P2 parameter contribution" + "P2 parameter contribution", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AlphaConstInfo = { "AlphaConst", "Alpha", - "Empirical Alpha Constant" + "Empirical Alpha Constant", + openspace::properties::Property::Visibility::AdvancedUser }; const openspace::properties::PropertyOwner::PropertyOwnerInfo @@ -349,13 +378,15 @@ namespace { constexpr openspace::properties::Property::PropertyInfo FWHMInfo = { "FWHM", "FWHM", - "Moffat's FWHM" + "Moffat's FWHM", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo BetaInfo = { "Beta", "Beta", - "Moffat's Beta Constant" + "Moffat's Beta Constant", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FadeInDistancesInfo = { @@ -363,13 +394,15 @@ namespace { "Fade-In Start and End Distances", "These values determine the initial and final distances from the center of " "our galaxy from which the astronomical object will start and end " - "fading-in" + "fading-in", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DisableFadeInInfo = { "DisableFadeIn", "Disable Fade-in effect", - "Enables/Disables the Fade-in effect" + "Enables/Disables the Fade-in effect", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderableStars)]] Parameters { @@ -512,7 +545,7 @@ RenderableStars::RenderableStars(const ghoul::Dictionary& dictionary) , _lumCent(LumPercentInfo, 0.5f, 0.f, 3.f) , _radiusCent(RadiusPercentInfo, 0.5f, 0.f, 3.f) , _brightnessCent(BrightnessPercentInfo, 0.5f, 0.f, 3.f) - , _magnitudeExponent(MagnitudeExponentInfo, 4.f, 0.f, 8.f) + , _magnitudeExponent(MagnitudeExponentInfo, 6.2f, 5.f, 8.f) , _spencerPSFParamOwner(SpencerPSFParamOwnerInfo) , _p0Param(P0ParamInfo, 0.384f, 0.f, 1.f) , _p1Param(P1ParamInfo, 0.478f, 0.f, 1.f) diff --git a/modules/space/rendering/renderabletravelspeed.cpp b/modules/space/rendering/renderabletravelspeed.cpp index de00b849aa..b495961e39 100644 --- a/modules/space/rendering/renderabletravelspeed.cpp +++ b/modules/space/rendering/renderabletravelspeed.cpp @@ -42,38 +42,48 @@ namespace { constexpr openspace::properties::Property::PropertyInfo SpeedInfo = { "TravelSpeed", "Speed of travel", - "The speed of light is the default value" + "The speed of light is the default value", + // @VISIBILITY(1.25) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo TargetInfo = { "TargetNode", "Target object", - "This value sets which scene graph node to target with the light speed indicator" + "This value sets which scene graph node to target with the light speed indicator", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo LineColorInfo = { "Color", "Color", - "This value determines the RGB color for the line" + "This value determines the RGB color for the line", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo LineWidthInfo = { "LineWidth", "Line Width", - "This value specifies the line width" + "This value specifies the line width", + // @VISIBILITY(1.33) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo IndicatorLengthInfo = { "IndicatorLength", "Indicator Length", - "This value specifies the length of the light indicator set in light seconds" + "This value specifies the length of the light indicator set in light seconds", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo FadeLengthInfo = { "FadeLength", "Fade Length", "This value specifies the length of the faded tail of the light indicator " - "set in light seconds" + "set in light seconds", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(RenderableLightTravel)]] Parameters { diff --git a/modules/space/rotation/spicerotation.cpp b/modules/space/rotation/spicerotation.cpp index b755ff4b04..ae9958bddf 100644 --- a/modules/space/rotation/spicerotation.cpp +++ b/modules/space/rotation/spicerotation.cpp @@ -36,27 +36,31 @@ namespace { "SourceFrame", "Source", "This value specifies the source frame that is used as the basis for the " - "coordinate transformation. This has to be a valid SPICE name" + "coordinate transformation. This has to be a valid SPICE name", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo DestinationInfo = { "DestinationFrame", "Destination", "This value specifies the destination frame that is used for the coordinate " - "transformation. This has to be a valid SPICE name" + "transformation. This has to be a valid SPICE name", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo TimeFrameInfo = { "TimeFrame", "Time Frame", - "The time frame in which the spice kernels are valid" + "The time frame in which the spice kernels are valid", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FixedDateInfo = { "FixedDate", "Fixed Date", "A time to lock the rotation to. Setting this to an empty string will " - "unlock the time and return to rotation based on current simulation time" + "unlock the time and return to rotation based on current simulation time", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(SpiceRotation)]] Parameters { diff --git a/modules/space/spacemodule.cpp b/modules/space/spacemodule.cpp index b56af70f35..cd975b4eed 100644 --- a/modules/space/spacemodule.cpp +++ b/modules/space/spacemodule.cpp @@ -55,7 +55,8 @@ namespace { "ShowExceptions", "Show Exceptions", "If enabled, errors from SPICE will be thrown and show up in the log. If " - "disabled, the errors will be ignored silently" + "disabled, the errors will be ignored silently", + openspace::properties::Property::Visibility::Developer }; } // namespace diff --git a/modules/space/translation/horizonstranslation.cpp b/modules/space/translation/horizonstranslation.cpp index aa673960a9..8065361403 100644 --- a/modules/space/translation/horizonstranslation.cpp +++ b/modules/space/translation/horizonstranslation.cpp @@ -47,7 +47,9 @@ namespace { "HorizonsTextFile", "Horizons Text File", "This value is the path to the file or files generated by Horizons with " - "either a Vector table or an Observer table with the correct settings (see wiki)" + "either a Vector table or an Observer table with the correct settings (see wiki)", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(HorizonsTranslation)]] Parameters { diff --git a/modules/space/translation/keplertranslation.cpp b/modules/space/translation/keplertranslation.cpp index c6d7e1c94f..b6c722bdad 100644 --- a/modules/space/translation/keplertranslation.cpp +++ b/modules/space/translation/keplertranslation.cpp @@ -51,7 +51,8 @@ namespace { "Eccentricity", "This value determines the eccentricity, that is the deviation from a perfect " "sphere, for this orbit. Currently, hyperbolic orbits using Keplerian elements " - "are not supported" + "are not supported", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SemiMajorAxisInfo = { @@ -59,7 +60,8 @@ namespace { "Semi-major axis", "This value determines the semi-major axis, that is the distance of the object " "from the central body in kilometers (semi-major axis = average of periapsis and " - "apoapsis)" + "apoapsis)", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo InclinationInfo = { @@ -67,7 +69,8 @@ namespace { "Inclination", "This value determines the degrees of inclination, or the angle of the orbital " "plane, relative to the reference plane, on which the object orbits around the " - "central body" + "central body", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AscendingNodeInfo = { @@ -75,34 +78,39 @@ namespace { "Right ascension of ascending Node", "This value determines the right ascension of the ascending node in degrees, " "that is the location of position along the orbit where the inclined plane and " - "the horizonal reference plane intersect" + "the horizonal reference plane intersect", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ArgumentOfPeriapsisInfo = { "ArgumentOfPeriapsis", "Argument of Periapsis", "This value determines the argument of periapsis in degrees, that is the " - "position on the orbit that is closest to the orbiting body" + "position on the orbit that is closest to the orbiting body", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MeanAnomalyAtEpochInfo = { "MeanAnomaly", "Mean anomaly at epoch", "This value determines the mean anomaly at the epoch in degrees, which " - "determines the initial location of the object along the orbit at epoch" + "determines the initial location of the object along the orbit at epoch", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo EpochInfo = { "Epoch", "Epoch", "This value determines the epoch for which the initial location is defined in " - "the form of YYYY MM DD HH:mm:ss" + "the form of YYYY MM DD HH:mm:ss", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo PeriodInfo = { "Period", "Orbit period", - "Specifies the orbital period (in seconds)" + "Specifies the orbital period (in seconds)", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(KeplerTranslation)]] Parameters { diff --git a/modules/space/translation/spicetranslation.cpp b/modules/space/translation/spicetranslation.cpp index b920300b9f..fb08e91c76 100644 --- a/modules/space/translation/spicetranslation.cpp +++ b/modules/space/translation/spicetranslation.cpp @@ -43,7 +43,9 @@ namespace { "Target", "This is the SPICE NAIF name for the body whose translation is to be computed by " "the SpiceTranslation. It can either be a fully qualified name (such as 'EARTH') " - "or a NAIF integer id code (such as '399')" + "or a NAIF integer id code (such as '399')", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ObserverInfo = { @@ -51,21 +53,27 @@ namespace { "Observer", "This is the SPICE NAIF name for the parent of the body whose translation is to " "be computed by the SpiceTranslation. It can either be a fully qualified name " - "(such as 'SOLAR SYSTEM BARYCENTER') or a NAIF integer id code (such as '0')" + "(such as 'SOLAR SYSTEM BARYCENTER') or a NAIF integer id code (such as '0')", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FrameInfo = { "Frame", "Reference Frame", "This is the SPICE NAIF name for the reference frame in which the position " - "should be retrieved. The default value is GALACTIC" + "should be retrieved. The default value is GALACTIC", + // @VISIBILITY(3.33) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FixedDateInfo = { "FixedDate", "Fixed Date", "A time to lock the position to. Setting this to an empty string will " - "unlock the time and return to position based on current simulation time" + "unlock the time and return to position based on current simulation time", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(SpiceTranslation)]] Parameters { diff --git a/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp b/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp index bdb34c7444..9db867a435 100644 --- a/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp +++ b/modules/spacecraftinstruments/dashboard/dashboarditeminstruments.cpp @@ -44,14 +44,18 @@ namespace { "Active Color", "This value determines the color that the active instrument is rendered in. " "Shortly after activation, the used color is mixture of this and the flash " - "color. The default value is (0.6, 1.0, 0.0)" + "color. The default value is (0.6, 1.0, 0.0)", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo FlashColorInfo = { "FlashColor", "Flash Color", "This value determines the color that is used shortly after an instrument " - "activation. The default value is (0.9, 1.0, 0.75)" + "activation. The default value is (0.9, 1.0, 0.75)", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; std::string progressToStr(int size, double t) { diff --git a/modules/spacecraftinstruments/rendering/renderablefov.cpp b/modules/spacecraftinstruments/rendering/renderablefov.cpp index 3d20967e73..e29610b013 100644 --- a/modules/spacecraftinstruments/rendering/renderablefov.cpp +++ b/modules/spacecraftinstruments/rendering/renderablefov.cpp @@ -51,7 +51,8 @@ namespace { "LineWidth", "Line Width", "This value determines width of the lines connecting the instrument to the " - "corners of the field of view" + "corners of the field of view", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo StandoffDistanceInfo = { @@ -61,14 +62,17 @@ namespace { "distance of the plane to the focus object. If this value is '1', the field of " "view will be rendered exactly on the surface of, for example, a planet. With a " "value of smaller than 1, the field of view will hover of ther surface, thus " - "making it more visible" + "making it more visible", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AlwaysDrawFovInfo = { "AlwaysDrawFov", "Always Draw FOV", "If this value is enabled, the field of view will always be drawn, regardless of " - "whether image information has been loaded or not" + "whether image information has been loaded or not", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo DefaultStartColorInfo = { @@ -76,7 +80,8 @@ namespace { "Start of default color", "This value determines the color of the field of view frustum close to the " "instrument. The final colors are interpolated between this value and the end " - "color" + "color", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DefaultEndColorInfo = { @@ -84,21 +89,24 @@ namespace { "End of default color", "This value determines the color of the field of view frustum close to the " "target. The final colors are interpolated between this value and the start " - "color" + "color", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ActiveColorInfo = { "Colors.Active", "Active Color", "This value determines the color that is used when the instrument's field of " - "view is active" + "view is active", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TargetInFovInfo = { "Colors.TargetInFieldOfView", "Target in field-of-view Color", "This value determines the color that is used if the target is inside the field " - "of view of the instrument but the instrument is not yet active" + "of view of the instrument but the instrument is not yet active", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo IntersectionStartInfo = { @@ -106,7 +114,8 @@ namespace { "Start of the intersection", "This value determines the color that is used close to the instrument if one of " "the field of view corners is intersecting the target object. The final color is " - "retrieved by interpolating between this color and the intersection end color" + "retrieved by interpolating between this color and the intersection end color", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo IntersectionEndInfo = { @@ -114,7 +123,8 @@ namespace { "End of the intersection", "This value determines the color that is used close to the target if one of the " "field of view corners is intersecting the target object. The final color is " - "retrieved by interpolating between this color and the intersection begin color" + "retrieved by interpolating between this color and the intersection begin color", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SquareColorInfo = { @@ -122,7 +132,8 @@ namespace { "Orthogonal Square", "This value determines the color that is used for the field of view square in " "the case that there is no intersection and that the instrument is not currently " - "active" + "active", + openspace::properties::Property::Visibility::AdvancedUser }; template diff --git a/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp b/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp index b80cfc36c0..3852feda2e 100644 --- a/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderablemodelprojection.cpp @@ -58,7 +58,9 @@ namespace { "Perform Shading", "If this value is enabled, the model will be shaded based on the relative " "location to the Sun. If this value is disabled, shading is disabled and the " - "entire model is rendered brightly" + "entire model is rendered brightly", + // @VISIBILITY(1.5) + openspace::properties::Property::Visibility::NoviceUser }; struct [[codegen::Dictionary(RenderableModelProjection)]] Parameters { diff --git a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp index 79bb113699..818c2e0a7d 100644 --- a/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp +++ b/modules/spacecraftinstruments/rendering/renderableplanetprojection.cpp @@ -58,14 +58,16 @@ namespace { "The texture path selected in this property is used as the base texture that is " "applied to the planet prior to any image projections. This menu always contains " "an empty option for not using a color map. If this value is specified in an " - "asset, the last texture is used" + "asset, the last texture is used", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AddColorTextureInfo = { "AddColorTexture", "Add Color Base Texture", "Adds a new base color texture to the list of selectable base maps used prior to " - "any image projection" + "any image projection", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo HeightTexturePathsInfo = { @@ -73,13 +75,15 @@ namespace { "Heightmap Texture", "The texture path selected in this property is used as the height map on the " "planet. This menu always contains an empty option for not using a heightmap. If " - "this value is specified in an asset, the last texture is used" + "this value is specified in an asset, the last texture is used", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AddHeightTextureInfo = { "AddHeightTexture", "Add Heightmap Texture", - "Adds a new height map texture to the list of selectable height maps used" + "Adds a new height map texture to the list of selectable height maps used", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo HeightExaggerationInfo = { @@ -87,7 +91,8 @@ namespace { "Height Exaggeration", "This value determines the level of height exaggeration that is applied to a " "potential height field. A value of '0' inhibits the height field, whereas a " - "value of '1' uses the measured height field" + "value of '1' uses the measured height field", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MeridianShiftInfo = { @@ -96,44 +101,51 @@ namespace { "If this value is enabled, a shift of the meridian by 180 degrees is performed. " "This is a fix especially for Pluto height maps, where the definition of the " "meridian has changed through the New Horizons mission and this requires this " - "shift" + "shift", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AmbientBrightnessInfo = { "AmbientBrightness", "Ambient Brightness", - "This value determines the ambient brightness of the dark side of the planet" + "This value determines the ambient brightness of the dark side of the planet", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo MaxProjectionsPerFrameInfo = { "MaxProjectionsPerFrame", "Max Projections Per Frame", "The maximum number of image projections to perform per frame. " - "Useful to avoid freezing the system for large delta times" + "Useful to avoid freezing the system for large delta times", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ProjectionsInBufferInfo = { "ProjectionsInBuffer", "Projections In Buffer", - "(Read only) The number of images that are currently waiting to be projected" + "(Read only) The number of images that are currently waiting to be projected", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ClearProjectionBufferInfo = { "ClearProjectionBuffer", "Clear Projection Buffer", - "Remove all pending projections from the buffer" + "Remove all pending projections from the buffer", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RadiusInfo = { "Radius", "Radius", - "This value specifies the radius of this sphere in meters" + "This value specifies the radius of this sphere in meters", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SegmentsInfo = { "Segments", "Segments", - "This value specifies the number of segments that this sphere is split into" + "This value specifies the number of segments that this sphere is split into", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderablePlanetProjection)]] Parameters { diff --git a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp index 4cd745e98a..be1f8efef7 100644 --- a/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp +++ b/modules/spacecraftinstruments/rendering/renderableshadowcylinder.cpp @@ -43,7 +43,8 @@ namespace { "Points", "This value determines the number of control points that is used to construct " "the shadow geometry. The higher this number, the more detailed the shadow is, " - "but it will have a negative impact on the performance" + "but it will have a negative impact on the performance", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ShadowLengthInfo = { @@ -51,55 +52,65 @@ namespace { "Shadow Length", "This value determines the length of the shadow that is cast by the target " "object. The total distance of the shadow is equal to the distance from the " - "target to the Sun multiplied with this value" + "target to the Sun multiplied with this value", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ShadowColorInfo = { "ShadowColor", "Shadow Color", - "This value determines the color that is used for the shadow cylinder" + "This value determines the color that is used for the shadow cylinder", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo TerminatorTypeInfo = { "TerminatorType", "Terminator Type", "This value determines the type of the terminator that is used to calculate the " - "shadow eclipse" + "shadow eclipse", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo LightSourceInfo = { "LightSource", "Light Source", "This value determines the SPICE name of the object that is used as the " - "illuminator for computing the shadow cylinder" + "illuminator for computing the shadow cylinder", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ObserverInfo = { "Observer", "Observer", "This value specifies the SPICE name of the object that is the observer of the " - "shadow cylinder" + "shadow cylinder", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo BodyInfo = { "Body", "Target Body", "This value is the SPICE name of target body that is used as the shadow caster " - "for the shadow cylinder" + "for the shadow cylinder", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo BodyFrameInfo = { "BodyFrame", "Body Frame", "This value is the SPICE name of the reference frame in which the shadow " - "cylinder is expressed" + "cylinder is expressed", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AberrationInfo = { "Aberration", "Aberration", "This value determines the aberration method that is used to compute the shadow " - "cylinder" + "cylinder", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderableShadowCylinder)]] Parameters { diff --git a/modules/spacecraftinstruments/util/projectioncomponent.cpp b/modules/spacecraftinstruments/util/projectioncomponent.cpp index d12e1d9aac..aa03fa8db9 100644 --- a/modules/spacecraftinstruments/util/projectioncomponent.cpp +++ b/modules/spacecraftinstruments/util/projectioncomponent.cpp @@ -50,14 +50,18 @@ namespace { "PerformProjection", "Perform Projections", "If this value is enabled, this ProjectionComponent will perform projections. If " - "it is disabled, projections will be ignored" + "it is disabled, projections will be ignored", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ClearProjectionInfo = { "ClearAllProjections", "Clear Projections", "If this property is triggered, it will remove all the projections that have " - "already been applied" + "already been applied", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo FadingInfo = { @@ -65,7 +69,9 @@ namespace { "Projection Fading", "This value fades the previously performed projections in or out. If this value " "is equal to '1', the projections are fully visible, if the value is equal to " - "'0', the performed projections are completely invisible" + "'0', the performed projections are completely invisible", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo TextureSizeInfo = { @@ -74,14 +80,16 @@ namespace { "This value determines the size of the texture into which the images are " "projected and thus provides the limit to the resolution of projections that can " "be applied. Changing this value will not cause the texture to be automatically " - "updated, but triggering the 'ApplyTextureSize' property is required" + "updated, but triggering the 'ApplyTextureSize' property is required", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ApplyTextureSizeInfo = { "ApplyTextureSize", "Apply Texture Size", "Triggering this property applies a new size to the underlying projection " - "texture. The old texture is resized and interpolated to fit the new size" + "texture. The old texture is resized and interpolated to fit the new size", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(ProjectionComponent)]] Parameters { diff --git a/modules/spout/renderableplanespout.cpp b/modules/spout/renderableplanespout.cpp index 0f747e2b46..2e3bea2bc9 100644 --- a/modules/spout/renderableplanespout.cpp +++ b/modules/spout/renderableplanespout.cpp @@ -38,7 +38,8 @@ namespace { "SpoutName", "Spout Sender Name", "This value explicitly sets the Spout receiver to use a specific name. If this " - "is not a valid name, an empty image is used" + "is not a valid name, an empty image is used", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SelectionInfo = { @@ -46,13 +47,15 @@ namespace { "Spout Selection", "This property displays all available Spout sender on the system. If one them is " "selected, its value is stored in the 'SpoutName' property, overwriting its " - "previous value" + "previous value", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo UpdateInfo = { "UpdateSelection", "Update Selection", - "If this property is trigged, the 'SpoutSelection' options will be refreshed" + "If this property is trigged, the 'SpoutSelection' options will be refreshed", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderablePlaneSpout)]] Parameters { diff --git a/modules/spout/screenspacespout.cpp b/modules/spout/screenspacespout.cpp index 83f6993a1b..7ba25f1ede 100644 --- a/modules/spout/screenspacespout.cpp +++ b/modules/spout/screenspacespout.cpp @@ -36,7 +36,8 @@ namespace { "SpoutName", "Spout Sender Name", "This value explicitly sets the Spout receiver to use a specific name. If this " - "is not a valid name, an empty image is used" + "is not a valid name, an empty image is used", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SelectionInfo = { @@ -44,13 +45,15 @@ namespace { "Spout Selection", "This property displays all available Spout sender on the system. If one them is " "selected, its value is stored in the 'SpoutName' property, overwriting its " - "previous value" + "previous value", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo UpdateInfo = { "UpdateSelection", "Update Selection", - "If this property is trigged, the 'SpoutSelection' options will be refreshed" + "If this property is trigged, the 'SpoutSelection' options will be refreshed", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(ScreenSpaceSpout)]] Parameters { diff --git a/modules/spout/spoutwrapper.cpp b/modules/spout/spoutwrapper.cpp index e45a1efbf8..543a339fd0 100644 --- a/modules/spout/spoutwrapper.cpp +++ b/modules/spout/spoutwrapper.cpp @@ -37,14 +37,16 @@ namespace { constexpr openspace::properties::Property::PropertyInfo NameSenderInfo = { "SpoutName", "Spout Sender Name", - "This value sets the Spout sender to use a specific name" + "This value sets the Spout sender to use a specific name", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo NameReceiverInfo = { "SpoutName", "Spout Receiver Name", "This value explicitly sets the Spout receiver to use a specific name. If this " - "is not a valid name, an empty image is used" + "is not a valid name, an empty image is used", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SelectionInfo = { @@ -52,13 +54,15 @@ namespace { "Spout Selection", "This property displays all available Spout sender on the system. If one them is " "selected, its value is stored in the 'SpoutName' property, overwriting its " - "previous value" + "previous value", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo UpdateInfo = { "UpdateSelection", "Update Selection", - "If this property is trigged, the 'SpoutSelection' options will be refreshed" + "If this property is trigged, the 'SpoutSelection' options will be refreshed", + openspace::properties::Property::Visibility::AdvancedUser }; } // namespace diff --git a/modules/touch/src/touchinteraction.cpp b/modules/touch/src/touchinteraction.cpp index f5c3ba7ab6..ce4d7438ae 100644 --- a/modules/touch/src/touchinteraction.cpp +++ b/modules/touch/src/touchinteraction.cpp @@ -74,68 +74,84 @@ namespace { constexpr openspace::properties::Property::PropertyInfo DisableZoomInfo = { "DisableZoom", "Disable zoom navigation", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo DisableRollInfo = { "DisableRoll", "Disable roll navigation", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo SetDefaultInfo = { "SetDefault", "Reset all properties to default", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MaxTapTimeInfo = { "MaxTapTime", "Max tap delay (in ms) for double tap", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DecelatesPerSecondInfo = { "DeceleratesPerSecond", "Number of times velocity is decelerated per second", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TouchScreenSizeInfo = { "TouchScreenSize", "Touch Screen size in inches", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TapZoomFactorInfo = { "TapZoomFactor", "Scaling distance travelled on tap", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo PinchZoomFactorInfo = { "PinchZoomFactor", "Scaling distance travelled on pinch", "This value is used to reduce the amount of pinching needed. A linear kind of " - "sensitivity that will alter the pinch-zoom speed" + "sensitivity that will alter the pinch-zoom speed", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RollThresholdInfo = { "RollThreshold", "Threshold for min angle for roll interpret", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ZoomSensitivityExpInfo = { "ZoomSensitivityExp", "Sensitivity of exponential zooming in relation to distance from focus node", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ZoomSensitivityPropInfo = { "ZoomSensitivityProp", "Sensitivity of zooming proportional to distance from focus node", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo @@ -144,7 +160,9 @@ namespace { "ZoomSensitivityDistanceThreshold", "Threshold of distance to target node for whether or not to use exponential " "zooming", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo @@ -153,7 +171,9 @@ namespace { "ZoomInBoundarySphereMultiplier", "Multiplies a node's boundary sphere by this in order to limit zoom in & prevent " "surface collision", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo @@ -167,37 +187,44 @@ namespace { constexpr openspace::properties::Property::PropertyInfo ConstantTimeDecaySecsInfo = { "ConstantTimeDecaySecs", "Time duration that a pitch/roll/zoom/pan should take to decay to zero (seconds)", - "" + "", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo InputSensitivityInfo = { "InputSensitivity", "Threshold for interpreting input as still", - "" + "", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo StationaryCentroidInfo = { "CentroidStationary", "Threshold for stationary centroid", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo PanModeInfo = { "PanMode", "Allow panning gesture", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo PanDeltaDistanceInfo = { "PanDeltaDistance", "Delta distance between fingers allowed for interpreting pan interaction", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FrictionInfo = { "Friction", "Friction for different interactions (orbit, zoom, roll, pan)", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ZoomOutLimitInfo = { @@ -205,7 +232,9 @@ namespace { "Zoom Out Limit", "The maximum distance you are allowed to navigate away from the anchor. " "This should always be larger than the zoom in value if you want to be able " - "to zoom. Defaults to maximum allowed double" + "to zoom. Defaults to maximum allowed double", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ZoomInLimitInfo = { @@ -213,7 +242,9 @@ namespace { "Zoom In Limit", "The minimum distance from the anchor that you are allowed to navigate to. " "Its purpose is to limit zooming in on a node. If this value is not set it " - "defaults to the surface of the current anchor." + "defaults to the surface of the current anchor.", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo @@ -221,7 +252,8 @@ namespace { { "EnableDirectManipulation", "Enable direct manipulation", - "Decides whether the direct manipulation mode should be enabled or not. " + "Decides whether the direct manipulation mode should be enabled or not.", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo @@ -231,7 +263,8 @@ namespace { "Direct manipulation threshold", "This threshold affects the distance from the interaction sphere at which the " "direct manipulation interaction mode starts being active. The value is given " - "as a factor times the interaction sphere" + "as a factor times the interaction sphere", + openspace::properties::Property::Visibility::AdvancedUser }; // Compute coefficient of decay based on current frametime; if frametime has been diff --git a/modules/touch/src/touchmarker.cpp b/modules/touch/src/touchmarker.cpp index cde53a73ad..b746ca2547 100644 --- a/modules/touch/src/touchmarker.cpp +++ b/modules/touch/src/touchmarker.cpp @@ -38,29 +38,36 @@ namespace { constexpr openspace::properties::Property::PropertyInfo VisibilityInfo = { "Visibility", "Toggle visibility of markers", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo RadiusInfo = { "Size", "Marker radius", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo OpacityInfo = { "Opacity", "Marker opacity", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ThicknessInfo = { "Thickness", "Marker thickness", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ColorInfo = { - "MarkerColor", "Marker color", "" // @TODO Missing documentation + "MarkerColor", + "Marker color", + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::User }; } // namespace diff --git a/modules/touch/touchmodule.cpp b/modules/touch/touchmodule.cpp index 02b8c68386..98e61911c0 100644 --- a/modules/touch/touchmodule.cpp +++ b/modules/touch/touchmodule.cpp @@ -45,7 +45,8 @@ namespace { "EnableTouchInteraction", "Enable Touch Interaction", "Use this property to turn on/off touch input navigation in the 3D scene. " - "Disabling will reset all current touch inputs to the navigation." + "Disabling will reset all current touch inputs to the navigation.", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo EventsInfo = { @@ -66,7 +67,8 @@ namespace { "relatively spherical objects.", openspace::properties::Property::Visibility::AdvancedUser }; -} +} // namespace openspace + namespace openspace { TouchModule::TouchModule() diff --git a/modules/toyvolume/rendering/renderabletoyvolume.cpp b/modules/toyvolume/rendering/renderabletoyvolume.cpp index b7d6e94e8e..8dadf4203b 100644 --- a/modules/toyvolume/rendering/renderabletoyvolume.cpp +++ b/modules/toyvolume/rendering/renderabletoyvolume.cpp @@ -37,44 +37,53 @@ namespace { constexpr openspace::properties::Property::PropertyInfo SizeInfo = { "Size", "Size", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ScalingExponentInfo = { "ScalingExponent", "Scaling Exponent", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo StepSizeInfo = { "StepSize", "Step Size", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TranslationInfo = { "Translation", "Translation", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(3.) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RotationInfo = { "Rotation", "Euler rotation", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(3.) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ColorInfo = { "Color", "Color", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo DownscaleVolumeRenderingInfo = { "Downscale", "Downscale Factor Volume Rendering", - "This value set the downscaling factor when rendering the current volume" + "This value set the downscaling factor when rendering the current volume", + openspace::properties::Property::Visibility::AdvancedUser }; } // namespace diff --git a/modules/video/CMakeLists.txt b/modules/video/CMakeLists.txt index 059ec4f666..af48257537 100644 --- a/modules/video/CMakeLists.txt +++ b/modules/video/CMakeLists.txt @@ -45,6 +45,13 @@ set(SOURCE_FILES ) source_group("Source Files" FILES ${SOURCE_FILES}) +create_new_module( + "Video" + video_module + STATIC + ${HEADER_FILES} ${SOURCE_FILES} +) + # Libmpv if (WIN32) set(LIBMPV_ROOT "${CMAKE_CURRENT_BINARY_DIR}/ext/libmpv" CACHE INTERNAL "LIBMPV_ROOT") @@ -90,18 +97,13 @@ if (WIN32) IMPORTED_IMPLIB "${LIBMPV_ROOT}/libmpv/lib/mpv.lib" ) - target_link_libraries(openspace-module-globebrowsing PUBLIC libmpv libopenh264) + target_link_libraries(openspace-module-video PUBLIC libmpv libopenh264) else (WIN32) - find_package(LIBMPV REQUIRED) + find_package(Libmpv REQUIRED) + # For some reason libmpv on Ubuntu doesn't link if Vulkan is not included too + find_package(Vulkan REQUIRED) - target_include_directories(openspace-module-globebrowsing SYSTEM PRIVATE ${LIBMPV_INCLUDE_DIR}) - target_link_libraries(openspace-module-globebrowsing PRIVATE ${LIBMPV_LIBRARY}) - mark_as_advanced(LIBMPV_CONFIG LIBMPV_INCLUDE_DIR LIBMPV_LIBRARY) + target_include_directories(openspace-module-video SYSTEM PRIVATE ${Libmpv_INCLUDE_DIRS}) + target_link_libraries(openspace-module-video PRIVATE ${Libmpv_LIBRARIES} Vulkan::Vulkan) + mark_as_advanced(LIBMPV_CONFIG Libmpv_INCLUDE_DIRS Libmpv_LIBRARIES) endif () # WIN32 - -create_new_module( - "Video" - video_module - STATIC - ${HEADER_FILES} ${SOURCE_FILES} -) diff --git a/modules/video/src/renderablevideosphere.cpp b/modules/video/src/renderablevideosphere.cpp index 2334c00755..9bb108ce2f 100644 --- a/modules/video/src/renderablevideosphere.cpp +++ b/modules/video/src/renderablevideosphere.cpp @@ -148,7 +148,6 @@ RenderableVideoSphere::RenderableVideoSphere(const ghoul::Dictionary& dictionary const Parameters p = codegen::bake(dictionary); addProperty(_opacity); - registerUpdateRenderBinFromOpacity(); _size = p.size; _segments = p.segments; diff --git a/modules/vislab/rendering/renderabledistancelabel.cpp b/modules/vislab/rendering/renderabledistancelabel.cpp index 071039b17d..80c2fa3aac 100644 --- a/modules/vislab/rendering/renderabledistancelabel.cpp +++ b/modules/vislab/rendering/renderabledistancelabel.cpp @@ -41,21 +41,25 @@ namespace { "NodeLine", "Node Line", "Property to track a nodeline. When tracking the label text will be updating the " - "distance from the nodeline start and end" + "distance from the nodeline start and end", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DistanceUnitInfo = { "DistanceUnit", "Distance Unit", "Property to define the unit in which the distance should be displayed. " - "Defaults to 'km' if not specified" + "Defaults to 'km' if not specified", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo CustomUnitDescriptorInfo = { "CustomUnitDescriptor", "Custom Unit Descriptor", "Property to define a custom unit descriptor to use to describe the distance " - "value. Defaults to the units SI descriptor if not specified" + "value. Defaults to the units SI descriptor if not specified", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderableDistanceLabel)]] Parameters { diff --git a/modules/volume/rendering/renderabletimevaryingvolume.cpp b/modules/volume/rendering/renderabletimevaryingvolume.cpp index d0d5838dc2..21f04ae866 100644 --- a/modules/volume/rendering/renderabletimevaryingvolume.cpp +++ b/modules/volume/rendering/renderabletimevaryingvolume.cpp @@ -55,70 +55,85 @@ namespace { constexpr openspace::properties::Property::PropertyInfo StepSizeInfo = { "StepSize", "Step Size", - "Specifies how often to sample on the raycaster. Lower step -> higher resolution" + "Specifies how often to sample on the raycaster. Lower step -> higher resolution", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo GridTypeInfo = { "GridType", "Grid Type", "Spherical or Cartesian grid", - openspace::properties::Property::Visibility::Developer + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SecondsBeforeInfo = { "SecondsBefore", "Seconds before", "Specifies the number of seconds to show the first timestep before its " - "actual time. The default value is 0" + "actual time. The default value is 0", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SecondsAfterInfo = { "SecondsAfter", "Seconds after", "Specifies the number of seconds to show the the last timestep after its " - "actual time" + "actual time", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SourceDirectoryInfo = { "SourceDirectory", "Source Directory", - "Specifies the path to load timesteps from" + "Specifies the path to load timesteps from", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TransferFunctionInfo = { "TransferFunctionPath", "Transfer Function Path", - "Specifies the transfer function file path" + "Specifies the transfer function file path", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TriggerTimeJumpInfo = { "TriggerTimeJump", "Jump", - "Sets the time to be the first time of the volume sequence" + "Sets the time to be the first time of the volume sequence", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo JumpToTimestepInfo = { "JumpToTimestep", "Jump to timestep", - "Lets you scrub through the sequence's time steps" + "Lets you scrub through the sequence's time steps", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo BrightnessInfo = { "Brightness", "Brightness", - "The volume renderer's general brightness" + "The volume renderer's general brightness", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo rNormalizationInfo = { "RNormalization", "Radius normalization", - "" // @TODO Missing documentation + "", // @TODO Missing documentation + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo rUpperBoundInfo = { "RUpperBound", "Radius upper bound", - "Limit the volume's radius" + "Limit the volume's radius", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(RenderableTimeVaryingVolume)]] Parameters { diff --git a/modules/volume/transferfunctionhandler.cpp b/modules/volume/transferfunctionhandler.cpp index 12878a6e83..c6968542cb 100644 --- a/modules/volume/transferfunctionhandler.cpp +++ b/modules/volume/transferfunctionhandler.cpp @@ -32,31 +32,37 @@ namespace { constexpr openspace::properties::Property::PropertyInfo TransferFunctionInfo = { "TransferFunction", "TransferFunction", - "All the envelopes used in the transfer function" + "All the envelopes used in the transfer function", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DataUnitInfo = { "DataUnit", "DataUnit", - "Unit of the data" + "Unit of the data", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MinValueInfo = { "MinValue", "MinValue", - "Minimum value in the data" + "Minimum value in the data", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MaxValueInfo = { "MaxValue", "MaxValue", - "Maximum value in the data" + "Maximum value in the data", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SaveTransferFunctionInfo = { "SaveTransferFunction", "Save Transfer Function", - "Save your transfer function" + "Save your transfer function", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; } // namespace diff --git a/modules/webbrowser/src/screenspacebrowser.cpp b/modules/webbrowser/src/screenspacebrowser.cpp index 420947a95d..f1ebe5fc81 100644 --- a/modules/webbrowser/src/screenspacebrowser.cpp +++ b/modules/webbrowser/src/screenspacebrowser.cpp @@ -41,19 +41,23 @@ namespace { constexpr openspace::properties::Property::PropertyInfo DimensionsInfo = { "Dimensions", "Browser Dimensions", - "Set the dimensions of the web browser windows" + "Set the dimensions of the web browser windows", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo UrlInfo = { "Url", "URL", - "The URL to load" + "The URL to load", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo ReloadInfo = { "Reload", "Reload", - "Reload the web browser" + "Reload the web browser", + openspace::properties::Property::Visibility::NoviceUser }; struct [[codegen::Dictionary(ScreenSpaceBrowser)]] Parameters { diff --git a/modules/webbrowser/webbrowsermodule.cpp b/modules/webbrowser/webbrowsermodule.cpp index cbb4bbf57e..f0fec3e77a 100644 --- a/modules/webbrowser/webbrowsermodule.cpp +++ b/modules/webbrowser/webbrowsermodule.cpp @@ -58,14 +58,16 @@ namespace { "Update Browser Between Renderables", "Run the message loop of the browser between calls to render individual " "renderables. When disabled, the browser message loop only runs " - "once per frame" + "once per frame", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo BrowserUpdateIntervalInfo = { "BrowserUpdateInterval", "Browser Update Interval", "The time in microseconds between running the message loop of the browser. " - "Only used if UpdateBrowserBetweenRenderables is true" + "Only used if UpdateBrowserBetweenRenderables is true", + openspace::properties::Property::Visibility::Developer }; } // namespace diff --git a/modules/webgui/webguimodule.cpp b/modules/webgui/webguimodule.cpp index b334a39a77..26b9ab478e 100644 --- a/modules/webgui/webguimodule.cpp +++ b/modules/webgui/webguimodule.cpp @@ -44,32 +44,39 @@ namespace { constexpr openspace::properties::Property::PropertyInfo ServerProcessEnabledInfo = { "ServerProcessEnabled", "Enable Server Process", - "Enable the node js based process used to serve the Web GUI" + "Enable the node js based process used to serve the Web GUI", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AddressInfo = { "Address", "Address", - "The network address to use when connecting to OpenSpace from the Web GUI" + "The network address to use when connecting to OpenSpace from the Web GUI", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo PortInfo = { "Port", "Port", - "The network port to use when serving the Web GUI over HTTP" + "The network port to use when serving the Web GUI over HTTP", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo WebSocketInterfaceInfo = { "WebSocketInterface", "WebSocket Interface", - "The identifier of the websocket interface to use when communicating" + "The identifier of the websocket interface to use when communicating", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ServerProcessEntryPointInfo = { "ServerProcessEntryPoint", "Server Process Entry Point", - "The node js command to invoke" + "The node js command to invoke", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DirectoriesInfo = { @@ -78,13 +85,17 @@ namespace { "Directories from which to to serve static content, as a string list " "with entries expressed as pairs, where every odd is the endpoint name and every " "even is the directory", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DefaultEndpointInfo = { "DefaultEndpoint", "Default Endpoint", "The 'default' endpoint. The server will redirect http requests from / to " - "/" + "/", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ServedDirectoriesInfo = { @@ -93,7 +104,8 @@ namespace { "Directories that are currently served. This value is set by the server process, " "as a verification of the actually served directories. For example, an onChange " "callback can be registered to this, to reload browsers when the server is " - "ready. Manual changes to this property have no effect" + "ready. Manual changes to this property have no effect", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(WebGuiModule)]] Parameters { diff --git a/openspace.cfg b/openspace.cfg index 5ff6679817..b5b6508bc5 100644 --- a/openspace.cfg +++ b/openspace.cfg @@ -59,6 +59,27 @@ SGCTConfig = sgct.config.single{vsync=false} -- spout_output_fisheye.json: a window where the rendering is sent to spout (fisheye -- output) instead of the display +-- These are window configurations that are set to "read-only" +ReadOnlyWindowConfigs = { + "equirectangular_gui.json", + "fullscreen1080.json", + "gui_projector.json", + "single_fisheye_gui.json", + "single_fisheye.json", + "single_gui.json", + "single_gui_spout.json", + "single.json", + "single_sbs_stereo.json", + "single_two_win.json", + "spherical_mirror_gui.json", + "spherical_mirror.json", + "spout_output_cubemap.json", + "spout_output_equirectangular.json", + "spout_output_fisheye.json", + "spout_output_flat.json", + "two_nodes.json" +} + -- Variable: Profile -- Sets the profile that should be loaded by OpenSpace. Profile = "default" @@ -105,6 +126,14 @@ GlobalCustomizationScripts = { "${SCRIPTS}/customization.lua" } +-- Determines how many settings in the menu are shown +-- Valid values: +-- "NoviceUser" +-- "User" +-- "AdvancedUser" +-- "Developer" +PropertyVisibility = os.getenv("OPENSPACE_LEVEL") or "User" + -- Use these paths if you want to put items outside of -- the main OpenSpace folder. Typically SYNC Paths = { @@ -140,7 +169,8 @@ ModuleConfigurations = { GlobeBrowsing = { TileCacheSize = 2048, -- for all globes (CPU and GPU memory) MRFCacheEnabled = false, - MRFCacheLocation = "${BASE}/mrf_cache" + MRFCacheLocation = "${BASE}/mrf_cache", + DefaultGeoPointTexture = "${DATA}/globe_pin.png" }, Sync = { SynchronizationRoot = "${SYNC}", diff --git a/scripts/developer_settings.lua b/scripts/developer_settings.lua deleted file mode 100644 index 8957cd3911..0000000000 --- a/scripts/developer_settings.lua +++ /dev/null @@ -1,4 +0,0 @@ -if os.getenv("OPENSPACE_DEVELOPER") -then - openspace.setPropertyValueSingle('OpenSpaceEngine.PropertyVisibility', 4) -end diff --git a/scripts/drag_drop_handler.lua b/scripts/drag_drop_handler.lua index e1b58c7473..b972971e8e 100644 --- a/scripts/drag_drop_handler.lua +++ b/scripts/drag_drop_handler.lua @@ -46,4 +46,6 @@ elseif extension == ".asset" then openspace.asset.add("]] .. filename .. '");' .. ReloadUIScript elseif extension == ".osrec" or extension == ".osrectxt" then return 'openspace.sessionRecording.startPlayback("' .. filename .. '")' +elseif extension == ".geojson" then + return 'openspace.globebrowsing.addGeoJsonFromFile("' .. filename .. '")' .. ReloadUIScript end diff --git a/src/engine/configuration.cpp b/src/engine/configuration.cpp index 1712c61b02..6da66b1e3a 100644 --- a/src/engine/configuration.cpp +++ b/src/engine/configuration.cpp @@ -59,6 +59,18 @@ namespace { // global rebinding of keys from the default std::optional> globalCustomizationScripts; + enum class [[codegen::map(openspace::properties::Property::Visibility)]] + Visibility + { + NoviceUser = 0, + User, + AdvancedUser, + Developer + }; + // Determines the property visibility level that is selected when starting up + // OpenSpace. If it is not provided, it defaults to 'User' + std::optional propertyVisibility; + // 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 // configuration files or scripts @@ -291,6 +303,9 @@ namespace { // displayed while the scene graph is created and initialized std::optional loadingScreen; + // List of window configurations that cannot be overwritten by user + std::optional> readOnlyWindowConfigs; + // List of profiles that cannot be overwritten by user std::optional> readOnlyProfiles; @@ -342,6 +357,12 @@ void parseLuaState(Configuration& configuration) { c.profile = p.profile.value_or(c.profile); c.globalCustomizationScripts = p.globalCustomizationScripts.value_or(c.globalCustomizationScripts); + + if (p.propertyVisibility.has_value()) { + c.propertyVisibility = codegen::map( + *p.propertyVisibility + ); + } c.pathTokens = p.paths; c.fonts = p.fonts.value_or(c.fonts); c.fontSize.frameInfo = p.fontSize.frameInfo; @@ -438,6 +459,7 @@ void parseLuaState(Configuration& configuration) { c.httpProxy.password = p.httpProxy->password.value_or(c.httpProxy.password); } + c.readOnlyWindowConfigs = p.readOnlyWindowConfigs.value_or(c.readOnlyWindowConfigs); c.readOnlyProfiles = p.readOnlyProfiles.value_or(c.readOnlyProfiles); c.bypassLauncher = p.bypassLauncher.value_or(c.bypassLauncher); } diff --git a/src/engine/moduleengine.cpp b/src/engine/moduleengine.cpp index e2fe9f2a3b..f3190a224a 100644 --- a/src/engine/moduleengine.cpp +++ b/src/engine/moduleengine.cpp @@ -42,7 +42,9 @@ namespace { "AllModules", "All Modules", "The list of all modules that were compiled for this version of OpenSpace in the " - "same order in which they were initialized" + "same order in which they were initialized", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; } // namespace diff --git a/src/engine/openspaceengine.cpp b/src/engine/openspaceengine.cpp index 508567d1b7..752b5e7e6a 100644 --- a/src/engine/openspaceengine.cpp +++ b/src/engine/openspaceengine.cpp @@ -119,20 +119,23 @@ namespace { "PrintEvents", "Print Events", "If this is enabled, all events that are propagated through the system are " - "printed to the log" + "printed to the log", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo VisibilityInfo = { "PropertyVisibility", "Property Visibility", "Hides or displays different settings in the GUI depending on how advanced they " - "are" + "are", + openspace::properties::Property::Visibility::Always }; constexpr openspace::properties::Property::PropertyInfo ShowHiddenSceneInfo = { "ShowHiddenSceneGraphNodes", "Show Hidden Scene Graph Nodes", - "If checked, hidden scene graph nodes are visible in the UI" + "If checked, hidden scene graph nodes are visible in the UI", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FadeDurationInfo = { @@ -141,14 +144,17 @@ namespace { "Controls how long time the fading in/out takes when enabling/disabling an " "object through a checkbox in the UI. Holding SHIFT while clicking the " "checkbox will enable/disable the renderable without fading, as will setting " - "this value to zero." + "this value to zero.", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DisableMouseInputInfo = { "DisableMouseInputs", "Disable All Mouse Inputs", "Disables all mouse inputs. Useful when using touch interaction, to prevent " - "double inputs on touch (from both touch input and inserted mouse inputs)" + "double inputs on touch (from both touch input and inserted mouse inputs)", + // @VISIBILITY(2.67) + openspace::properties::Property::Visibility::User }; } // namespace @@ -169,10 +175,6 @@ OpenSpaceEngine::OpenSpaceEngine() TransformationManager::initialize(); addProperty(_printEvents); - addProperty(_visibility); - addProperty(_showHiddenSceneGraphNodes); - addProperty(_fadeOnEnableDuration); - addProperty(_disableAllMouseInputs); using Visibility = openspace::properties::Property::Visibility; _visibility.addOptions({ @@ -182,6 +184,11 @@ OpenSpaceEngine::OpenSpaceEngine() { static_cast(Visibility::Developer), "Developer" }, { static_cast(Visibility::Hidden), "Everything" }, }); + addProperty(_visibility); + + addProperty(_showHiddenSceneGraphNodes); + addProperty(_fadeOnEnableDuration); + addProperty(_disableAllMouseInputs); } OpenSpaceEngine::~OpenSpaceEngine() {} @@ -225,6 +232,7 @@ void OpenSpaceEngine::initialize() { ); _printEvents = global::configuration->isPrintingEvents; + _visibility = static_cast(global::configuration->propertyVisibility); std::string cacheFolder = absPath("${CACHE}").string(); if (global::configuration->usePerProfileCache) { @@ -1153,8 +1161,6 @@ void OpenSpaceEngine::preSynchronization() { if (_isRenderingFirstFrame) { setCameraFromProfile(*global::profile); setAdditionalScriptsFromProfile(*global::profile); - - global::scriptEngine->runScriptFile(absPath("${SCRIPTS}/developer_settings.lua")); } // Handle callback(s) for change in engine mode diff --git a/src/events/event.cpp b/src/events/event.cpp index a1bf358986..1bcc037f4e 100644 --- a/src/events/event.cpp +++ b/src/events/event.cpp @@ -205,6 +205,11 @@ void log(int i, const EventCameraPathFinished& e) { )); } +void log(int i, const EventCameraMovedPosition& e) { + ghoul_assert(e.type == EventCameraMovedPosition::Type, "Wrong type"); + LINFO(fmt::format("[{}] EventCameraMovedPosition", i)); +} + void log(int i, const CustomEvent& e) { ghoul_assert(e.type == CustomEvent::Type, "Wrong type"); LINFO(fmt::format("[{}] CustomEvent: {} ({})", i, e.subtype, e.payload)); @@ -234,6 +239,7 @@ std::string_view toString(Event::Type type) { case Event::Type::RenderableDisabled: return "RenderableDisabled"; case Event::Type::CameraPathStarted: return "CameraPathStarted"; case Event::Type::CameraPathFinished: return "CameraPathFinished"; + case Event::Type::CameraMovedPosition: return "CameraMovedPosition"; case Event::Type::Custom: return "Custom"; default: throw ghoul::MissingCaseException(); @@ -304,6 +310,9 @@ Event::Type fromString(std::string_view str) { else if (str == "CameraPathFinished") { return Event::Type::CameraPathFinished; } + else if (str == "CameraMovedPosition") { + return Event::Type::CameraMovedPosition; + } else if (str == "Custom") { return Event::Type::Custom; } @@ -725,6 +734,10 @@ EventCameraPathFinished::EventCameraPathFinished(const SceneGraphNode* origin_, , destination(temporaryString(destination_->identifier())) {} +EventCameraMovedPosition::EventCameraMovedPosition() + : Event(Type) +{} + CustomEvent::CustomEvent(std::string_view subtype_, std::string_view payload_) : Event(Type) , subtype(subtype_) diff --git a/src/interaction/camerainteractionstates.cpp b/src/interaction/camerainteractionstates.cpp index b50e139ed8..e55a2b45e6 100644 --- a/src/interaction/camerainteractionstates.cpp +++ b/src/interaction/camerainteractionstates.cpp @@ -84,13 +84,16 @@ void CameraInteractionStates::resetVelocities() { _globalRollState.velocity.setHard({ 0.0, 0.0 }); } -bool CameraInteractionStates::hasNonZeroVelocities() { - glm::dvec2 sum = globalRotationVelocity(); - sum += localRotationVelocity(); +bool CameraInteractionStates::hasNonZeroVelocities(bool checkOnlyMovement) { + glm::dvec2 sum = glm::dvec2(0.0); + sum += globalRotationVelocity(); sum += truckMovementVelocity(); - sum += localRotationVelocity(); - sum += localRollVelocity(); - sum += globalRollVelocity(); + if (!checkOnlyMovement) { + sum += localRotationVelocity(); + sum += localRotationVelocity(); + sum += localRollVelocity(); + sum += globalRollVelocity(); + } // Epsilon size based on that even if no interaction is happening, // there might still be some residual velocity in the variables return glm::length(sum) > 0.001; diff --git a/src/interaction/interactionmonitor.cpp b/src/interaction/interactionmonitor.cpp index 0fedd45769..5410714cfb 100644 --- a/src/interaction/interactionmonitor.cpp +++ b/src/interaction/interactionmonitor.cpp @@ -33,13 +33,18 @@ namespace { "IdleTime", "Idle Time", "Time in seconds that has passed from latest registered interaction until the " - "application goes idle" + "application goes idle", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; + constexpr openspace::properties::Property::PropertyInfo IsInActiveStateInfo = { "IsInActiveState", "Is State Active", "Keeps track whether the interaction session is in active state or not. False if " - "application is in idle state, true if it is in active state" + "application is in idle state, true if it is in active state", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; } // namespace diff --git a/src/interaction/sessionrecording.cpp b/src/interaction/sessionrecording.cpp index cc25f89000..3adfa64eb9 100644 --- a/src/interaction/sessionrecording.cpp +++ b/src/interaction/sessionrecording.cpp @@ -63,21 +63,23 @@ namespace { constexpr std::string_view _loggerCat = "SessionRecording"; + constexpr bool UsingTimeKeyframes = false; + constexpr openspace::properties::Property::PropertyInfo RenderPlaybackInfo = { "RenderInfo", "Render Playback Information", "If enabled, information about a currently played back session recording is " - "rendering to screen" + "rendering to screen", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo IgnoreRecordedScaleInfo = { "IgnoreRecordedScale", "Ignore Recorded Scale", "If this value is enabled, the scale value from a recording is ignored and the " - "computed values are used instead" + "computed values are used instead", + openspace::properties::Property::Visibility::Hidden }; - - constexpr bool UsingTimeKeyframes = false; } // namespace namespace openspace::interaction { diff --git a/src/navigation/navigationhandler.cpp b/src/navigation/navigationhandler.cpp index a20d6248e7..4134e9ff47 100644 --- a/src/navigation/navigationhandler.cpp +++ b/src/navigation/navigationhandler.cpp @@ -63,26 +63,30 @@ namespace { "DisableKeybindings", "Disable all Keybindings", "Disables all keybindings without removing them. Please note that this does not " - "apply to the key to open the console" + "apply to the key to open the console", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DisableMouseInputInfo = { "DisableMouseInputs", "Disable all mouse inputs", - "Disables all mouse inputs and prevents them from affecting the camera" + "Disables all mouse inputs and prevents them from affecting the camera", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DisableJoystickInputInfo = { "DisableJoystickInputs", "Disable all joystick inputs", - "Disables all joystick inputs and prevents them from affecting the camera" + "Disables all joystick inputs and prevents them from affecting the camera", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo FrameInfo = { "UseKeyFrameInteraction", "Use keyframe interaction", "If this is set to 'true' the entire interaction is based off key frames rather " - "than using the mouse interaction" + "than using the mouse interaction", + openspace::properties::Property::Visibility::Developer }; } // namespace diff --git a/src/navigation/orbitalnavigator.cpp b/src/navigation/orbitalnavigator.cpp index 303f0ff53b..38e5467833 100644 --- a/src/navigation/orbitalnavigator.cpp +++ b/src/navigation/orbitalnavigator.cpp @@ -48,33 +48,45 @@ namespace { constexpr double AngleEpsilon = 1e-7; constexpr double DistanceRatioAimThreshold = 1e-4; + constexpr std::string_view IdleKeyOrbit = "Orbit"; + constexpr std::string_view IdleKeyOrbitAtConstantLat = "OrbitAtConstantLatitude"; + constexpr std::string_view IdleKeyOrbitAroundUp = "OrbitAroundUp"; + constexpr openspace::properties::Property::PropertyInfo AnchorInfo = { "Anchor", "Anchor", "The name of the scene graph node that is the origin of the camera interaction. " "The camera follows, orbits and dollies towards this node. Any scene graph node " - "can be the anchor node" + "can be the anchor node", + // @VISIBILITY(1.33) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo AimInfo = { "Aim", "Aim", "The name of the scene graph node that is the aim of the camera. The camera " - "direction is relative to the vector from the camera position to this node" + "direction is relative to the vector from the camera position to this node", + // @VISIBILITY(1.67) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo RetargetAnchorInfo = { "RetargetAnchor", "Retarget Anchor", "When triggered, this property starts an interpolation to reset the " - "camera direction to the anchor node" + "camera direction to the anchor node", + // @VISIBILITY(1.33) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo RetargetAimInfo = { "RetargetAim", "Retarget Aim", "When triggered, this property starts an interpolation to reset the " - "camera direction to the aim node" + "camera direction to the aim node", + // @VISIBILITY(1.67) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo RollFrictionInfo = { @@ -82,7 +94,9 @@ namespace { "Roll Friction", "If this is enabled, a small friction is applied to the rolling part of the " "camera motion, thus slowing it down within a small time period. If this value " - "is disabled, the camera will roll forever" + "is disabled, the camera will roll forever", + // @VISIBILITY(1.33) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo RotationalFrictionInfo = { @@ -90,7 +104,9 @@ namespace { "Rotational Friction", "If this is enabled, a small friction is applied to the rotational part of the " "camera motion, thus slowing it down within a small time period. If this value " - "is disabled, the camera will rotate forever" + "is disabled, the camera will rotate forever", + // @VISIBILITY(1.33) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo ZoomFrictionInfo = { @@ -98,28 +114,33 @@ namespace { "Zoom Friction", "If this is enabled, a small friction is applied to the zoom part of the camera " "motion, thus slowing it down within a small time period. If this value is " - "disabled, the camera will zoom in or out forever" + "disabled, the camera will zoom in or out forever", + // @VISIBILITY(1.33) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo MouseSensitivityInfo = { "MouseSensitivity", "Mouse Sensitivity", "Determines the sensitivity of the camera motion thorugh the mouse. The lower " - "the sensitivity is the less impact a mouse motion will have" + "the sensitivity is the less impact a mouse motion will have", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo JoystickSensitivityInfo = { "JoystickSensitivity", "Joystick Sensitivity", "Determines the sensitivity of the camera motion thorugh a joystick. The lower " - "the sensitivity is the less impact a joystick motion will have" + "the sensitivity is the less impact a joystick motion will have", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo WebsocketSensitivityInfo = { "WebsocketSensitivity", "Websocket Sensitivity", "Determines the sensitivity of the camera motion thorugh a websocket. The lower " - "the sensitivity is the less impact a webstick motion will have" + "the sensitivity is the less impact a webstick motion will have", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo FrictionInfo = { @@ -127,7 +148,8 @@ namespace { "Friction Factor", "Determines the factor that is applied if the 'Roll Friction', 'Rotational " "Friction', and 'Zoom Friction' values are enabled. The lower this value is, the " - "faster the camera movements will stop" + "faster the camera movements will stop", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo FollowAnchorNodeInfo = { @@ -136,7 +158,8 @@ namespace { "If true, the camera will rotate with the current achor node if within a " "certain distance from it. When this happens, the object will appear fixed in " "relation to the camera. The distance at which the change happens is controlled " - "through another property" + "through another property", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo FollowAnchorNodeDistanceInfo = @@ -145,7 +168,8 @@ namespace { "Follow Anchor Node Rotation Distance", "A factor used to determine the distance at which the camera starts rotating " "with the anchor node. The actual distance will be computed by multiplying " - "this factor with the approximate radius of the node" + "this factor with the approximate radius of the node", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo StereoInterpolationTimeInfo = @@ -153,7 +177,8 @@ namespace { "StereoInterpolationTime", "Stereo Interpolation Time", "The time to interpolate to a new stereoscopic depth when the anchor node is " - "changed, in seconds" + "changed, in seconds", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo @@ -162,14 +187,16 @@ namespace { "RetargetAnchorInterpolationTime", "Retarget Interpolation Time", "The time to interpolate the camera rotation when the anchor or aim node is " - "changed, in seconds" + "changed, in seconds", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo FollowRotationInterpTimeInfo = { "FollowRotationInterpolationTime", "Follow Rotation Interpolation Time", - "The interpolation time when toggling following focus node rotation" + "The interpolation time when toggling following focus node rotation", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo InvertMouseButtons = { @@ -177,7 +204,9 @@ namespace { "Invert Left and Right Mouse Buttons", "If this value is 'false', the left mouse button causes the camera to rotate " "around the object and the right mouse button causes the zooming motion. If this " - "value is 'true', these two functionalities are reversed" + "value is 'true', these two functionalities are reversed", + // @VISIBILITY(1.33) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo @@ -188,7 +217,8 @@ namespace { "Dynamically adjust the view scaling based on the distance to the surface of " "the anchor and aim nodes. If enabled, view scale will be set to " "StereoscopicDepthOfFocusSurface / min(anchorDistance, aimDistance). " - "If disabled, view scale will be set to 10^StaticViewScaleExponent" + "If disabled, view scale will be set to 10^StaticViewScaleExponent", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo StaticViewScaleExponentInfo = @@ -196,7 +226,8 @@ namespace { "StaticViewScaleExponent", "Static View Scale Exponent", "Statically scale the world by 10^StaticViewScaleExponent. Only used if " - "UseAdaptiveStereoscopicDepthInfo is set to false" + "UseAdaptiveStereoscopicDepthInfo is set to false", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo @@ -206,7 +237,9 @@ namespace { "Stereoscopic Depth of the Surface in Focus", "Set the stereoscopically perceived distance (in meters) to the closest point " "out of the surface of the anchor and the center of the aim node. Only used if " - "UseAdaptiveStereoscopicDepthInfo is set to true" + "UseAdaptiveStereoscopicDepthInfo is set to true", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ConstantVelocityFlight = { @@ -214,21 +247,26 @@ namespace { "Constant Velocitry Flight", "If this value is enabled, the camera motion will not be affected by the " "distance of the camera to the surface of a planet. When enabling this setting " - "consider adjusting the mouse sensitivity to a lower value" + "consider adjusting the mouse sensitivity to a lower value", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ApplyIdleBehaviorInfo = { "ApplyIdleBehavior", "Apply Idle Behavior", "When set to true, the chosen idle behavior will be applied to the camera, " - "moving the camera accordingly" + "moving the camera accordingly", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo IdleBehaviorInfo = { "IdleBehavior", "Idle Behavior", "The chosen camera behavior that will be triggered when the idle behavior is " - "applied. Each option represents a predefined camera behavior" + "applied. Each option represents a predefined camera behavior", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo @@ -237,14 +275,18 @@ namespace { "ShouldTriggerWhenIdle", "Should Trigger When Idle", "If true, the chosen idle behavior will trigger automatically after a certain " - "time (see 'IdleWaitTime' property)" + "time (see 'IdleWaitTime' property)", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo IdleWaitTimeInfo = { "IdleWaitTime", "Idle Wait Time", "The time (seconds) until idle behavior starts, if no camera interaction " - "has been performed. Note that friction counts as camera interaction" + "has been performed. Note that friction counts as camera interaction", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo IdleBehaviorSpeedInfo = { @@ -252,7 +294,8 @@ namespace { "Speed Factor", "A factor that can be used to increase or slow down the speed of an applied " "idle behavior. A negative value will invert the direction. Note that a speed " - "of exactly 0 leads to no movement at all" + "of exactly 0 leads to no movement at all", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo InvertIdleBehaviorInfo = { @@ -260,7 +303,9 @@ namespace { "Invert", "If true, the direction of the idle behavior motion will be inverted compared " "to the default. For example, the 'Orbit' option rotates to the right per " - "default, and will rotate to the left when inverted" + "default, and will rotate to the left when inverted", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AbortOnCameraInteractionInfo = @@ -270,7 +315,9 @@ namespace { "If set to true, the idle behavior is aborted on camera interaction. If false, " "the behavior will be reapplied after the interaction. Examples of camera " "interaction are: changing the anchor node, starting a camera path or session " - "recording playback, or navigating manually using an input device" + "recording playback, or navigating manually using an input device", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo @@ -279,7 +326,9 @@ namespace { "DampenInterpolationTime", "Start/End Dampen Interpolation Time", "The time to interpolate to/from full speed when an idle behavior is triggered " - "or canceled, in seconds" + "or canceled, in seconds", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; static const openspace::properties::PropertyOwner::PropertyOwnerInfo LimitZoomInfo = { @@ -295,33 +344,36 @@ namespace { "EnabledMinimumAllowedDistance", "Enable minimum allowed distance limit", "Enables or disables that the camera cannot go closer to an object than " - "the set minimum allowed distance" + "the set minimum allowed distance", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo MinimumDistanceInfo = { "MinimumAllowedDistance", "Minimum Allowed Distance", "The limit of how close the camera can get to an object. The distance is given " - "in meters above the surface" + "in meters above the surface", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo EnabledMaximumDistanceInfo = { "EnableMaximumAllowedDistance", "Enable Maximum Allowed Distance limit", "Enables or disables that the camera cannot go further away from an object than " - "the set maximum allowed distance" + "the set maximum allowed distance", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MaximumDistanceInfo = { "MaximumAllowedDistance", "Maximum Allowed Distance", "The limit of how far away the camera can get from an object. The distance is " - "given in meters above the surface" + "given in meters above the surface", + // @VISIBILITY(?) + openspace::properties::Property::Visibility::AdvancedUser }; - - constexpr std::string_view IdleKeyOrbit = "Orbit"; - constexpr std::string_view IdleKeyOrbitAtConstantLat = "OrbitAtConstantLatitude"; - constexpr std::string_view IdleKeyOrbitAroundUp = "OrbitAroundUp"; } // namespace namespace openspace::interaction { @@ -661,6 +713,19 @@ void OrbitalNavigator::updateStatesFromInput(const MouseInputState& mouseInputSt else { tickIdleBehaviorTimer(deltaTime); } + + bool cameraLocationChanged = _mouseStates.hasNonZeroVelocities(true) || + _joystickStates.hasNonZeroVelocities(true) || + _websocketStates.hasNonZeroVelocities(true) || + _scriptStates.hasNonZeroVelocities(true); + + if (cameraLocationChanged && (_movementTimer < 0.f)) { + global::eventEngine->publishEvent(); + _movementTimer = _idleBehavior.idleWaitTime; + } + else if (!cameraLocationChanged) { + tickMovementTimer(deltaTime); + } } void OrbitalNavigator::updateCameraStateFromStates(double deltaTime) { @@ -850,6 +915,10 @@ void OrbitalNavigator::updateOnCameraInteraction() { } } +void OrbitalNavigator::tickMovementTimer(float deltaTime) { + _movementTimer -= deltaTime; +} + void OrbitalNavigator::tickIdleBehaviorTimer(double deltaTime) { if (!_idleBehavior.shouldTriggerWhenIdle) { return; diff --git a/src/navigation/pathnavigator.cpp b/src/navigation/pathnavigator.cpp index e505201f45..df1c4f3689 100644 --- a/src/navigation/pathnavigator.cpp +++ b/src/navigation/pathnavigator.cpp @@ -58,13 +58,15 @@ namespace { "Default Path Type", "The default path type chosen when generating a path or flying to a target. " "See wiki for alternatives. The shape of the generated path will be different " - "depending on the path type" + "depending on the path type", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo IncludeRollInfo = { "IncludeRoll", "Include Roll", - "If disabled, roll is removed from the interpolation of camera orientation" + "If disabled, roll is removed from the interpolation of camera orientation", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo SpeedScaleInfo = { @@ -72,14 +74,16 @@ namespace { "Speed Scale", "Scale factor that the speed will be multiplied with during path traversal. " "Can be used to speed up or slow down the camera motion, depending on if the " - "value is larger than or smaller than one" + "value is larger than or smaller than one", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo IdleBehaviorOnFinishInfo = { "ApplyIdleBehaviorOnFinish", "Apply Idle Behavior on Finish", "If set to true, the chosen IdleBehavior of the OrbitalNavigator will be " - "triggered once the path has reached its target" + "triggered once the path has reached its target", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ArrivalDistanceFactorInfo = { @@ -88,7 +92,8 @@ namespace { "A factor used to compute the default distance from a target scene graph node " "when creating a camera path. The factor will be multipled with the node's " "bounding sphere to compute the target height from the bounding sphere of the " - "object" + "object", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RotationSpeedFactorInfo = { @@ -96,7 +101,9 @@ namespace { "Rotation Speed Factor (Linear Path)", "Affects how fast the camera rotates to the target rotation during a linear " "path. A value of 1 means that the camera will rotate 90 degrees in about 5 " - "seconds. A value of 2 means twice that fast, and so on" + "seconds. A value of 2 means twice that fast, and so on", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo MinBoundingSphereInfo = { @@ -104,14 +111,17 @@ namespace { "Minimal Valid Bounding Sphere", "The minimal allowed value for a bounding sphere, in meters. Used for " "computation of target positions and path generation, to avoid issues when " - "there is no bounding sphere" + "there is no bounding sphere", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RelevantNodeTagsInfo = { "RelevantNodeTags", "Relevant Node Tags", "List of tags for the nodes that are relevant for path creation, for example " - "when avoiding collisions" + "when avoiding collisions", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; } // namespace diff --git a/src/network/parallelpeer.cpp b/src/network/parallelpeer.cpp index 60bd016d3d..28a1f12c0a 100644 --- a/src/network/parallelpeer.cpp +++ b/src/network/parallelpeer.cpp @@ -50,34 +50,39 @@ namespace { "Password", "Password", "The general password that allows this OpenSpace instance access to the Wormhole " - "server" + "server", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo HostPasswordInfo = { "HostPassword", "Host Password", "The password that is required to take control of the joint session and thus " - "send all commands to connected clients" + "send all commands to connected clients", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo PortInfo = { "Port", "Port", "The port on which the Wormhole server is listening to connections from " - "OpenSpace" + "OpenSpace", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo AddressInfo = { "Address", "Address", - "The address of the Wormhole server either as a DNS name or an IP address" + "The address of the Wormhole server either as a DNS name or an IP address", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo NameInfo = { "Name", "Connection Name", "The name of this OpenSpace instance that will be potentially broadcast to other " - "connected instances" + "connected instances", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo BufferTimeInfo = { @@ -86,7 +91,9 @@ namespace { "This is the number of seconds that received keyframes are buffered before they " "get applied to the rendering. A higher value leads to smoother rendering, " "particularly when the internet connection is unstable, but also leads to higher " - "delay" + "delay", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo TimeKeyFrameInfo = { @@ -94,7 +101,9 @@ namespace { "Time keyframe interval", "Determines how often the information about the simulation time is sent (in " "seconds). Lower values mean more accurate representation of the time, but also " - "require higher internet bandwidth" + "require higher internet bandwidth", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo CameraKeyFrameInfo = { @@ -102,7 +111,9 @@ namespace { "Camera Keyframe interval", "Determines how often the information about the camera position and orientation " "is sent (in seconds). Lower values mean more accurate representation of the " - "time, but also more internet traffic" + "time, but also more internet traffic", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; } // namespace diff --git a/src/rendering/dashboard.cpp b/src/rendering/dashboard.cpp index d2b99fcdaf..d3ad44420c 100644 --- a/src/rendering/dashboard.cpp +++ b/src/rendering/dashboard.cpp @@ -38,14 +38,17 @@ namespace { "IsEnabled", "Enabled", "If this value is 'false', this dashboard will be invisible, regardless of the " - "state of the individual components" + "state of the individual components", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo StartPositionOffsetInfo = { "StartPositionOffset", "Start Position Offset", "A 2D vector controlling where the dashboard rendering starts. Adding an offset " - "in x and y-direction on screen" + "in x and y-direction on screen", + // @VISIBILITY(2.75) + openspace::properties::Property::Visibility::User }; } // namespace diff --git a/src/rendering/dashboarditem.cpp b/src/rendering/dashboarditem.cpp index 4060f685dd..ab2eb27ac5 100644 --- a/src/rendering/dashboarditem.cpp +++ b/src/rendering/dashboarditem.cpp @@ -37,7 +37,9 @@ namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { "Enabled", "Is Enabled", - "If this value is set to 'true' this dashboard item is shown in the dashboard" + "If this value is set to 'true' this dashboard item is shown in the dashboard", + // @VISIBILITY(1.75) + openspace::properties::Property::Visibility::NoviceUser }; struct [[codegen::Dictionary(DashboardItem)]] Parameters { diff --git a/src/rendering/dashboardtextitem.cpp b/src/rendering/dashboardtextitem.cpp index 47d4bfa478..a423e841c5 100644 --- a/src/rendering/dashboardtextitem.cpp +++ b/src/rendering/dashboardtextitem.cpp @@ -35,13 +35,17 @@ namespace { "FontName", "Font Name", "This value is the name of the font that is used. It can either refer to an " - "internal name registered previously, or it can refer to a path that is used" + "internal name registered previously, or it can refer to a path that is used", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo FontSizeInfo = { "FontSize", "Font Size", - "This value determines the size of the font that is used to render the distance" + "This value determines the size of the font that is used to render the distance", + // @VISIBILITY(2.33) + openspace::properties::Property::Visibility::User }; struct [[codegen::Dictionary(DashboardTextItem)]] Parameters { diff --git a/src/rendering/fadeable.cpp b/src/rendering/fadeable.cpp index a1439dc086..22ea057424 100644 --- a/src/rendering/fadeable.cpp +++ b/src/rendering/fadeable.cpp @@ -33,7 +33,8 @@ namespace { "Opacity", "Opacity", "This value determines the opacity of this object. A value of 0 means " - "completely transparent" + "completely transparent", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo FadeInfo = { @@ -45,7 +46,7 @@ namespace { "components of the system programmatically", // The Developer mode should be used once the properties in the UI listen to this // openspace::properties::Property::Visibility::Developer - openspace::properties::Property::Visibility::Hidden + openspace::properties::Property::Visibility::Developer }; } // namespace diff --git a/src/rendering/helper.cpp b/src/rendering/helper.cpp index 61c841be35..8184c7b605 100644 --- a/src/rendering/helper.cpp +++ b/src/rendering/helper.cpp @@ -26,6 +26,7 @@ #include #include +#include #include #include #include @@ -504,4 +505,26 @@ std::pair, std::vector> createSphere(int nSegments return { vertices, indices }; } +void LightSourceRenderData::updateBasedOnLightSources(const RenderData& renderData, + const std::vector>& sources) +{ + unsigned int nEnabledLightSources = 0; + intensitiesBuffer.resize(sources.size()); + directionsViewSpaceBuffer.resize(sources.size()); + + // Get intensities and view space direction for the given light sources, + // given the provided render data information + for (const std::unique_ptr& lightSource : sources) { + if (!lightSource->isEnabled()) { + continue; + } + intensitiesBuffer[nEnabledLightSources] = lightSource->intensity(); + directionsViewSpaceBuffer[nEnabledLightSources] = + lightSource->directionViewSpace(renderData); + + ++nEnabledLightSources; + } + nLightSources = nEnabledLightSources; +} + } // namespace openspace::rendering::helper diff --git a/src/rendering/luaconsole.cpp b/src/rendering/luaconsole.cpp index b7d97d74b2..d87833ea29 100644 --- a/src/rendering/luaconsole.cpp +++ b/src/rendering/luaconsole.cpp @@ -72,38 +72,44 @@ namespace { "IsVisible", "Is Visible", "Determines whether the Lua console is shown on the screen or not. Toggling it " - "will fade the console in and out" + "will fade the console in and out", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RemoveScriptingInfo = { "RemoteScripting", "Remote scripting", "Determines whether the entered commands will only be executed locally (if this " - "is disabled), or whether they will be send to connected remove instances" + "is disabled), or whether they will be send to connected remove instances", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo BackgroundColorInfo = { "BackgroundColor", "Background Color", - "Sets the background color of the console" + "Sets the background color of the console", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo EntryTextColorInfo = { "EntryTextColor", "Entry Text Color", - "Sets the text color of the entry area of the console" + "Sets the text color of the entry area of the console", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo HistoryTextColorInfo = { "HistoryTextColor", "History Text Color", - "Sets the text color of the history area of the console" + "Sets the text color of the history area of the console", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo HistoryLengthInfo = { "HistoryLength", "History Length", - "Determines the length of the history in number of lines" + "Determines the length of the history in number of lines", + openspace::properties::Property::Visibility::AdvancedUser }; std::string sanitizeInput(std::string str) { diff --git a/src/rendering/renderable.cpp b/src/rendering/renderable.cpp index b8dbaabe78..89fa5a45f8 100644 --- a/src/rendering/renderable.cpp +++ b/src/rendering/renderable.cpp @@ -45,14 +45,17 @@ namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { "Enabled", "Is Enabled", - "This setting determines whether this object will be visible or not" + "This setting determines whether this object will be visible or not", + // @VISIBILITY(0.33) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo RenderableTypeInfo = { "Type", "Renderable Type", "This tells the type of the renderable", - openspace::properties::Property::Visibility::Hidden + // @VISIBILITY(3.4) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo RenderableRenderBinModeInfo = @@ -61,7 +64,8 @@ namespace { "Render Bin Mode", "This value specifies if the renderable should be rendered in the Background," "Opaque, Pre/PostDeferredTransparency, or Overlay rendering step", - openspace::properties::Property::Visibility::Developer + // @VISIBILITY(3.2) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DimInAtmosphereInfo = { @@ -69,7 +73,7 @@ namespace { "Dim In Atmosphere", "Enables/Disables if the object should be dimmed when the camera is in the " "sunny part of an atmosphere", - openspace::properties::Property::Visibility::Developer + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(Renderable)]] Parameters { diff --git a/src/rendering/renderengine.cpp b/src/rendering/renderengine.cpp index 85da66d100..9410a1c6ee 100644 --- a/src/rendering/renderengine.cpp +++ b/src/rendering/renderengine.cpp @@ -1,3 +1,4 @@ + /***************************************************************************************** * * * OpenSpace * @@ -83,7 +84,8 @@ namespace { "ShowOverlayOnClients", "Show Overlay Information on Clients", "If this value is enabled, the overlay information text is also automatically " - "rendered on client nodes. This values is disabled by default" + "rendered on client nodes. This values is disabled by default", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ShowLogInfo = { @@ -91,28 +93,34 @@ namespace { "Show the on-screen log", "This value determines whether the on-screen log will be shown or hidden. Even " "if it is shown, all 'Debug' and 'Trace' level messages are omitted from this " - "log" + "log", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo VerticalLogOffsetInfo = { "VerticalLogOffset", "Vertical Log Offset", "The vertical offset for the on-screen log in [0,1] coordinates, a factor that " - "is scaled with the vertical resolution" + "is scaled with the vertical resolution", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ShowVersionInfo = { "ShowVersion", "Shows the version on-screen information", "This value determines whether the Git version information (branch and commit) " - "hash are shown on the screen" + "hash are shown on the screen", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ShowCameraInfo = { "ShowCamera", "Shows information about the current camera state, such as friction", "This value determines whether the information about the current camera state is " - "shown on the screen" + "shown on the screen", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ScreenshotWindowIdsInfo = { @@ -120,7 +128,8 @@ namespace { "Screenshow Window Ids", "The list of window identifiers whose screenshot will be taken the next time " "anyone triggers a screenshot. If this list is empty (the default), all windows " - "will have their screenshot taken. Id's that do not exist are silently ignored" + "will have their screenshot taken. Id's that do not exist are silently ignored", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ApplyWarpingInfo = { @@ -129,27 +138,32 @@ namespace { "This value determines whether a warping should be applied before taking a " "screenshot. If it is enabled, all post processing is applied as well, which " "includes everything rendered on top of the rendering, such as the user " - "interface" + "interface", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ShowStatisticsInfo = { "ShowStatistics", "Show Statistics", - "Show updating, rendering, and network statistics on all rendering nodes" + "Show updating, rendering, and network statistics on all rendering nodes", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ScreenshotUseDateInfo = { "ScreenshotUseDate", "Screenshot Folder uses Date", "If this value is set to 'true', screenshots will be saved to a folder that " - "contains the time at which this value was enabled" + "contains the time at which this value was enabled", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ShowFrameNumberInfo = { "ShowFrameInformation", "Show Frame Information", "If this value is enabled, the current frame number and frame times are rendered " - "into the window" + "into the window", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DisableMasterInfo = { @@ -159,7 +173,8 @@ namespace { "Every other aspect of the application will be unaffected by this and it will " "still respond to user input. This setting is reasonably only useful in the case " "of multi-pipeline environments, such as planetariums, where the output of the " - "master node is not required and performance can be gained by disabling it" + "master node is not required and performance can be gained by disabling it", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo GlobalRotationInfo = { @@ -168,14 +183,16 @@ namespace { "Applies a global view rotation. Use this to rotate the position of the " "focus node away from the default location on the screen. This setting " "persists even when a new focus node is selected. Defined using pitch, yaw, " - "roll in radians" + "roll in radians", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ScreenSpaceRotationInfo = { "ScreenSpaceRotation", "Screen Space Rotation", "Applies a rotation to all screen space renderables. Defined using pitch, yaw, " - "roll in radians" + "roll in radians", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo MasterRotationInfo = { @@ -183,7 +200,8 @@ namespace { "Master Rotation", "Applies a view rotation for only the master node, defined using pitch, yaw, " "roll in radians.This can be used to compensate the master view direction for " - "tilted display systems in clustered immersive environments" + "tilted display systems in clustered immersive environments", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DisableHDRPipelineInfo = { @@ -191,46 +209,55 @@ namespace { "Disable HDR Rendering", "If this value is enabled, the rendering will disable the HDR color handling and " "the LDR color pipeline will be used. Be aware of possible over exposure in the " - "final colors" + "final colors", + openspace::properties::Property::Visibility::Hidden }; constexpr openspace::properties::Property::PropertyInfo HDRExposureInfo = { "HDRExposure", "HDR Exposure", "This value determines the amount of light per unit area reaching the equivalent " - "of an electronic image sensor" + "of an electronic image sensor", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo GammaInfo = { "Gamma", "Gamma Correction", "Gamma, is the nonlinear operation used to encode and decode luminance or " - "tristimulus values in the image" + "tristimulus values in the image", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo HueInfo = { "Hue", "Hue", - "Hue" + "Hue", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo SaturationInfo = { "Saturation", "Saturation", - "Saturation" + "Saturation", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ValueInfo = { "Value", "Value", - "Value" + "Value", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo FramerateLimitInfo = { "FramerateLimit", "Framerate Limit", "If set to a value bigger than 0, the framerate will be limited to that many " - "frames per second without using V-Sync" + "frames per second without using V-Sync", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo HorizFieldOfViewInfo = { @@ -238,32 +265,39 @@ namespace { "Horizontal Field of View", "Adjusts the degrees of the horizontal field of view. The vertical field of " "view will be automatically adjusted to match, according to the current " - "aspect ratio" + "aspect ratio", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo GlobalBlackoutFactorInfo = { "BlackoutFactor", "Blackout Factor", "The blackout factor of the rendering. This can be used for fading in or out the " - "rendering window" + "rendering window", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo FXAAInfo = { "FXAA", "Enable FXAA", - "Enable FXAA" + "Enable FXAA", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo EnabledFontColorInfo = { "EnabledFontColor", "Enabled Font Color", - "The font color used for enabled options" + "The font color used for enabled options", + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DisabledFontColorInfo = { "DisabledFontColor", "Disabled Font Color", - "The font color used for disabled options" + "The font color used for disabled options", + openspace::properties::Property::Visibility::AdvancedUser }; } // namespace diff --git a/src/rendering/screenspacerenderable.cpp b/src/rendering/screenspacerenderable.cpp index e02f3f1448..b0915128d2 100644 --- a/src/rendering/screenspacerenderable.cpp +++ b/src/rendering/screenspacerenderable.cpp @@ -50,7 +50,8 @@ namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { "Enabled", "Is Enabled", - "This setting determines whether this sceen space plane will be visible or not" + "This setting determines whether this sceen space plane will be visible or not", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo @@ -63,21 +64,25 @@ namespace { "using cartesian coordinates. By switching this value, the correct property will " "be shown or hidden. The Cartesian coordinate system is useful if a regular " "rendering is applied, whereas the radius azimuth elevation are most useful in a " - "planetarium environment" + "planetarium environment", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo UsePerspectiveProjectionInfo = { "UsePerspectiveProjection", "Use Perspective Projection", - "Determines whetether the z/radius values affects the size of the plane or not" + "Determines whetether the z/radius values affects the size of the plane or not", + // @VISIBILITY(3.25) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo CartesianPositionInfo = { "CartesianPosition", "Cartesian Coordinates", "This value determines the position of this screen space plane in Cartesian " - "three-dimensional coordinates (meters)" + "three-dimensional coordinates (meters)", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo RadiusAzimuthElevationInfo = { @@ -85,7 +90,8 @@ namespace { "Radius Azimuth Elevation", "This value determines the position of this screen space plane in a " "coordinate system based on radius (meters), azimuth (radians) and elevation " - "(radians)" + "(radians)", + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo ScaleInfo = { @@ -93,20 +99,24 @@ namespace { "Scale Value", "This value determines a scale factor for the plane. The default size of a plane " "is determined by the concrete instance and reflects, for example, the size of " - "the image being displayed" + "the image being displayed", + // @VISIBILITY(1.6) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo LocalRotationInfo = { "Rotation", "Local Rotation", - "An euler rotation (x, y, z) to apply to the plane" + "An euler rotation (x, y, z) to apply to the plane", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo MultiplyColorInfo = { "MultiplyColor", "Multiply Color", "If set, the plane's texture is multiplied with this color. Useful for applying " - "a color grayscale images" + "a color grayscale images", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo BackgroundColorInfo = { @@ -114,34 +124,39 @@ namespace { "Background Color", "The fixed color that is combined with the screen space renderable to create the " "final color. The actual color of the screen space renderable is alpha-blended " - "with the background color to produce the final result" + "with the background color to produce the final result", + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo DeleteInfo = { "Delete", "Delete", "If this property is triggered, this screen space plane is removed from the " - "scene" + "scene", + // @VISIBILITY(2.25) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo FaceCameraInfo = { "FaceCamera", "Face Camera", "If enabled, the local rotation is applied after the plane is rotated to face " - "the camera" + "the camera", + // @VISIBILITY(1.25) + openspace::properties::Property::Visibility::NoviceUser }; constexpr openspace::properties::Property::PropertyInfo GammaInfo = { "Gamma", "Gamma Correction", - "Sets the gamma correction of the texture" + "Sets the gamma correction of the texture", + openspace::properties::Property::Visibility::AdvancedUser }; float wrap(float value, float min, float max) { return glm::mod(value - min, max - min) + min; } - struct [[codegen::Dictionary(ScreenSpaceRenderable)]] Parameters { // The type of the Screenspace renderable that is to be created. The available // types of Screenspace renderable depend on the configuration of the application diff --git a/src/rendering/texturecomponent.cpp b/src/rendering/texturecomponent.cpp index ae5b7ea948..61432631b3 100644 --- a/src/rendering/texturecomponent.cpp +++ b/src/rendering/texturecomponent.cpp @@ -90,16 +90,19 @@ void TextureComponent::loadFromFile(const std::filesystem::path& path) { if (!path.empty()) { using namespace ghoul::io; using namespace ghoul::opengl; + + std::filesystem::path absolutePath = absPath(path); + std::unique_ptr texture = TextureReader::ref().loadTexture( - absPath(path.string()).string(), + absolutePath.string(), _nDimensions ); if (texture) { - LDEBUG(fmt::format("Loaded texture from {}", absPath(path.string()))); + LDEBUG(fmt::format("Loaded texture from {}", absolutePath)); _texture = std::move(texture); - _textureFile = std::make_unique(path); + _textureFile = std::make_unique(absolutePath); if (_shouldWatchFile) { _textureFile->setCallback([this]() { _fileIsDirty = true; }); } diff --git a/src/scene/lightsource.cpp b/src/scene/lightsource.cpp index 063742cfe1..78e909c3a1 100644 --- a/src/scene/lightsource.cpp +++ b/src/scene/lightsource.cpp @@ -38,7 +38,8 @@ namespace { constexpr openspace::properties::Property::PropertyInfo EnabledInfo = { "Enabled", "Enabled", - "Whether the light source is enabled or not" + "Whether the light source is enabled or not", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(LightSource)]] Parameters { diff --git a/src/scene/scenegraphnode.cpp b/src/scene/scenegraphnode.cpp index 3a0b211bd2..c20dccbd04 100644 --- a/src/scene/scenegraphnode.cpp +++ b/src/scene/scenegraphnode.cpp @@ -47,35 +47,37 @@ namespace { "ComputeScreenSpaceData", "Compute Screen Space Data", "If this value is set to 'true', the screenspace-based properties are calculated " - "at regular intervals. If these values are set to 'false', they are not updated" + "at regular intervals. If these values are set to 'false', they are not updated", + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo ScreenSpacePositionInfo = { "ScreenSpacePosition", "ScreenSpacePosition", "The x,y position in screen space. Can be used for placing GUI elements", - openspace::properties::Property::Visibility::Hidden + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo ScreenVisibilityInfo = { "ScreenVisibility", "ScreenVisibility", "Determines if the node is currently visible on screen", - openspace::properties::Property::Visibility::Hidden + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo DistanceFromCamToNodeInfo = { "DistanceFromCamToNode", "DistanceFromCamToNode", "The distance from the camera to the node surface", - openspace::properties::Property::Visibility::Hidden + openspace::properties::Property::Visibility::Developer }; constexpr openspace::properties::Property::PropertyInfo ScreenSizeRadiusInfo = { "ScreenSizeRadius", "ScreenSizeRadius", "The screen size of the radius of the node", - openspace::properties::Property::Visibility::Hidden + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo VisibilityDistanceInfo = { @@ -83,7 +85,7 @@ namespace { "VisibilityDistance", "The distace in world coordinates between node and camera at which the " "screenspace object will become visible", - openspace::properties::Property::Visibility::Hidden + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo BoundingSphereInfo = { @@ -94,7 +96,7 @@ namespace { "only used as an override to the bounding sphere calculated by the Renderable, " "if present. If this value is -1, the Renderable's computed bounding sphere is " "used", - openspace::properties::Property::Visibility::Developer + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo InteractionSphereInfo = { @@ -104,21 +106,25 @@ namespace { "node. This value is only used as an override to the bounding sphere calculated " "by the Renderable, if present. If this value is -1, the Renderable's computed " "interaction sphere is used", - openspace::properties::Property::Visibility::Developer + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ApproachFactorInfo = { "ApproachFactor", "Approach Factor", "This value is a multiplication factor for the interaction sphere that " - "determines when the camera is 'approaching' the scene graph node" + "determines when the camera is 'approaching' the scene graph node", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo ReachFactorInfo = { "ReachFactor", "Reach Factor", "This value is a multiplication factor for the interaction sphere that " - "determines when the camera has 'reached' the scene graph node" + "determines when the camera has 'reached' the scene graph node", + // @VISIBILITY(3.5) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo GuiPathInfo = { @@ -157,7 +163,8 @@ namespace { "Show Debug Sphere", "If enabled the bounding sphere of this scene graph node is rendered as a debug " "method", - openspace::properties::Property::Visibility::Developer + // @VISIBILITY(3.67) + openspace::properties::Property::Visibility::AdvancedUser }; constexpr openspace::properties::Property::PropertyInfo @@ -533,7 +540,9 @@ SceneGraphNode::SceneGraphNode() { addProperty(_computeScreenSpaceValues); addProperty(_screenSpacePosition); + _screenVisibility.setReadOnly(true); addProperty(_screenVisibility); + _distFromCamToNode.setReadOnly(true); addProperty(_distFromCamToNode); addProperty(_screenSizeRadius); addProperty(_visibilityDistance); diff --git a/src/scripting/scriptengine.cpp b/src/scripting/scriptengine.cpp index c2fc5fb626..21f58ebaba 100644 --- a/src/scripting/scriptengine.cpp +++ b/src/scripting/scriptengine.cpp @@ -127,6 +127,87 @@ namespace { return function; } + void toJson(const openspace::scripting::LuaLibrary& library, std::stringstream& json) + { + constexpr std::string_view replStr = R"("{}": "{}", )"; + constexpr std::string_view replStr2 = R"("{}": "{}")"; + + using namespace openspace; + using namespace openspace::scripting; + + json << "{"; + json << fmt::format(replStr, "library", library.name); + json << "\"functions\": ["; + + for (const LuaLibrary::Function& f : library.functions) { + json << "{"; + json << fmt::format(replStr, "name", f.name); + json << "\"arguments\": ["; + for (const LuaLibrary::Function::Argument& arg : f.arguments) { + json << "{"; + json << fmt::format(replStr, "name", escapedJson(arg.name)); + json << fmt::format(replStr, "type", escapedJson(arg.type)); + json << fmt::format( + replStr2, "defaultValue", escapedJson(arg.defaultValue.value_or("")) + ); + json << "}"; + + if (&arg != &f.arguments.back()) { + json << ","; + } + } + json << "],"; + json << fmt::format(replStr, "returnType", escapedJson(f.returnType)); + json << fmt::format(replStr, "help", escapedJson(f.helpText)); + json << fmt::format( + "\"sourceLocation\": {{ \"file\": \"{}\", \"line\": {} }}", + escapedJson(f.sourceLocation.file), f.sourceLocation.line + ); + json << "}"; + if (&f != &library.functions.back() || !library.documentations.empty()) { + json << ","; + } + } + + + for (const LuaLibrary::Function& f : library.documentations) { + json << "{"; + json << fmt::format(replStr, "name", f.name); + json << "\"arguments\": ["; + for (const LuaLibrary::Function::Argument& arg : f.arguments) { + json << "{"; + json << fmt::format(replStr, "name", escapedJson(arg.name)); + json << fmt::format(replStr, "type", escapedJson(arg.type)); + json << fmt::format( + replStr2, "defaultValue", escapedJson(arg.defaultValue.value_or("")) + ); + json << "}"; + + if (&arg != &f.arguments.back()) { + json << ","; + } + } + json << "],"; + json << fmt::format(replStr, "returnType", escapedJson(f.returnType)); + json << fmt::format(replStr2, "help", escapedJson(f.helpText)); + json << "}"; + if (&f != &library.documentations.back()) { + json << ","; + } + } + + json << "],"; + + json << "\"subLibraries\": ["; + for (const LuaLibrary& sl : library.subLibraries) { + toJson(sl, json); + if (&sl != &library.subLibraries.back()) { + json << ","; + } + } + json << "]}"; + } + #include "scriptengine_codegen.cpp" } // namespace @@ -474,7 +555,24 @@ std::vector ScriptEngine::allLuaFunctions() const { } std::string ScriptEngine::generateJson() const { - return ""; + ZoneScoped; + + // Create JSON + std::stringstream json; + json << "["; + + bool first = true; + for (const LuaLibrary& l : _registeredLibraries) { + if (!first) { + json << ","; + } + first = false; + + toJson(l, json); + } + json << "]"; + + return json.str(); } nlohmann::json ScriptEngine::generateJsonJson() const { diff --git a/src/scripting/scriptscheduler.cpp b/src/scripting/scriptscheduler.cpp index 39a0d1ff7e..0cf65ad6ef 100644 --- a/src/scripting/scriptscheduler.cpp +++ b/src/scripting/scriptscheduler.cpp @@ -39,7 +39,9 @@ namespace { "Enabled", "This enables or disables the ScriptScheduler. If disabled, no scheduled scripts " "will be executed. If enabled, scheduled scripts will be executed at their given " - "time as normal" + "time as normal", + // @VISIBILITY(2.5) + openspace::properties::Property::Visibility::User }; constexpr openspace::properties::Property::PropertyInfo ShouldRunAllTimeJumpInfo = { @@ -47,7 +49,8 @@ namespace { "Should Run All Time Jump", "If 'true': In a time jump, all scheduled scripts between the old time and the " "new time is executed. If 'false': In a time jump, no scripts scheduled between " - "the new time and the old time is executed" + "the new time and the old time is executed", + openspace::properties::Property::Visibility::AdvancedUser }; struct [[codegen::Dictionary(ScheduledScript)]] Parameters { diff --git a/support/cmake/FindLibmpv.cmake b/support/cmake/FindLibmpv.cmake new file mode 100644 index 0000000000..bc5697af7a --- /dev/null +++ b/support/cmake/FindLibmpv.cmake @@ -0,0 +1,78 @@ +# +# SPDX-FileCopyrightText: 2006 Laurent Montel +# SPDX-FileCopyrightText: 2019 Heiko Becker +# SPDX-FileCopyrightText: 2020 Elvis Angelaccio +# SPDX-FileCopyrightText: 2021 George Florea Bănuș +# +# SPDX-License-Identifier: BSD-3-Clause +# +# +# FindLibmpv +# ---------- +# +# Find the mpv media player client library. +# +# Defines the following variables: +# +# - Libmpv_FOUND +# True if it finds the library and include directory +# +# - Libmpv_INCLUDE_DIRS +# The libmpv include dirs for use with target_include_directories +# +# - Libmpvb_LIBRARIES +# The libmpv libraries for use with target_link_libraries() +# +# - Libmpv_VERSION +# The version of the found libmpv +# +# +# Defines the following imported target if 'Libmpv_FOUND' is true: +# +# - Libmpv::Libmpv +# + +find_package(PkgConfig QUIET) + +pkg_search_module(PC_MPV QUIET mpv) + +find_path(Libmpv_INCLUDE_DIRS + NAMES client.h + PATH_SUFFIXES mpv + HINTS ${PC_MPV_INCLUDEDIR} +) + + +find_library(Libmpv_LIBRARIES + NAMES mpv + HINTS ${PC_MPV_LIBDIR} +) + +set(Libmpv_VERSION ${PC_MPV_VERSION}) + +include(FindPackageHandleStandardArgs) +find_package_handle_standard_args(Libmpv + FOUND_VAR + Libmpv_FOUND + REQUIRED_VARS + Libmpv_LIBRARIES + Libmpv_INCLUDE_DIRS + VERSION_VAR + Libmpv_VERSION +) + +if (Libmpv_FOUND AND NOT TARGET Libmpv::Libmpv) + add_library(Libmpv::Libmpv UNKNOWN IMPORTED) + set_target_properties(Libmpv::Libmpv PROPERTIES + IMPORTED_LOCATION "${Libmpv_LIBRARIES}" + INTERFACE_INCLUDE_DIRECTORIES "${Libmpv_INCLUDE_DIRS}" + ) +endif() + +mark_as_advanced(Libmpv_LIBRARIES Libmpv_INCLUDE_DIRS) + +include(FeatureSummary) +set_package_properties(Libmpv PROPERTIES + URL "https://mpv.io" + DESCRIPTION "mpv media player client library" +) diff --git a/support/coding/codegen b/support/coding/codegen index 014b0046d1..686e1ba8f2 160000 --- a/support/coding/codegen +++ b/support/coding/codegen @@ -1 +1 @@ -Subproject commit 014b0046d11d832630e82aa1a7f36000d5770597 +Subproject commit 686e1ba8f239e8b7fc2eca3918cd5e98e59a8287 diff --git a/tests/CMakeLists.txt b/tests/CMakeLists.txt index b2d5e9f9cb..7aa711c631 100644 --- a/tests/CMakeLists.txt +++ b/tests/CMakeLists.txt @@ -39,6 +39,7 @@ add_executable( test_profile.cpp test_rawvolumeio.cpp test_scriptscheduler.cpp + test_sgctedit.cpp test_spicemanager.cpp test_timeconversion.cpp test_timeline.cpp @@ -53,8 +54,14 @@ add_executable( set_openspace_compile_settings(OpenSpaceTest) +target_include_directories(OpenSpaceTest + PUBLIC + "../apps/OpenSpace/ext/sgct/ext/json/include" + "../apps/OpenSpace/ext/sgct/ext/json-schema-validator/src" +) + target_compile_definitions(OpenSpaceTest PUBLIC "GHL_THROW_ON_ASSERT") -target_link_libraries(OpenSpaceTest PUBLIC Catch2 openspace-core) +target_link_libraries(OpenSpaceTest PUBLIC Catch2 openspace-core sgct) foreach (library_name ${all_enabled_modules}) get_target_property(library_type ${library_name} TYPE) diff --git a/tests/sgctedit/fails_minimum_version.json b/tests/sgctedit/fails_minimum_version.json new file mode 100644 index 0000000000..501ecae40a --- /dev/null +++ b/tests/sgctedit/fails_minimum_version.json @@ -0,0 +1,67 @@ +{ + "generator": { + "major": 0, + "minor": 11, + "name": "SgctWindowConfig" + }, + "masteraddress": "localhost", + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "border": true, + "id": 0, + "monitor": 0, + "name": "min name", + "pos": { + "x": 10, + "y": 10 + }, + "size": { + "x": 1280, + "y": 720 + }, + "viewports": [ + { + "pos": { + "x": 0.0, + "y": 0.0 + }, + "projection": { + "heightoffset": 0.0, + "quality": "1024", + "type": "CylindricalProjection" + }, + "size": { + "x": 1.0, + "y": 1.0 + }, + "tracked": true + } + ] + } + ] + } + ], + "scene": { + "orientation": { + "w": 0.0, + "x": 0.0, + "y": 0.0, + "z": 0.0 + } + }, + "users": [ + { + "eyeseparation": 0.06499999761581421, + "pos": { + "x": 0.0, + "y": 0.0, + "z": 4.0 + } + } + ], + "version": 1 +} diff --git a/tests/test_sgctedit.cpp b/tests/test_sgctedit.cpp new file mode 100644 index 0000000000..ea224bf9c0 --- /dev/null +++ b/tests/test_sgctedit.cpp @@ -0,0 +1,619 @@ +/***************************************************************************************** + * * + * OpenSpace * + * * + * Copyright (c) 2014-2023 * + * * + * 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 +#include +#include +#include +#include + +using namespace openspace::configuration; + +namespace { + std::string stringify(const std::string filename) { + std::ifstream myfile; + myfile.open(filename); + std::stringstream buffer; + buffer << myfile.rdbuf(); + return buffer.str(); + } + + void attemptValidation(const std::string cfgString) { + std::filesystem::path schemaDir = absPath("${TESTDIR}/../config/schema"); + std::string schemaString = stringify( + schemaDir.string() + "/sgcteditor.schema.json" + ); + sgct::validateConfigAgainstSchema(cfgString, schemaString, schemaDir); + } +} // namespace + +TEST_CASE("SgctEdit: pass", "[sgctedit]") { + const std::string config = +R"({ + "generator": { + "major": 1, + "minor": 1, + "name": "SgctWindowConfig" + }, + "masteraddress": "localhost", + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "border": true, + "id": 0, + "monitor": 0, + "name": "ffss", + "pos": { + "x": 112, + "y": 77 + }, + "size": { + "x": 1280, + "y": 720 + }, + "viewports": [ + { + "pos": { + "x": 0.0, + "y": 0.0 + }, + "projection": { + "heightoffset": 0.0, + "quality": "1024", + "type": "CylindricalProjection" + }, + "size": { + "x": 1.0, + "y": 1.0 + }, + "tracked": true + } + ] + } + ] + } + ], + "scene": { + "orientation": { + "w": 0.0, + "x": 0.0, + "y": 0.0, + "z": 0.0 + } + }, + "users": [ + { + "eyeseparation": 0.06499999761581421, + "pos": { + "x": 0.0, + "y": 0.0, + "z": 4.0 + } + } + ], + "version": 1 +})"; + CHECK_NOTHROW(attemptValidation(config)); +} + +TEST_CASE("SgctEdit: addedTrailingBracket", "[sgctedit]") { + const std::string config = +R"({ + "generator": { + "major": 0, + "minor": 1, + "name": "SgctWindowConfig" + }, + "masteraddress": "localhost", + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "border": true, + "id": 0, + "monitor": 0, + "name": "ffss", + "pos": { + "x": 112, + "y": 77 + }, + "size": { + "x": 1280, + "y": 720 + }, + "viewports": [ + { + "pos": { + "x": 0.0, + "y": 0.0 + }, + "projection": { + "heightoffset": 0.0, + "quality": "1024", + "type": "CylindricalProjection" + }, + "size": { + "x": 1.0, + "y": 1.0 + }, + "tracked": true + } + ] + } + ] + } + ], + "scene": { + "orientation": { + "w": 0.0, + "x": 0.0, + "y": 0.0, + "z": 0.0 + } + }, + "users": [ + { + "eyeseparation": 0.06499999761581421, + "pos": { + "x": 0.0, + "y": 0.0, + "z": 4.0 + } + } + ], + "version": 1 +}})"; + CHECK_THROWS_MATCHES( + attemptValidation(config), + nlohmann::json::parse_error, + Catch::Matchers::Message( + "[json.exception.parse_error.101] parse error at line 67, column 2: " + "syntax error while parsing value - unexpected '}'; expected " + "end of input" + ) + ); +} + +TEST_CASE("SgctEdit: missingMasterAddress", "[sgctedit]") { + const std::string config = +R"({ + "generator": { + "major": 1, + "minor": 1, + "name": "SgctWindowConfig" + }, + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "border": true, + "id": 0, + "monitor": 1, + "name": "name", + "pos": { + "x": 112, + "y": 77 + }, + "size": { + "x": 1280, + "y": 720 + }, + "viewports": [ + { + "pos": { + "x": 0.0, + "y": 0.0 + }, + "projection": { + "heightoffset": 0.0, + "quality": "1024", + "type": "CylindricalProjection" + }, + "size": { + "x": 1.0, + "y": 1.0 + }, + "tracked": true + } + ] + } + ] + } + ], + "scene": { + "orientation": { + "w": 0.0, + "x": 0.0, + "y": 0.0, + "z": 0.0 + } + }, + "users": [ + { + "eyeseparation": 0.06499999761581421, + "pos": { + "x": 0.0, + "y": 0.0, + "z": 4.0 + } + } + ], + "version": 1 +})"; + CHECK_THROWS_MATCHES( + attemptValidation(config), + std::exception, + Catch::Matchers::Message( + "At of {\"generator\":{\"major\":1,\"minor\":1,\"name\":" + "\"SgctWindowConfig\"},\"nodes\":[{\"address\":\"localhost\",\"port\":" + "20401,\"windows\":[{\"border\":true,\"id\":0,\"monitor\":1,\"name\":" + "\"name\",\"pos\":{\"x\":112,\"y\":77},\"size\":{\"x\":1280,\"y\":720}," + "\"viewports\":[{\"pos\":{\"x\":0.0,\"y\":0.0},\"projection\":" + "{\"heightoffset\":0.0,\"quality\":\"1024\",\"type\":" + "\"CylindricalProjection\"},\"size\":{\"x\":1.0,\"y\":1.0},\"tracked\":" + "true}]}]}],\"scene\":{\"orientation\":{\"w\":0.0,\"x\":0.0,\"y\":0.0," + "\"z\":0.0}},\"users\":[{\"eyeseparation\":0.06499999761581421,\"pos\":" + "{\"x\":0.0,\"y\":0.0,\"z\":4.0}}],\"version\":1} - required property " + "'masteraddress' not found in object\n" + ) + ); +} + +TEST_CASE("SgctEdit: missingPos", "[sgctedit]") { + const std::string config = +R"({ + "generator": { + "major": 1, + "minor": 1, + "name": "SgctWindowConfig" + }, + "masteraddress": "localhost", + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "border": true, + "id": 0, + "monitor": 0, + "name": "name", + "pos": { + "x": 112, + "y": 77 + }, + "size": { + "x": 1280, + "y": 720 + }, + "viewports": [ + { + "pos": { + "x": 0.0, + "y": 0.0 + }, + "projection": { + "heightoffset": 0.0, + "quality": "1024", + "type": "CylindricalProjection" + }, + "size": { + "x": 1.0, + "y": 1.0 + }, + "tracked": true + } + ] + } + ] + } + ], + "scene": { + "orientation": { + "w": 0.0, + "x": 0.0, + "y": 0.0, + "z": 0.0 + } + }, + "users": [ + { + "eyeseparation": 0.06499999761581421 + } + ], + "version": 1 +})"; + CHECK_THROWS_MATCHES( + attemptValidation(config), + std::exception, + Catch::Matchers::Message( + "At /users/0 of {\"eyeseparation\":0.06499999761581421} - required " + "property 'pos' not found in object\n" + ) + ); +} + +TEST_CASE("SgctEdit: missingGenerator", "[sgctedit]") { + const std::string config = +R"({ + "masteraddress": "localhost", + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "border": true, + "id": 0, + "monitor": 0, + "name": "name", + "pos": { + "x": 112, + "y": 77 + }, + "size": { + "x": 1280, + "y": 720 + }, + "viewports": [ + { + "pos": { + "x": 0.0, + "y": 0.0 + }, + "projection": { + "heightoffset": 0.0, + "quality": "1024", + "type": "CylindricalProjection" + }, + "size": { + "x": 1.0, + "y": 1.0 + }, + "tracked": true + } + ] + } + ] + } + ], + "scene": { + "orientation": { + "w": 0.0, + "x": 0.0, + "y": 0.0, + "z": 0.0 + } + }, + "users": [ + { + "eyeseparation": 0.06499999761581421, + "pos": { + "x": 0.0, + "y": 0.0, + "z": 4.0 + } + } + ], + "version": 1 +})"; + CHECK_THROWS_MATCHES( + attemptValidation(config), + std::exception, + Catch::Matchers::Message( + "At of {\"masteraddress\":\"localhost\",\"nodes\":[{\"address\":" + "\"localhost\",\"port\":20401,\"windows\":[{\"border\":true,\"id\":" + "0,\"monitor\":0,\"name\":\"name\",\"pos\":{\"x\":112,\"y\":77},\"size\":" + "{\"x\":1280,\"y\":720},\"viewports\":[{\"pos\":{\"x\":0.0,\"y\":0.0}," + "\"projection\":{\"heightoffset\":0.0,\"quality\":\"1024\",\"type\":" + "\"CylindricalProjection\"},\"size\":{\"x\":1.0,\"y\":1.0},\"tracked\":" + "true}]}]}],\"scene\":{\"orientation\":{\"w\":0.0,\"x\":0.0,\"y\":0.0,\"z\":" + "0.0}},\"users\":[{\"eyeseparation\":0.06499999761581421,\"pos\":{\"x\":" + "0.0,\"y\":0.0,\"z\":4.0}}],\"version\":1} - required property 'generator' " + "not found in object\n" + ) + ); +} + +TEST_CASE("SgctEdit: minimumVersion", "[sgctedit]") { + const sgct::config::GeneratorVersion minVersion { "SgctWindowConfig", 1, 1 }; + std::string inputCfg = + absPath("${TESTDIR}/sgctedit/fails_minimum_version.json").string(); + sgct::config::GeneratorVersion ver = sgct::readConfigGenerator(inputCfg); + CHECK_FALSE(ver.versionCheck(minVersion)); +} + +TEST_CASE("SgctEdit: invalidZvalue", "[sgctedit]") { + const std::string config = +R"({ + "generator": { + "major": 1, + "minor": 1, + "name": "SgctWindowConfig" + }, + "masteraddress": "localhost", + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "border": true, + "id": 0, + "monitor": 1, + "name": "ffss", + "pos": { + "x": 112, + "y": 77 + }, + "size": { + "x": 1280, + "y": 720, + "z": s + }, + "viewports": [ + { + "pos": { + "x": 0.0, + "y": 0.0 + }, + "projection": { + "heightoffset": 0.0, + "quality": "1024", + "type": "CylindricalProjection" + }, + "size": { + "x": 1.0, + "y": 1.0 + }, + "tracked": true + } + ] + } + ] + } + ], + "scene": { + "orientation": { + "w": 0.0, + "x": 0.0, + "y": 0.0, + "z": 0.0 + } + }, + "users": [ + { + "eyeseparation": 0.06499999761581421, + "pos": { + "x": 0.0, + "y": 0.0, + "z": 4.0 + } + } + ], + "version": 1 +})"; + CHECK_THROWS_MATCHES( + attemptValidation(config), + std::exception, + Catch::Matchers::Message( + "[json.exception.parse_error.101] parse error at line 25, column 11: " + "syntax error while parsing value - invalid literal; last read: '\"z\": s'" + ) + ); +} + +TEST_CASE("SgctEdit: unwelcomeValue", "[sgctedit]") { + const std::string config = +R"({ + "generator": { + "major": 1, + "minor": 1, + "name": "SgctWindowConfig" + }, + "masteraddress": "localhost", + "nodes": [ + { + "address": "localhost", + "port": 20401, + "windows": [ + { + "border": true, + "id": 0, + "monitor": 0, + "name": "ffss", + "pos": { + "x": 112, + "y": 77 + }, + "size": { + "x": 1280, + "y": 720 + }, + "viewports": [ + { + "pos": { + "x": 0.0, + "y": 0.0 + }, + "projection": { + "heightoffset": 0.0, + "quality": "1024", + "type": "CylindricalProjection" + }, + "size": { + "x": 1.0, + "y": 1.0 + }, + "tracked": true + } + ] + } + ] + } + ], + "scene": { + "orientation": { + "w": 0.0, + "x": 0.0, + "y": 0.0, + "z": 0.0 + } + }, + "users": [ + { + "extra": "???", + "eyeseparation": 0.6, + "pos": { + "x": 0.0, + "y": 0.0, + "z": 4.0 + } + } + ], + "version": 1 +})"; + CHECK_THROWS_MATCHES( + attemptValidation(config), + std::exception, + Catch::Matchers::Message( + "At /users/0 of {\"extra\":\"???\",\"eyeseparation\":0.6,\"pos\":" + "{\"x\":0.0,\"y\":0.0,\"z\":4.0}} - validation failed for additional " + "property 'extra': instance invalid as per false-schema\n" + ) + ); +}