mirror of
https://github.com/OpenSpace/OpenSpace.git
synced 2026-01-06 03:29:44 -06:00
Merge branch 'feature/video-module' of https://github.com/OpenSpace/OpenSpace into feature/video-module
This commit is contained in:
1
.gitignore
vendored
1
.gitignore
vendored
@@ -39,3 +39,4 @@ COMMIT.md
|
||||
*_codegen.cpp
|
||||
# SkyBrowser Module downloaded data
|
||||
/modules/skybrowser/wwtimagedata
|
||||
doc
|
||||
|
||||
@@ -163,7 +163,8 @@ add_custom_target(
|
||||
add_dependencies(run_codegen codegen)
|
||||
add_custom_command(
|
||||
OUTPUT "${CMAKE_CURRENT_BINARY_DIR}/__codegen.h"
|
||||
COMMAND codegen ARGS "${PROJECT_SOURCE_DIR}/modules" "${PROJECT_SOURCE_DIR}/src"
|
||||
COMMAND codegen ARGS "modules" "src"
|
||||
WORKING_DIRECTORY "${PROJECT_SOURCE_DIR}"
|
||||
VERBATIM
|
||||
)
|
||||
set_target_properties(codegen-lib PROPERTIES FOLDER "support")
|
||||
|
||||
@@ -33,6 +33,7 @@ class QCheckBox;
|
||||
class QComboBox;
|
||||
class QDialogButtonBox;
|
||||
class QGridLayout;
|
||||
class QLabel;
|
||||
class QLineEdit;
|
||||
class QListWidget;
|
||||
class QPushButton;
|
||||
@@ -58,7 +59,7 @@ private:
|
||||
void clearActionFields();
|
||||
void actionRejected();
|
||||
void chooseScripts();
|
||||
void appendScriptsToTextfield(std::string scripts);
|
||||
void appendScriptsToTextfield(std::vector<std::string> scripts);
|
||||
|
||||
openspace::Profile::Keybinding* selectedKeybinding();
|
||||
void keybindingAdd();
|
||||
@@ -77,6 +78,7 @@ private:
|
||||
struct {
|
||||
QListWidget* list = nullptr;
|
||||
QLineEdit* identifier = nullptr;
|
||||
QLabel* infoText = nullptr;
|
||||
QLineEdit* name = nullptr;
|
||||
QLineEdit* guiPath = nullptr;
|
||||
QLineEdit* documentation = nullptr;
|
||||
@@ -101,7 +103,7 @@ private:
|
||||
QDialogButtonBox* saveButtons = nullptr;
|
||||
} _keybindingWidgets;
|
||||
|
||||
QDialogButtonBox* _mainButtons = nullptr;
|
||||
QDialogButtonBox* _mainButton = nullptr;
|
||||
};
|
||||
|
||||
#endif // __OPENSPACE_UI_LAUNCHER___ACTIONDIALOG___H__
|
||||
|
||||
@@ -52,7 +52,7 @@ private:
|
||||
*
|
||||
* \param scripts #std::string scripts to be appended
|
||||
*/
|
||||
void appendScriptsToTextfield(std::string scripts);
|
||||
void appendScriptsToTextfield(std::vector<std::string> scripts);
|
||||
|
||||
std::vector<std::string>* _scripts = nullptr;
|
||||
std::vector<std::string> _scriptsData;
|
||||
|
||||
@@ -63,7 +63,7 @@ public:
|
||||
|
||||
private:
|
||||
void createWidgets();
|
||||
|
||||
|
||||
void listItemSelected();
|
||||
void valueChanged(const QString& text);
|
||||
void saveDeltaTimeValue();
|
||||
@@ -76,7 +76,7 @@ private:
|
||||
* Called to transition to editing a particular dt value (gui settings)
|
||||
*
|
||||
* \param index index in dt list
|
||||
* \param state \c true if the edit mode should be turned on, \c false otherwise
|
||||
* \param state `true` if the edit mode should be turned on, `false` otherwise
|
||||
*/
|
||||
void transitionEditMode(int index, bool state);
|
||||
|
||||
|
||||
@@ -58,9 +58,7 @@ private:
|
||||
void listItemRemove();
|
||||
void parseSelections();
|
||||
|
||||
std::vector<QListWidgetItem*> _markedNodesListItems;
|
||||
std::vector<std::string>* _markedNodes;
|
||||
std::vector<std::string> _markedNodesData;
|
||||
|
||||
QListWidget* _list = nullptr;
|
||||
QPushButton* _removeButton = nullptr;
|
||||
|
||||
@@ -34,10 +34,10 @@ class QPushButton;
|
||||
class ScriptlogDialog final : public QDialog {
|
||||
Q_OBJECT
|
||||
public:
|
||||
ScriptlogDialog(QWidget* parent);
|
||||
ScriptlogDialog(QWidget* parent, std::string filter = "");
|
||||
|
||||
signals:
|
||||
void scriptsSelected(std::string script);
|
||||
void scriptsSelected(std::vector<std::string> script);
|
||||
|
||||
private:
|
||||
void createWidgets();
|
||||
@@ -52,6 +52,8 @@ private:
|
||||
QPushButton* _reloadFile = nullptr;
|
||||
std::string _scriptLogFile;
|
||||
std::vector<std::string> _scripts;
|
||||
|
||||
std::string _fixedFilter;
|
||||
};
|
||||
|
||||
#endif // __OPENSPACE_UI_LAUNCHER___SCRIPTLOGDIALOG___H__
|
||||
|
||||
@@ -29,6 +29,7 @@
|
||||
|
||||
#include <openspace/scene/profile.h>
|
||||
|
||||
class QCheckBox;
|
||||
class QComboBox;
|
||||
class QDateTimeEdit;
|
||||
class QLabel;
|
||||
@@ -63,6 +64,7 @@ private:
|
||||
QDateTimeEdit* _absoluteEdit = nullptr;
|
||||
QLabel* _relativeLabel = nullptr;
|
||||
QLineEdit* _relativeEdit = nullptr;
|
||||
QCheckBox* _startPaused = nullptr;
|
||||
};
|
||||
|
||||
#endif // __OPENSPACE_UI_LAUNCHER___TIMEDIALOG___H__
|
||||
|
||||
@@ -36,7 +36,7 @@ LauncherWindow QComboBox#config {
|
||||
border-radius: 3px;
|
||||
border-color: rgb(225, 225, 225);
|
||||
padding: 1px 18px 1px 3px;
|
||||
min-width: 6em;
|
||||
min-width: 14em;
|
||||
font-size: 10pt;
|
||||
font-family: Segoe UI;
|
||||
font-weight: bold;
|
||||
|
||||
@@ -51,7 +51,7 @@ namespace {
|
||||
|
||||
constexpr int LeftRuler = 40;
|
||||
constexpr int TopRuler = 80;
|
||||
constexpr int ItemWidth = 240;
|
||||
constexpr int ItemWidth = 260;
|
||||
constexpr int ItemHeight = ItemWidth / 4;
|
||||
constexpr int SmallItemWidth = 100;
|
||||
constexpr int SmallItemHeight = SmallItemWidth / 4;
|
||||
@@ -62,7 +62,7 @@ namespace {
|
||||
constexpr QRect ChooseLabel(LeftRuler, TopRuler + 80, 151, 24);
|
||||
constexpr QRect ProfileBox(LeftRuler, TopRuler + 110, ItemWidth, ItemHeight);
|
||||
constexpr QRect NewProfileButton(
|
||||
LeftRuler + 140, TopRuler + 180, SmallItemWidth, SmallItemHeight
|
||||
LeftRuler + 160, TopRuler + 180, SmallItemWidth, SmallItemHeight
|
||||
);
|
||||
constexpr QRect EditProfileButton(
|
||||
LeftRuler, TopRuler + 180, SmallItemWidth, SmallItemHeight
|
||||
@@ -70,7 +70,7 @@ namespace {
|
||||
constexpr QRect OptionsLabel(LeftRuler, TopRuler + 230, 151, 24);
|
||||
constexpr QRect WindowConfigBox(LeftRuler, TopRuler + 260, ItemWidth, ItemHeight);
|
||||
constexpr QRect NewWindowButton(
|
||||
LeftRuler + 140, TopRuler + 330, SmallItemWidth, SmallItemHeight
|
||||
LeftRuler + 160, TopRuler + 330, SmallItemWidth, SmallItemHeight
|
||||
);
|
||||
constexpr QRect EditWindowButton(
|
||||
LeftRuler, TopRuler + 330, SmallItemWidth, SmallItemHeight
|
||||
|
||||
@@ -75,62 +75,58 @@ ActionDialog::ActionDialog(QWidget* parent,
|
||||
}
|
||||
|
||||
void ActionDialog::createWidgets() {
|
||||
// Column 0 Column 1 Column 2
|
||||
// *----------------------*---------------*----------------*
|
||||
// | Actions | Row 0
|
||||
// | | Identifier | [oooooooooooo] | Row 1
|
||||
// | | Name | [oooooooooooo] | Row 2
|
||||
// | | GUI Path | [oooooooooooo] | Row 3
|
||||
// | | Documentation | [oooooooooooo] | Row 4
|
||||
// | | Is Local | [] [choosescr] | Row 5
|
||||
// | | Script | [oooooooooooo] | Row 6
|
||||
// *----------------------*---------------*----------------*
|
||||
// | [+] [-] | | <Save> <Cancel>| Row 7
|
||||
// *----------------------*---------------*----------------*
|
||||
// |=======================================================| Row 8
|
||||
// | Keybindings | Row 9
|
||||
// *----------------------*---------------*----------------|
|
||||
// | | Modifier | []S []C []A | Row 10
|
||||
// | | Key | DDDDDDDDDDDD> | Row 11
|
||||
// | | Add actions | DDDDDDDDDDDD> | Row 12
|
||||
// | | Action | [oooooooooooo] | Row 13
|
||||
// *----------------------*---------------*----------------*
|
||||
// | [+] [-] | | <Save> <Cancel>| Row 14
|
||||
// *----------------------*---------------*----------------*
|
||||
// |=======================================================| Row 16
|
||||
// *----------------------*---------------*----------------*
|
||||
// | | <Save> <Cancel>| Row 17
|
||||
// *----------------------*---------------*----------------*
|
||||
// Column 0 Column 1 Column 2 Col3
|
||||
// *----------------------*---------------*----------|------*
|
||||
// | Actions | Row 0
|
||||
// | | Identifier | [oooooo] | Info | Row 1
|
||||
// | | Name | [ooooooooooooo] | Row 2
|
||||
// | | GUI Path | [ooooooooooooo] | Row 3
|
||||
// | | Documentation | [ooooooooooooo] | Row 4
|
||||
// | | Is Local | [] [choosescr] | Row 5
|
||||
// | | Script | [ooooooooooooo] | Row 6
|
||||
// *----------------------*---------------*-----------------*
|
||||
// | [+] [-] | | <Save> <Cancel> | Row 7
|
||||
// *----------------------*---------------*-----------------*
|
||||
// |========================================================| Row 8
|
||||
// | Keybindings | Row 9
|
||||
// *----------------------*---------------*-----------------|
|
||||
// | | Modifier | []S []C []A | Row 10
|
||||
// | | Key | DDDDDDDDDDDD> | Row 11
|
||||
// | | Add actions | DDDDDDDDDDDD> | Row 12
|
||||
// | | Action | [ooooooooooooo] | Row 13
|
||||
// *----------------------*---------------*-----------------*
|
||||
// | [+] [-] | | <Save> <Cancel> | Row 14
|
||||
// *----------------------*---------------*-----------------*
|
||||
// |========================================================| Row 16
|
||||
// *----------------------*---------------*-----------------*
|
||||
// | | <Save> <Cancel> | Row 17
|
||||
// *----------------------*---------------*-----------------*
|
||||
|
||||
QGridLayout* layout = new QGridLayout(this);
|
||||
|
||||
createActionWidgets(layout);
|
||||
clearActionFields();
|
||||
|
||||
layout->addWidget(new Line, 8, 0, 1, 3);
|
||||
layout->addWidget(new Line, 8, 0, 1, 4);
|
||||
|
||||
createKeyboardWidgets(layout);
|
||||
clearKeybindingFields();
|
||||
|
||||
layout->addWidget(new Line, 16, 0, 1, 3);
|
||||
layout->addWidget(new Line, 16, 0, 1, 4);
|
||||
|
||||
_mainButtons = new QDialogButtonBox;
|
||||
_mainButtons->setStandardButtons(QDialogButtonBox::Save | QDialogButtonBox::Cancel);
|
||||
_mainButton = new QDialogButtonBox;
|
||||
_mainButton->setStandardButtons(QDialogButtonBox::Close);
|
||||
QObject::connect(
|
||||
_mainButtons, &QDialogButtonBox::accepted,
|
||||
this, &ActionDialog::applyChanges
|
||||
);
|
||||
QObject::connect(
|
||||
_mainButtons, &QDialogButtonBox::rejected,
|
||||
_mainButton, &QDialogButtonBox::rejected,
|
||||
this, &ActionDialog::reject
|
||||
);
|
||||
layout->addWidget(_mainButtons, 17, 2, Qt::AlignRight);
|
||||
layout->addWidget(_mainButton, 17, 2, Qt::AlignRight);
|
||||
}
|
||||
|
||||
void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
QLabel* title = new QLabel("Actions");
|
||||
title->setObjectName("heading");
|
||||
layout->addWidget(title, 0, 0, 1, 3);
|
||||
layout->addWidget(title, 0, 0, 1, 4);
|
||||
|
||||
_actionWidgets.list = new QListWidget;
|
||||
_actionWidgets.list->setToolTip(
|
||||
@@ -161,8 +157,31 @@ void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
"separated hierarchical structure is suggested to prevent name clashes"
|
||||
);
|
||||
_actionWidgets.identifier->setEnabled(false);
|
||||
connect(
|
||||
_actionWidgets.identifier, &QLineEdit::textEdited,
|
||||
[this]() {
|
||||
// Check if the identifier is legal
|
||||
std::string identifier = _actionWidgets.identifier->text().toStdString();
|
||||
bool isLegal = identifier.find_first_of("\t\n. ") == std::string::npos;
|
||||
if (isLegal) {
|
||||
_actionWidgets.infoText->clear();
|
||||
_actionWidgets.infoText->setHidden(true);
|
||||
}
|
||||
else {
|
||||
_actionWidgets.infoText->setText(
|
||||
"Identifier must not contain whitespace or ."
|
||||
);
|
||||
_actionWidgets.infoText->setHidden(false);
|
||||
}
|
||||
}
|
||||
);
|
||||
layout->addWidget(_actionWidgets.identifier, 1, 2);
|
||||
|
||||
_actionWidgets.infoText = new QLabel;
|
||||
_actionWidgets.infoText->setHidden(true);
|
||||
_actionWidgets.infoText->setObjectName("error-message");
|
||||
layout->addWidget(_actionWidgets.infoText, 1, 3);
|
||||
|
||||
layout->addWidget(new QLabel("Name"), 2, 1);
|
||||
_actionWidgets.name = new QLineEdit;
|
||||
_actionWidgets.name->setToolTip(
|
||||
@@ -170,7 +189,7 @@ void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
"name should be as concise and informative as possible"
|
||||
);
|
||||
_actionWidgets.name->setEnabled(false);
|
||||
layout->addWidget(_actionWidgets.name, 2, 2);
|
||||
layout->addWidget(_actionWidgets.name, 2, 2, 1, 2);
|
||||
|
||||
layout->addWidget(new QLabel("GUI Path"), 3, 1);
|
||||
_actionWidgets.guiPath = new QLineEdit;
|
||||
@@ -180,7 +199,7 @@ void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
"character that denotes the root folder"
|
||||
);
|
||||
_actionWidgets.guiPath->setEnabled(false);
|
||||
layout->addWidget(_actionWidgets.guiPath, 3, 2);
|
||||
layout->addWidget(_actionWidgets.guiPath, 3, 2, 1, 2);
|
||||
|
||||
layout->addWidget(new QLabel("Documentation"), 4, 1);
|
||||
_actionWidgets.documentation = new QLineEdit;
|
||||
@@ -191,7 +210,7 @@ void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
"parameters that that action can consume"
|
||||
);
|
||||
_actionWidgets.documentation->setEnabled(false);
|
||||
layout->addWidget(_actionWidgets.documentation, 4, 2);
|
||||
layout->addWidget(_actionWidgets.documentation, 4, 2, 1, 2);
|
||||
|
||||
layout->addWidget(new QLabel("Is Local"), 5, 1);
|
||||
_actionWidgets.isLocal = new QCheckBox;
|
||||
@@ -204,7 +223,7 @@ void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
"instances as well"
|
||||
);
|
||||
_actionWidgets.isLocal->setEnabled(false);
|
||||
layout->addWidget(_actionWidgets.isLocal, 5, 2);
|
||||
layout->addWidget(_actionWidgets.isLocal, 5, 2, 1, 2);
|
||||
|
||||
_actionWidgets.chooseScripts = new QPushButton("Choose Scripts");
|
||||
_actionWidgets.chooseScripts->setToolTip(
|
||||
@@ -215,7 +234,7 @@ void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
this, &ActionDialog::chooseScripts
|
||||
);
|
||||
_actionWidgets.chooseScripts->setEnabled(false);
|
||||
layout->addWidget(_actionWidgets.chooseScripts, 5, 2, Qt::AlignRight);
|
||||
layout->addWidget(_actionWidgets.chooseScripts, 5, 2, 1, 2, Qt::AlignRight);
|
||||
|
||||
layout->addWidget(new QLabel("Script"), 6, 1);
|
||||
_actionWidgets.script = new QTextEdit;
|
||||
@@ -226,7 +245,7 @@ void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
"variable does not exist"
|
||||
);
|
||||
_actionWidgets.script->setEnabled(false);
|
||||
layout->addWidget(_actionWidgets.script, 6, 2);
|
||||
layout->addWidget(_actionWidgets.script, 6, 2, 1, 2);
|
||||
|
||||
|
||||
// + / - buttons
|
||||
@@ -270,13 +289,13 @@ void ActionDialog::createActionWidgets(QGridLayout* layout) {
|
||||
_actionWidgets.saveButtons, &QDialogButtonBox::rejected,
|
||||
this, &ActionDialog::actionRejected
|
||||
);
|
||||
layout->addWidget(_actionWidgets.saveButtons, 7, 2, Qt::AlignRight);
|
||||
layout->addWidget(_actionWidgets.saveButtons, 7, 2, 1, 2, Qt::AlignRight);
|
||||
}
|
||||
|
||||
void ActionDialog::createKeyboardWidgets(QGridLayout* layout) {
|
||||
QLabel* title = new QLabel("Keybindings");
|
||||
title->setObjectName("heading");
|
||||
layout->addWidget(title);
|
||||
layout->addWidget(title, 9, 0, 1, 4);
|
||||
|
||||
_keybindingWidgets.list = new QListWidget;
|
||||
_keybindingWidgets.list->setToolTip(
|
||||
@@ -311,7 +330,7 @@ void ActionDialog::createKeyboardWidgets(QGridLayout* layout) {
|
||||
_keybindingWidgets.altModifier = new QCheckBox("Alt");
|
||||
_keybindingWidgets.altModifier->setEnabled(false);
|
||||
containerLayout->addWidget(_keybindingWidgets.altModifier);
|
||||
layout->addWidget(container, 10, 2);
|
||||
layout->addWidget(container, 10, 2, 1, 2);
|
||||
}
|
||||
|
||||
layout->addWidget(new QLabel("Key"), 11, 1);
|
||||
@@ -342,7 +361,7 @@ void ActionDialog::createKeyboardWidgets(QGridLayout* layout) {
|
||||
);
|
||||
}
|
||||
);
|
||||
layout->addWidget(_keybindingWidgets.key, 11, 2);
|
||||
layout->addWidget(_keybindingWidgets.key, 11, 2, 1, 2);
|
||||
|
||||
layout->addWidget(new QLabel("Action chooser"), 12, 1);
|
||||
_keybindingWidgets.action = new QComboBox;
|
||||
@@ -361,7 +380,7 @@ void ActionDialog::createKeyboardWidgets(QGridLayout* layout) {
|
||||
);
|
||||
|
||||
_keybindingWidgets.action->setEnabled(false);
|
||||
layout->addWidget(_keybindingWidgets.action, 12, 2);
|
||||
layout->addWidget(_keybindingWidgets.action, 12, 2, 1, 2);
|
||||
|
||||
layout->addWidget(new QLabel("Action"), 13, 1);
|
||||
_keybindingWidgets.actionText = new QLineEdit;
|
||||
@@ -376,7 +395,7 @@ void ActionDialog::createKeyboardWidgets(QGridLayout* layout) {
|
||||
"at startup"
|
||||
);
|
||||
_keybindingWidgets.actionText->setEnabled(false);
|
||||
layout->addWidget(_keybindingWidgets.actionText, 13, 2);
|
||||
layout->addWidget(_keybindingWidgets.actionText, 13, 2, 1, 2);
|
||||
|
||||
|
||||
// +/- buttons
|
||||
@@ -424,13 +443,7 @@ void ActionDialog::createKeyboardWidgets(QGridLayout* layout) {
|
||||
this, &ActionDialog::keybindingRejected
|
||||
);
|
||||
|
||||
layout->addWidget(_keybindingWidgets.saveButtons, 14, 2, Qt::AlignRight);
|
||||
}
|
||||
|
||||
void ActionDialog::applyChanges() {
|
||||
*_actions = std::move(_actionData);
|
||||
*_keybindings = std::move(_keybindingsData);
|
||||
accept();
|
||||
layout->addWidget(_keybindingWidgets.saveButtons, 14, 2, 1, 2, Qt::AlignRight);
|
||||
}
|
||||
|
||||
Profile::Action* ActionDialog::selectedAction() {
|
||||
@@ -476,6 +489,10 @@ void ActionDialog::actionRemove() {
|
||||
_keybindingsData.erase(_keybindingsData.begin() + i);
|
||||
delete _keybindingWidgets.list->takeItem(static_cast<int>(i));
|
||||
i--;
|
||||
//Save the updated keybindings to the profile
|
||||
if (_keybindings) {
|
||||
*_keybindings = _keybindingsData;
|
||||
}
|
||||
}
|
||||
else {
|
||||
// If the user chooses 'No' at least once, we have to bail
|
||||
@@ -494,6 +511,10 @@ void ActionDialog::actionRemove() {
|
||||
_keybindingWidgets.action->addItem(QString::fromStdString(a.identifier));
|
||||
}
|
||||
clearKeybindingFields();
|
||||
//Save the updated actions to the profile
|
||||
if (_actions) {
|
||||
*_actions = _actionData;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -523,9 +544,10 @@ void ActionDialog::actionSelected() {
|
||||
_actionWidgets.addButton->setEnabled(false);
|
||||
_actionWidgets.removeButton->setEnabled(true);
|
||||
_actionWidgets.saveButtons->setEnabled(true);
|
||||
if (_mainButtons) {
|
||||
_mainButtons->setEnabled(false);
|
||||
if (_mainButton) {
|
||||
_mainButton->setEnabled(false);
|
||||
}
|
||||
_actionWidgets.list->setEnabled(false);
|
||||
}
|
||||
else {
|
||||
// No action selected
|
||||
@@ -533,9 +555,10 @@ void ActionDialog::actionSelected() {
|
||||
_actionWidgets.removeButton->setEnabled(false);
|
||||
_actionWidgets.saveButtons->setEnabled(false);
|
||||
//Keybinding panel must also be in valid state to re-enable main start button
|
||||
if (_mainButtons && !_keybindingWidgets.saveButtons->isEnabled()) {
|
||||
_mainButtons->setEnabled(true);
|
||||
if (_mainButton && !_keybindingWidgets.saveButtons->isEnabled()) {
|
||||
_mainButton->setEnabled(true);
|
||||
}
|
||||
_actionWidgets.list->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -610,6 +633,10 @@ void ActionDialog::actionSaved() {
|
||||
for (const Profile::Action& a : _actionData) {
|
||||
_keybindingWidgets.action->addItem(QString::fromStdString(a.identifier));
|
||||
}
|
||||
//Save the updated actions to the profile
|
||||
if (_actions) {
|
||||
*_actions = _actionData;
|
||||
}
|
||||
clearKeybindingFields();
|
||||
clearActionFields();
|
||||
}
|
||||
@@ -618,6 +645,8 @@ void ActionDialog::clearActionFields() {
|
||||
_actionWidgets.list->setCurrentRow(-1);
|
||||
_actionWidgets.identifier->clear();
|
||||
_actionWidgets.identifier->setEnabled(false);
|
||||
_actionWidgets.infoText->clear();
|
||||
_actionWidgets.infoText->setHidden(true);
|
||||
_actionWidgets.name->clear();
|
||||
_actionWidgets.name->setEnabled(false);
|
||||
_actionWidgets.guiPath->clear();
|
||||
@@ -630,6 +659,7 @@ void ActionDialog::clearActionFields() {
|
||||
_actionWidgets.script->clear();
|
||||
_actionWidgets.script->setEnabled(false);
|
||||
_actionWidgets.saveButtons->setEnabled(false);
|
||||
_actionWidgets.list->setEnabled(true);
|
||||
}
|
||||
|
||||
void ActionDialog::actionRejected() {
|
||||
@@ -644,12 +674,17 @@ void ActionDialog::actionRejected() {
|
||||
|
||||
void ActionDialog::chooseScripts() {
|
||||
ScriptlogDialog d(this);
|
||||
connect(&d, &ScriptlogDialog::scriptsSelected, this, &ActionDialog::appendScriptsToTextfield);
|
||||
connect(
|
||||
&d, &ScriptlogDialog::scriptsSelected,
|
||||
this, &ActionDialog::appendScriptsToTextfield
|
||||
);
|
||||
d.exec();
|
||||
}
|
||||
|
||||
void ActionDialog::appendScriptsToTextfield(std::string scripts) {
|
||||
_actionWidgets.script->append(QString::fromStdString(std::move(scripts)));
|
||||
void ActionDialog::appendScriptsToTextfield(std::vector<std::string> scripts) {
|
||||
for (std::string script : scripts) {
|
||||
_actionWidgets.script->append(QString::fromStdString(std::move(script)));
|
||||
}
|
||||
}
|
||||
|
||||
Profile::Keybinding* ActionDialog::selectedKeybinding() {
|
||||
@@ -675,6 +710,10 @@ void ActionDialog::keybindingRemove() {
|
||||
clearKeybindingFields();
|
||||
_keybindingsData.erase(_keybindingsData.begin() + i);
|
||||
delete _keybindingWidgets.list->takeItem(static_cast<int>(i));
|
||||
//Save the updated keybindings to the profile
|
||||
if (_keybindings) {
|
||||
*_keybindings = _keybindingsData;
|
||||
}
|
||||
return;
|
||||
}
|
||||
}
|
||||
@@ -716,9 +755,10 @@ void ActionDialog::keybindingSelected() {
|
||||
_keybindingWidgets.saveButtons->button(QDialogButtonBox::Save)->setEnabled(
|
||||
_keybindingWidgets.key->currentIndex() > 0
|
||||
);
|
||||
if (_mainButtons) {
|
||||
_mainButtons->setEnabled(false);
|
||||
if (_mainButton) {
|
||||
_mainButton->setEnabled(false);
|
||||
}
|
||||
_keybindingWidgets.list->setEnabled(false);
|
||||
}
|
||||
else {
|
||||
// No keybinding selected
|
||||
@@ -726,9 +766,10 @@ void ActionDialog::keybindingSelected() {
|
||||
_keybindingWidgets.removeButton->setEnabled(false);
|
||||
_keybindingWidgets.saveButtons->setEnabled(false);
|
||||
//Action panel must also be in valid state to re-enable main start button
|
||||
if (_mainButtons && !_actionWidgets.saveButtons->isEnabled()) {
|
||||
_mainButtons->setEnabled(true);
|
||||
if (_mainButton && !_actionWidgets.saveButtons->isEnabled()) {
|
||||
_mainButton->setEnabled(true);
|
||||
}
|
||||
_keybindingWidgets.list->setEnabled(true);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -766,6 +807,10 @@ void ActionDialog::keybindingSaved() {
|
||||
keybinding->action = _keybindingWidgets.actionText->text().toStdString();
|
||||
|
||||
updateListItem(_keybindingWidgets.list->currentItem(), *keybinding);
|
||||
//Save the updated keybindings to the profile
|
||||
if (_keybindings) {
|
||||
*_keybindings = _keybindingsData;
|
||||
}
|
||||
clearKeybindingFields();
|
||||
}
|
||||
|
||||
@@ -783,6 +828,7 @@ void ActionDialog::clearKeybindingFields() {
|
||||
_keybindingWidgets.action->setEnabled(false);
|
||||
_keybindingWidgets.actionText->clear();
|
||||
_keybindingWidgets.actionText->setEnabled(false);
|
||||
_keybindingWidgets.list->setEnabled(true);
|
||||
}
|
||||
|
||||
void ActionDialog::keybindingRejected() {
|
||||
|
||||
@@ -109,6 +109,8 @@ void AdditionalScriptsDialog::chooseScripts() {
|
||||
d.exec();
|
||||
}
|
||||
|
||||
void AdditionalScriptsDialog::appendScriptsToTextfield(std::string scripts) {
|
||||
_textScripts->append(QString::fromStdString(std::move(scripts)));
|
||||
void AdditionalScriptsDialog::appendScriptsToTextfield(std::vector<std::string> scripts) {
|
||||
for (std::string script : scripts) {
|
||||
_textScripts->append(QString::fromStdString(std::move(script)));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -734,9 +734,8 @@ bool HorizonsDialog::handleRequest() {
|
||||
std::string newName = _horizonsFile.file().filename().stem().string();
|
||||
|
||||
std::filesystem::path oldFile = _horizonsFile.file();
|
||||
std::filesystem::path newFile = _horizonsFile.file().replace_filename(
|
||||
newName + "_error.txt"
|
||||
);
|
||||
std::filesystem::path newFile = oldFile;
|
||||
newFile.replace_filename(newName + "_error.txt");
|
||||
|
||||
std::filesystem::rename(oldFile, newFile);
|
||||
|
||||
|
||||
@@ -38,7 +38,6 @@
|
||||
MarkNodesDialog::MarkNodesDialog(QWidget* parent, std::vector<std::string>* markedNodes)
|
||||
: QDialog(parent)
|
||||
, _markedNodes(markedNodes)
|
||||
, _markedNodesData(*_markedNodes)
|
||||
{
|
||||
setWindowTitle("Mark Interesting Nodes");
|
||||
createWidgets();
|
||||
@@ -55,13 +54,13 @@ void MarkNodesDialog::createWidgets() {
|
||||
);
|
||||
_list->setAlternatingRowColors(true);
|
||||
_list->setMovement(QListView::Free);
|
||||
_list->setDragDropMode(QListView::InternalMove);
|
||||
_list->setResizeMode(QListView::Adjust);
|
||||
|
||||
for (size_t i = 0; i < _markedNodesData.size(); ++i) {
|
||||
_markedNodesListItems.push_back(
|
||||
new QListWidgetItem(QString::fromStdString(_markedNodesData[i]))
|
||||
);
|
||||
_list->addItem(_markedNodesListItems[i]);
|
||||
for (size_t i = 0; i < _markedNodes->size(); ++i) {
|
||||
QListWidgetItem* item =
|
||||
new QListWidgetItem(QString::fromStdString(_markedNodes->at(i)));
|
||||
_list->addItem(item);
|
||||
}
|
||||
layout->addWidget(_list);
|
||||
|
||||
@@ -102,23 +101,11 @@ void MarkNodesDialog::listItemAdded() {
|
||||
}
|
||||
|
||||
std::string itemToAdd = _newNode->text().toStdString();
|
||||
const auto it = std::find(
|
||||
_markedNodesData.cbegin(), _markedNodesData.cend(),
|
||||
itemToAdd
|
||||
);
|
||||
if (it != _markedNodesData.end()) {
|
||||
_list->setCurrentRow(
|
||||
static_cast<int>(std::distance(_markedNodesData.cbegin(), it))
|
||||
);
|
||||
}
|
||||
else {
|
||||
_markedNodesData.push_back(itemToAdd);
|
||||
_markedNodesListItems.push_back(new QListWidgetItem(_newNode->text()));
|
||||
_list->addItem(_markedNodesListItems.back());
|
||||
QListWidgetItem* item = new QListWidgetItem(_newNode->text());
|
||||
_list->addItem(item);
|
||||
|
||||
// Scroll down to that blank line highlighted
|
||||
_list->setCurrentItem(_markedNodesListItems.back());
|
||||
}
|
||||
// Scroll down to that blank line highlighted
|
||||
_list->setCurrentItem(item);
|
||||
|
||||
// Blank-out entry again
|
||||
_newNode->clear();
|
||||
@@ -127,18 +114,16 @@ void MarkNodesDialog::listItemAdded() {
|
||||
void MarkNodesDialog::listItemRemove() {
|
||||
QListWidgetItem* item = _list->currentItem();
|
||||
int index = _list->row(item);
|
||||
|
||||
if (index < 0 || index >= static_cast<int>(_markedNodesListItems.size())) {
|
||||
return;
|
||||
}
|
||||
|
||||
_list->takeItem(index);
|
||||
_markedNodesData.erase(_markedNodesData.begin() + index);
|
||||
_markedNodesListItems.erase(_markedNodesListItems.begin() + index);
|
||||
}
|
||||
|
||||
void MarkNodesDialog::parseSelections() {
|
||||
*_markedNodes = std::move(_markedNodesData);
|
||||
std::vector<std::string> nodes;
|
||||
for (int i = 0; i < _list->count(); i++) {
|
||||
QString node = _list->item(i)->text();
|
||||
nodes.push_back(node.toStdString());
|
||||
}
|
||||
*_markedNodes = std::move(nodes);
|
||||
accept();
|
||||
}
|
||||
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "profile/propertiesdialog.h"
|
||||
|
||||
#include "profile/line.h"
|
||||
#include "profile/scriptlogdialog.h"
|
||||
#include <ghoul/filesystem/filesystem.h>
|
||||
#include <QComboBox>
|
||||
#include <QDialogButtonBox>
|
||||
@@ -92,17 +93,17 @@ void PropertiesDialog::createWidgets() {
|
||||
|
||||
box->addStretch();
|
||||
|
||||
layout->addLayout(box);
|
||||
}
|
||||
layout->addWidget(new Line);
|
||||
{
|
||||
_fillFromScriptLog = new QPushButton("Fill from ScriptLog");
|
||||
connect(
|
||||
_fillFromScriptLog, &QPushButton::clicked,
|
||||
this, &PropertiesDialog::selectLineFromScriptLog
|
||||
);
|
||||
layout->addWidget(_fillFromScriptLog);
|
||||
box->addWidget(_fillFromScriptLog);
|
||||
|
||||
layout->addLayout(box);
|
||||
}
|
||||
layout->addWidget(new Line);
|
||||
{
|
||||
_commandLabel = new QLabel("Property Set Command");
|
||||
layout->addWidget(_commandLabel);
|
||||
|
||||
@@ -339,7 +340,6 @@ void PropertiesDialog::transitionFromEditMode() {
|
||||
}
|
||||
|
||||
void PropertiesDialog::editBoxDisabled(bool disabled) {
|
||||
_fillFromScriptLog->setDisabled(disabled);
|
||||
_commandLabel->setDisabled(disabled);
|
||||
_commandCombo->setDisabled(disabled);
|
||||
_propertyLabel->setDisabled(disabled);
|
||||
@@ -374,91 +374,52 @@ void PropertiesDialog::keyPressEvent(QKeyEvent* evt) {
|
||||
}
|
||||
|
||||
void PropertiesDialog::selectLineFromScriptLog() {
|
||||
QComboBox* comboBox = new QComboBox;
|
||||
|
||||
QFile file(QString::fromStdString(absPath("${LOGS}/scriptLog.txt").string()));
|
||||
if (file.open(QIODevice::ReadOnly | QIODevice::Text)) {
|
||||
QTextStream in(&file);
|
||||
while (!in.atEnd()) {
|
||||
QString line = in.readLine();
|
||||
// removing return from a few statments
|
||||
// these are usually generated by gui panels
|
||||
line.remove(QRegularExpression("^return "));
|
||||
|
||||
if (line.isEmpty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
if (!line.startsWith("openspace.setPropertyValue")) {
|
||||
continue;
|
||||
}
|
||||
|
||||
comboBox->addItem(line);
|
||||
}
|
||||
}
|
||||
|
||||
QDialog dialog;
|
||||
|
||||
ScriptlogDialog d(this, "openspace.setPropertyValue");
|
||||
connect(
|
||||
&dialog, &QDialog::finished,
|
||||
[this, comboBox](int result) {
|
||||
if (result == QDialog::Rejected) {
|
||||
return;
|
||||
&d, &ScriptlogDialog::scriptsSelected,
|
||||
[this](std::vector<std::string> scripts) {
|
||||
for (const std::string& script : scripts) {
|
||||
listItemAdded();
|
||||
|
||||
QString text = QString::fromStdString(script);
|
||||
if (!text.startsWith("openspace.setPropertyValue")) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We have a string that is of the form:
|
||||
// openspace.setPropertyValue('prop', value);
|
||||
if (text.startsWith("openspace.setPropertyValueSingle")) {
|
||||
_commandCombo->setCurrentIndex(0);
|
||||
std::string_view prefix = "openspace.setPropertyValueSingle";
|
||||
text = text.mid(static_cast<int>(prefix.size()) + 1); // +1 for (
|
||||
}
|
||||
else {
|
||||
// command == "openspace.setPropertyValue"
|
||||
_commandCombo->setCurrentIndex(1);
|
||||
std::string_view prefix = "openspace.setPropertyValue";
|
||||
text = text.mid(static_cast<int>(prefix.size()) + 1); // +1 for (
|
||||
}
|
||||
|
||||
// Remove everything past the closing brace
|
||||
text = text.left(text.indexOf(")"));
|
||||
QStringList textList = text.split(",");
|
||||
|
||||
if (textList.size() < 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove the string markers around the property
|
||||
QString property = textList[0].mid(1, textList[0].size() - 2);
|
||||
|
||||
textList.removeFirst();
|
||||
QString value = textList.join(",");
|
||||
|
||||
|
||||
_propertyEdit->setText(property.trimmed());
|
||||
_valueEdit->setText(value.trimmed());
|
||||
listItemSave();
|
||||
}
|
||||
|
||||
QString text = comboBox->currentText();
|
||||
if (!text.startsWith("openspace.setPropertyValue")) {
|
||||
return;
|
||||
}
|
||||
|
||||
// We have a string that is of the form:
|
||||
// openspace.setPropertyValue('prop', value);
|
||||
|
||||
if (text.startsWith("openspace.setPropertyValueSingle")) {
|
||||
_commandCombo->setCurrentIndex(0);
|
||||
std::string_view prefix = "openspace.setPropertyValueSingle";
|
||||
text = text.mid(static_cast<int>(prefix.size()) + 1); // +1 for (
|
||||
}
|
||||
else {
|
||||
// command == "openspace.setPropertyValue"
|
||||
_commandCombo->setCurrentIndex(1);
|
||||
std::string_view prefix = "openspace.setPropertyValue";
|
||||
text = text.mid(static_cast<int>(prefix.size()) + 1); // +1 for (
|
||||
}
|
||||
|
||||
// Remove everything past the closing brace
|
||||
text = text.left(text.indexOf(")"));
|
||||
QStringList textList = text.split(",");
|
||||
|
||||
if (textList.size() < 2) {
|
||||
return;
|
||||
}
|
||||
|
||||
// Remove the string markers around the property
|
||||
QString property = textList[0].mid(1, textList[0].size() - 2);
|
||||
|
||||
textList.removeFirst();
|
||||
QString value = textList.join(",");
|
||||
|
||||
|
||||
_propertyEdit->setText(property.trimmed());
|
||||
_valueEdit->setText(value.trimmed());
|
||||
}
|
||||
);
|
||||
|
||||
QLayout* layout = new QVBoxLayout;
|
||||
QLabel* label = new QLabel("Select a line from the Script Log to add");
|
||||
layout->addWidget(label);
|
||||
|
||||
layout->addWidget(comboBox);
|
||||
|
||||
QDialogButtonBox* bb = new QDialogButtonBox(
|
||||
QDialogButtonBox::Ok | QDialogButtonBox::Cancel
|
||||
);
|
||||
connect(bb, &QDialogButtonBox::accepted, &dialog, &QDialog::accept);
|
||||
connect(bb, &QDialogButtonBox::rejected, &dialog, &QDialog::reject);
|
||||
layout->addWidget(bb);
|
||||
|
||||
dialog.setLayout(layout);
|
||||
dialog.exec();
|
||||
d.exec();
|
||||
}
|
||||
|
||||
@@ -40,9 +40,10 @@
|
||||
#include <QPushButton>
|
||||
#include <QTextStream>
|
||||
|
||||
ScriptlogDialog::ScriptlogDialog(QWidget* parent)
|
||||
ScriptlogDialog::ScriptlogDialog(QWidget* parent, std::string filter)
|
||||
: QDialog(parent)
|
||||
, _scriptLogFile(openspace::global::configuration->scriptLog)
|
||||
, _fixedFilter(std::move(filter))
|
||||
{
|
||||
setWindowTitle("Scriptlog");
|
||||
createWidgets();
|
||||
@@ -151,7 +152,10 @@ void ScriptlogDialog::updateScriptList() {
|
||||
int index = -1;
|
||||
_scriptlogList->clear();
|
||||
for (const std::string& script : _scripts) {
|
||||
if (script.find(filter) != std::string::npos) {
|
||||
bool foundDynamic = script.find(filter) != std::string::npos;
|
||||
bool foundStatic =
|
||||
_fixedFilter.empty() ? true : script.find(_fixedFilter) != std::string::npos;
|
||||
if (foundDynamic && foundStatic) {
|
||||
if (script == selection && index == -1) {
|
||||
index = _scriptlogList->count();
|
||||
}
|
||||
@@ -161,15 +165,11 @@ void ScriptlogDialog::updateScriptList() {
|
||||
}
|
||||
|
||||
void ScriptlogDialog::saveChosenScripts() {
|
||||
std::string chosenScripts;
|
||||
std::vector<std::string> chosenScripts;
|
||||
QList<QListWidgetItem*> itemList = _scriptlogList->selectedItems();
|
||||
for (int i = 0; i < itemList.size(); ++i) {
|
||||
chosenScripts += itemList.at(i)->text().toStdString();
|
||||
if (i < itemList.size()) {
|
||||
chosenScripts += "\n";
|
||||
}
|
||||
for (QListWidgetItem* item : _scriptlogList->selectedItems()) {
|
||||
chosenScripts.push_back(item->text().toStdString());
|
||||
}
|
||||
emit scriptsSelected(chosenScripts);
|
||||
|
||||
accept();
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "profile/timedialog.h"
|
||||
|
||||
#include "profile/line.h"
|
||||
#include <QCheckBox>
|
||||
#include <QComboBox>
|
||||
#include <QDateTimeEdit>
|
||||
#include <QDialogButtonBox>
|
||||
@@ -63,6 +64,8 @@ TimeDialog::TimeDialog(QWidget* parent, std::optional<openspace::Profile::Time>*
|
||||
_timeData.type = Profile::Time::Type::Relative;
|
||||
_timeData.value = "0d";
|
||||
}
|
||||
_startPaused->setChecked(_timeData.startPaused);
|
||||
|
||||
_initializedAsAbsolute = (_timeData.type == Profile::Time::Type::Absolute);
|
||||
enableAccordingToType(static_cast<int>(_timeData.type));
|
||||
}
|
||||
@@ -98,6 +101,14 @@ void TimeDialog::createWidgets() {
|
||||
);
|
||||
layout->addWidget(_relativeEdit);
|
||||
}
|
||||
{
|
||||
_startPaused = new QCheckBox("Start with time paused");
|
||||
_startPaused->setChecked(false);
|
||||
_startPaused->setToolTip(
|
||||
"If this is checked, the profile will start with the delta time paused"
|
||||
);
|
||||
layout->addWidget(_startPaused);
|
||||
}
|
||||
layout->addWidget(new Line);
|
||||
{
|
||||
QDialogButtonBox* buttons = new QDialogButtonBox;
|
||||
@@ -153,6 +164,7 @@ void TimeDialog::approved() {
|
||||
Profile::Time t;
|
||||
t.type = Profile::Time::Type::Relative;
|
||||
t.value = _relativeEdit->text().toStdString();
|
||||
t.startPaused = _startPaused->isChecked();
|
||||
*_time = t;
|
||||
}
|
||||
}
|
||||
@@ -164,6 +176,7 @@ void TimeDialog::approved() {
|
||||
_absoluteEdit->date().toString("yyyy-MM-dd").toStdString(),
|
||||
_absoluteEdit->time().toString().toStdString()
|
||||
);
|
||||
t.startPaused = _startPaused->isChecked();
|
||||
*_time = t;
|
||||
}
|
||||
accept();
|
||||
|
||||
@@ -277,6 +277,11 @@ sgct::config::Cluster SgctEdit::generateConfiguration() const {
|
||||
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;
|
||||
}
|
||||
}
|
||||
|
||||
cluster.nodes.push_back(node);
|
||||
|
||||
Submodule apps/OpenSpace/ext/sgct updated: 4a555d7922...2f82990b3d
@@ -53,7 +53,7 @@
|
||||
#include <sgct/user.h>
|
||||
#include <sgct/window.h>
|
||||
#include <stb_image.h>
|
||||
#include <Tracy.hpp>
|
||||
#include <tracy/Tracy.hpp>
|
||||
#include <iostream>
|
||||
#include <string_view>
|
||||
|
||||
@@ -109,7 +109,7 @@ Window* FirstOpenVRWindow = nullptr;
|
||||
/**
|
||||
* This struct stores all information about a single render window. Depending on the
|
||||
* frame setup, each window can be mono or stereo, the information of which is stored in
|
||||
* the \c leftOrMain and \c right members respectively.
|
||||
* the `leftOrMain` and `right` members respectively.
|
||||
*/
|
||||
struct SpoutWindow {
|
||||
/// The left framebuffer (or main, if there is no stereo rendering)
|
||||
@@ -275,7 +275,7 @@ bool isGuiWindow(sgct::Window* window) {
|
||||
// Init function
|
||||
//
|
||||
void mainInitFunc(GLFWwindow*) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
LTRACE("main::mainInitFunc(begin)");
|
||||
|
||||
@@ -392,7 +392,7 @@ void mainInitFunc(GLFWwindow*) {
|
||||
|
||||
|
||||
void mainPreSyncFunc() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
LTRACE("main::mainPreSyncFunc(begin)");
|
||||
|
||||
try {
|
||||
@@ -412,7 +412,7 @@ void mainPreSyncFunc() {
|
||||
|
||||
|
||||
void mainPostSyncPreDrawFunc() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
#ifdef OPENSPACE_HAS_NVTOOLS
|
||||
nvtxRangePush("postSyncPreDraw");
|
||||
@@ -438,7 +438,7 @@ void mainPostSyncPreDrawFunc() {
|
||||
|
||||
|
||||
void mainRenderFunc(const sgct::RenderData& data) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
#ifdef OPENSPACE_HAS_NVTOOLS
|
||||
nvtxRangePush("render");
|
||||
@@ -526,7 +526,7 @@ void mainRenderFunc(const sgct::RenderData& data) {
|
||||
|
||||
|
||||
void mainDraw2DFunc(const sgct::RenderData& data) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
LTRACE("main::mainDraw2DFunc(begin)");
|
||||
|
||||
currentWindow = &data.window;
|
||||
@@ -551,7 +551,7 @@ void mainDraw2DFunc(const sgct::RenderData& data) {
|
||||
|
||||
|
||||
void mainPostDrawFunc() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
LTRACE("main::mainPostDrawFunc(begin)");
|
||||
|
||||
#ifdef OPENVR_SUPPORT
|
||||
@@ -571,7 +571,7 @@ void mainPostDrawFunc() {
|
||||
void mainKeyboardCallback(sgct::Key key, sgct::Modifier modifiers, sgct::Action action,
|
||||
int, sgct::Window* window)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
LTRACE("main::mainKeyboardCallback(begin)");
|
||||
|
||||
const openspace::Key k = openspace::Key(key);
|
||||
@@ -589,7 +589,7 @@ void mainKeyboardCallback(sgct::Key key, sgct::Modifier modifiers, sgct::Action
|
||||
void mainMouseButtonCallback(sgct::MouseButton key, sgct::Modifier modifiers,
|
||||
sgct::Action action, sgct::Window* window)
|
||||
{
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
LTRACE("main::mainMouseButtonCallback(begin)");
|
||||
|
||||
const openspace::MouseButton k = openspace::MouseButton(key);
|
||||
@@ -605,7 +605,7 @@ void mainMouseButtonCallback(sgct::MouseButton key, sgct::Modifier modifiers,
|
||||
|
||||
|
||||
void mainMousePosCallback(double x, double y, sgct::Window* window) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
const IsGuiWindow isGui = IsGuiWindow(isGuiWindow(window));
|
||||
global::openSpaceEngine->mousePositionCallback(x, y, isGui);
|
||||
}
|
||||
@@ -613,7 +613,7 @@ void mainMousePosCallback(double x, double y, sgct::Window* window) {
|
||||
|
||||
|
||||
void mainMouseScrollCallback(double posX, double posY, sgct::Window* window) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
LTRACE("main::mainMouseScrollCallback(begin");
|
||||
|
||||
const IsGuiWindow isGui = IsGuiWindow(isGuiWindow(window));
|
||||
@@ -625,7 +625,7 @@ void mainMouseScrollCallback(double posX, double posY, sgct::Window* window) {
|
||||
|
||||
|
||||
void mainCharCallback(unsigned int codepoint, int modifiers, sgct::Window* window) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
const KeyModifier m = KeyModifier(modifiers);
|
||||
const IsGuiWindow isGui = IsGuiWindow(isGuiWindow(window));
|
||||
@@ -647,7 +647,7 @@ void mainDropCallback(int amount, const char** paths) {
|
||||
|
||||
|
||||
std::vector<std::byte> mainEncodeFun() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
LTRACE("main::mainEncodeFun(begin)");
|
||||
|
||||
std::vector<std::byte> data = global::openSpaceEngine->encode();
|
||||
@@ -658,8 +658,8 @@ std::vector<std::byte> mainEncodeFun() {
|
||||
|
||||
|
||||
|
||||
void mainDecodeFun(const std::vector<std::byte>& data, unsigned int) {
|
||||
ZoneScoped
|
||||
void mainDecodeFun(const std::vector<std::byte>& data) {
|
||||
ZoneScoped;
|
||||
LTRACE("main::mainDecodeFun(begin)");
|
||||
|
||||
global::openSpaceEngine->decode(data);
|
||||
@@ -670,7 +670,7 @@ void mainDecodeFun(const std::vector<std::byte>& data, unsigned int) {
|
||||
|
||||
|
||||
void mainLogCallback(Log::Level level, std::string_view message) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
switch (level) {
|
||||
case Log::Level::Debug:
|
||||
@@ -694,54 +694,52 @@ void setSgctDelegateFunctions() {
|
||||
WindowDelegate& sgctDelegate = *global::windowDelegate;
|
||||
sgctDelegate.terminate = []() { Engine::instance().terminate(); };
|
||||
sgctDelegate.setBarrier = [](bool enabled) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
sgct::Window::setBarrier(enabled);
|
||||
};
|
||||
sgctDelegate.setSynchronization = [](bool enabled) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
sgct::ClusterManager::instance().setUseIgnoreSync(enabled);
|
||||
};
|
||||
sgctDelegate.windowHasResized = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return currentWindow->isWindowResized();
|
||||
};
|
||||
sgctDelegate.averageDeltaTime = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return Engine::instance().statistics().avgDt(
|
||||
Engine::instance().currentFrameNumber()
|
||||
);
|
||||
return Engine::instance().statistics().avgDt();
|
||||
};
|
||||
sgctDelegate.minDeltaTime = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return Engine::instance().statistics().minDt();
|
||||
};
|
||||
sgctDelegate.maxDeltaTime = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return Engine::instance().statistics().maxDt();
|
||||
};
|
||||
sgctDelegate.deltaTime = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return Engine::instance().statistics().dt();
|
||||
};
|
||||
sgctDelegate.applicationTime = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return sgct::Engine::getTime();
|
||||
return time();
|
||||
};
|
||||
sgctDelegate.currentWindowSize = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return glm::ivec2(currentWindow->resolution().x, currentWindow->resolution().y);
|
||||
};
|
||||
sgctDelegate.currentSubwindowSize = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
if (currentWindow->viewports().size() > 1) {
|
||||
const Viewport& viewport = *currentWindow->viewports().front();
|
||||
@@ -771,7 +769,7 @@ void setSgctDelegateFunctions() {
|
||||
}
|
||||
};
|
||||
sgctDelegate.currentDrawBufferResolution = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
Viewport* viewport = currentWindow->viewports().front().get();
|
||||
if (viewport != nullptr) {
|
||||
@@ -793,7 +791,7 @@ void setSgctDelegateFunctions() {
|
||||
return glm::ivec2(-1, -1);
|
||||
};
|
||||
sgctDelegate.currentViewportSize = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
if (currentViewport != nullptr) {
|
||||
vec2 size = currentViewport->size();
|
||||
@@ -802,13 +800,13 @@ void setSgctDelegateFunctions() {
|
||||
return glm::ivec2(-1, -1);
|
||||
};
|
||||
sgctDelegate.dpiScaling = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
vec2 scale = currentWindow->scale();
|
||||
return glm::vec2(scale.x, scale.y);
|
||||
};
|
||||
sgctDelegate.osDpiScaling = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
// Detect which DPI scaling to use
|
||||
// 1. If there is a GUI window, use the GUI window's content scale value
|
||||
@@ -838,7 +836,7 @@ void setSgctDelegateFunctions() {
|
||||
return scale.x;
|
||||
};
|
||||
sgctDelegate.hasGuiWindow = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
for (const std::unique_ptr<Window>& window : Engine::instance().windows()) {
|
||||
if (window->hasTag("GUI")) {
|
||||
@@ -848,70 +846,74 @@ void setSgctDelegateFunctions() {
|
||||
return false;
|
||||
};
|
||||
sgctDelegate.isGuiWindow = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return currentWindow->hasTag("GUI");
|
||||
};
|
||||
sgctDelegate.isMaster = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return Engine::instance().isMaster();
|
||||
};
|
||||
sgctDelegate.modelMatrix = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return currentModelMatrix;
|
||||
};
|
||||
sgctDelegate.setNearFarClippingPlane = [](float nearPlane, float farPlane) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
Engine::instance().setNearAndFarClippingPlanes(nearPlane, farPlane);
|
||||
};
|
||||
sgctDelegate.isFisheyeRendering = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return dynamic_cast<FisheyeProjection*>(
|
||||
currentWindow->viewports().front()->nonLinearProjection()
|
||||
) != nullptr;
|
||||
};
|
||||
sgctDelegate.takeScreenshot = [](bool applyWarping, std::vector<int> windowIds) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
Settings::instance().setCaptureFromBackBuffer(applyWarping);
|
||||
Engine::instance().takeScreenshot(std::move(windowIds));
|
||||
return Engine::instance().screenShotNumber();
|
||||
};
|
||||
sgctDelegate.resetScreenshotNumber = []() {
|
||||
ZoneScoped;
|
||||
Engine::instance().resetScreenshotNumber();
|
||||
};
|
||||
sgctDelegate.swapBuffer = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
GLFWwindow* w = glfwGetCurrentContext();
|
||||
glfwSwapBuffers(w);
|
||||
glfwPollEvents();
|
||||
};
|
||||
sgctDelegate.nWindows = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return static_cast<int>(Engine::instance().windows().size());
|
||||
};
|
||||
sgctDelegate.currentWindowId = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return currentWindow->id();
|
||||
};
|
||||
sgctDelegate.openGLProcedureAddress = [](const char* func) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return glfwGetProcAddress(func);
|
||||
};
|
||||
sgctDelegate.getHorizFieldOfView = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return static_cast<double>(
|
||||
Engine::instance().windows().front()->horizFieldOfViewDegrees()
|
||||
);
|
||||
};
|
||||
sgctDelegate.setHorizFieldOfView = [](float hFovDeg) {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
for (std::unique_ptr<sgct::Window> const& w : Engine::instance().windows()) {
|
||||
w->setHorizFieldOfView(hFovDeg);
|
||||
@@ -919,7 +921,7 @@ void setSgctDelegateFunctions() {
|
||||
};
|
||||
#ifdef WIN32
|
||||
sgctDelegate.getNativeWindowHandle = [](size_t windowIndex) -> void* {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
Window* w = Engine::instance().windows()[windowIndex].get();
|
||||
if (w) {
|
||||
@@ -930,7 +932,7 @@ void setSgctDelegateFunctions() {
|
||||
};
|
||||
#endif // WIN32
|
||||
sgctDelegate.frustumMode = []() {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
switch (currentFrustumMode) {
|
||||
default:
|
||||
@@ -940,7 +942,7 @@ void setSgctDelegateFunctions() {
|
||||
}
|
||||
};
|
||||
sgctDelegate.swapGroupFrameNumber = []() -> uint64_t {
|
||||
ZoneScoped
|
||||
ZoneScoped;
|
||||
|
||||
return currentWindow->swapGroupFrameNumber();
|
||||
};
|
||||
@@ -1077,7 +1079,6 @@ int main(int argc, char* argv[]) {
|
||||
LogMgr.addLog(std::make_unique<ghoul::logging::VisualStudioOutputLog>());
|
||||
}
|
||||
#endif // WIN32
|
||||
|
||||
}
|
||||
|
||||
ghoul::initialize();
|
||||
@@ -1117,7 +1118,9 @@ int main(int argc, char* argv[]) {
|
||||
"configuration file without editing the file on disk, for example in a "
|
||||
"planetarium environment. Please not that the Lua script must not contain any - "
|
||||
"or they will be interpreted as a new command. Similar, in Bash, ${...} will be "
|
||||
"evaluated before it is passed to OpenSpace"
|
||||
"evaluated before it is passed to OpenSpace. Windows does not approve of using \""
|
||||
"either, so it is recommended to deliniate strings with [[ ]] instead. For "
|
||||
"example: OpenSpace --config Profile=[[jwst]]"
|
||||
));
|
||||
|
||||
// setCommandLine returns a reference to the vector that will be filled later
|
||||
@@ -1125,10 +1128,16 @@ int main(int argc, char* argv[]) {
|
||||
{ argv, argv + argc }
|
||||
);
|
||||
|
||||
bool showHelp = parser.execute();
|
||||
if (showHelp) {
|
||||
std::cout << parser.helpText();
|
||||
exit(EXIT_SUCCESS);
|
||||
try {
|
||||
bool showHelp = parser.execute();
|
||||
if (showHelp) {
|
||||
std::cout << parser.helpText();
|
||||
exit(EXIT_SUCCESS);
|
||||
}
|
||||
}
|
||||
catch (const ghoul::RuntimeError& e) {
|
||||
LFATALC(e.component, e.message);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
// Take an actual copy of the arguments
|
||||
std::vector<std::string> arguments = sgctArguments;
|
||||
@@ -1366,7 +1375,7 @@ int main(int argc, char* argv[]) {
|
||||
Engine::instance().setSyncParameters(false, 15.f * 60.f);
|
||||
|
||||
LINFO("Starting rendering loop");
|
||||
Engine::instance().render();
|
||||
Engine::instance().exec();
|
||||
LINFO("Ending rendering loop");
|
||||
|
||||
global::openSpaceEngine->deinitializeGL();
|
||||
|
||||
@@ -30,11 +30,10 @@
|
||||
},
|
||||
{
|
||||
"fullscreen": true,
|
||||
"monitor": 1,
|
||||
"name": "OpenSpace",
|
||||
"draw2d": false,
|
||||
"stereo": "none",
|
||||
"pos": { "x": 0, "y": 0 },
|
||||
"pos": { "x": 1920, "y": 1080 },
|
||||
"size": { "x": 1920, "y": 1080 },
|
||||
"viewports": [
|
||||
{
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
"stereo": "none",
|
||||
"pos": { "x": 50, "y": 50 },
|
||||
"size": { "x": 1280, "y": 720 },
|
||||
"res": { "x": 2560, "y": 1440 },
|
||||
"viewports": [
|
||||
{
|
||||
"tracked": true,
|
||||
|
||||
71
config/single_gui_with_graphics.json
Normal file
71
config/single_gui_with_graphics.json
Normal file
@@ -0,0 +1,71 @@
|
||||
{
|
||||
"version": 1,
|
||||
"masteraddress": "localhost",
|
||||
"externalcontrolport": 20500,
|
||||
"settings": {
|
||||
"display": {
|
||||
"swapinterval": 0
|
||||
}
|
||||
},
|
||||
"nodes": [
|
||||
{
|
||||
"address": "localhost",
|
||||
"port": 20401,
|
||||
"windows": [
|
||||
{
|
||||
"name": "GUI",
|
||||
"tags": [ "GUI" ],
|
||||
"fullscreen": false,
|
||||
"draw3d": false,
|
||||
"blitwindowid": 1,
|
||||
"stereo": "none",
|
||||
"pos": { "x": 50, "y": 50 },
|
||||
"size": { "x": 1280, "y": 720 },
|
||||
"viewports": [
|
||||
{
|
||||
"pos": { "x": 0.0, "y": 0.0 },
|
||||
"size": { "x": 1.0, "y": 1.0 },
|
||||
"projection": {
|
||||
"type": "PlanarProjection",
|
||||
"fov": {
|
||||
"hfov": 80.0,
|
||||
"vfov": 50.534015846724
|
||||
},
|
||||
"orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 }
|
||||
}
|
||||
}
|
||||
]
|
||||
},
|
||||
{
|
||||
"name": "OpenSpace",
|
||||
"fullscreen": false,
|
||||
"draw2d": false,
|
||||
"stereo": "none",
|
||||
"pos": { "x": 50, "y": 50 },
|
||||
"size": { "x": 1280, "y": 720 },
|
||||
"viewports": [
|
||||
{
|
||||
"tracked": true,
|
||||
"pos": { "x": 0.0, "y": 0.0 },
|
||||
"size": { "x": 1.0, "y": 1.0 },
|
||||
"projection": {
|
||||
"type": "PlanarProjection",
|
||||
"fov": {
|
||||
"hfov": 80.0,
|
||||
"vfov": 50.534015846724
|
||||
},
|
||||
"orientation": { "yaw": 0.0, "pitch": 0.0, "roll": 0.0 }
|
||||
}
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
],
|
||||
"users": [
|
||||
{
|
||||
"eyeseparation": 0.065,
|
||||
"pos": { "x": 0.0, "y": 0.0, "z": 0.0 }
|
||||
}
|
||||
]
|
||||
}
|
||||
@@ -25,7 +25,8 @@
|
||||
"pos": { "x": 0.0, "y": 0.0 },
|
||||
"size": { "x": 1.0, "y": 1.0 },
|
||||
"projection": {
|
||||
"PlanarProjection": {
|
||||
"type": "SpoutFlatProjection",
|
||||
"planarprojection": {
|
||||
"fov": {
|
||||
"hfov": 80.0,
|
||||
"vfov": 50.534015846724
|
||||
@@ -38,11 +39,10 @@
|
||||
"b": 0.1,
|
||||
"a": 1.0
|
||||
},
|
||||
"drawMain": true,
|
||||
"height": "1080",
|
||||
"drawmain": true,
|
||||
"height": 1080,
|
||||
"mappingspoutname": "OS_FLAT",
|
||||
"type": "SpoutFlatProjection",
|
||||
"width": "1920"
|
||||
"width": 1920
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
@@ -19,6 +19,7 @@ asset.require("util/launcher_images")
|
||||
-- Modules and component settings
|
||||
asset.require("modules/exoplanets/exoplanets")
|
||||
asset.require("modules/skybrowser/skybrowser")
|
||||
asset.require("modules/touch/default_settings")
|
||||
|
||||
|
||||
asset.onInitialize(function ()
|
||||
|
||||
@@ -1,11 +1,18 @@
|
||||
local bookmarkHelper = asset.require("util/generate_bookmarks")
|
||||
|
||||
-- Most of the local bookmarks we are loading are relative to the Earth so we should
|
||||
-- ensure that it is loaded first
|
||||
asset.require("scene/solarsystem/planets/earth/earth")
|
||||
|
||||
local nodes = bookmarkHelper.getBookmarks("Local Bookmarks", "${ASSETS}/customization/localbookmarks.csv")
|
||||
|
||||
|
||||
asset.onInitialize(function()
|
||||
for _, n in ipairs(nodes) do
|
||||
pcall(openspace.addSceneGraphNode, n)
|
||||
local success, error = pcall(openspace.addSceneGraphNode, n)
|
||||
if not success then
|
||||
openspace.printError(error)
|
||||
end
|
||||
end
|
||||
end)
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ local DataPath = asset.syncedResource({
|
||||
Name = "Exoplanet Data Files",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "exoplanets_data",
|
||||
Version = 3
|
||||
Version = 4
|
||||
})
|
||||
|
||||
local colormaps = asset.syncedResource({
|
||||
@@ -30,7 +30,7 @@ asset.export("DataPath", DataPath)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Exoplanet Data",
|
||||
Version = "3.0",
|
||||
Version = "4.0",
|
||||
Description = [[The data that is used for the exoplanet systems. The data has been
|
||||
derived from the 'Planetary Systems Composite Data' dataset from the NASA Exoplanet
|
||||
Archive]],
|
||||
|
||||
24
data/assets/modules/touch/default_settings.asset
Normal file
24
data/assets/modules/touch/default_settings.asset
Normal file
@@ -0,0 +1,24 @@
|
||||
asset.onInitialize(function ()
|
||||
-- Avoid errors for developers when building without the touch module
|
||||
if not openspace.modules.isLoaded("Touch") then
|
||||
return
|
||||
end
|
||||
|
||||
openspace.setPropertyValueSingle("Modules.Touch.EnableTouchInteraction", true)
|
||||
|
||||
-- A list of renderable types that apply the "direct manipulation". Works best for
|
||||
-- things with a sperical-ish shape and an intearction sphere of about the same size
|
||||
-- as the bounding sphere.
|
||||
-- Can also be set for each scene graph node using the "IsDirectlyTouchable" property
|
||||
local directTouchList = { "RenderableGlobe" }
|
||||
openspace.setPropertyValueSingle("Modules.Touch.DefaultDirectTouchRenderableTypes", directTouchList)
|
||||
end)
|
||||
|
||||
asset.meta = {
|
||||
Name = "Touch Module Default Settings",
|
||||
Version = "1.0",
|
||||
Description = "Some default settings related to the touch module",
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
License = "MIT license"
|
||||
}
|
||||
@@ -6,10 +6,8 @@ local gaia618Destination = asset.syncedResource({
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "gaia_stars_618M_octree",
|
||||
Version = 1,
|
||||
Unzip = {
|
||||
UnzipFiles = true,
|
||||
Destination = "data"
|
||||
}
|
||||
UnzipFiles = true,
|
||||
UnzipFilesDestination = "data"
|
||||
})
|
||||
local gaia618DestinationExtracted = gaia618Destination .. "data";
|
||||
|
||||
|
||||
@@ -42,8 +42,8 @@ asset.onInitialize(function()
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.action.registerAction(focus_earth)
|
||||
openspace.action.registerAction(focus_moon)
|
||||
openspace.action.removeAction(focus_earth)
|
||||
openspace.action.removeAction(focus_moon)
|
||||
openspace.action.removeAction(toggle_moon_shading)
|
||||
end)
|
||||
|
||||
|
||||
@@ -14,7 +14,7 @@ local kernels = asset.syncedResource({
|
||||
Name = "Juno Kernels",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "juno_kernels",
|
||||
Version = 2
|
||||
Version = 3
|
||||
})
|
||||
|
||||
local JunoKernels = {
|
||||
@@ -31,6 +31,7 @@ local JunoKernels = {
|
||||
kernels .. "juno_waves_v00.ti",
|
||||
kernels .. "juno_mwr_v01.ti",
|
||||
kernels .. "spk_merge_110805_171017_130515.bsp",
|
||||
kernels .. "spk_ref_210111_251021_210111.bsp",
|
||||
kernels .. "juno_sc_nom_110807_171016_v01.bc",
|
||||
kernels .. "juno_sc_prl_110930_111028_jc003c01_v01.bc",
|
||||
kernels .. "juno_sc_prl_111028_111125_jc004b00_v01.bc",
|
||||
@@ -121,7 +122,8 @@ local JunoKernels = {
|
||||
kernels .. "juno_sc_prl_170831_170927_jm0081a00_v01.bc",
|
||||
kernels .. "juno_sc_prl_170927_171023_jm0082a00_v01.bc",
|
||||
kernels .. "juno_sc_prl_171023_171030_jm0091a00_v01.bc",
|
||||
kernels .. "juno_sc_prl_171023_171030_jm0091a00_v01.bc"
|
||||
kernels .. "juno_sc_prl_171023_171030_jm0091a00_v01.bc",
|
||||
kernels .. "juno_sc_prl_230228_230407_jm0490rp_v01.bc"
|
||||
}
|
||||
|
||||
local RotationMatrix = {
|
||||
@@ -163,7 +165,7 @@ local Juno = {
|
||||
TimeFrame = {
|
||||
Type = "TimeFrameInterval",
|
||||
Start = "2011-08-07T17:15:00",
|
||||
End = "2017-10-16T19:29:24"
|
||||
End = "2025-10-16T19:29:24"
|
||||
},
|
||||
GUI = {
|
||||
Path = "/Solar System/Missions/Juno"
|
||||
@@ -183,7 +185,7 @@ local JunoTrail = {
|
||||
},
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
StartTime = "2016 JUL 01",
|
||||
EndTime = "2016 DEC 13",
|
||||
EndTime = "2025 DEC 13",
|
||||
SampleInterval = 3600
|
||||
},
|
||||
GUI = {
|
||||
@@ -196,11 +198,11 @@ asset.onInitialize(function()
|
||||
openspace.addSceneGraphNode(Juno)
|
||||
openspace.addSceneGraphNode(JunoTrail)
|
||||
end)
|
||||
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.removeSceneGraphNode(JunoTrail)
|
||||
openspace.removeSceneGraphNode(Juno)
|
||||
end)
|
||||
|
||||
|
||||
asset.export(Juno)
|
||||
asset.export(JunoTrail)
|
||||
|
||||
@@ -5,7 +5,8 @@ local distance_voyager1 = {
|
||||
SourceType = "Node",
|
||||
SourceNodeName = "Voyager_1",
|
||||
DestinationType = "Node",
|
||||
DestinationNodeName = "Earth"
|
||||
DestinationNodeName = "Earth",
|
||||
Enabled = asset.enabled
|
||||
}
|
||||
|
||||
local distance_voyager2 = {
|
||||
@@ -15,7 +16,8 @@ local distance_voyager2 = {
|
||||
SourceType = "Node",
|
||||
SourceNodeName = "Voyager_2",
|
||||
DestinationType = "Node",
|
||||
DestinationNodeName = "Earth"
|
||||
DestinationNodeName = "Earth",
|
||||
Enabled = asset.enabled
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
|
||||
@@ -73,8 +73,10 @@ local Voyager1Main = {
|
||||
Type = "CameraLightSource",
|
||||
Intensity = 0.5
|
||||
}
|
||||
}
|
||||
},
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager1_part" },
|
||||
GUI = {
|
||||
Name = "Voyager 1 Main",
|
||||
Path = "/Solar System/Missions/Voyager 1"
|
||||
@@ -95,8 +97,10 @@ local Voyager1Antenna = {
|
||||
Type = "CameraLightSource",
|
||||
Intensity = 0.5
|
||||
}
|
||||
}
|
||||
},
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager1_part" },
|
||||
GUI = {
|
||||
Name = "Voyager 1 Antenna",
|
||||
Path = "/Solar System/Missions/Voyager 1"
|
||||
@@ -120,8 +124,10 @@ local VoyagerTrailCruiseEarthJupiter = {
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
StartTime = "1977 SEP 05",
|
||||
EndTime = "1979 MAR 04",
|
||||
SampleInterval = 545 * 2 -- 545 is the number of days between the Start and End time
|
||||
SampleInterval = 545 * 2, -- 545 is the number of days between the Start and End time
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager1_trail" },
|
||||
GUI = {
|
||||
Name = "Voyager 1 Trail Cruise Earth-Jupiter",
|
||||
Path = "/Solar System/Missions/Voyager 1"
|
||||
@@ -143,8 +149,10 @@ local VoyagerTrailEncounterJupiter = {
|
||||
EnableFade = false,
|
||||
StartTime = "1979 MAR 03 23:24:00", -- @TODO: Probably an off-by-one bug in RenderableTrailTrajectory?
|
||||
EndTime = "1979 MAR 09",
|
||||
SampleInterval = 100
|
||||
SampleInterval = 100,
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager1_trail" },
|
||||
GUI = {
|
||||
Name = "Voyager 1 Trail Encounter Jupiter",
|
||||
Path = "/Solar System/Missions/Voyager 1"
|
||||
@@ -166,8 +174,10 @@ local VoyagerTrailCruiseJupiterSaturn = {
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
StartTime = "1979 MAR 09",
|
||||
EndTime = "1980 NOV 11",
|
||||
SampleInterval = 618 * 2 -- 618 is the number of days between the Start and End time
|
||||
SampleInterval = 618 * 2, -- 618 is the number of days between the Start and End time
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager1_trail" },
|
||||
GUI = {
|
||||
Name = "Voyager 1 Trail Cruise Jupiter-Saturn",
|
||||
Path = "/Solar System/Missions/Voyager 1"
|
||||
@@ -189,8 +199,10 @@ local VoyagerTrailEncounterSaturn = {
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
StartTime = "1980 NOV 10 23:08:30", -- @TODO: Probably an off-by-one bug in RenderableTrailTrajectory?
|
||||
EndTime = "1980 NOV 16",
|
||||
SampleInterval = 100
|
||||
SampleInterval = 100,
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager1_trail" },
|
||||
GUI = {
|
||||
Name = "Voyager 1 Trail Encounter Saturn",
|
||||
Path = "/Solar System/Missions/Voyager 1"
|
||||
@@ -212,8 +224,10 @@ local VoyagerTrailCruiseSaturnInf = {
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
StartTime = "1980 NOV 16",
|
||||
EndTime = "2300 JAN 01",
|
||||
SampleInterval = 116558 * 2 -- 116558 is the number of days between the Start and End time
|
||||
SampleInterval = 116558 * 2, -- 116558 is the number of days between the Start and End time
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager1_trail" },
|
||||
GUI = {
|
||||
Name = "Voyager 1 Trail Cruise Saturn-Inf",
|
||||
Path = "/Solar System/Missions/Voyager 1"
|
||||
|
||||
@@ -77,8 +77,10 @@ local Voyager2Main = {
|
||||
Type = "CameraLightSource",
|
||||
Intensity = 0.5
|
||||
}
|
||||
}
|
||||
},
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager2_part" },
|
||||
GUI = {
|
||||
Name = "Voyager 2 Main",
|
||||
Path = "/Solar System/Missions/Voyager 2"
|
||||
@@ -99,8 +101,10 @@ local Voyager2Antenna = {
|
||||
Type = "CameraLightSource",
|
||||
Intensity = 0.5
|
||||
}
|
||||
}
|
||||
},
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager2_part" },
|
||||
GUI = {
|
||||
Name = "Voyager 2 Antenna",
|
||||
Path = "/Solar System/Missions/Voyager 2"
|
||||
@@ -124,8 +128,10 @@ local VoyagerTrailCruiseEarthJupiter = {
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
StartTime = "1977-AUG-20 16:07:06.535",
|
||||
EndTime = "1979 JUL 06",
|
||||
SampleInterval = 669 * 2 -- 669 is the number of days between the Start and End time
|
||||
SampleInterval = 669 * 2, -- 669 is the number of days between the Start and End time
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager2_trail" },
|
||||
GUI = {
|
||||
Name = "Voyager 2 Trail Cruise Earth-Jupiter",
|
||||
Path = "/Solar System/Missions/Voyager 2"
|
||||
@@ -147,8 +153,10 @@ local VoyagerTrailEncounterJupiter = {
|
||||
EnableFade = false,
|
||||
StartTime = "1979 JUL 05 23:24:00", -- @TODO: Probably an off-by-one bug in RenderableTrailTrajectory?
|
||||
EndTime = "1979 JUL 15",
|
||||
SampleInterval = 100
|
||||
SampleInterval = 100,
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager2_trail" },
|
||||
GUI = {
|
||||
Name = "Voyager 2 Trail Encounter Jupiter",
|
||||
Path = "/Solar System/Missions/Voyager 2"
|
||||
@@ -170,8 +178,10 @@ local VoyagerTrailCruiseJupiterSaturn = {
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
StartTime = "1979 JUL 15",
|
||||
EndTime = "1981 AUG 23",
|
||||
SampleInterval = 770 * 2 -- 770 is the number of days between the Start and End time
|
||||
SampleInterval = 770 * 2, -- 770 is the number of days between the Start and End time
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager2_trail" },
|
||||
GUI = {
|
||||
Name = "Voyager 2 Trail Cruise Jupiter-Saturn",
|
||||
Path = "/Solar System/Missions/Voyager 2"
|
||||
@@ -193,8 +203,10 @@ local VoyagerTrailEncounterSaturn = {
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
StartTime = "1981 AUG 22 23:08:30", -- @TODO: Probably an off-by-one bug in RenderableTrailTrajectory?
|
||||
EndTime = "1981 AUG 30",
|
||||
SampleInterval = 100
|
||||
SampleInterval = 100,
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager2_trail" },
|
||||
GUI = {
|
||||
Name = "Voyager 2 Trail Encounter Saturn",
|
||||
Path = "/Solar System/Missions/Voyager 2"
|
||||
@@ -216,8 +228,10 @@ local VoyagerTrailCruiseSaturnUranus = {
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
StartTime = "1981 AUG 30",
|
||||
EndTime = "1986 JAN 22",
|
||||
SampleInterval = 1971 * 2 -- 1971 is the number of days between the Start and End time
|
||||
SampleInterval = 1971 * 2, -- 1971 is the number of days between the Start and End time
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager2_trail" },
|
||||
GUI = {
|
||||
Name = "Voyager 2 Trail Cruise Saturn-Uranus",
|
||||
Path = "/Solar System/Missions/Voyager 2"
|
||||
@@ -239,8 +253,10 @@ local VoyagerTrailEncounterUranus = {
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
StartTime = "1986 JAN 21 23:30:00", -- @TODO: Probably an off-by-one bug in RenderableTrailTrajectory?
|
||||
EndTime = "1986 JAN 27",
|
||||
SampleInterval = 100
|
||||
SampleInterval = 100,
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager2_trail" },
|
||||
GUI = {
|
||||
Name = "Voyager 2 Trail Encounter Uranus",
|
||||
Path = "/Solar System/Missions/Voyager 2"
|
||||
@@ -262,8 +278,10 @@ local VoyagerTrailCruiseUranusNeptune = {
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
StartTime = "1986 JAN 27",
|
||||
EndTime = "1989 AUG 24",
|
||||
SampleInterval = 1305 * 2 -- 1305 is the number of days between the Start and End time
|
||||
SampleInterval = 1305 * 2, -- 1305 is the number of days between the Start and End time
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager2_trail" },
|
||||
GUI = {
|
||||
Name = "Voyager 2 Trail Cruise Uranus-Neptune",
|
||||
Path = "/Solar System/Missions/Voyager 2"
|
||||
@@ -285,8 +303,10 @@ local VoyagerTrailEncounterNeptune = {
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
StartTime = "1989 AUG 23 23:30:00", -- @TODO: Probably an off-by-one bug in RenderableTrailTrajectory?
|
||||
EndTime = "1989 AUG 26",
|
||||
SampleInterval = 100
|
||||
SampleInterval = 100,
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager2_trail" },
|
||||
GUI = {
|
||||
Name = "Voyager 2 Trail Encounter Neptune",
|
||||
Path = "/Solar System/Missions/Voyager 2"
|
||||
@@ -308,8 +328,10 @@ local VoyagerTrailCruiseNeptuneInf = {
|
||||
Color = { 0.70, 0.50, 0.20 },
|
||||
StartTime = "1989 AUG 26",
|
||||
EndTime = "2300 JAN 01",
|
||||
SampleInterval = 113353 * 2 -- 113353 is the number of days between the Start and End time
|
||||
SampleInterval = 113353 * 2, -- 113353 is the number of days between the Start and End time
|
||||
Enabled = asset.enabled
|
||||
},
|
||||
Tag = { "voyager2_trail" },
|
||||
GUI = {
|
||||
Name = "Voyager 2 Trail Cruise Neptune-Inf",
|
||||
Path = "/Solar System/Missions/Voyager 2"
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
-- Color layers
|
||||
asset.require("./layers/colorlayers/blue_marble", false)
|
||||
asset.require("./layers/colorlayers/esri_viirs_combo", true)
|
||||
asset.require("./layers/colorlayers/esri_noaa20_combo", false)
|
||||
asset.require("./layers/colorlayers/esri_world_imagery", false)
|
||||
asset.require("./layers/colorlayers/viirs_snpp_temporal", false)
|
||||
asset.require("./layers/colorlayers/aqua_modis_temporal", false)
|
||||
|
||||
@@ -0,0 +1,67 @@
|
||||
local globeIdentifier = asset.require("../../earth").Earth.Identifier
|
||||
|
||||
local layer = {
|
||||
Identifier = "ESRI_NOAA20_Combo",
|
||||
Name = "ESRI NOAA20 Combo",
|
||||
Enabled = asset.enabled,
|
||||
Type = "ByLevelTileLayer",
|
||||
LevelTileProviders = {
|
||||
{
|
||||
MaxLevel = 4,
|
||||
TileProvider = {
|
||||
Identifier = "Temporal_VIIRS_NOAA20",
|
||||
Name = "Temporal VIIRS NOAA20",
|
||||
Type = "TemporalTileLayer",
|
||||
Mode = "Prototyped",
|
||||
Prototyped = {
|
||||
Time = {
|
||||
Start = "2020-04-25",
|
||||
End = "Today"
|
||||
},
|
||||
TemporalResolution = "1d",
|
||||
TimeFormat = "YYYY-MM-DD",
|
||||
Prototype = openspace.globebrowsing.createTemporalGibsGdalXml(
|
||||
"VIIRS_NOAA20_CorrectedReflectance_TrueColor",
|
||||
"250m",
|
||||
"jpg"
|
||||
)
|
||||
},
|
||||
PadTiles = false
|
||||
}
|
||||
},
|
||||
{
|
||||
MaxLevel = 22,
|
||||
TileProvider = {
|
||||
Identifier = "ESRI_World_Imagery",
|
||||
Name = "ESRI World Imagery",
|
||||
FilePath = asset.localResource("esri_world_imagery.wms"),
|
||||
PadTiles = false
|
||||
}
|
||||
},
|
||||
},
|
||||
PadTiles = false,
|
||||
Description = [[Level based layer combining "NOAA20 SNPP (Temporal)" and ESRI World
|
||||
Imagery. "NOAA20 SNPP (Temporal)" is faded out at tile level 4]]
|
||||
}
|
||||
|
||||
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 = "ESRI NOAA20 VIIRS Combo",
|
||||
Version = "1.0",
|
||||
Description = [[Level based layer combining "NOAA20 SNPP (Temporal)" and ESRI World
|
||||
Imagery. "NOAA20 SNPP (Temporal)" is faded out at tile level 4]],
|
||||
Author = "OpenSpace Tem",
|
||||
URL = "http://www.openspaceproject.com",
|
||||
License = "MIT License"
|
||||
}
|
||||
@@ -131,7 +131,7 @@ local focus_iss = {
|
||||
|
||||
asset.onInitialize(function ()
|
||||
local i = openspace.space.readKeplerFile(omm .. "ISS.txt", "OMM")
|
||||
issTrail.Renderable.Period = i[0].Period / (60 * 60 * 24)
|
||||
issTrail.Renderable.Period = i[1].Period / (60 * 60 * 24)
|
||||
|
||||
openspace.addSceneGraphNode(iss)
|
||||
openspace.addSceneGraphNode(parentNode)
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
-- Color layers
|
||||
asset.require("./layers/colorlayers/magellan_mosaic_utah", false)
|
||||
asset.require("./layers/colorlayers/venus_texture", false)
|
||||
asset.require("./layers/colorlayers/magellan_mosaic_utah", true)
|
||||
asset.require("./layers/colorlayers/clouds_magellan_combo", true)
|
||||
|
||||
-- Height layers
|
||||
asset.require("./layers/heightlayers/magellan_utah", true)
|
||||
|
||||
@@ -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",
|
||||
Name = "Clouds Magellan Combo",
|
||||
Enabled = asset.enabled,
|
||||
Type = "ByLevelTileLayer",
|
||||
LevelTileProviders = {
|
||||
{
|
||||
MaxLevel = 4,
|
||||
TileProvider = {
|
||||
Identifier = "Clouds",
|
||||
Name = "Clouds",
|
||||
FilePath = texturesPath .. "venus_clouds.jpg"
|
||||
}
|
||||
},
|
||||
{
|
||||
MaxLevel = 7,
|
||||
TileProvider = {
|
||||
Identifier = "Magellan_Mosaic_Utah",
|
||||
Name = "Magellan Mosaic [Utah]",
|
||||
FilePath = asset.localResource("magellan_mosaic_utah.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)
|
||||
@@ -4,9 +4,15 @@ local texturesPath = asset.syncedResource({
|
||||
Name = "Venus Textures",
|
||||
Type = "HttpSynchronization",
|
||||
Identifier = "venus_textures",
|
||||
Version = 1
|
||||
Version = 2
|
||||
})
|
||||
|
||||
local clouds = {
|
||||
Identifier = "Clouds",
|
||||
FilePath = texturesPath .. "venus_clouds.jpg",
|
||||
Enabled = asset.enabled,
|
||||
}
|
||||
|
||||
local layer = {
|
||||
Identifier = "Texture",
|
||||
FilePath = texturesPath .. "venus.jpg",
|
||||
@@ -18,20 +24,23 @@ local layer = {
|
||||
}
|
||||
|
||||
asset.onInitialize(function()
|
||||
openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", clouds)
|
||||
openspace.globebrowsing.addLayer(globeIdentifier, "ColorLayers", layer)
|
||||
end)
|
||||
|
||||
asset.onDeinitialize(function()
|
||||
openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", layer)
|
||||
openspace.globebrowsing.deleteLayer(globeIdentifier, "ColorLayers", clouds)
|
||||
end)
|
||||
|
||||
asset.export("layer", layer)
|
||||
asset.export(layer)
|
||||
asset.export(clouds)
|
||||
|
||||
|
||||
|
||||
asset.meta = {
|
||||
Name = "Venus Texture",
|
||||
Version = "1.0",
|
||||
Version = "2.0",
|
||||
Description = "This asset supplies a default texture for Venus",
|
||||
Author = "OpenSpace Team",
|
||||
URL = "http://openspaceproject.com",
|
||||
|
||||
@@ -1,80 +1,90 @@
|
||||
local getBookmarks = function (guiPath, bookmarkfile)
|
||||
local genBookmarks = {};
|
||||
local notFirstLine = false;
|
||||
local PARSEC_CONSTANT = 3.0856776E16;
|
||||
for line in io.lines(openspace.absPath(bookmarkfile)) do
|
||||
if (notFirstLine) then
|
||||
local matchstring = "(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-),(.-)$"
|
||||
local group, name, globe, lat, lon, altitude, x, y, z, scale, linewidth = line:match(matchstring)
|
||||
|
||||
scale = (scale == "" and 75000 or scale)
|
||||
linewidth = (linewidth == "" and 2.0 or tonumber(linewidth))
|
||||
group = (group == "" and globe or group)
|
||||
local extract_first_line = false
|
||||
local contents = openspace.readCSVFile(openspace.absPath(bookmarkfile), extract_first_line);
|
||||
openspace.printWarning(contents)
|
||||
|
||||
local parent = (globe == "" and "Root" or globe)
|
||||
for _,v in ipairs(contents) do
|
||||
local group = v[1]
|
||||
local name = v[2]
|
||||
local globe = v[3]
|
||||
local lat = v[4]
|
||||
local lon = v[5]
|
||||
local altitude = v[6]
|
||||
local x = v[7]
|
||||
local y = v[8]
|
||||
local z = v[9]
|
||||
local scale = v[10]
|
||||
local linewidth = v[11]
|
||||
|
||||
local sgn = {
|
||||
Identifier = guiPath .. "-" .. name,
|
||||
Parent = parent,
|
||||
Transform = {
|
||||
Scale = {
|
||||
Type = "StaticScale",
|
||||
Scale = tonumber(scale);
|
||||
},
|
||||
local identifier = string.gsub(guiPath .. "-" .. name, " ", "_")
|
||||
|
||||
scale = (scale == "" and 75000 or scale)
|
||||
linewidth = (linewidth == "" and 2.0 or tonumber(linewidth))
|
||||
|
||||
local parent = (globe == "" and "Root" or globe)
|
||||
|
||||
local sgn = {
|
||||
Identifier = identifier,
|
||||
Parent = parent,
|
||||
Transform = {
|
||||
Scale = {
|
||||
Type = "StaticScale",
|
||||
Scale = tonumber(scale);
|
||||
},
|
||||
Rotation = {
|
||||
Type = "StaticRotation",
|
||||
Rotation = {
|
||||
Type = "StaticRotation",
|
||||
Rotation = {
|
||||
-0.05487554, 0.4941095, -0.8676661,
|
||||
-0.9938214 , -0.1109906, -0.0003515167,
|
||||
-0.09647644, 0.8622859, 0.4971472
|
||||
}
|
||||
-0.05487554, 0.4941095, -0.8676661,
|
||||
-0.9938214 , -0.1109906, -0.0003515167,
|
||||
-0.09647644, 0.8622859, 0.4971472
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
Type = "RenderableSphericalGrid",
|
||||
Enabled = false,
|
||||
Opacity = 0.3,
|
||||
Color = { 0.3, 0.84, 1.0},
|
||||
LineWidth = linewidth
|
||||
},
|
||||
GUI = {
|
||||
Name = name,
|
||||
Path = "/" .. guiPath
|
||||
}
|
||||
},
|
||||
Renderable = {
|
||||
Type = "RenderableSphericalGrid",
|
||||
Enabled = false,
|
||||
Opacity = 0.3,
|
||||
Color = { 0.3, 0.84, 1.0},
|
||||
LineWidth = linewidth
|
||||
},
|
||||
GUI = {
|
||||
Name = name,
|
||||
Path = "/" .. guiPath
|
||||
}
|
||||
}
|
||||
|
||||
if (group ~= "") then
|
||||
sgn.GUI.Path = sgn.GUI.Path .. "/" .. group
|
||||
end
|
||||
|
||||
if (globe == "") then
|
||||
sgn.Transform.Translation = {
|
||||
Type = "StaticTranslation",
|
||||
Position = {
|
||||
tonumber(x) * PARSEC_CONSTANT,
|
||||
tonumber(y) * PARSEC_CONSTANT,
|
||||
tonumber(z) * PARSEC_CONSTANT
|
||||
}
|
||||
}
|
||||
|
||||
if (group ~= "") then
|
||||
sgn.GUI.Path = sgn.GUI.Path .. "/" .. group
|
||||
end
|
||||
|
||||
if (globe == "") then
|
||||
sgn.Transform.Translation = {
|
||||
Type = "StaticTranslation",
|
||||
Position = {
|
||||
tonumber(x) * PARSEC_CONSTANT,
|
||||
tonumber(y) * PARSEC_CONSTANT,
|
||||
tonumber(z) * PARSEC_CONSTANT
|
||||
}
|
||||
}
|
||||
else
|
||||
sgn.Transform.Translation = {
|
||||
Type = "GlobeTranslation",
|
||||
Globe = globe,
|
||||
Latitude = tonumber(lat),
|
||||
Longitude = tonumber(lon)
|
||||
}
|
||||
if (altitude == nil) then
|
||||
sgn.Transform.Translation.UseHeightMap = true;
|
||||
else
|
||||
sgn.Transform.Translation.UseHeightMap = false;
|
||||
sgn.Transform.Translation.Altitude = tonumber(altitude);
|
||||
end
|
||||
end
|
||||
|
||||
table.insert(genBookmarks, sgn);
|
||||
else
|
||||
notFirstLine = true
|
||||
sgn.Transform.Translation = {
|
||||
Type = "GlobeTranslation",
|
||||
Globe = globe,
|
||||
Latitude = tonumber(lat),
|
||||
Longitude = tonumber(lon)
|
||||
}
|
||||
if (altitude == nil) then
|
||||
sgn.Transform.Translation.UseHeightMap = true;
|
||||
else
|
||||
sgn.Transform.Translation.UseHeightMap = false;
|
||||
sgn.Transform.Translation.Altitude = tonumber(altitude);
|
||||
end
|
||||
end
|
||||
|
||||
table.insert(genBookmarks, sgn);
|
||||
end
|
||||
return genBookmarks
|
||||
end
|
||||
|
||||
@@ -3,7 +3,7 @@ asset.require("./static_server")
|
||||
local guiCustomization = asset.require("customization/gui")
|
||||
|
||||
-- Select which commit hashes to use for the frontend and backend
|
||||
local frontendHash = "644f308be66309c2089bf6f94929205b24d56a8f"
|
||||
local frontendHash = "ed8c050c75ce3d859bfd9babdfe6b08affd750dc"
|
||||
local dataProvider = "data.openspaceproject.com/files/webgui"
|
||||
|
||||
local frontend = asset.syncedResource({
|
||||
|
||||
@@ -5,7 +5,7 @@ return {
|
||||
|
||||
InputDataFile = "${DATA}/tasks/exoplanets/downloaded_exo_data.csv",
|
||||
InputSPECK = "${SYNC}/http/digitaluniverse_exoplanets_speck/2/expl.speck",
|
||||
TeffToBvFile = "${SYNC}/http/exoplanets_data/2/teff_bv.txt",
|
||||
TeffToBvFile = "${SYNC}/http/exoplanets_data/3/teff_bv.txt",
|
||||
OutputBIN = dataFolder .. "/exoplanets_data.bin",
|
||||
OutputLUT = dataFolder .. "/lookup.txt"
|
||||
}
|
||||
|
||||
Submodule ext/ghoul updated: 742730cd05...14fc8c5487
@@ -92,10 +92,10 @@ struct TestResult {
|
||||
};
|
||||
|
||||
|
||||
/// Is \c true if the TestResult is positive, \c false otherwise
|
||||
/// Is `true` if the TestResult is positive, `false` otherwise
|
||||
bool success = false;
|
||||
/// Contains a list of offenses that were found in the test. Is empty if
|
||||
/// TestResult::Success is \c true
|
||||
/// TestResult::Success `true`
|
||||
std::vector<Offense> offenses;
|
||||
/// Contains a list of warnings that were found in the test
|
||||
std::vector<Warning> warnings;
|
||||
@@ -113,7 +113,7 @@ struct SpecificationError : public ghoul::RuntimeError {
|
||||
* \param res The offending TestResult that is passed on
|
||||
* \param comp The component that initiated the specification test
|
||||
*
|
||||
* \pre \p res%'s TestResult::success must be \c false
|
||||
* \pre \p res%'s TestResult::success must be `false`
|
||||
*/
|
||||
SpecificationError(TestResult res, std::string comp);
|
||||
|
||||
@@ -138,7 +138,7 @@ DocumentationEntry e = { "key", new IntVerifier, "Documentation text", Optional:
|
||||
\endverbatim
|
||||
|
||||
* Furthermore, these initializer lists can be crated all at once for a Documentation.
|
||||
* Even if the Verifier%s are specified using the \c new operators, they will not leak
|
||||
* Even if the Verifier%s are specified using the `new` operators, they will not leak
|
||||
* memory as the DocumentationEntry takes ownership of them in the constructor.
|
||||
*/
|
||||
struct DocumentationEntry {
|
||||
@@ -212,7 +212,7 @@ struct DocumentationEntry {
|
||||
* used to impose restrictions on keys and values and determine whether a given
|
||||
* ghoul::Dictionary adheres to these specifications (see #testSpecification and
|
||||
* #testSpecificationAndThrow methods). Each Documentation consists of a human-readable
|
||||
* \c name, and a list of DocumentationEntry%s that each describe a single key value. The
|
||||
* `name`, and a list of DocumentationEntry%s that each describe a single key value. The
|
||||
* most convenient way of creating a Documentation is by using nested initializer lists:
|
||||
*\verbatim
|
||||
Documentation doc = {
|
||||
|
||||
@@ -101,9 +101,9 @@ public:
|
||||
* in it: HandlebarJS Templates (from _handlebarTemplates) and json (from
|
||||
* \p data) along with the base template and js/css files from the source
|
||||
* directory ${WEB}/documentation
|
||||
* \param templates Vector of templates to add. Most of the time this list
|
||||
* will just contain one item, but some modules may wish to provide
|
||||
* multiple templates for subtypes, etc
|
||||
*
|
||||
* \param path The path to add
|
||||
* \param data The JSON data that is written to the documentation
|
||||
*/
|
||||
void writeDocumentationHtml(const std::string& path, std::string data);
|
||||
|
||||
|
||||
@@ -48,22 +48,22 @@ class DocumentationGenerator {
|
||||
public:
|
||||
/// This struct contains a single Handlebar template, with the name and the filename
|
||||
struct HandlebarTemplate {
|
||||
std::string name; ///< The name of the Handlebar template defined in \m filename
|
||||
std::string filename; ///< The filename referenced in the \m name
|
||||
std::string name; ///< The name of the Handlebar template defined in #filename
|
||||
std::string filename; ///< The filename referenced in the #name
|
||||
};
|
||||
|
||||
/**
|
||||
* The constructor that is used to set the member variables later used in the
|
||||
* writeDocumentation method.
|
||||
*
|
||||
* \param name The name of the written documentation
|
||||
* \param jsonName The variable name of the value generated by the generateJson
|
||||
* \param handlebarTemplates A list of Handlebar templates that is added to the
|
||||
* documentation file
|
||||
* \param javascriptFilename The path to a Javascript source file that is added to the
|
||||
* documentation and that can contain additional functionality
|
||||
*
|
||||
* \pre name must not be empty
|
||||
* \pre jsonName must not be empty
|
||||
* \pre Each handlebarTemplates' \c name must not be empty
|
||||
* \pre Each handlebarTemplates' `name` must not be empty
|
||||
* \pre javascriptFilename must not be empty
|
||||
*/
|
||||
DocumentationGenerator(std::string name, std::string jsonName,
|
||||
@@ -82,7 +82,8 @@ public:
|
||||
* This abstract method is used by concrete subclasses to provide the actual data that
|
||||
* is used in the documentation written by this DocumentationGenerator class. The JSON
|
||||
* string returned by this function will be stored in the variable with the
|
||||
* \c jsonName as passed in the constructor.
|
||||
* `jsonName` as passed in the constructor.
|
||||
*
|
||||
* \return A JSON script that is parsed and stored in the variable passed in the
|
||||
* DocumentationGenerator constructor
|
||||
*/
|
||||
|
||||
@@ -59,7 +59,7 @@ struct Verifier {
|
||||
* TestResult::offenders will either contain \p key or, in the case of a
|
||||
* TableVerifier, a list of all offending subkeys as fully qualified names.
|
||||
*
|
||||
* \post If the return values' TestResult::success is \c true, its
|
||||
* \post If the return values' TestResult::success is `true`, its
|
||||
* TestResult::offenders is empty
|
||||
*/
|
||||
virtual TestResult operator()(const ghoul::Dictionary& dictionary,
|
||||
@@ -96,7 +96,7 @@ struct Verifier {
|
||||
/**
|
||||
* The base class Verifier for all Verifier%s that have to test against a specific value
|
||||
* type. This Verifier tests whether a given key exists and whether it has the same type
|
||||
* as the template parameter \c T.
|
||||
* as the template parameter `T`.
|
||||
* \tparam T The type against which the key's value is tested
|
||||
*/
|
||||
template <typename T>
|
||||
@@ -105,15 +105,15 @@ struct TemplateVerifier : public Verifier {
|
||||
|
||||
/**
|
||||
* Tests whether the \p key contained in the ghoul::Dictionary \p dictionary exists
|
||||
* and has the same type as \c T.
|
||||
* and has the same type as `T`.
|
||||
*
|
||||
* \param dictionary The ghoul::Dictionary that contains the \p key to be tested
|
||||
* \param key The key inside the \p dictinoary that is to be tested
|
||||
* \return A TestResult that contains the information whether the \p key exists in the
|
||||
* \p dictionary and whether the key's value's type agrees with \c T.
|
||||
* \p dictionary and whether the key's value's type agrees with `T`.
|
||||
*
|
||||
* \post The return values' TestResult::success is either \c true and
|
||||
* TestResult::offenders is empty, or it is \c false and TestResult::offenders
|
||||
* \post The return values' TestResult::success is either `true` and
|
||||
* TestResult::offenders is empty, or it is `false` and TestResult::offenders
|
||||
* contains \p key
|
||||
*/
|
||||
TestResult operator()(const ghoul::Dictionary& dictionary,
|
||||
@@ -124,7 +124,7 @@ struct TemplateVerifier : public Verifier {
|
||||
|
||||
/**
|
||||
* A Verifier that checks whether a given key inside a ghoul::Dictionary is of type
|
||||
* \c bool. No implicit conversion is considered in this testing.
|
||||
* `bool`. No implicit conversion is considered in this testing.
|
||||
*/
|
||||
struct BoolVerifier : public TemplateVerifier<bool> {
|
||||
std::string type() const override;
|
||||
@@ -132,7 +132,7 @@ struct BoolVerifier : public TemplateVerifier<bool> {
|
||||
|
||||
/**
|
||||
* A Verifier that checks whether a given key inside a ghoul::Dictionary is of type
|
||||
* \c double. No implicit conversion is considered in this testing.
|
||||
* `double`. No implicit conversion is considered in this testing.
|
||||
*/
|
||||
struct DoubleVerifier : public TemplateVerifier<double> {
|
||||
std::string type() const override;
|
||||
@@ -140,9 +140,8 @@ struct DoubleVerifier : public TemplateVerifier<double> {
|
||||
|
||||
/**
|
||||
* A Verifier that checks whether a given key inside a ghoul::Dictionary is of type
|
||||
* \c int. It will also return \c true if the key's value is of type \c double, but is a
|
||||
* integer value (for example, <code>0.0</code>, <code>12.0</code>, but not
|
||||
* <code>0.5</code>).
|
||||
* `int`. It will also return `true` if the key's value is of type `double`, but is a
|
||||
* integer value (for example, `0.0`, `12.0`, but not `0.5`).
|
||||
*/
|
||||
struct IntVerifier : public TemplateVerifier<int> {
|
||||
TestResult operator()(const ghoul::Dictionary& dict,
|
||||
@@ -153,7 +152,7 @@ struct IntVerifier : public TemplateVerifier<int> {
|
||||
|
||||
/**
|
||||
* A Verifier that checks whether a given key inside a ghoul::Dictionary is of type
|
||||
* <code>std::string</code>. No implicit conversion is considered in this testing.
|
||||
* `std::string`. No implicit conversion is considered in this testing.
|
||||
*/
|
||||
struct StringVerifier : public TemplateVerifier<std::string> {
|
||||
StringVerifier(bool mustBeNotEmpty = false);
|
||||
@@ -169,6 +168,21 @@ private:
|
||||
bool _mustBeNotEmpty = false;
|
||||
};
|
||||
|
||||
/**
|
||||
* A Verifier that checks whether a given string is a valid identifier, meaning that is
|
||||
* does not contain any whitespaces or dots
|
||||
*/
|
||||
struct IdentifierVerifier : public StringVerifier {
|
||||
IdentifierVerifier();
|
||||
|
||||
TestResult operator()(const ghoul::Dictionary& dict,
|
||||
const std::string& key) const override;
|
||||
|
||||
std::string documentation() const override;
|
||||
|
||||
std::string type() const override;
|
||||
};
|
||||
|
||||
/**
|
||||
* A Verifier that checks whether a given key inside a ghoul::Dictionary is a string and
|
||||
* refers to an existing file on disk.
|
||||
@@ -214,9 +228,9 @@ struct DateTimeVerifier : public StringVerifier {
|
||||
* recursively to check the contained table. If this list is empty, a simple type testing
|
||||
* is performed instead. If the testing finds any offending keys, it will return those
|
||||
* keys with fully qualified names, that is, the name of the table will be prepended to
|
||||
* the offending keys. Example: If the key \c Table is tested and a passed
|
||||
* DocumentationEntry checks for a nested key \c a and this does not comply, this Verifier
|
||||
* will return <code>Table.a</code> as an offender.
|
||||
* the offending keys. Example: If the key `Table` is tested and a passed
|
||||
* DocumentationEntry checks for a nested key `a` and this does not comply, this Verifier
|
||||
* will return `Table.a` as an offender.
|
||||
*/
|
||||
struct TableVerifier : public TemplateVerifier<ghoul::Dictionary> {
|
||||
/**
|
||||
@@ -242,7 +256,7 @@ struct TableVerifier : public TemplateVerifier<ghoul::Dictionary> {
|
||||
* \return A TestResult containing the results of the testing. If DocumentationEntry%s
|
||||
* were specified in the constructor and one of those values find an offending
|
||||
* key inside the table, it's name will be returned with a fully qualified
|
||||
* name by prepending the name (= \key) of the table.
|
||||
* name by prepending the name (= \p key) of the table.
|
||||
*/
|
||||
TestResult operator()(const ghoul::Dictionary& dictionary,
|
||||
const std::string& key) const override;
|
||||
@@ -254,7 +268,7 @@ struct TableVerifier : public TemplateVerifier<ghoul::Dictionary> {
|
||||
};
|
||||
|
||||
/**
|
||||
* A Verifier that checks whether all values contained in a Table are of type \c string.
|
||||
* A Verifier that checks whether all values contained in a Table are of type `string`.
|
||||
*/
|
||||
struct StringListVerifier : public TableVerifier {
|
||||
/**
|
||||
@@ -268,7 +282,7 @@ struct StringListVerifier : public TableVerifier {
|
||||
};
|
||||
|
||||
/**
|
||||
* A Verifier that checks whether all values contained in a Table are of type \c int.
|
||||
* A Verifier that checks whether all values contained in a Table are of type `int`.
|
||||
*/
|
||||
struct IntListVerifier : public TableVerifier {
|
||||
/**
|
||||
@@ -286,26 +300,26 @@ struct IntListVerifier : public TableVerifier {
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* This struct is the base class for all Verifier%s that check for \c glm vector types.
|
||||
* This struct is the base class for all Verifier%s that check for `glm` vector types.
|
||||
* The template parameter for the subclasses is the containing type, not the full vector
|
||||
* type. For example to check for <code>glm::dvec3</code>, one would create a
|
||||
* <code>Vector3Verifier<double></code>.
|
||||
* type. For example to check for `glm::dvec3`, one would create a
|
||||
* `Vector3Verifier<double>`.
|
||||
*/
|
||||
struct VectorVerifier {};
|
||||
|
||||
/// This Verifier checks whether the value is of type <code>glm::tvec2<T></code>
|
||||
/// This Verifier checks whether the value is of type `glm::tvec2<T>`
|
||||
template <typename T>
|
||||
struct Vector2Verifier : public TemplateVerifier<glm::tvec2<T>>, public VectorVerifier {
|
||||
std::string type() const override;
|
||||
};
|
||||
|
||||
/// This Verifier checks whether the value is of type <code>glm::tvec3<T></code>
|
||||
/// This Verifier checks whether the value is of type `glm::tvec3<T>`
|
||||
template <typename T>
|
||||
struct Vector3Verifier : public TemplateVerifier<glm::tvec3<T>>, public VectorVerifier {
|
||||
std::string type() const override;
|
||||
};
|
||||
|
||||
/// This Verifier checks whether the value is of type <code>glm::tvec4<T></code>
|
||||
/// This Verifier checks whether the value is of type `glm::tvec4<T>`
|
||||
template <typename T>
|
||||
struct Vector4Verifier : public TemplateVerifier<glm::tvec4<T>>, public VectorVerifier {
|
||||
std::string type() const override;
|
||||
@@ -327,7 +341,7 @@ struct Color4Verifier : public Vector4Verifier<double> {
|
||||
|
||||
/**
|
||||
* A Verifier that checks whether all values contained in a Table are of
|
||||
* type <code>glm::tvec2<T></code>
|
||||
* type `glm::tvec2<T>`
|
||||
*/
|
||||
template <typename T>
|
||||
struct Vector2ListVerifier : public TableVerifier {
|
||||
@@ -344,7 +358,7 @@ struct Vector2ListVerifier : public TableVerifier {
|
||||
|
||||
/**
|
||||
* A Verifier that checks whether all values contained in a Table are of
|
||||
* type <code>glm::tvec3<T></code>
|
||||
* type `glm::tvec3<T>`
|
||||
*/
|
||||
template <typename T>
|
||||
struct Vector3ListVerifier : public TableVerifier {
|
||||
@@ -361,7 +375,7 @@ struct Vector3ListVerifier : public TableVerifier {
|
||||
|
||||
/**
|
||||
* A Verifier that checks whether all values contained in a Table are of
|
||||
* type <code>glm::tvec4<T></code>
|
||||
* type `glm::tvec4<T>`
|
||||
*/
|
||||
template <typename T>
|
||||
struct Vector4ListVerifier : public TableVerifier {
|
||||
@@ -381,15 +395,15 @@ struct Vector4ListVerifier : public TableVerifier {
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* This struct is the base class for all Verifier%s that check for \c glm matrix types.
|
||||
* This struct is the base class for all Verifier%s that check for `glm` matrix types.
|
||||
* The template parameter for the subclasses is the containing type, not the full matrix
|
||||
* type. For example to check for <code>glm::dmat4x3</code>, one would create a
|
||||
* <code>Matrix4x3Verifier<double></code>.
|
||||
* type. For example to check for `glm::dmat4x3`, one would create a
|
||||
* `Matrix4x3Verifier<double>`.
|
||||
*/
|
||||
struct MatrixVerifier {};
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the value is of type <code>glm::mat2x2<T></code>
|
||||
* This Verifier checks whether the value is of type `glm::mat2x2<T>`
|
||||
*/
|
||||
template <typename T>
|
||||
struct Matrix2x2Verifier : public TemplateVerifier<glm::tmat2x2<T>>, public MatrixVerifier
|
||||
@@ -398,7 +412,7 @@ struct Matrix2x2Verifier : public TemplateVerifier<glm::tmat2x2<T>>, public Matr
|
||||
};
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the value is of type <code>glm::mat2x3<T></code>
|
||||
* This Verifier checks whether the value is of type `glm::mat2x3<T>`
|
||||
*/
|
||||
template <typename T>
|
||||
struct Matrix2x3Verifier : public TemplateVerifier<glm::tmat2x3<T>>, public MatrixVerifier
|
||||
@@ -407,7 +421,7 @@ struct Matrix2x3Verifier : public TemplateVerifier<glm::tmat2x3<T>>, public Matr
|
||||
};
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the value is of type <code>glm::mat2x4<T></code>
|
||||
* This Verifier checks whether the value is of type `glm::mat2x4<T>`
|
||||
*/
|
||||
template <typename T>
|
||||
struct Matrix2x4Verifier : public TemplateVerifier<glm::tmat2x4<T>>, public MatrixVerifier
|
||||
@@ -416,7 +430,7 @@ struct Matrix2x4Verifier : public TemplateVerifier<glm::tmat2x4<T>>, public Matr
|
||||
};
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the value is of type <code>glm::mat3x2<T></code>
|
||||
* This Verifier checks whether the value is of type `glm::mat3x2<T>`
|
||||
*/
|
||||
template <typename T>
|
||||
struct Matrix3x2Verifier : public TemplateVerifier<glm::tmat3x2<T>>, public MatrixVerifier
|
||||
@@ -425,7 +439,7 @@ struct Matrix3x2Verifier : public TemplateVerifier<glm::tmat3x2<T>>, public Matr
|
||||
};
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the value is of type <code>glm::mat3x3<T></code>
|
||||
* This Verifier checks whether the value is of type `glm::mat3x3<T>`
|
||||
*/
|
||||
template <typename T>
|
||||
struct Matrix3x3Verifier : public TemplateVerifier<glm::tmat3x3<T>>, public MatrixVerifier
|
||||
@@ -434,7 +448,7 @@ struct Matrix3x3Verifier : public TemplateVerifier<glm::tmat3x3<T>>, public Matr
|
||||
};
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the value is of type <code>glm::mat3x4<T></code>
|
||||
* This Verifier checks whether the value is of type `glm::mat3x4<T>`
|
||||
*/
|
||||
template <typename T>
|
||||
struct Matrix3x4Verifier : public TemplateVerifier<glm::tmat3x4<T>>, public MatrixVerifier
|
||||
@@ -443,7 +457,7 @@ struct Matrix3x4Verifier : public TemplateVerifier<glm::tmat3x4<T>>, public Matr
|
||||
};
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the value is of type <code>glm::mat4x2<T></code>
|
||||
* This Verifier checks whether the value is of type `glm::mat4x2<T>`
|
||||
*/
|
||||
template <typename T>
|
||||
struct Matrix4x2Verifier : public TemplateVerifier<glm::tmat4x2<T>>, public MatrixVerifier
|
||||
@@ -452,7 +466,7 @@ struct Matrix4x2Verifier : public TemplateVerifier<glm::tmat4x2<T>>, public Matr
|
||||
};
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the value is of type <code>glm::mat4x3<T></code>
|
||||
* This Verifier checks whether the value is of type `glm::mat4x3<T>`
|
||||
*/
|
||||
template <typename T>
|
||||
struct Matrix4x3Verifier : public TemplateVerifier<glm::tmat4x3<T>>, public MatrixVerifier
|
||||
@@ -461,7 +475,7 @@ struct Matrix4x3Verifier : public TemplateVerifier<glm::tmat4x3<T>>, public Matr
|
||||
};
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the value is of type <code>glm::mat4x4<T></code>
|
||||
* This Verifier checks whether the value is of type `glm::mat4x4<T>`
|
||||
*/
|
||||
template <typename T>
|
||||
struct Matrix4x4Verifier : public TemplateVerifier<glm::tmat4x4<T>>, public MatrixVerifier
|
||||
@@ -477,15 +491,15 @@ struct Matrix4x4Verifier : public TemplateVerifier<glm::tmat4x4<T>>, public Matr
|
||||
* This is the abstract base class of all binary operator-based verifiers. This class
|
||||
* takes two template parameters. The first is the Verifier that one would use to only
|
||||
* check for the type of the object, for example IntVerifier. The second argument is a
|
||||
* function object that has its <code>operator()</code> function overloaded and returns a
|
||||
* boolean value. In these cases, the \c std function objects <code>std::less</code>,
|
||||
* <code>std::equal_to</code>, etc are used.
|
||||
* function object that has its `operator()` function overloaded and returns a boolean
|
||||
* value. In these cases, the `std` function objects `std::less`, `std::equal_to, etc are
|
||||
* used.
|
||||
*
|
||||
* This verifier will apply the \c Operator to the stored value and the incoming value
|
||||
* (after type checking) and will check if the \c Operator returns \c true or \c false.
|
||||
* This verifier will apply the `Operator` to the stored value and the incoming value
|
||||
* (after type checking) and will check if the `Operator` returns `true` or `false`.
|
||||
* The incoming value is used as the first argument and the stored value as the second
|
||||
* argument to the \c Operator. If the type checking fails, the offense reason
|
||||
* TestResult::Offense::Reason::WrongType is returned. If the \c Operator fails, the
|
||||
* argument to the `Operator`. If the type checking fails, the offense reason
|
||||
* TestResult::Offense::Reason::WrongType is returned. If the `Operator` fails, the
|
||||
* reason TestResult::Offense::Verification is returned instead.
|
||||
*/
|
||||
template <typename T, typename Operator>
|
||||
@@ -494,34 +508,34 @@ struct OperatorVerifier : public T {
|
||||
* Constructor for an OperatorVerifier. As all operators need to compare the incoming
|
||||
* value to a stored value, we require the comparison \p value to be passed in here.
|
||||
* \param value The value against which the tested value is compared using the
|
||||
* \c Operator
|
||||
* `Operator`
|
||||
*/
|
||||
OperatorVerifier(typename T::Type value);
|
||||
|
||||
/**
|
||||
* First checks whether the \p dictionary contains the passed \p key and whether the
|
||||
* \p key%'s value is correct using the template paramater \c T as a verifier. Then,
|
||||
* \p key%'s value is correct using the template paramater `T` as a verifier. Then,
|
||||
* the \p key%'s value is checked against the stored OperatorVerifier::value using the
|
||||
* \c Operator.
|
||||
* `Operator`.
|
||||
*
|
||||
* \param dictionary The ghoul::Dictionary that contains the \p key to be tested
|
||||
* \param key The key inside the \p dictinoary that is to be tested
|
||||
* \return A TestResult containing the results of the specification testing. If the
|
||||
* \p key%'s value has the wrong type, it will be added to the TestResult's
|
||||
* offense list with the reason TestResult::Offense::Reason::WrongType; if the
|
||||
* \c Operator returns false, it will be added with the reason
|
||||
* `Operator` returns false, it will be added with the reason
|
||||
* TestResult::Offense::Verification instead.
|
||||
*/
|
||||
TestResult operator()(const ghoul::Dictionary& dictionary,
|
||||
const std::string& key) const override;
|
||||
|
||||
/// The stored value which is passed to the \c Operator as a second argument
|
||||
/// The stored value which is passed to the `Operator` as a second argument
|
||||
typename T::Type value;
|
||||
};
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the incoming value is strictly smaller than the stored
|
||||
* value. Due to the operator type restrictions, \c T cannot be a subclass of (or the same
|
||||
* value. Due to the operator type restrictions, `T` cannot be a subclass of (or the same
|
||||
* as) BoolVerifier, StringVerifier, TableVerifier, or VectorVerifier.
|
||||
*/
|
||||
template <typename T>
|
||||
@@ -541,7 +555,7 @@ struct LessVerifier : public OperatorVerifier<T, std::less<typename T::Type>> {
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the incoming value is smaller than or equal to the stored
|
||||
* value. Due to the operator type restrictions, \c T cannot be a subclass of (or the same
|
||||
* value. Due to the operator type restrictions, `T` cannot be a subclass of (or the same
|
||||
* as) BoolVerifier, StringVerifier, TableVerifier, or VectorVerifier.
|
||||
*/
|
||||
template <typename T>
|
||||
@@ -562,7 +576,7 @@ struct LessEqualVerifier : public OperatorVerifier<T, std::less_equal<typename T
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the incoming value is strictly greater than the stored
|
||||
* value. Due to the operator type restrictions, \c T cannot be a subclass of (or the same
|
||||
* value. Due to the operator type restrictions, `T` cannot be a subclass of (or the same
|
||||
* as) BoolVerifier, StringVerifier, TableVerifier, or VectorVerifier.
|
||||
*/
|
||||
template <typename T>
|
||||
@@ -583,7 +597,7 @@ struct GreaterVerifier : public OperatorVerifier<T, std::greater<typename T::Typ
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the incoming value is greater than or equal to the stored
|
||||
* value. Due to the operator type restrictions, \c T cannot be a subclass of (or the same
|
||||
* value. Due to the operator type restrictions, `T` cannot be a subclass of (or the same
|
||||
* as) BoolVerifier, StringVerifier, TableVerifier, or VectorVerifier.
|
||||
*/
|
||||
template <typename T>
|
||||
@@ -606,7 +620,7 @@ struct GreaterEqualVerifier : public OperatorVerifier<T,
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the incoming value is equal to the stored value. Due to
|
||||
* the operator type restrictions, \c T cannot be a subclass of (or the same as)
|
||||
* the operator type restrictions, `T` cannot be a subclass of (or the same as)
|
||||
* TableVerifier.
|
||||
*/
|
||||
template <typename T>
|
||||
@@ -622,7 +636,7 @@ struct EqualVerifier : public OperatorVerifier<T, std::equal_to<typename T::Type
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the incoming value is unequal to the store value. Due to
|
||||
* the operator type restrictions, \c T cannot be a subclass of (or the same as)
|
||||
* the operator type restrictions, `T` cannot be a subclass of (or the same as)
|
||||
* TableVerifier.
|
||||
*/
|
||||
template <typename T>
|
||||
@@ -642,8 +656,8 @@ struct UnequalVerifier : public OperatorVerifier<T, std::not_equal_to<typename T
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the incoming value is of the correct type, using the
|
||||
* Verifier passed as a template parameter \c T and then checks whether it is part of a
|
||||
* list that is passed to the constructor. To the missing equality operator, \c T cannot
|
||||
* Verifier passed as a template parameter `T` and then checks whether it is part of a
|
||||
* list that is passed to the constructor. To the missing equality operator, `T` cannot
|
||||
* be a subclass of (or the same as) TableVerifier.
|
||||
*/
|
||||
template <typename T>
|
||||
@@ -660,7 +674,7 @@ struct InListVerifier : public T {
|
||||
|
||||
/**
|
||||
* Tests whether the \p key exists in the \p dictionary, whether it has the correct
|
||||
* type by invoking the template parameter \c T, and then tests if the \p key's value
|
||||
* type by invoking the template parameter `T`, and then tests if the \p key's value
|
||||
* is part of the list passed to the constructor.
|
||||
*
|
||||
* \param dictionary The ghoul::Dictionary that contains the \p key
|
||||
@@ -682,8 +696,8 @@ struct InListVerifier : public T {
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the incoming value is of the correct type, using the
|
||||
* Verifier passed as a template parameter \c T and then checks whether it is not part of
|
||||
* a list that is passed to the constructor. To the missing equality operator, \c T cannot
|
||||
* Verifier passed as a template parameter `T` and then checks whether it is not part of
|
||||
* a list that is passed to the constructor. To the missing equality operator, `T` cannot
|
||||
* be a subclass of (or the same as) TableVerifier.
|
||||
*/
|
||||
template <typename T>
|
||||
@@ -700,7 +714,7 @@ struct NotInListVerifier : public T {
|
||||
|
||||
/**
|
||||
* Tests whether the \p key exists in the \p dictionary, whether it has the correct
|
||||
* type by invoking the template parameter \c T, and then tests if the \p key's value
|
||||
* type by invoking the template parameter `T`, and then tests if the \p key's value
|
||||
* is not part of the list passed to the constructor.
|
||||
*
|
||||
* \param dictionary The ghoul::Dictionary that contains the \p key
|
||||
@@ -725,9 +739,9 @@ struct NotInListVerifier : public T {
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the incoming value is of the correct type, using the
|
||||
* Verifier passed as a template parameter \c T and then checks whether it is greater or
|
||||
* Verifier passed as a template parameter `T` and then checks whether it is greater or
|
||||
* equal to a lower limit and less or equal to a higher limit. To the missing comparison
|
||||
* operators, \c T cannot be a subclass of (or the same as) BoolVerifier, StringVerifier,
|
||||
* operators, `T` cannot be a subclass of (or the same as) BoolVerifier, StringVerifier,
|
||||
* TableVerifier, or VectorVerifier. Both the lower and the higher limit are inclusive).
|
||||
*/
|
||||
template <typename T>
|
||||
@@ -748,7 +762,7 @@ struct InRangeVerifier : public T {
|
||||
/**
|
||||
* Constructs a InRangeVerifier that checks whether the incoming value is of the
|
||||
* correct type and whether the value is greater or equal to \p lower and less or
|
||||
* equal to \upper.
|
||||
* equal to \p upper.
|
||||
*
|
||||
* \param lower The (inclusive) lower limit of the range
|
||||
* \param upper The (inclusive) upper limit of the range
|
||||
@@ -759,7 +773,7 @@ struct InRangeVerifier : public T {
|
||||
|
||||
/**
|
||||
* Tests whether the \p key exists in the \p dictionary, whether it has the correct
|
||||
* type by invoking the template parameter \c T, and then tests if the \p key's value
|
||||
* type by invoking the template parameter `T`, and then tests if the \p key's value
|
||||
* is between the lower and upper limits (both inclusive) that were passed to the
|
||||
* constructor.
|
||||
*
|
||||
@@ -783,9 +797,9 @@ struct InRangeVerifier : public T {
|
||||
|
||||
/**
|
||||
* This Verifier checks whether the incoming value is of the correct type, using the
|
||||
* Verifier passed as a template parameter \c T and then checks whether it is outside the
|
||||
* Verifier passed as a template parameter `T` and then checks whether it is outside the
|
||||
* (exclusive) range defined by a lower and upper limit. To the missing comparison
|
||||
* operators, \c T cannot be a subclass of (or the same as) BoolVerifier, StringVerifier,
|
||||
* operators, `T` cannot be a subclass of (or the same as) BoolVerifier, StringVerifier,
|
||||
* TableVerifier, or VectorVerifier. Both the lower and the higher limit are exclusive).
|
||||
*/
|
||||
template <typename T>
|
||||
@@ -816,7 +830,7 @@ struct NotInRangeVerifier : public T {
|
||||
|
||||
/**
|
||||
* Tests whether the \p key exists in the \p dictionary, whether it has the correct
|
||||
* type by invoking the template parameter \c T, and then tests if the \p key's value
|
||||
* type by invoking the template parameter `T`, and then tests if the \p key's value
|
||||
* is outside the lower and upper limits (both exclusive) that were passed to the
|
||||
* constructor.
|
||||
*
|
||||
@@ -870,16 +884,16 @@ struct AnnotationVerifier : public T {
|
||||
};
|
||||
|
||||
/**
|
||||
* This Verifier is a marker that performs the same testing as the \c T parameter, but
|
||||
* This Verifier is a marker that performs the same testing as the `T` parameter, but
|
||||
* also adds a warning to the test result informing the user of the deprecation.
|
||||
* Furthermore, the documentation will contain the word <code>(deprecated)</code> in
|
||||
* addition to the documentation returned by \c T
|
||||
* Furthermore, the documentation will contain the word `(deprecated)` in
|
||||
* addition to the documentation returned by `T`
|
||||
* \tparam T The Verifier that is to be marked deprecated
|
||||
*/
|
||||
template <typename T>
|
||||
struct DeprecatedVerifier : public T {
|
||||
/**
|
||||
* Tests the \p dictionary%s \p key using the Verifier \c T and adds a warning to the
|
||||
* Tests the \p dictionary%s \p key using the Verifier `T` and adds a warning to the
|
||||
* TestResult informing the caller of the deprecation.
|
||||
*
|
||||
* \param dictionary The ghoul::Dictionary whose \p key should be tested
|
||||
@@ -890,9 +904,9 @@ struct DeprecatedVerifier : public T {
|
||||
const std::string& key) const override;
|
||||
|
||||
/**
|
||||
* Returns the documentation as reported by \c T and adds the word
|
||||
* <code>(deprecated)</code> to it.
|
||||
* \return The deprecated version of \c T%'s documentation
|
||||
* Returns the documentation as reported by `T` and adds the word
|
||||
* `(deprecated)` to it.
|
||||
* \return The deprecated version of `T`%'s documentation
|
||||
*/
|
||||
std::string documentation() const override;
|
||||
};
|
||||
@@ -908,12 +922,13 @@ struct DeprecatedVerifier : public T {
|
||||
struct ReferencingVerifier : public TableVerifier {
|
||||
/**
|
||||
* Creates a ReferencingVerifier that references a documentation with the provided
|
||||
* identifier \p id. The ReferencingVerifier will use the static DocumentationEngine
|
||||
* to retrieve Documentation%s and find the \p identifier among them.
|
||||
* identifier \p identifier. The ReferencingVerifier will use the static
|
||||
* DocumentationEngine to retrieve Documentation%s and find the \p identifier among
|
||||
* them.
|
||||
*
|
||||
* \param identifier The identifier of the Documentation that this Verifier references
|
||||
*/
|
||||
ReferencingVerifier(std::string id);
|
||||
ReferencingVerifier(std::string identifier);
|
||||
|
||||
/**
|
||||
* Checks whether the \p key in the \p dictionary exists and is of type Table (similar
|
||||
@@ -944,9 +959,9 @@ struct ReferencingVerifier : public TableVerifier {
|
||||
//----------------------------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
* This Verifier takes two Verifiers and performs a boolean \c and operation on their
|
||||
* This Verifier takes two Verifiers and performs a boolean `and` operation on their
|
||||
* results. In essence, a value only passes this Verifier if it passes both Verifier%s
|
||||
* that are passed in the constructor. Opposed to the <code>C++</code> <code>&&</code>
|
||||
* that are passed in the constructor. Opposed to the `C++` `&&`
|
||||
* operator, the AndVerifier does not perform any short-circut evaluation.
|
||||
*/
|
||||
struct AndVerifier : public Verifier {
|
||||
@@ -969,10 +984,10 @@ struct AndVerifier : public Verifier {
|
||||
* \param dictionary The ghoul::Dictionary that is to be tested
|
||||
* \param key The key contained in \p dictionary that is to be tested
|
||||
* \return A TestResult object that contains the test results. If the value fails
|
||||
* any passed Verifiers, TestResult::success is \c false and the
|
||||
* any passed Verifiers, TestResult::success is `false` and the
|
||||
* TestResult::offenses list contains \p with a reason of
|
||||
* TestResult::Offense::Reason::Verification. If \p key%'s value passes both
|
||||
* Verifier%s, the result's TestResult::success is \c true and the
|
||||
* Verifier%s, the result's TestResult::success is `true` and the
|
||||
* TestResult::offenses is empty.
|
||||
*/
|
||||
TestResult operator()(const ghoul::Dictionary& dictionary,
|
||||
@@ -985,10 +1000,10 @@ struct AndVerifier : public Verifier {
|
||||
};
|
||||
|
||||
/**
|
||||
* This Verifier takes two Verifiers and performs a boolean \c or operation on their
|
||||
* This Verifier takes two Verifiers and performs a boolean `or` operation on their
|
||||
* results. In essence, a value only passes this Verifier if it passes either of the two
|
||||
* Verifier%s that are passed in the constructor. Opposed to the <code>C++</code>
|
||||
* <code>||</code> operator, the OrVerifier does not perform any short-circut evaluation.
|
||||
* Verifier%s that are passed in the constructor. Opposed to the `C++` `||` operator, the
|
||||
* OrVerifier does not perform any short-circut evaluation.
|
||||
*/
|
||||
struct OrVerifier : public Verifier {
|
||||
/**
|
||||
@@ -999,11 +1014,11 @@ struct OrVerifier : public Verifier {
|
||||
*
|
||||
* \pre values must contain at least two values
|
||||
*
|
||||
* \todo: The use of the variant to use both raw pointers and shared pointers is
|
||||
* definitely undesired. At the momement we are not handling the ownership of
|
||||
* the verifiers very well and this must be cleaned up when doing a pass over
|
||||
* the entire ownership model of the documentation/verifiers. For now it was
|
||||
* necessary to make the codegen work in all cases without complications there
|
||||
* \todo The use of the variant to use both raw pointers and shared pointers is
|
||||
* definitely undesired. At the momement we are not handling the ownership of
|
||||
* the verifiers very well and this must be cleaned up when doing a pass over
|
||||
* the entire ownership model of the documentation/verifiers. For now it was
|
||||
* necessary to make the codegen work in all cases without complications there
|
||||
*/
|
||||
OrVerifier(const std::vector<std::variant<Verifier*,
|
||||
std::shared_ptr<Verifier>>> values);
|
||||
@@ -1017,10 +1032,10 @@ struct OrVerifier : public Verifier {
|
||||
* \param dictionary The ghoul::Dictionary that is to be tested
|
||||
* \param key The key contained in \p dictionary that is to be tested
|
||||
* \return A TestResult object that contains the test results. If the value fails
|
||||
* all Verifiers, TestResult::success is \c false and the
|
||||
* all Verifiers, TestResult::success is `false` and the
|
||||
* TestResult::offenses list contains \p with a reason of
|
||||
* TestResult::Offense::Reason::Verification. If \p key%'s value passes either
|
||||
* of the two Verifier%s, the result's TestResult::success is \c true and the
|
||||
* of the two Verifier%s, the result's TestResult::success is `true` and the
|
||||
* TestResult::offenses is empty.
|
||||
*/
|
||||
TestResult operator()(const ghoul::Dictionary& dictionary,
|
||||
@@ -1032,130 +1047,130 @@ struct OrVerifier : public Verifier {
|
||||
std::vector<std::shared_ptr<Verifier>> values;
|
||||
};
|
||||
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::bvec2</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::bvec2`
|
||||
using BoolVector2Verifier = Vector2Verifier<bool>;
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::ivec2</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::ivec2`
|
||||
using IntVector2Verifier = Vector2Verifier<int>;
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::dvec2</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::dvec2`
|
||||
using DoubleVector2Verifier = Vector2Verifier<double>;
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::bvec3</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::bvec3`
|
||||
using BoolVector3Verifier = Vector3Verifier<bool>;
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::ivec3</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::ivec3`
|
||||
using IntVector3Verifier = Vector3Verifier<int>;
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::dvec3</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::dvec3`
|
||||
using DoubleVector3Verifier = Vector3Verifier<double>;
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::bvec4</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::bvec4`
|
||||
using BoolVector4Verifier = Vector4Verifier<bool>;
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::ivec4</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::ivec4`
|
||||
using IntVector4Verifier = Vector4Verifier<int>;
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::dvec4</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::dvec4`
|
||||
using DoubleVector4Verifier = Vector4Verifier<double>;
|
||||
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::dmat2x2</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::dmat2x2`
|
||||
using DoubleMatrix2x2Verifier = Matrix2x2Verifier<double>;
|
||||
using DoubleMatrix2Verifier = DoubleMatrix2x2Verifier;
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::dmat2x3</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::dmat2x3`
|
||||
using DoubleMatrix2x3Verifier = Matrix2x3Verifier<double>;
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::dmat2x4</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::dmat2x4`
|
||||
using DoubleMatrix2x4Verifier = Matrix2x4Verifier<double>;
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::dmat3x2</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::dmat3x2`
|
||||
using DoubleMatrix3x2Verifier = Matrix3x2Verifier<double>;
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::dmat3x3</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::dmat3x3`
|
||||
using DoubleMatrix3x3Verifier = Matrix3x3Verifier<double>;
|
||||
using DoubleMatrix3Verifier = DoubleMatrix3x3Verifier;
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::dmat3x4</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::dmat3x4`
|
||||
using DoubleMatrix3x4Verifier = Matrix3x4Verifier<double>;
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::dmat4x2</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::dmat4x2`
|
||||
using DoubleMatrix4x2Verifier = Matrix4x2Verifier<double>;
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::dmat4x3</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::dmat4x3`
|
||||
using DoubleMatrix4x3Verifier = Matrix4x3Verifier<double>;
|
||||
/// A short-hand definition for a Verifier checking for <code>glm::dmat4x4</code>
|
||||
/// A short-hand definition for a Verifier checking for `glm::dmat4x4`
|
||||
using DoubleMatrix4x4Verifier = Matrix4x4Verifier<double>;
|
||||
using DoubleMatrix4Verifier = DoubleMatrix4x4Verifier;
|
||||
|
||||
/// A short-hand definition for a LessVerifier with a type check for \c int
|
||||
/// A short-hand definition for a LessVerifier with a type check for `int`
|
||||
using IntLessVerifier = LessVerifier<IntVerifier>;
|
||||
/// A short-hand definition for a LessVerifier with a type check for \c double
|
||||
/// A short-hand definition for a LessVerifier with a type check for `double`
|
||||
using DoubleLessVerifier = LessVerifier<DoubleVerifier>;
|
||||
/// A short-hand definition for a LessEqualVerifier with a type check for \c int
|
||||
/// A short-hand definition for a LessEqualVerifier with a type check for `int`
|
||||
using IntLessEqualVerifier = LessEqualVerifier<IntVerifier>;
|
||||
/// A short-hand definition for a LessEqualVerifier with a type check for \c double
|
||||
/// A short-hand definition for a LessEqualVerifier with a type check for `double`
|
||||
using DoubleLessEqualVerifier = LessEqualVerifier<DoubleVerifier>;
|
||||
/// A short-hand definition for a GreaterVerifier with a type check for \c int
|
||||
/// A short-hand definition for a GreaterVerifier with a type check for `int`
|
||||
using IntGreaterVerifier = GreaterVerifier<IntVerifier>;
|
||||
/// A short-hand definition for a GreaterVerifier with a type check for \c double
|
||||
/// A short-hand definition for a GreaterVerifier with a type check for `double`
|
||||
using DoubleGreaterVerifier = GreaterVerifier<DoubleVerifier>;
|
||||
/// A short-hand definition for a GreaterEqualVerifier with a type check for \c int
|
||||
/// A short-hand definition for a GreaterEqualVerifier with a type check for `int`
|
||||
using IntGreaterEqualVerifier = GreaterEqualVerifier<IntVerifier>;
|
||||
/// A short-hand definition for a GreaterEqualVerifier with a type check for \c double
|
||||
/// A short-hand definition for a GreaterEqualVerifier with a type check for `double`
|
||||
using DoubleGreaterEqualVerifier = GreaterEqualVerifier<DoubleVerifier>;
|
||||
/// A short-hand definition for a EqualVerifier with a type check for \c bool
|
||||
/// A short-hand definition for a EqualVerifier with a type check for `bool`
|
||||
using BoolEqualVerifier = EqualVerifier<BoolVerifier>;
|
||||
/// A short-hand definition for a EqualVerifier with a type check for \c int
|
||||
/// A short-hand definition for a EqualVerifier with a type check for `int`
|
||||
using IntEqualVerifier = EqualVerifier<IntVerifier>;
|
||||
/// A short-hand definition for a EqualVerifier with a type check for \c double
|
||||
/// A short-hand definition for a EqualVerifier with a type check for `double`
|
||||
using DoubleEqualVerifier = EqualVerifier<DoubleVerifier>;
|
||||
/// A short-hand definition for a EqualVerifier with a type check for \c string
|
||||
/// A short-hand definition for a EqualVerifier with a type check for `string`
|
||||
using StringEqualVerifier = EqualVerifier<StringVerifier>;
|
||||
/// A short-hand definition for a UnequalVerifier with a type check for \c bool
|
||||
/// A short-hand definition for a UnequalVerifier with a type check for `bool`
|
||||
using BoolUnequalVerifier = UnequalVerifier<BoolVerifier>;
|
||||
/// A short-hand definition for a UnequalVerifier with a type check for \c int
|
||||
/// A short-hand definition for a UnequalVerifier with a type check for `int`
|
||||
using IntUnequalVerifier = UnequalVerifier<IntVerifier>;
|
||||
/// A short-hand definition for a UnequalVerifier with a type check for \c double
|
||||
/// A short-hand definition for a UnequalVerifier with a type check for `double`
|
||||
using DoubleUnequalVerifier = UnequalVerifier<DoubleVerifier>;
|
||||
/// A short-hand definition for a UnequalVerifier with a type check for \c string
|
||||
/// A short-hand definition for a UnequalVerifier with a type check for `string`
|
||||
using StringUnequalVerifier = UnequalVerifier<StringVerifier>;
|
||||
|
||||
/// A short-hand definition for a InListVerifier with a type check for \c bool
|
||||
/// A short-hand definition for a InListVerifier with a type check for `bool`
|
||||
using BoolInListVerifier = InListVerifier<BoolVerifier>;
|
||||
/// A short-hand definition for a InListVerifier with a type check for \c int
|
||||
/// A short-hand definition for a InListVerifier with a type check for `int`
|
||||
using IntInListVerifier = InListVerifier<IntVerifier>;
|
||||
/// A short-hand definition for a InListVerifier with a type check for \c double
|
||||
/// A short-hand definition for a InListVerifier with a type check for `double`
|
||||
using DoubleInListVerifier = InListVerifier<DoubleVerifier>;
|
||||
/// A short-hand definition for a InListVerifier with a type check for \c string
|
||||
/// A short-hand definition for a InListVerifier with a type check for `string`
|
||||
using StringInListVerifier = InListVerifier<StringVerifier>;
|
||||
/// A short-hand definition for a NotInListVerifier with a type check for \c bool
|
||||
/// A short-hand definition for a NotInListVerifier with a type check for `bool`
|
||||
using BoolNotInListVerifier = NotInListVerifier<BoolVerifier>;
|
||||
/// A short-hand definition for a NotInListVerifier with a type check for \c int
|
||||
/// A short-hand definition for a NotInListVerifier with a type check for `int`
|
||||
using IntNotInListVerifier = NotInListVerifier<IntVerifier>;
|
||||
/// A short-hand definition for a NotInListVerifier with a type check for \c double
|
||||
/// A short-hand definition for a NotInListVerifier with a type check for `double`
|
||||
using DoubleNotInListVerifier = NotInListVerifier<DoubleVerifier>;
|
||||
/// A short-hand definition for a NotInListVerifier with a type check for \c string
|
||||
/// A short-hand definition for a NotInListVerifier with a type check for `string`
|
||||
using StringNotInListVerifier = NotInListVerifier<StringVerifier>;
|
||||
|
||||
/// A short-hand definition for a InRangeVerifier with a type check for \c int
|
||||
/// A short-hand definition for a InRangeVerifier with a type check for `int`
|
||||
using IntInRangeVerifier = InRangeVerifier<IntVerifier>;
|
||||
/// A short-hand definition for a InRangeVerifier with a type check for \c double
|
||||
/// A short-hand definition for a InRangeVerifier with a type check for `double`
|
||||
using DoubleInRangeVerifier = InRangeVerifier<DoubleVerifier>;
|
||||
/// A short-hand definition for a InRangeVerifier with a type check for \c vec2
|
||||
/// A short-hand definition for a InRangeVerifier with a type check for `vec2`
|
||||
using Vec2InRangeVerifier = InRangeVerifier<DoubleVector2Verifier>;
|
||||
/// A short-hand definition for a NotInRangeVerifier with a type check for \c int
|
||||
/// A short-hand definition for a NotInRangeVerifier with a type check for `int`
|
||||
using IntNotInRangeVerifier = NotInRangeVerifier<IntVerifier>;
|
||||
/// A short-hand definition for a NotInRangeVerifier with a type check for \c double
|
||||
/// A short-hand definition for a NotInRangeVerifier with a type check for `double`
|
||||
using DoubleNotInRangeVerifier = NotInRangeVerifier<DoubleVerifier>;
|
||||
|
||||
/// A short-hand definition for a AnnotationVerifier with a type check for \c bool
|
||||
/// A short-hand definition for a AnnotationVerifier with a type check for `bool`
|
||||
using BoolAnnotationVerifier = AnnotationVerifier<BoolVerifier>;
|
||||
/// A short-hand definition for a AnnotationVerifier with a type check for \c int
|
||||
/// A short-hand definition for a AnnotationVerifier with a type check for `int`
|
||||
using IntAnnotationVerifier = AnnotationVerifier<IntVerifier>;
|
||||
/// A short-hand definition for a AnnotationVerifier with a type check for \c double
|
||||
/// A short-hand definition for a AnnotationVerifier with a type check for `double`
|
||||
using DoubleAnnotationVerifier = AnnotationVerifier<DoubleVerifier>;
|
||||
/// A short-hand definition for a AnnotationVerifier with a type check for \c string
|
||||
/// A short-hand definition for a AnnotationVerifier with a type check for `string`
|
||||
using StringAnnotationVerifier = AnnotationVerifier<StringVerifier>;
|
||||
/// A short-hand definition for a AnnotationVerifier with a type check for
|
||||
/// <code>ghoul::Dictionary</code>
|
||||
/// `ghoul::Dictionary`
|
||||
using TableAnnotationVerifier = AnnotationVerifier<TableVerifier>;
|
||||
|
||||
/// A short-hand definition for a DeprecatedVerifier with a type check for \c bool
|
||||
/// A short-hand definition for a DeprecatedVerifier with a type check for `bool`
|
||||
using BoolDeprecatedVerifier = DeprecatedVerifier<BoolVerifier>;
|
||||
/// A short-hand definition for a DeprecatedVerifier with a type check for \c int
|
||||
/// A short-hand definition for a DeprecatedVerifier with a type check for `int`
|
||||
using IntDeprecatedVerifier = DeprecatedVerifier<IntVerifier>;
|
||||
/// A short-hand definition for a DeprecatedVerifier with a type check for \c double
|
||||
/// A short-hand definition for a DeprecatedVerifier with a type check for `double`
|
||||
using DoubleDeprecatedVerifier = DeprecatedVerifier<DoubleVerifier>;
|
||||
/// A short-hand definition for a DeprecatedVerifier with a type check for \c string
|
||||
/// A short-hand definition for a DeprecatedVerifier with a type check for `string`
|
||||
using StringDeprecatedVerifier = DeprecatedVerifier<StringVerifier>;
|
||||
/// A short-hand definition for a DeprecatedVerifier with a type check for
|
||||
/// <code>ghoul::Dictionary</code>
|
||||
/// `ghoul::Dictionary`
|
||||
using TableDeprecatedVerifier = DeprecatedVerifier<TableVerifier>;
|
||||
|
||||
// Definitions of external templates that are instantiated in the cpp file
|
||||
|
||||
@@ -36,18 +36,16 @@ namespace documentation { struct Documentation; }
|
||||
|
||||
/**
|
||||
* This function provides the capabilities to create a new ghoul::logging::Log from the
|
||||
* provided ghoul::Dictionary%. The Dictionary must at least contain a <code>Type</code>
|
||||
* value that determines the type of the created Log. Currently the types
|
||||
* <code>HTML</code> and <code>Text</code> are supported which create a
|
||||
* ghoul::logging::TextLog%, and ghoul::logging::HTMLLog respectively with both also
|
||||
* require the <code>FileName</code> value for the location at which the logfile should be
|
||||
* created . Both logs can be customized using the <code>Append</code>,
|
||||
* <code>TimeStamping</code>, <code>DateStamping</code>, <code>CategoryStamping</code>,
|
||||
* and <code>LogLevelStamping</code> values.
|
||||
* provided ghoul::Dictionary%. The Dictionary must at least contain a `Type` value that
|
||||
* determines the type of the created Log. Currently the types `HTML` and `Text` are
|
||||
* supported which create a ghoul::logging::TextLog%, and ghoul::logging::HTMLLog
|
||||
* respectively with both also require the `FileName` value for the location at which the
|
||||
* logfile should be created. Both logs can be customized using the `Append`,
|
||||
* `TimeStamping`, `DateStamping`, `CategoryStamping`, and `LogLevelStamping` values.
|
||||
*
|
||||
* \param dictionary The dictionary from which the ghoul::logging::Log should be created
|
||||
* \return The created ghoul::logging::Log
|
||||
* \post The return value will not be <code>nullptr</code>
|
||||
* \post The return value will not be `nullptr`
|
||||
* \throw ghoul::RuntimeError If there was an error creating the ghoul::logging::Log
|
||||
* \sa ghoul::logging::TextLog
|
||||
* \sa ghoul::logging::HTMLLog
|
||||
|
||||
@@ -45,7 +45,7 @@ namespace scripting { struct LuaLibrary; }
|
||||
* The ModuleEngine is the central repository for registering and accessing
|
||||
* OpenSpaceModule for the current application run. By initializing (#initialize) the
|
||||
* ModuleEngine, the default set of OpenSpaceModule%s as generated by CMake in the
|
||||
* <code>moduleregistration.h</code> file is automatically registered and created.
|
||||
* `moduleregistration.h` file is automatically registered and created.
|
||||
* Additional OpenSpaceModule%s can be registered with the #registerModule function, which
|
||||
* will internally call the OpenSpaceModule::initialize method.
|
||||
*/
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
|
||||
/**
|
||||
* Registers all of the OpenSpaceModule%s which are created by the CMake configuration
|
||||
* and stored in the <code>moduleregistration.h</code> file. For all of those modules
|
||||
* and stored in the `moduleregistration.h` file. For all of those modules
|
||||
* the OpenSpaceModule::initialize method with will called.
|
||||
*
|
||||
* \throw ghoul::RuntimeError If two modules in the default modules have the same
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
|
||||
/**
|
||||
* Get the module subclass with given template argument. Requires the module subclass
|
||||
* to have the public static member variable <code>name</code> which must be equal to
|
||||
* to have the public static member variable `name` which must be equal to
|
||||
* the name of the module used in its constructor.
|
||||
*
|
||||
* \return a pointer to the module of the given subclass
|
||||
|
||||
@@ -36,7 +36,7 @@ namespace openspace {
|
||||
class Syncable;
|
||||
|
||||
/**
|
||||
* Manages a collection of <code>Syncable</code>s and ensures they are synchronized
|
||||
* Manages a collection of `Syncable`s and ensures they are synchronized
|
||||
* over SGCT nodes. Encoding/Decoding order is handles internally.
|
||||
*/
|
||||
class SyncEngine {
|
||||
@@ -50,13 +50,13 @@ public:
|
||||
SyncEngine(unsigned int syncBufferSize);
|
||||
|
||||
/**
|
||||
* Encodes all added Syncables in the injected <code>SyncBuffer</code>.
|
||||
* Encodes all added Syncables in the injected `SyncBuffer`.
|
||||
* This method is only called on the SGCT master node
|
||||
*/
|
||||
std::vector<std::byte> encodeSyncables();
|
||||
|
||||
/**
|
||||
* Decodes the <code>SyncBuffer</code> into the added Syncables.
|
||||
* Decodes the `SyncBuffer` into the added Syncables.
|
||||
* This method is only called on the SGCT client nodes
|
||||
*/
|
||||
void decodeSyncables(std::vector<std::byte> data);
|
||||
|
||||
@@ -81,6 +81,8 @@ struct WindowDelegate {
|
||||
unsigned int (*takeScreenshot)(bool applyWarping, std::vector<int> windowIds) =
|
||||
[](bool, std::vector<int>) { return 0u; };
|
||||
|
||||
void (*resetScreenshotNumber)() = []() {};
|
||||
|
||||
void (*swapBuffer)() = []() {};
|
||||
|
||||
int (*nWindows)() = []() { return 0; };
|
||||
|
||||
@@ -77,6 +77,8 @@ struct Event {
|
||||
PointSpacecraft,
|
||||
RenderableEnabled,
|
||||
RenderableDisabled,
|
||||
CameraPathStarted,
|
||||
CameraPathFinished,
|
||||
Custom
|
||||
};
|
||||
constexpr explicit Event(Type type_) : type(type_) {}
|
||||
@@ -118,7 +120,7 @@ struct EventSceneGraphNodeAdded : public Event {
|
||||
/**
|
||||
* Creates an instance of an EventSceneGraphNodeAdded event.
|
||||
*
|
||||
* \param Node The identifier of the node that was added
|
||||
* \param node_ The identifier of the node that was added
|
||||
*
|
||||
* \pre node_ must not be nullptr
|
||||
*/
|
||||
@@ -136,7 +138,7 @@ struct EventSceneGraphNodeRemoved : public Event {
|
||||
/**
|
||||
* Creates an instance of an EventSceneGraphNodeRemoved event.
|
||||
*
|
||||
* \param Node The identifier of the node that was removed
|
||||
* \param node_ The identifier of the node that was removed
|
||||
*
|
||||
* \pre node_ must not be nullptr
|
||||
*/
|
||||
@@ -161,7 +163,7 @@ struct EventParallelConnection : public Event {
|
||||
/**
|
||||
* Creates an instance of an EventParallelConnection event.
|
||||
*
|
||||
* \param State The new state of the parallel connection system; is one of
|
||||
* \param state_ The new state of the parallel connection system; is one of
|
||||
* `Established`, `Lost`, `HostshipGained`, or `HostshipLost`
|
||||
*/
|
||||
explicit EventParallelConnection(State state_);
|
||||
@@ -198,7 +200,7 @@ struct EventApplicationShutdown : public Event {
|
||||
/**
|
||||
* Creates an instance of an EventApplicationShutdown event.
|
||||
*
|
||||
* \param State The next state of the application shutdown sequence; is one of
|
||||
* \param state_ The next state of the application shutdown sequence; is one of
|
||||
* `Started`, `Aborted`, or `Finished`
|
||||
*/
|
||||
explicit EventApplicationShutdown(State state_);
|
||||
@@ -352,7 +354,7 @@ struct EventInterpolationFinished : public Event {
|
||||
/**
|
||||
* Creates an instance of an EventInterpolationFinished event.
|
||||
*
|
||||
* \param Property The property whose interpolation has finished
|
||||
* \param property_ The property whose interpolation has finished
|
||||
*
|
||||
* \pre property_ must not be nullptr
|
||||
*/
|
||||
@@ -520,6 +522,30 @@ struct EventRenderableDisabled : public Event {
|
||||
const tstring node;
|
||||
};
|
||||
|
||||
/**
|
||||
* This event is created when the a camera path is started
|
||||
*/
|
||||
struct EventCameraPathStarted : public Event {
|
||||
static constexpr Type Type = Event::Type::CameraPathStarted;
|
||||
|
||||
/**
|
||||
* Creates an instance of an EventCameraPathStarted event.
|
||||
*/
|
||||
EventCameraPathStarted();
|
||||
};
|
||||
|
||||
/**
|
||||
* This event is created when the a camera path is finished
|
||||
*/
|
||||
struct EventCameraPathFinished : public Event {
|
||||
static constexpr Type Type = Event::Type::CameraPathFinished;
|
||||
|
||||
/**
|
||||
* Creates an instance of an EventCameraPathStarted event.
|
||||
*/
|
||||
EventCameraPathFinished();
|
||||
};
|
||||
|
||||
/**
|
||||
* 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
|
||||
|
||||
@@ -45,7 +45,7 @@ public:
|
||||
};
|
||||
|
||||
/**
|
||||
* This function returns the first event stored in the EventEngine, or \c nullptr if
|
||||
* This function returns the first event stored in the EventEngine, or `nullptr` if
|
||||
* no event exists. To navigate the full list of events, you can access the returned
|
||||
* Event's next function. If the end of the list is reached, the next pointer will be
|
||||
* a nullptr
|
||||
@@ -57,8 +57,8 @@ public:
|
||||
/**
|
||||
* Publish a new event of type T by providing optional arguments Args to the Event's
|
||||
* constructor. An example of usage is
|
||||
* <code>engine.publishEvent<MyEvent>("a", 2.0);</code> which would call the
|
||||
* constructor of \c MyEvent with a <code>const char*</code> and \c double parameter.
|
||||
* `engine.publishEvent<MyEvent>("a", 2.0);` which would call the
|
||||
* constructor of `MyEvent` with a `const char*` and `double` parameter.
|
||||
*
|
||||
* \param args The arguments that are passed to the constructor of T
|
||||
* \tparam T The subclass of Event that is to be published
|
||||
@@ -77,7 +77,7 @@ public:
|
||||
* Registers a new action for a specific event type.
|
||||
*
|
||||
* \param type The type for which a new action is registered
|
||||
* \param actionIdentifier The identifier of the action that will be triggered the
|
||||
* \param identifier The identifier of the action that will be triggered the
|
||||
* identifier must not exist at this moment, but must exist by the time the
|
||||
* event is encountered next
|
||||
* \param filter If the filter is provided, it describes the event parameters that are
|
||||
@@ -91,7 +91,7 @@ public:
|
||||
* Removing registration for a type/action combination.
|
||||
*
|
||||
* \param type The type of the action that should be unregistered
|
||||
* \param actionIdentifier The identifier of the action that should be unregistered
|
||||
* \param identifier The identifier of the action that should be unregistered
|
||||
* \param filter The optional filter applied to the event-action combination
|
||||
*/
|
||||
void unregisterEventAction(events::Event::Type type,
|
||||
|
||||
@@ -54,7 +54,7 @@ enum class JoystickAction : uint8_t {
|
||||
* The input state of a single joystick.
|
||||
*/
|
||||
struct JoystickInputState {
|
||||
/// Marks whether this joystick is connected. If this value is \c false, all other
|
||||
/// Marks whether this joystick is connected. If this value is `false`, all other
|
||||
/// members of this struct are undefined
|
||||
bool isConnected = false;
|
||||
|
||||
@@ -120,7 +120,7 @@ struct JoystickInputStates : public std::array<JoystickInputState, MaxJoysticks>
|
||||
* \param joystickName The name of the joystick, if empty all joysticks are combined
|
||||
* \param button The button that is to be checked
|
||||
* \param action The action which is checked for each button
|
||||
* \return \c true if there is at least one joystick whose \param button is in the
|
||||
* \return `true` if there is at least one joystick whose \p button is in the
|
||||
* \p action state
|
||||
*
|
||||
* \pre \p button must be 0 or positive
|
||||
|
||||
@@ -174,9 +174,7 @@ public:
|
||||
* Starts a recording session, which will save data to the provided filename
|
||||
* in ASCII data format until recording is stopped using stopRecording() method.
|
||||
*
|
||||
* \param filename file saved with recorded keyframes.
|
||||
*
|
||||
* \return \c true if recording to file starts without errors
|
||||
* \param dataMode The format in which the session recording is stored
|
||||
*/
|
||||
void setRecordDataFormat(DataMode dataMode);
|
||||
|
||||
@@ -206,7 +204,7 @@ public:
|
||||
* \param loop if true then the file will playback in loop mode, continuously
|
||||
* looping back to the beginning until it is manually stopped
|
||||
*
|
||||
* \return \c true if recording to file starts without errors
|
||||
* \return `true` if recording to file starts without errors
|
||||
*/
|
||||
bool startPlayback(std::string& filename, KeyframeTimeRef timeMode,
|
||||
bool forceSimTimeAtStart, bool loop);
|
||||
@@ -220,7 +218,7 @@ public:
|
||||
/**
|
||||
* Returns playback pause status.
|
||||
*
|
||||
* \return \c true if playback is paused
|
||||
* \return `true` if playback is paused
|
||||
*/
|
||||
bool isPlaybackPaused();
|
||||
|
||||
@@ -303,7 +301,7 @@ public:
|
||||
*
|
||||
* \param callback function handle for the callback
|
||||
*/
|
||||
void removeStateChangeCallback(CallbackHandle handle);
|
||||
void removeStateChangeCallback(CallbackHandle callback);
|
||||
|
||||
/**
|
||||
* Provides list of available playback files.
|
||||
@@ -492,7 +490,7 @@ public:
|
||||
/**
|
||||
* Reads header information from a session recording file
|
||||
*
|
||||
* \param stringstream reference to ifstream that contains the session recording file
|
||||
* \param stream reference to ifstream that contains the session recording file
|
||||
* data
|
||||
* \param readLen_chars number of characters to be read, which may be the expected
|
||||
* length of the header line, or an arbitrary number of characters within it
|
||||
@@ -556,7 +554,7 @@ public:
|
||||
* header version number). Accepts a relative path (currently from task runner dir)
|
||||
* rather than a path assumed to be relative to ${RECORDINGS}.
|
||||
*
|
||||
* \param filename name of the file to convert
|
||||
* \param filenameRelative name of the file to convert
|
||||
*/
|
||||
void convertFileRelativePath(std::string filenameRelative);
|
||||
|
||||
|
||||
@@ -59,7 +59,7 @@ struct WebsocketInputState {
|
||||
/// The maximum number of supported buttons
|
||||
static constexpr int MaxButtons = 32;
|
||||
|
||||
/// Marks whether this websocket is connected. If this value is \c false, all other
|
||||
/// Marks whether this websocket is connected. If this value is `false`, all other
|
||||
/// members of this struct are undefined
|
||||
bool isConnected = false;
|
||||
|
||||
@@ -69,12 +69,12 @@ struct WebsocketInputState {
|
||||
/// The number of axes that this websocket supports
|
||||
int nAxes = 0;
|
||||
/// The values for each axis. Each value is in the range [-1, 1]. Only the first
|
||||
/// \c nAxes values are defined values, the rest are undefined
|
||||
/// `nAxes` values are defined values, the rest are undefined
|
||||
std::array<float, MaxAxes> axes;
|
||||
|
||||
/// The number of buttons that this websocket possesses
|
||||
int nButtons = 0;
|
||||
/// The status of each button. Only the first \c nButtons values are defined, the rest
|
||||
/// The status of each button. Only the first `nButtons` values are defined, the rest
|
||||
/// are undefined
|
||||
std::array<WebsocketAction, MaxButtons> buttons;
|
||||
};
|
||||
@@ -104,7 +104,7 @@ struct WebsocketInputStates : public std::unordered_map<size_t, WebsocketInputSt
|
||||
*
|
||||
* \param button The button that is to be checked
|
||||
* \param action The action which is checked for each button
|
||||
* \return \c true if there is at least one websocket whose \param button is in the
|
||||
* \return `true` if there is at least one websocket whose \p button is in the
|
||||
* \p action state
|
||||
*
|
||||
* \pre \p button must be 0 or positive
|
||||
|
||||
@@ -97,7 +97,7 @@ public:
|
||||
* \param time The time in which the subphases have to be active in order to be
|
||||
* included
|
||||
* \param maxDepth The maximum levels of subphases that will be considered. If this
|
||||
* value is equal to <code>-1</code>, an infinite depth will be considered.
|
||||
* value is equal to `-1`, an infinite depth will be considered.
|
||||
* \return A list of MissionPhases that cover the provided \p time
|
||||
*/
|
||||
Trace phaseTrace(double time, int maxDepth = -1) const;
|
||||
|
||||
@@ -51,6 +51,7 @@ public:
|
||||
* Reads a mission from file and maps the mission name to the Mission object. If
|
||||
* this is the first mission to be loaded, the mission will also be set as the
|
||||
* current active mission.
|
||||
*
|
||||
* \param filename The file that contains the mission that is to be loaded
|
||||
* \return The name of the mission that was loaded
|
||||
* \pre \p filename must not be empty
|
||||
@@ -61,6 +62,7 @@ public:
|
||||
|
||||
/**
|
||||
* Unloads a previously loaded mission identified by the provided \p missionName.
|
||||
*
|
||||
* \param missionName The name of the mission that should be unloded
|
||||
* \pre \p filename must not be empty
|
||||
* \pre \p missionName must be a valid mission that has previously been loaded
|
||||
@@ -70,14 +72,16 @@ public:
|
||||
/**
|
||||
* Returns whether the provided \p missionName has previously been added to the
|
||||
* MissionManager.
|
||||
*
|
||||
* \param missionName The name of the mission that is to be tested
|
||||
* \return \c true if the \p missionName has been added before
|
||||
* \return `true` if the \p missionName has been added before
|
||||
*/
|
||||
bool hasMission(const std::string& missionName);
|
||||
|
||||
/**
|
||||
* Sets the mission with the name <missionName> as the current mission. The current
|
||||
* Sets the mission with the name \p missionName as the current mission. The current
|
||||
* mission is what is return by `currentMission()`.
|
||||
*
|
||||
* \pre missionName must not be empty
|
||||
*/
|
||||
void setCurrentMission(const std::string& missionName);
|
||||
|
||||
@@ -140,7 +140,7 @@ public:
|
||||
NavigationState navigationState() const;
|
||||
NavigationState navigationState(const SceneGraphNode& referenceFrame) const;
|
||||
|
||||
void saveNavigationState(const std::string& filepath,
|
||||
void saveNavigationState(const std::filesystem::path& filepath,
|
||||
const std::string& referenceFrameIdentifier);
|
||||
|
||||
void loadNavigationState(const std::string& filepath);
|
||||
|
||||
@@ -70,11 +70,12 @@ public:
|
||||
properties::BoolProperty shouldTriggerWhenIdle;
|
||||
properties::FloatProperty idleWaitTime;
|
||||
properties::BoolProperty abortOnCameraInteraction;
|
||||
properties::FloatProperty speedScale;
|
||||
properties::BoolProperty invert;
|
||||
properties::FloatProperty speedScaleFactor;
|
||||
properties::FloatProperty dampenInterpolationTime;
|
||||
|
||||
properties::OptionProperty defaultBehavior;
|
||||
std::optional<Behavior> chosenBehavior = std::nullopt;
|
||||
std::optional<Behavior> chosenBehavior;
|
||||
};
|
||||
|
||||
OrbitalNavigator();
|
||||
@@ -129,9 +130,18 @@ public:
|
||||
bool hasZoomFriction() const;
|
||||
bool hasRollFriction() const;
|
||||
|
||||
double minAllowedDistance() const;
|
||||
|
||||
glm::dvec3 anchorNodeToCameraVector() const;
|
||||
glm::quat anchorNodeToCameraRotation() const;
|
||||
|
||||
/**
|
||||
* Compute a camera position that pushed the camera position to
|
||||
* a valid position over the anchor node, accounting for the
|
||||
* minimal allowed distance
|
||||
*/
|
||||
glm::dvec3 pushToSurfaceOfAnchor(const glm::dvec3& cameraPosition) const;
|
||||
|
||||
private:
|
||||
struct CameraRotationDecomposition {
|
||||
glm::dquat localRotation = glm::dquat(1.0, 0.0, 0.0, 0.0);
|
||||
@@ -186,6 +196,8 @@ private:
|
||||
properties::FloatProperty _stereoscopicDepthOfFocusSurface;
|
||||
properties::FloatProperty _staticViewScaleExponent;
|
||||
|
||||
properties::BoolProperty _constantVelocityFlight;
|
||||
|
||||
properties::FloatProperty _retargetInterpolationTime;
|
||||
properties::FloatProperty _stereoInterpolationTime;
|
||||
properties::FloatProperty _followRotationInterpolationTime;
|
||||
@@ -223,7 +235,7 @@ private:
|
||||
* camera points towards the reference node in the direction opposite to the direction
|
||||
* out from the surface of the object. The local rotation defines the differential
|
||||
* from the global to the current total rotation so that
|
||||
* <code>cameraRotation = globalRotation * localRotation</code>.
|
||||
* `cameraRotation = globalRotation * localRotation`.
|
||||
*/
|
||||
CameraRotationDecomposition decomposeCameraRotationSurface(const CameraPose pose,
|
||||
const SceneGraphNode& reference);
|
||||
@@ -233,7 +245,7 @@ private:
|
||||
* CameraRotationDecomposition. The global rotation defines the rotation so that the
|
||||
* camera points towards the reference position.
|
||||
* The local rotation defines the differential from the global to the current total
|
||||
* rotation so that <code>cameraRotation = globalRotation * localRotation</code>.
|
||||
* rotation so that `cameraRotation = globalRotation * localRotation`.
|
||||
*/
|
||||
CameraRotationDecomposition decomposeCameraRotation(const CameraPose pose,
|
||||
glm::dvec3 reference);
|
||||
@@ -328,11 +340,11 @@ private:
|
||||
/**
|
||||
* Push the camera out to the surface of the object.
|
||||
*
|
||||
* \return a position vector adjusted to be at least minHeightAboveGround meters
|
||||
* \return a position vector adjusted to be at least _minimumAllowedDistance meters
|
||||
* above the actual surface of the object
|
||||
*/
|
||||
glm::dvec3 pushToSurface(double minHeightAboveGround,
|
||||
const glm::dvec3& cameraPosition, const glm::dvec3& objectPosition,
|
||||
glm::dvec3 pushToSurface(const glm::dvec3& cameraPosition,
|
||||
const glm::dvec3& objectPosition,
|
||||
const SurfacePositionHandle& positionHandle) const;
|
||||
|
||||
/**
|
||||
@@ -351,7 +363,7 @@ private:
|
||||
* Calculates a SurfacePositionHandle given a camera position in world space.
|
||||
*/
|
||||
SurfacePositionHandle calculateSurfacePositionHandle(const SceneGraphNode& node,
|
||||
const glm::dvec3 cameraPositionWorldSpace);
|
||||
const glm::dvec3& cameraPositionWorldSpace) const;
|
||||
|
||||
void resetIdleBehavior();
|
||||
|
||||
|
||||
@@ -76,7 +76,7 @@ public:
|
||||
CameraPose traversePath(double dt, float speedScale = 1.f);
|
||||
|
||||
/**
|
||||
* Function that can be used to permaturely quit a path ,for example when skipping
|
||||
* Function that can be used to permaturely quit a path, for example when skipping
|
||||
* to the end
|
||||
*/
|
||||
void quitPath();
|
||||
|
||||
@@ -41,8 +41,6 @@ public:
|
||||
using TemplateProperty<std::vector<double>>::operator=;
|
||||
|
||||
protected:
|
||||
std::vector<double> fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
void toLuaConversion(lua_State* state) const override;
|
||||
std::string toStringConversion() const override;
|
||||
};
|
||||
|
||||
|
||||
@@ -41,8 +41,6 @@ public:
|
||||
using TemplateProperty<std::vector<int>>::operator=;
|
||||
|
||||
protected:
|
||||
std::vector<int> fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
void toLuaConversion(lua_State* state) const override;
|
||||
std::string toStringConversion() const override;
|
||||
};
|
||||
|
||||
|
||||
@@ -42,9 +42,6 @@ public:
|
||||
using TemplateProperty<std::vector<std::string>>::operator=;
|
||||
|
||||
protected:
|
||||
std::vector<std::string> fromLuaConversion(lua_State* state,
|
||||
bool& success) const override;
|
||||
void toLuaConversion(lua_State* state) const override;
|
||||
std::string toStringConversion() const override;
|
||||
};
|
||||
|
||||
|
||||
@@ -36,6 +36,10 @@ public:
|
||||
ListProperty(Property::PropertyInfo info, std::vector<T> values);
|
||||
|
||||
virtual ~ListProperty() override = 0;
|
||||
|
||||
protected:
|
||||
std::vector<T> fromLuaConversion(lua_State* state) const override;
|
||||
void toLuaConversion(lua_State* state) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -32,5 +32,15 @@ ListProperty<T>::ListProperty(Property::PropertyInfo info, std::vector<T> values
|
||||
template <typename T>
|
||||
ListProperty<T>::~ListProperty() {}
|
||||
|
||||
template <typename T>
|
||||
std::vector<T> ListProperty<T>::fromLuaConversion(lua_State* state) const {
|
||||
return ghoul::lua::value<std::vector<T>>(state);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
void ListProperty<T>::toLuaConversion(lua_State* state) const {
|
||||
ghoul::lua::push(state, TemplateProperty<std::vector<T>>::_value);
|
||||
}
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
|
||||
@@ -45,9 +45,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<glm::dmat2x2>::operator=;
|
||||
|
||||
protected:
|
||||
glm::dmat2x2 fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -45,9 +45,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<glm::dmat3x3>::operator=;
|
||||
|
||||
protected:
|
||||
glm::dmat3x3 fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -45,9 +45,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<glm::dmat4x4>::operator=;
|
||||
|
||||
protected:
|
||||
glm::dmat4x4 fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -45,9 +45,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<glm::mat2x2>::operator=;
|
||||
|
||||
protected:
|
||||
glm::mat2x2 fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -45,9 +45,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<glm::mat3x3>::operator=;
|
||||
|
||||
protected:
|
||||
glm::mat3x3 fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -45,9 +45,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<glm::mat4x4>::operator=;
|
||||
|
||||
protected:
|
||||
glm::mat4x4 fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -66,7 +66,7 @@ protected:
|
||||
static const std::string SteppingValueKey;
|
||||
static const std::string ExponentValueKey;
|
||||
|
||||
virtual T fromLuaConversion(lua_State* state, bool& success) const override = 0;
|
||||
T fromLuaConversion(lua_State* state) const override;
|
||||
virtual void toLuaConversion(lua_State* state) const override;
|
||||
virtual std::string toStringConversion() const override;
|
||||
|
||||
|
||||
@@ -166,12 +166,9 @@ void NumericalProperty<T>::setInterpolationTarget(std::any value) {
|
||||
|
||||
template <typename T>
|
||||
void NumericalProperty<T>::setLuaInterpolationTarget(lua_State* state) {
|
||||
bool success = false;
|
||||
T targetValue = fromLuaConversion(state, success);
|
||||
if (success) {
|
||||
_interpolationStart = TemplateProperty<T>::_value;
|
||||
_interpolationEnd = std::move(targetValue);
|
||||
}
|
||||
T targetValue = fromLuaConversion(state);
|
||||
_interpolationStart = TemplateProperty<T>::_value;
|
||||
_interpolationEnd = std::move(targetValue);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
@@ -191,6 +188,11 @@ void NumericalProperty<T>::toLuaConversion(lua_State* state) const {
|
||||
ghoul::lua::push(state, TemplateProperty<T>::_value);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
T NumericalProperty<T>::fromLuaConversion(lua_State* state) const {
|
||||
return ghoul::lua::value<T>(state);
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
std::string NumericalProperty<T>::toStringConversion() const {
|
||||
return formatJson(TemplateProperty<T>::_value);
|
||||
|
||||
@@ -33,16 +33,15 @@ namespace openspace::properties {
|
||||
|
||||
/**
|
||||
* The OptionProperty is a property that provides a number of predefined (using the
|
||||
* addOption method) options consisting of a <code>description</code> and a
|
||||
* <code>value</code>. The available options can be queried using the options method.
|
||||
* Only values representing valid options can be used to set this property, or an error
|
||||
* will be logged
|
||||
* addOption method) options consisting of a `description` and a `value`. The available
|
||||
* options can be queried using the options method. Only values representing valid options
|
||||
* can be used to set this property, or an error will be logged
|
||||
*/
|
||||
class OptionProperty : public IntProperty {
|
||||
public:
|
||||
/**
|
||||
* The struct storing a single option consisting of an integer \c value and a
|
||||
* \c string description.
|
||||
* The struct storing a single option consisting of an integer `value` and a
|
||||
* `string` description.
|
||||
*/
|
||||
struct Option {
|
||||
int value;
|
||||
@@ -55,7 +54,7 @@ public:
|
||||
};
|
||||
|
||||
/**
|
||||
* The constructor delegating the \c identifier and the \c guiName to its super class.
|
||||
* The constructor delegating the `identifier` and the `guiName` to its super class.
|
||||
*
|
||||
* \param info The PropertyInfo structure that contains all the required static
|
||||
* information for initializing this Property.
|
||||
@@ -65,8 +64,7 @@ public:
|
||||
OptionProperty(Property::PropertyInfo info);
|
||||
|
||||
/**
|
||||
* The constructor delegating the <code>identifier</code> and the <code>guiName</code>
|
||||
* to its super class.
|
||||
* The constructor delegating the `identifier` and the `guiName` to its super class.
|
||||
*
|
||||
* \param info The PropertyInfo structure that contains all the required static
|
||||
* information for initializing this Property.
|
||||
@@ -93,8 +91,8 @@ public:
|
||||
DisplayType displayType() const;
|
||||
|
||||
/**
|
||||
* Adds the passed option to the list of available options. The \c value of the
|
||||
* \c option must not have been registered previously, or a warning will be logged.
|
||||
* Adds the passed option to the list of available options. The `value` of the
|
||||
* `option` must not have been registered previously, or a warning will be logged.
|
||||
*
|
||||
* \param value The option that will be added to the list of available options
|
||||
* \param desc The description of the value that will be added
|
||||
@@ -138,10 +136,10 @@ public:
|
||||
void setValue(int value) override;
|
||||
|
||||
/**
|
||||
* This method returns \c true if currently a valid option is selected. This might
|
||||
* This method returns `true` if currently a valid option is selected. This might
|
||||
* change as options are added or removed.
|
||||
*
|
||||
* \return \c true if a call to #option would return a valid Option
|
||||
* \return `true` if a call to #option would return a valid Option
|
||||
*/
|
||||
bool hasOption() const;
|
||||
|
||||
@@ -153,7 +151,7 @@ public:
|
||||
const Option& option() const;
|
||||
|
||||
/**
|
||||
* Get the description of the option that matches \c value .
|
||||
* Get the description of the option that matches `value`.
|
||||
*
|
||||
* \param value The value of the option
|
||||
*/
|
||||
|
||||
@@ -41,7 +41,7 @@ class PropertyOwner;
|
||||
/**
|
||||
* A property encapsulates a value which should be user-changeable. A property almost
|
||||
* always belongs to a PropertyOwner who has taken ownership (setPropertyOwner) of the
|
||||
* Property. Per PropertyOwner, the <code>identifier</code> needs to be unique and can be
|
||||
* Property. Per PropertyOwner, the `identifier` needs to be unique and can be
|
||||
* used as a URI. This class is an abstract base class and each subclass (most notable
|
||||
* TemplateProperty) needs to implement the methods Property::className, Property::get,
|
||||
* Property::set, Property::type(), Property::getLuaValue, Property::setLuaValue,
|
||||
@@ -119,12 +119,12 @@ public:
|
||||
std::numeric_limits<OnChangeHandle>::max();
|
||||
|
||||
/**
|
||||
* The constructor for the property. The \p info (see #PropertyInfo) contains
|
||||
* necessary information for this Property. #PropertyInfo::identifier needs to be
|
||||
* unique for each PropertyOwner. The #PropertyInfo::guiName will be stored in the
|
||||
* metaData to be accessed by the GUI elements using the #PropertyInfo::guiName key.
|
||||
* The constructor for the property. The \p info (see PropertyInfo) contains
|
||||
* necessary information for this Property. PropertyInfo::identifier needs to be
|
||||
* unique for each PropertyOwner. The PropertyInfo::guiName will be stored in the
|
||||
* metaData to be accessed by the GUI elements using the PropertyInfo::guiName key.
|
||||
* The default visibility settings is Visibility::Always, whereas the default
|
||||
* read-only state is \c false.
|
||||
* read-only state is `false`.
|
||||
*
|
||||
* \param info The PropertyInfo structure that contains all the required static
|
||||
* information for initializing this Property.
|
||||
@@ -172,7 +172,7 @@ public:
|
||||
|
||||
/**
|
||||
* This method returns the type that is requested by this Property for the set method.
|
||||
* The default implementation returns the type of \c void.
|
||||
* The default implementation returns the type of `void`.
|
||||
*
|
||||
* \return The type that is requested by this Property's Property::set method
|
||||
*/
|
||||
@@ -186,7 +186,7 @@ public:
|
||||
* no-op.
|
||||
*
|
||||
* \param state The Lua state to which the value will be encoded
|
||||
* \return \c true if the encoding succeeded, \c false otherwise
|
||||
* \return `true` if the encoding succeeded, `false` otherwise
|
||||
*/
|
||||
virtual bool getLuaValue(lua_State* state) const;
|
||||
|
||||
@@ -199,18 +199,16 @@ public:
|
||||
* no-op.
|
||||
*
|
||||
* \param state The Lua state from which the value will be decoded
|
||||
* \return \c true if the decoding and setting of the value succeeded, \c false
|
||||
* otherwise
|
||||
*/
|
||||
virtual bool setLuaValue(lua_State* state);
|
||||
virtual void setLuaValue(lua_State* state);
|
||||
|
||||
/**
|
||||
* Returns the Lua type that will be put onto the stack in the Property::getLua method
|
||||
* and which will be consumed by the Property::setLuaValue method. The returned value
|
||||
* can belong to the set of Lua types: \c LUA_TNONE, \c LUA_TNIL, \c LUA_TBOOLEAN,
|
||||
* \c LUA_TLIGHTUSERDATA, \c LUA_TNUMBER, \c LUA_TSTRING, \c LUA_TTABLE,
|
||||
* \c LUA_TFUNCTION, \c LUA_TUSERDATA, or \c LUA_TTHREAD. The default implementation
|
||||
* will return \c LUA_TNONE.
|
||||
* can belong to the set of Lua types: `LUA_TNONE`, `LUA_TNIL`, `LUA_TBOOLEAN`,
|
||||
* `LUA_TLIGHTUSERDATA`, `LUA_TNUMBER`, `LUA_TSTRING`, `LUA_TTABLE`,
|
||||
* `LUA_TFUNCTION`, `LUA_TUSERDATA`, or `LUA_TTHREAD`. The default implementation
|
||||
* will return `LUA_TNONE`.
|
||||
*
|
||||
* \return The Lua type that will be consumed or produced by the Property::getLuaValue
|
||||
* and Property::setLuaValue methods.
|
||||
@@ -218,12 +216,11 @@ public:
|
||||
virtual int typeLua() const;
|
||||
|
||||
/**
|
||||
* This method encodes the encapsulated \p value of this Property as a
|
||||
* <code>std::string</code>. The specific details of this serialization is up to the
|
||||
* property developer. The default implementation is a no-op.
|
||||
* This method encodes the encapsulated \p value of this Property as a `std::string`.
|
||||
* The specific details of this serialization is up to the property developer. The
|
||||
* default implementation is a no-op.
|
||||
*
|
||||
* \param value The value to which the Property will be encoded
|
||||
* \return \p true if the encoding succeeded, \p false otherwise
|
||||
* \return The string representation of the stored property value
|
||||
*/
|
||||
virtual std::string stringValue() const;
|
||||
|
||||
@@ -287,15 +284,14 @@ public:
|
||||
/**
|
||||
* Returns the fully qualified name for this Property that uniquely identifies this
|
||||
* Property within OpenSpace. It consists of the identifier preceded by all levels of
|
||||
* PropertyOwner%s separated with <code>.</code>; for example:
|
||||
* <code>owner1.owner2.identifier</code>.
|
||||
* PropertyOwner%s separated with `.`; for example: `owner1.owner2.identifier`.
|
||||
*
|
||||
* \return The fully qualified identifier for this Property
|
||||
*/
|
||||
std::string fullyQualifiedIdentifier() const;
|
||||
|
||||
/**
|
||||
* Returns the PropertyOwner of this Property or \c nullptr, if it does not have an
|
||||
* Returns the PropertyOwner of this Property or `nullptr`, if it does not have an
|
||||
* owner.
|
||||
*
|
||||
* \return The Property of this Property
|
||||
@@ -313,8 +309,7 @@ public:
|
||||
/**
|
||||
* Returns the human-readable GUI name for this Property that has been set in the
|
||||
* constructor. This method returns the same value as accessing the metaData object
|
||||
* and requesting the <code>std::string</code> stored for the <code>guiName</code>
|
||||
* key.
|
||||
* and requesting the `std::string` stored for the `guiName` key.
|
||||
*
|
||||
* \return The human-readable GUI name for this Property
|
||||
*/
|
||||
@@ -333,14 +328,14 @@ public:
|
||||
* Sets the identifier of the group that this Property belongs to. Property groups can
|
||||
* be used, for example, by GUI application to visually group different properties,
|
||||
* but it has no impact on the Property itself. The default value for the \p groupID
|
||||
* is <code>""</code>.
|
||||
* is `""`.
|
||||
*
|
||||
* \param groupId The group id that this property should belong to
|
||||
*/
|
||||
void setGroupIdentifier(std::string groupId);
|
||||
|
||||
/**
|
||||
* Returns the group idenfier that this Property belongs to, or <code>""</code> if it
|
||||
* Returns the group idenfier that this Property belongs to, or `""` if it
|
||||
* belongs to no group.
|
||||
* \return The group identifier that this Property belongs to
|
||||
*/
|
||||
@@ -349,7 +344,7 @@ public:
|
||||
/**
|
||||
* Sets a hint about the visibility of the Property. Each application accessing the
|
||||
* properties is free to ignore this hint. It is stored in the metaData Dictionary
|
||||
* with the key: <code>Visibility</code>.
|
||||
* with the key: `Visibility`.
|
||||
*
|
||||
* \param visibility The new visibility of the Property
|
||||
*/
|
||||
@@ -367,17 +362,17 @@ public:
|
||||
* applications. This setting is only a hint and does not need to be followed by GUI
|
||||
* applications and does not have any effect on the Property::set or
|
||||
* Property::setLuaValue methods. The value is stored in the metaData Dictionary
|
||||
* with the key: \c isReadOnly. The default value is \c false.
|
||||
* with the key: `isReadOnly`. The default value is `false`.
|
||||
*
|
||||
* \param state \c true if the Property should be read only, \c false otherwise
|
||||
* \param state `true` if the Property should be read only, `false` otherwise
|
||||
*/
|
||||
void setReadOnly(bool state);
|
||||
|
||||
/**
|
||||
* Default view options that can be used in the Property::setViewOption method. The
|
||||
* values are:
|
||||
* - Property::ViewOptions::Color = \c Color (Intended for Vec3 and Vec4),
|
||||
* - Property::ViewOptions::MinMaxRange = \c MinMaxRange (Intended for Vec2)
|
||||
* - Property::ViewOptions::Color = `Color` (Intended for Vec3 and Vec4),
|
||||
* - Property::ViewOptions::MinMaxRange = `MinMaxRange` (Intended for Vec2)
|
||||
*/
|
||||
struct ViewOptions {
|
||||
static const char* Color;
|
||||
@@ -388,12 +383,12 @@ public:
|
||||
* This method allows the developer to give hints to the GUI about different
|
||||
* representations for the GUI. The same Property (for example Vec4Property) can be
|
||||
* used in different ways, each requiring a different input method. These values are
|
||||
* stored in the metaData object under <code>ViewOptions</code>.
|
||||
* stored in the metaData object under `ViewOptions`.
|
||||
* See Property::ViewOptions for a default list of possible options. As these are
|
||||
* only hints, the GUI is free to ignore any suggestion by the developer.
|
||||
* \param option The view option that should be modified
|
||||
* \param value Determines if the view option should be active (<code>true</code>) or
|
||||
* deactivated (<code>false</code>)
|
||||
* \param value Determines if the view option should be active (`true`) or
|
||||
* deactivated (`false`)
|
||||
*/
|
||||
void setViewOption(std::string option, bool value = true);
|
||||
|
||||
@@ -434,8 +429,8 @@ public:
|
||||
|
||||
/**
|
||||
* Creates the information that is general to every Property and adds the
|
||||
* \c Identifier, \c Name, \c Type, and \c MetaData keys and their values. The meta
|
||||
* data is handles by the generateMetaDataDescription method, which has to be
|
||||
* `Identifier`, `Name`, `Type`, and `MetaData` keys and their values. The meta
|
||||
* data is handles by the generateMetaDataJsonDescription method, which has to be
|
||||
* overloaded if a concrete base class wants to add meta data that is not curated by
|
||||
* the Property class.
|
||||
*
|
||||
@@ -444,7 +439,7 @@ public:
|
||||
std::string generateJsonDescription() const;
|
||||
|
||||
/**
|
||||
* Creates the information for the \c MetaData key-part of the JSON description for
|
||||
* Creates the information for the `MetaData` key-part of the JSON description for
|
||||
* the Property. The result can be included as one key-value pair in the description
|
||||
* text generated by subclasses. Only the metadata curated by the Property class is
|
||||
* used in this method.
|
||||
@@ -459,9 +454,15 @@ public:
|
||||
* override this method and return the string containing all of the additional
|
||||
* information. The base implementation of the #description method will return the Lua
|
||||
* script:
|
||||
* <code>return { generateBaseDescription(), generateMetaDataDescription(),</code>
|
||||
* <code>generateAdditionalDescription()}</code>, which #generateMetaDataDescription
|
||||
* and this method being the override points to customize the behavior.
|
||||
* ```
|
||||
* return {
|
||||
* generateBaseDescription(),
|
||||
* generateMetaDataJsonDescription(),
|
||||
* generateAdditionalDescription()
|
||||
* }
|
||||
* ```
|
||||
* #generateMetaDataJsonDescription and this method being the override points to
|
||||
* customize the behavior.
|
||||
*
|
||||
* \return The information specific to each subclass of Property
|
||||
*/
|
||||
@@ -486,7 +487,7 @@ protected:
|
||||
*/
|
||||
void notifyChangeListeners();
|
||||
|
||||
/// The PropetyOwner this Property belongs to, or <code>nullptr</code>
|
||||
/// The PropetyOwner this Property belongs to, or `nullptr`
|
||||
PropertyOwner* _owner = nullptr;
|
||||
|
||||
/// The identifier for this Property
|
||||
|
||||
@@ -37,17 +37,16 @@ class Property;
|
||||
|
||||
/**
|
||||
* A PropertyOwner can own Propertys or other PropertyOwner and provide access to both in
|
||||
* a unified way. The <code>identifier</code>s and <code>name</code>s of Propertys and
|
||||
* sub-owners must be unique to this PropertyOwner. A Property cannot have the same name
|
||||
* as a PropertyOwner owned by this PropertyOwner.
|
||||
* Propertys can be added using the Property::addProperty methods and be removed by the
|
||||
* Property::removeProperty method. The same holds true for sub-owners
|
||||
* a unified way. The `identifier`s and `name`s of Propertys and sub-owners must be unique
|
||||
* to this PropertyOwner. A Property cannot have the same name as a PropertyOwner owned by
|
||||
* this PropertyOwner. Propertys can be added using the Property::addProperty methods and
|
||||
* be removed by the Property::removeProperty method. The same holds true for sub-owners
|
||||
* (Property::addPropertySubOwner, Property::removePropertySubOwner). These methods will
|
||||
* inform the passed object about the new ownership automatically.
|
||||
* Stored properties can be accessed using the Property::properties method or the
|
||||
* Property::property method, providing an URI for the location of the property. If the
|
||||
* URI contains separators (<code>.</code>), the first name before the separator will be
|
||||
* used as a subOwner's name and the search will proceed recursively.
|
||||
* inform the passed object about the new ownership automatically. Stored properties can
|
||||
* be accessed using the Property::properties method or the Property::property method,
|
||||
* providing an URI for the location of the property. If the URI contains separators
|
||||
* (`.`), the first name before the separator will be used as a subOwner's name and the
|
||||
* search will proceed recursively.
|
||||
*/
|
||||
class PropertyOwner : public DocumentationGenerator {
|
||||
public:
|
||||
@@ -68,8 +67,7 @@ public:
|
||||
* #PropertyOwnerInfo::description of this PropertyOwner.
|
||||
*
|
||||
* \pre The \p info 's #PropertyOwnerInfo::identifier must not contain any whitespaces
|
||||
* \pre The \p info 's #PropertyOwnerInfo::identifier must not contain any
|
||||
* <code>.</code>
|
||||
* \pre The \p info 's #PropertyOwnerInfo::identifier must not contain any `.`
|
||||
*/
|
||||
PropertyOwner(PropertyOwnerInfo info);
|
||||
|
||||
@@ -87,10 +85,10 @@ public:
|
||||
* PropertyOwner::addProperty and PropertyOwner::addPropertySubOwner methods).
|
||||
*
|
||||
* \param identifier The identifier of this PropertyOwner. It must not contain any
|
||||
* <code>.</code>s or whitespaces
|
||||
* `.`s or whitespaces
|
||||
*
|
||||
* \pre \p identifier must not contain any whitespaces
|
||||
* \pre \p identifier must not contain any <code>.</code>
|
||||
* \pre \p identifier must not contain any `.`
|
||||
*/
|
||||
void setIdentifier(std::string identifier);
|
||||
|
||||
@@ -137,14 +135,14 @@ public:
|
||||
|
||||
/**
|
||||
* Retrieves a Property identified by \p uri from this PropertyOwner. If \p uri does
|
||||
* not contain a <code>.</code> the identifier must refer to a Property directly owned
|
||||
* by this PropertyOwner. If the identifier contains one or more <code>.</code>, the
|
||||
* not contain a `.` the identifier must refer to a Property directly owned
|
||||
* by this PropertyOwner. If the identifier contains one or more `.`, the
|
||||
* first part of the name will be recursively extracted and used as a name for a
|
||||
* sub-owner and only the last part of the identifier is referring to a Property owned
|
||||
* by PropertyOwner named by the second-but-last name.
|
||||
*
|
||||
* \param uri The identifier of the Property that should be extracted
|
||||
* \return If the Property cannot be found, \c nullptr is returned, otherwise the
|
||||
* \return If the Property cannot be found, `nullptr` is returned, otherwise the
|
||||
* pointer to the Property is returned
|
||||
*/
|
||||
Property* property(const std::string& uri) const;
|
||||
@@ -152,17 +150,17 @@ public:
|
||||
/**
|
||||
* This method checks if a Property with the provided \p uri exists in this
|
||||
* PropertyOwner (or any sub-owner). If the identifier contains one or more
|
||||
* <code>.</code>, the first part of the name will be recursively extracted and is
|
||||
* `.`, the first part of the name will be recursively extracted and is
|
||||
* used as a name for a sub-owner and only the last part of the identifier is
|
||||
* referring to a Property owned by PropertyOwner named by the second-but-last name.
|
||||
*
|
||||
* \return \c true if the \p uri refers to a Property; \c false otherwise.
|
||||
* \return `true` if the \p uri refers to a Property; `false` otherwise.
|
||||
*/
|
||||
bool hasProperty(const std::string& uri) const;
|
||||
|
||||
/**
|
||||
* This method checks if a Property exists in this PropertyOwner.
|
||||
* \return <code>true</code> if the Property existed, <code>false</code> otherwise.
|
||||
* \return `true` if the Property existed, `false` otherwise.
|
||||
*/
|
||||
bool hasProperty(const Property* prop) const;
|
||||
|
||||
@@ -180,23 +178,22 @@ public:
|
||||
|
||||
/**
|
||||
* This method returns the direct sub-owner of this PropertyOwner with the provided
|
||||
* \p identifier. This means that <code>identifier</code> cannot contain any
|
||||
* <code>.</code> as this character is not allowed in PropertyOwner names. If the
|
||||
* \p name does not name a valid sub-owner of this PropertyOwner, a \c nullptr will be
|
||||
* returned.
|
||||
* \p identifier. This means that `identifier` cannot contain any `.` as this
|
||||
* character is not allowed in PropertyOwner names. If the \p name does not name a
|
||||
* valid sub-owner of this PropertyOwner, a `nullptr` will be returned.
|
||||
*
|
||||
* \param identifier The identifier of the sub-owner that should be returned
|
||||
* \return The PropertyOwner with the given \p name, or \c nullptr
|
||||
* \return The PropertyOwner with the given \p name, or `nullptr`
|
||||
*/
|
||||
PropertyOwner* propertySubOwner(const std::string& identifier) const;
|
||||
|
||||
/**
|
||||
* Returns \c true if this PropertyOwner owns a sub-owner with the provided
|
||||
* \p identifier; returns \c false otherwise.
|
||||
* Returns `true` if this PropertyOwner owns a sub-owner with the provided
|
||||
* \p identifier; returns `false` otherwise.
|
||||
*
|
||||
* \param identifier The identifier of the sub-owner that should be looked up
|
||||
* \return \c true if this PropertyOwner owns a sub-owner with the provided
|
||||
* \p identifier; returns \c false otherwise
|
||||
* \return `true` if this PropertyOwner owns a sub-owner with the provided
|
||||
* \p identifier; returns `false` otherwise
|
||||
*/
|
||||
bool hasPropertySubOwner(const std::string& identifier) const;
|
||||
|
||||
@@ -246,7 +243,7 @@ public:
|
||||
|
||||
/**
|
||||
* Removes the Property from this PropertyOwner. Notifies the Property about this
|
||||
* change by calling the Property::setPropertyOwner method with a \c nullptr as
|
||||
* change by calling the Property::setPropertyOwner method with a `nullptr` as
|
||||
* parameter.
|
||||
*
|
||||
* \param prop The Property that should be removed from this PropertyOwner
|
||||
|
||||
@@ -25,25 +25,14 @@
|
||||
#ifndef __OPENSPACE_CORE___BOOLPROPERTY___H__
|
||||
#define __OPENSPACE_CORE___BOOLPROPERTY___H__
|
||||
|
||||
/**
|
||||
* \file boolproperty.h
|
||||
*
|
||||
* \addtogroup openspace
|
||||
* @{
|
||||
* \addtogroup properties
|
||||
* @{
|
||||
|
||||
* \class BoolProperty
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type <code>bool</code>.
|
||||
|
||||
* @} @}
|
||||
*/
|
||||
|
||||
#include <openspace/properties/templateproperty.h>
|
||||
|
||||
namespace openspace::properties {
|
||||
|
||||
/**
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type `bool`.
|
||||
*/
|
||||
class BoolProperty : public TemplateProperty<bool> {
|
||||
public:
|
||||
BoolProperty(Property::PropertyInfo info, bool value = false);
|
||||
@@ -54,7 +43,7 @@ public:
|
||||
using TemplateProperty<bool>::operator=;
|
||||
|
||||
protected:
|
||||
bool fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
bool fromLuaConversion(lua_State* state) const override;
|
||||
void toLuaConversion(lua_State* state) const override;
|
||||
std::string toStringConversion() const override;
|
||||
};
|
||||
|
||||
@@ -25,26 +25,15 @@
|
||||
#ifndef __OPENSPACE_CORE___DOUBLEPROPERTY___H__
|
||||
#define __OPENSPACE_CORE___DOUBLEPROPERTY___H__
|
||||
|
||||
/**
|
||||
* \file doubleproperty.h
|
||||
*
|
||||
* \addtogroup openspace
|
||||
* @{
|
||||
* \addtogroup properties
|
||||
* @{
|
||||
|
||||
* \class DoubleProperty
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type <code>double</code>.
|
||||
|
||||
* @} @}
|
||||
*/
|
||||
|
||||
#include <openspace/properties/numericalproperty.h>
|
||||
#include <limits>
|
||||
|
||||
namespace openspace::properties {
|
||||
|
||||
/**
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type `double`.
|
||||
*/
|
||||
class DoubleProperty : public NumericalProperty<double> {
|
||||
public:
|
||||
DoubleProperty(Property::PropertyInfo info, double value = 0.0,
|
||||
@@ -55,9 +44,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<double>::operator=;
|
||||
|
||||
protected:
|
||||
double fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -25,26 +25,15 @@
|
||||
#ifndef __OPENSPACE_CORE___FLOATPROPERTY___H__
|
||||
#define __OPENSPACE_CORE___FLOATPROPERTY___H__
|
||||
|
||||
/**
|
||||
* \file floatproperty.h
|
||||
*
|
||||
* \addtogroup openspace
|
||||
* @{
|
||||
* \addtogroup properties
|
||||
* @{
|
||||
|
||||
* \class FloatProperty
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type <code>float</code>.
|
||||
|
||||
* @} @}
|
||||
*/
|
||||
|
||||
#include <openspace/properties/numericalproperty.h>
|
||||
#include <limits>
|
||||
|
||||
namespace openspace::properties {
|
||||
|
||||
/**
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type `float`.
|
||||
*/
|
||||
class FloatProperty : public NumericalProperty<float> {
|
||||
public:
|
||||
FloatProperty(Property::PropertyInfo info, float value = 0.f,
|
||||
@@ -55,9 +44,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<float>::operator=;
|
||||
|
||||
protected:
|
||||
float fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -25,26 +25,15 @@
|
||||
#ifndef __OPENSPACE_CORE___INTPROPERTY___H__
|
||||
#define __OPENSPACE_CORE___INTPROPERTY___H__
|
||||
|
||||
/**
|
||||
* \file intproperty.h
|
||||
*
|
||||
* \addtogroup openspace
|
||||
* @{
|
||||
* \addtogroup properties
|
||||
* @{
|
||||
|
||||
* \class IntProperty
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type <code>int</code>.
|
||||
|
||||
* @} @}
|
||||
*/
|
||||
|
||||
#include <openspace/properties/numericalproperty.h>
|
||||
#include <limits>
|
||||
|
||||
namespace openspace::properties {
|
||||
|
||||
/**
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type `int`.
|
||||
*/
|
||||
class IntProperty : public NumericalProperty<int> {
|
||||
public:
|
||||
IntProperty(Property::PropertyInfo info, int value = 0,
|
||||
@@ -56,8 +45,8 @@ public:
|
||||
|
||||
using TemplateProperty<int>::operator=;
|
||||
|
||||
protected:
|
||||
int fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
private:
|
||||
int fromLuaConversion(lua_State* state) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -25,26 +25,15 @@
|
||||
#ifndef __OPENSPACE_CORE___LONGPROPERTY___H__
|
||||
#define __OPENSPACE_CORE___LONGPROPERTY___H__
|
||||
|
||||
/**
|
||||
* \file longproperty.h
|
||||
*
|
||||
* \addtogroup openspace
|
||||
* @{
|
||||
* \addtogroup properties
|
||||
* @{
|
||||
|
||||
* \class LongProperty
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type <code>long</code>.
|
||||
|
||||
* @} @}
|
||||
*/
|
||||
|
||||
#include <openspace/properties/numericalproperty.h>
|
||||
#include <limits>
|
||||
|
||||
namespace openspace::properties {
|
||||
|
||||
/**
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type `long`.
|
||||
*/
|
||||
class LongProperty : public NumericalProperty<long> {
|
||||
public:
|
||||
LongProperty(Property::PropertyInfo info, long value = long(0),
|
||||
@@ -56,9 +45,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<long>::operator=;
|
||||
|
||||
protected:
|
||||
long fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -34,8 +34,6 @@
|
||||
* @{
|
||||
|
||||
* \class ShortProperty
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type <code>short</code>.
|
||||
|
||||
* @} @}
|
||||
*/
|
||||
@@ -45,6 +43,10 @@
|
||||
|
||||
namespace openspace::properties {
|
||||
|
||||
/**
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type `short`.
|
||||
*/
|
||||
class ShortProperty : public NumericalProperty<short> {
|
||||
public:
|
||||
ShortProperty(Property::PropertyInfo info, short value = short(0),
|
||||
@@ -56,9 +58,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<short>::operator=;
|
||||
|
||||
protected:
|
||||
short fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -25,26 +25,15 @@
|
||||
#ifndef __OPENSPACE_CORE___UINTPROPERTY___H__
|
||||
#define __OPENSPACE_CORE___UINTPROPERTY___H__
|
||||
|
||||
/**
|
||||
* \file uintproperty.h
|
||||
*
|
||||
* \addtogroup openspace
|
||||
* @{
|
||||
* \addtogroup properties
|
||||
* @{
|
||||
|
||||
* \class UIntProperty
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type <code>unsigned int</code>.
|
||||
|
||||
* @} @}
|
||||
*/
|
||||
|
||||
#include <openspace/properties/numericalproperty.h>
|
||||
#include <limits>
|
||||
|
||||
namespace openspace::properties {
|
||||
|
||||
/**
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type `unsigned int`.
|
||||
*/
|
||||
class UIntProperty : public NumericalProperty<unsigned int> {
|
||||
public:
|
||||
UIntProperty(Property::PropertyInfo info, unsigned int value = 0,
|
||||
@@ -56,9 +45,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<unsigned int>::operator=;
|
||||
|
||||
protected:
|
||||
unsigned int fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -25,26 +25,15 @@
|
||||
#ifndef __OPENSPACE_CORE___ULONGPROPERTY___H__
|
||||
#define __OPENSPACE_CORE___ULONGPROPERTY___H__
|
||||
|
||||
/**
|
||||
* \file ulongproperty.h
|
||||
*
|
||||
* \addtogroup openspace
|
||||
* @{
|
||||
* \addtogroup properties
|
||||
* @{
|
||||
|
||||
* \class ULongProperty
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type <code>unsigned long</code>.
|
||||
|
||||
* @} @}
|
||||
*/
|
||||
|
||||
#include <openspace/properties/numericalproperty.h>
|
||||
#include <limits>
|
||||
|
||||
namespace openspace::properties {
|
||||
|
||||
/**
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type `unsigned long`.
|
||||
*/
|
||||
class ULongProperty : public NumericalProperty<unsigned long> {
|
||||
public:
|
||||
ULongProperty(Property::PropertyInfo info, unsigned long value = 0ul,
|
||||
@@ -56,9 +45,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<unsigned long>::operator=;
|
||||
|
||||
protected:
|
||||
unsigned long fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -25,26 +25,15 @@
|
||||
#ifndef __OPENSPACE_CORE___USHORTPROPERTY___H__
|
||||
#define __OPENSPACE_CORE___USHORTPROPERTY___H__
|
||||
|
||||
/**
|
||||
* \file ushortproperty.h
|
||||
*
|
||||
* \addtogroup openspace
|
||||
* @{
|
||||
* \addtogroup properties
|
||||
* @{
|
||||
|
||||
* \class UShortProperty
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type <code>unsigned short</code>.
|
||||
|
||||
* @} @}
|
||||
*/
|
||||
|
||||
#include <openspace/properties/numericalproperty.h>
|
||||
#include <limits>
|
||||
|
||||
namespace openspace::properties {
|
||||
|
||||
/**
|
||||
* This class is a concrete implementation of openspace::properties::TemplateProperty with
|
||||
* the type `unsigned short`.
|
||||
*/
|
||||
class UShortProperty : public NumericalProperty<unsigned short> {
|
||||
public:
|
||||
UShortProperty(Property::PropertyInfo info, unsigned short value = 0,
|
||||
@@ -56,9 +45,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<unsigned short>::operator=;
|
||||
|
||||
protected:
|
||||
unsigned short fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -41,7 +41,7 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
/**
|
||||
* This method sets the stored value to the provided value <code>val</code>.
|
||||
* This method sets the stored value to the provided value `val`.
|
||||
* If the value is different, the listeners are notified. It also removes any
|
||||
* invalid keys in the input set. A key is invalid if it does not correspond to
|
||||
* an existing option in the SelectionProperty
|
||||
@@ -51,18 +51,18 @@ public:
|
||||
void setValue(std::set<std::string> val) override;
|
||||
|
||||
/**
|
||||
* Checks if an option given by the provided <code>key</code> exists.
|
||||
* Checks if an option given by the provided `key` exists.
|
||||
*
|
||||
* \param key The key that should be checked for existence
|
||||
* \return \c if the option exists; \c false otherwise
|
||||
* \return `true` if the option exists; `false` otherwise
|
||||
*/
|
||||
bool hasOption(const std::string& key) const;
|
||||
|
||||
/**
|
||||
* Checks if an option given by the provided <code>key</code> is selected.
|
||||
* Checks if an option given by the provided `key` is selected.
|
||||
*
|
||||
* \param key The key that should be checked
|
||||
* \return \c true if the option is selected; \c false otherwise
|
||||
* \return `true` if the option is selected; `false` otherwise
|
||||
*/
|
||||
bool isSelected(const std::string& key) const;
|
||||
|
||||
@@ -70,7 +70,7 @@ public:
|
||||
* Checks if the SelectionProperty has any selected values, that is, if its
|
||||
* value is empty.
|
||||
*
|
||||
* \return \c true if there are selected options; \c false otherwise
|
||||
* \return `true` if there are selected options; `false` otherwise
|
||||
*/
|
||||
bool hasSelected() const;
|
||||
|
||||
@@ -114,8 +114,7 @@ public:
|
||||
using TemplateProperty<std::set<std::string>>::operator=;
|
||||
|
||||
protected:
|
||||
std::set<std::string> fromLuaConversion(lua_State* state,
|
||||
bool& success) const override;
|
||||
std::set<std::string> fromLuaConversion(lua_State* state) const override;
|
||||
|
||||
void toLuaConversion(lua_State* state) const override;
|
||||
|
||||
|
||||
@@ -42,7 +42,7 @@ public:
|
||||
operator std::string_view() const;
|
||||
|
||||
protected:
|
||||
std::string fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
std::string fromLuaConversion(lua_State* state) const override;
|
||||
void toLuaConversion(lua_State* state) const override;
|
||||
std::string toStringConversion() const override;
|
||||
};
|
||||
|
||||
@@ -31,16 +31,16 @@ namespace openspace::properties {
|
||||
|
||||
/**
|
||||
* This subclass of Property handles a single parameter value that is of type
|
||||
* <code>T</code>. It provides all the necessary methods to automatically access the
|
||||
* `T`. It provides all the necessary methods to automatically access the
|
||||
* value. One notable instantiation of this class is StringProperty, using
|
||||
* <code>T = std::string</code> while NumericalProperty is a templated subclass dealing
|
||||
* `T = std::string` while NumericalProperty is a templated subclass dealing
|
||||
* with numerical parameter types.
|
||||
* The accessor operator and assignment operators are overloaded, so that the
|
||||
* TemplateProperty can be used just in the same way as a regular member variable. In the
|
||||
* case that these cannot not be used inline, the Property::get method will work.
|
||||
*
|
||||
* Each instantiation of this class should provide a constructor that deals with the
|
||||
* default value for that specific type <code>T</code>, so that a property can be
|
||||
* default value for that specific type `T`, so that a property can be
|
||||
* created from just a Property::PropertyInfo object.
|
||||
*
|
||||
* \tparam T The type of value that is stored in this TemplateProperty
|
||||
@@ -82,7 +82,7 @@ public:
|
||||
|
||||
/**
|
||||
* Sets the value from the provided ghoul::any object. If the types between
|
||||
* <code>T</code> and <code>value</code> disagree, an error is logged and the stored
|
||||
* `T` and `value` disagree, an error is logged and the stored
|
||||
* value remains unchanged.
|
||||
*
|
||||
* \param value The value that is used to set this Property
|
||||
@@ -90,11 +90,11 @@ public:
|
||||
virtual void set(std::any value) final;
|
||||
|
||||
/**
|
||||
* Returns the <code>std::type_info</code> describing the template parameter
|
||||
* <code>T</code>. It can be used to test against a ghoul::any value before trying to
|
||||
* Returns the `std::type_info` describing the template parameter
|
||||
* `T`. It can be used to test against a ghoul::any value before trying to
|
||||
* assign it.
|
||||
*
|
||||
* \return The type info object describing the template parameter <code>T</code>
|
||||
* \return The type info object describing the template parameter `T`
|
||||
*/
|
||||
virtual const std::type_info& type() const override;
|
||||
|
||||
@@ -103,7 +103,7 @@ public:
|
||||
* the stack.
|
||||
*
|
||||
* \param state The Lua state onto which the encoded object will be pushed
|
||||
* \return \c true if the encoding succeeded; \c false otherwise
|
||||
* \return `true` if the encoding succeeded; `false` otherwise
|
||||
*/
|
||||
virtual bool getLuaValue(lua_State* state) const override;
|
||||
|
||||
@@ -113,9 +113,9 @@ public:
|
||||
* decoding is successful, the new value is set, otherwise it remains unchanged.
|
||||
*
|
||||
* \param state The Lua state from which the value will be decoded
|
||||
* \return \c true if the decoding succeeded; \c false otherwise
|
||||
* \return `true` if the decoding succeeded; `false` otherwise
|
||||
*/
|
||||
virtual bool setLuaValue(lua_State* state) override;
|
||||
virtual void setLuaValue(lua_State* state) override;
|
||||
|
||||
/// \see Property::typeLua
|
||||
virtual int typeLua() const override = 0;
|
||||
@@ -124,8 +124,7 @@ public:
|
||||
* This method encodes the stored value into a std::string object. The resulting
|
||||
* encoding must also be a valid JSON representation fo the property.
|
||||
*
|
||||
* \param value The string object in which to store the resulting encoding
|
||||
* \return \c true if the encoding succeeded; \c false otherwise
|
||||
* \return The string representation of the stored property value
|
||||
*/
|
||||
virtual std::string stringValue() const override;
|
||||
|
||||
@@ -139,8 +138,8 @@ public:
|
||||
|
||||
/**
|
||||
* This operator allows the TemplateProperty to be used almost transparently as if it
|
||||
* was of the type <code>T</code>. It makes assignments such as
|
||||
* <code>T v = property;</code> possible by allowing implicit casts (even though,
|
||||
* was of the type `T`. It makes assignments such as
|
||||
* `T v = property;` possible by allowing implicit casts (even though,
|
||||
* internally, not casts are performed. This method is next to zero overhead).
|
||||
*
|
||||
* \return The internal representation of the Property
|
||||
@@ -149,8 +148,8 @@ public:
|
||||
|
||||
/**
|
||||
* This operator allows the TemplateProperty to be used almost transparently as if it
|
||||
* was of the type <code>T</code>. It makes assignments such as
|
||||
* <code>T v = property;</code> possible by allowing implicit casts (even though,
|
||||
* was of the type `T`. It makes assignments such as
|
||||
* `T v = property;` possible by allowing implicit casts (even though,
|
||||
* internally, not casts are performed. This method is next to zero overhead).
|
||||
*
|
||||
* \return The internal representation of the Property
|
||||
@@ -160,17 +159,17 @@ public:
|
||||
/**
|
||||
* The assignment operator allows the TemplateProperty's value to be set without using
|
||||
* the TemplateProperty::set method. It will be done internally by this method and it
|
||||
* allows assignments such as <code>prop = T(1)</code>.
|
||||
* allows assignments such as `prop = T(1)`.
|
||||
*
|
||||
* \param val The value that should be set
|
||||
*/
|
||||
TemplateProperty<T>& operator=(T val);
|
||||
|
||||
/**
|
||||
* This method sets the stored value to the provided value <code>val</code>,
|
||||
* moving it into place. The move only happens if the provided value <code>val</code>
|
||||
* This method sets the stored value to the provided value `val`,
|
||||
* moving it into place. The move only happens if the provided value `val`
|
||||
* is different from the stored value, which needs an operator== to exist for the type
|
||||
* <code>T</code>. If the value is different, the listeners are notified.
|
||||
* `T`. If the value is different, the listeners are notified.
|
||||
*
|
||||
* \param val The new value for this TemplateProperty
|
||||
*/
|
||||
@@ -185,14 +184,13 @@ public:
|
||||
|
||||
protected:
|
||||
/**
|
||||
* Decodes the object at the top of the stack to a value of the type <code>T</code>
|
||||
* Decodes the object at the top of the stack to a value of the type `T`
|
||||
* and returns it. This method has to be specialized for each new type.
|
||||
*
|
||||
* \param state The Lua state from which the value will be decoded
|
||||
* \param success Set to true \c true if the decoding succeeded; \c false otherwise
|
||||
* \return the decoded value
|
||||
*/
|
||||
virtual T fromLuaConversion(lua_State* state, bool& success) const = 0;
|
||||
virtual T fromLuaConversion(lua_State* state) const = 0;
|
||||
|
||||
/**
|
||||
* Encodes the stored value into a Lua object and pushes that object onto
|
||||
|
||||
@@ -22,6 +22,8 @@
|
||||
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
|
||||
****************************************************************************************/
|
||||
|
||||
#include <ghoul/lua/lua_helper.h>
|
||||
|
||||
namespace openspace::properties {
|
||||
|
||||
template <typename T>
|
||||
@@ -83,13 +85,9 @@ bool TemplateProperty<T>::getLuaValue(lua_State* state) const {
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
bool TemplateProperty<T>::setLuaValue(lua_State* state) {
|
||||
bool success = false;
|
||||
T thisValue = fromLuaConversion(state, success);
|
||||
if (success) {
|
||||
set(std::any(thisValue));
|
||||
}
|
||||
return success;
|
||||
void TemplateProperty<T>::setLuaValue(lua_State* state) {
|
||||
T thisValue = fromLuaConversion(state);
|
||||
set(std::any(thisValue));
|
||||
}
|
||||
|
||||
template <typename T>
|
||||
|
||||
@@ -36,28 +36,28 @@ namespace openspace::properties {
|
||||
class TriggerProperty : public Property {
|
||||
public:
|
||||
/**
|
||||
* Initializes the TriggerProperty by delegating the <code>identifier</code> and
|
||||
* <code>guiName</code> to the Property constructor.
|
||||
* Initializes the TriggerProperty by delegating the `identifier` and
|
||||
* `guiName` to the Property constructor.
|
||||
* \param info The PropertyInfo structure that contains all the required static
|
||||
* information for initializing this Property.
|
||||
* information for initializing this Property.
|
||||
* \pre \p info.identifier must not be empty
|
||||
* \pre \p info.guiName must not be empty
|
||||
*/
|
||||
TriggerProperty(PropertyInfo info);
|
||||
|
||||
/**
|
||||
* Returns the class name <code>TriggerProperty</code>.
|
||||
* \return The class name <code>TriggerProperty</code>
|
||||
* Returns the class name `TriggerProperty`.
|
||||
* \return The class name `TriggerProperty`
|
||||
*/
|
||||
std::string_view className() const override;
|
||||
|
||||
/**
|
||||
* Accepts only the <code>LUA_TNIL</code> type and will notify all the listeners
|
||||
* Accepts only the `LUA_TNIL` type and will notify all the listeners
|
||||
* that the event has been triggered.
|
||||
* \param state The unused Lua state
|
||||
* \return Returns always <code>true</code>
|
||||
* \return Returns always `true`
|
||||
*/
|
||||
bool setLuaValue(lua_State* state) override;
|
||||
void setLuaValue(lua_State* state) override;
|
||||
|
||||
/**
|
||||
* Silently ignores any value that is passed into this function and will trigger the
|
||||
|
||||
@@ -43,9 +43,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<glm::dvec2>::operator=;
|
||||
|
||||
protected:
|
||||
glm::dvec2 fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -43,9 +43,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<glm::dvec3>::operator=;
|
||||
|
||||
protected:
|
||||
glm::dvec3 fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -43,9 +43,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<glm::dvec4>::operator=;
|
||||
|
||||
protected:
|
||||
glm::dvec4 fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -43,9 +43,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<glm::ivec2>::operator=;
|
||||
|
||||
protected:
|
||||
glm::ivec2 fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -43,9 +43,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<glm::ivec3>::operator=;
|
||||
|
||||
protected:
|
||||
glm::ivec3 fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -43,9 +43,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<glm::ivec4>::operator=;
|
||||
|
||||
protected:
|
||||
glm::ivec4 fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
@@ -43,9 +43,6 @@ public:
|
||||
int typeLua() const override;
|
||||
|
||||
using TemplateProperty<glm::uvec2>::operator=;
|
||||
|
||||
protected:
|
||||
glm::uvec2 fromLuaConversion(lua_State* state, bool& success) const override;
|
||||
};
|
||||
|
||||
} // namespace openspace::properties
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user