From 0632fe0c6c12760f0493c8dc646351e5552deb19 Mon Sep 17 00:00:00 2001 From: GPayne Date: Tue, 22 Feb 2022 22:26:09 -0700 Subject: [PATCH] More header file public methods comments --- .../ext/launcher/include/sgctedit/display.h | 24 +++++- .../launcher/include/sgctedit/orientation.h | 30 ++++++- .../include/sgctedit/orientationdialog.h | 7 ++ .../ext/launcher/include/sgctedit/sgctedit.h | 27 ++++++- .../launcher/include/sgctedit/windowcontrol.h | 79 +++++++++++++++++++ .../ext/launcher/src/sgctedit/display.cpp | 6 -- .../ext/launcher/src/sgctedit/orientation.cpp | 2 +- .../ext/launcher/src/sgctedit/sgctedit.cpp | 2 +- 8 files changed, 165 insertions(+), 12 deletions(-) diff --git a/apps/OpenSpace/ext/launcher/include/sgctedit/display.h b/apps/OpenSpace/ext/launcher/include/sgctedit/display.h index b6144bfc32..b874f913a4 100644 --- a/apps/OpenSpace/ext/launcher/include/sgctedit/display.h +++ b/apps/OpenSpace/ext/launcher/include/sgctedit/display.h @@ -45,12 +45,34 @@ class Display : public QWidget { Q_OBJECT public: + /** + * Constructor for Display class, which manages the overall control layout including + * monitorBox, multiple WindowControl columns, and additional controls + * + * \param monitorRenderBox pointer to the MonitorBox object + * \param monitorSizeList A vector containing QRect objects containing pixel dims + * of each monitor + * \param nMaxWindows The maximum number of windows allowed (depends on the number + * of monitors in the system) + * \param winColors An array of QColor objects for window colors. The indexing of + * this array matches the window indexing used elsewhere in the + * class. This allows for a unique color for each window. + */ Display(std::shared_ptr monitorRenderBox, std::vector& monitorSizeList, unsigned int nMaxWindows, const std::array& winColors); + /** + * Returns a vector of pointers to all WindowControl objects for all windows + * + * \return vector of pointers of WindowControl objects + */ std::vector> windowControls() const; + /** + * Returns the current number of windows + * + * \return the currently-selected number of windows in unsigned int + */ unsigned int nWindows() const; - void uncheckWebGuiOptions(); private slots: void addWindow(); diff --git a/apps/OpenSpace/ext/launcher/include/sgctedit/orientation.h b/apps/OpenSpace/ext/launcher/include/sgctedit/orientation.h index ee13404cdf..d2266f48b1 100644 --- a/apps/OpenSpace/ext/launcher/include/sgctedit/orientation.h +++ b/apps/OpenSpace/ext/launcher/include/sgctedit/orientation.h @@ -37,9 +37,37 @@ class Orientation : public QWidget { Q_OBJECT public: + /** + * Constructor for Orientation class, which manages the overall control layout including + * monitorBox, multiple WindowControl columns, and additional controls + * + * \param monitorRenderBox pointer to the MonitorBox object + * \param monitorSizeList A vector containing QRect objects containing pixel dims + * of each monitor + * \param nMaxWindows The maximum number of windows allowed (depends on the number + * of monitors in the system) + * \param winColors An array of QColor objects for window colors. The indexing of + * this array matches the window indexing used elsewhere in the + * class. This allows for a unique color for each window. + */ Orientation(); - void addButtonToLayout(QVBoxLayout* parentLayout); + /** + * Add Orientation controls to the parent layout + * + * \param parentLayout the layout to which the Orientation's controls will be added + */ + void addControlsToParentLayout(QVBoxLayout* parentLayout); + /** + * Gets the user-provided x,y,z orientation values (degrees) + * + * \return the orientation angles provided in sgct::quat object + */ sgct::quat orientationValue() const; + /** + * Gets the value for if VSync is enabled + * + * \return true if the VSync option is checked/enabled + */ bool vsyncValue() const; private slots: diff --git a/apps/OpenSpace/ext/launcher/include/sgctedit/orientationdialog.h b/apps/OpenSpace/ext/launcher/include/sgctedit/orientationdialog.h index e026c7bbaa..9d9615dcbf 100644 --- a/apps/OpenSpace/ext/launcher/include/sgctedit/orientationdialog.h +++ b/apps/OpenSpace/ext/launcher/include/sgctedit/orientationdialog.h @@ -36,6 +36,13 @@ class QWidget; class OrientationDialog : public QDialog { Q_OBJECT public: + /** + * Constructor for OrientationDialog object which contains the input text boxes for + * orientation x,y,z values + * + * \param orientation x,y,z angles in degrees contained in sgct::quat object + * \param parent pointer to Qt QWidget parent object + */ OrientationDialog(sgct::quat& orientation, QWidget* parent); private slots: diff --git a/apps/OpenSpace/ext/launcher/include/sgctedit/sgctedit.h b/apps/OpenSpace/ext/launcher/include/sgctedit/sgctedit.h index dbab4e2d58..a664a60706 100644 --- a/apps/OpenSpace/ext/launcher/include/sgctedit/sgctedit.h +++ b/apps/OpenSpace/ext/launcher/include/sgctedit/sgctedit.h @@ -45,15 +45,38 @@ class SgctEdit final : public QDialog { Q_OBJECT public: + /** + * Constructor for SgctEdit class, the underlying class for the full window + * configuration editor + * + * \param parent The Qt QWidget parent object + * \param windowList vector of sgct::config::Window objects which will be modified + * by the user settings, and then used for writing to file in + * the launcher code + * \param cluster reference to sgct::config::Cluster object that contains sgct + * objects that will be modified by the window configuration settings + * \param screenList A QList containing a QScreen object for each monitor in the + * system + */ SgctEdit(QWidget* parent, std::vector& windowList, sgct::config::Cluster& cluster, const QList& screenList); ~SgctEdit(); - void addDisplayLayout(QHBoxLayout* layout); - void createWidgets(); + /** + * Used to determine if the window configuration was saved to file, or canceled + * + * \return true if configuration was saved to file + */ bool wasSaved() const; + /** + * Returns the saved filename + * + * \return saved filename in std::string + */ std::string saveFilename(); private: + void addDisplayLayout(QHBoxLayout* layout); + void createWidgets(); void systemMonitorConfiguration(const QList& screenList); std::shared_ptr _monBox = nullptr; diff --git a/apps/OpenSpace/ext/launcher/include/sgctedit/windowcontrol.h b/apps/OpenSpace/ext/launcher/include/sgctedit/windowcontrol.h index 665d00e1d7..d99d9630e5 100644 --- a/apps/OpenSpace/ext/launcher/include/sgctedit/windowcontrol.h +++ b/apps/OpenSpace/ext/launcher/include/sgctedit/windowcontrol.h @@ -66,20 +66,94 @@ public: * WebGUI option selected */ void setWebGuiChangeCallback(std::function cb); + /** + * Makes the window label at top of a window control column visible + * + * \param bool Shows the window label if true + */ void showWindowLabel(bool show); + /** + * Initializes the layout of a window controls column, returning the Qt layout object + * + * \return the QVBoxLayout object that contains the entire windows control column + */ QVBoxLayout* initializeLayout(); + /** + * Returns the dimensions of the window + * + * \return the QRectF object that contains the windows dimensions + */ QRectF& dimensions(); + /** + * Returns the title name of the window + * + * \return the std::string of the window name + */ std::string windowName() const; + /** + * Returns the user-entered window size width, height from the text line objects + * + * \return the user-entered window size in sgct::ivec2 object + */ sgct::ivec2 windowSize() const; + /** + * Returns the user-entered window position in x,y pixles from the text line objects + * + * \return the user-entered window position in sgct::ivec2 object + */ sgct::ivec2 windowPos() const; + /** + * Returns bool for if the window control checkbox is set to be decorated + * + * \return bool for if window decoration is enabled + */ bool isDecorated() const; + /** + * Returns bool for if the window control checkbox spout selection is enabled + * + * \return bool for if window has spout enabled + */ bool isSpoutSelected() const; + /** + * Returns bool for if the window control checkbox for WebGUI is enabled + * + * \return bool for if window has WebGUI enabled + */ bool isGuiWindow() const; + /** + * Function called in order to disable/uncheck the WebGUI checkbox option + */ void uncheckWebGuiOption(); + /** + * Returns index number of the selected window quality value. This is an index into + * the QualityValues array + * + * \return index int into the QualityValues array + */ int qualitySelectedValue() const; + /** + * Returns index number of the monitor that this window is assigned to + * + * \return int index of monitor + */ unsigned int monitorNum() const; + /** + * Returns the user-entered horizontal field-of-view (planar projection only) + * + * \return float value of horizontal FOV + */ float fovH() const; + /** + * Returns the user-entered vertical field-of-view (planar projection only) + * + * \return float value of vertical FOV + */ float fovV() const; + /** + * Returns the user-entered height offset (cylindrical projection only) + * + * \return float value of height offset + */ float heightOffset() const; enum class ProjectionIndeces { Planar = 0, @@ -88,6 +162,11 @@ public: Cylindrical, Equirectangular }; + /** + * Returns the user-selected window projection type + * + * \return ProjectionIndeces enum of the projection type + */ ProjectionIndeces projectionSelectedIndex() const; private slots: diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/display.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/display.cpp index 7d3fa066ed..93ab23ceb0 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/display.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/display.cpp @@ -161,9 +161,3 @@ void Display::initializeWindowControl() { } } -void Display::uncheckWebGuiOptions() { - for (std::shared_ptr w : _windowControl) { - w->uncheckWebGuiOption(); - } -} - diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/orientation.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/orientation.cpp index e00bb75d08..4f939bdaa4 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/orientation.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/orientation.cpp @@ -55,7 +55,7 @@ Orientation::Orientation() } } -void Orientation::addButtonToLayout(QVBoxLayout* parentLayout) { +void Orientation::addControlsToParentLayout(QVBoxLayout* parentLayout) { parentLayout->addLayout(_layoutOrientationFull); } diff --git a/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp b/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp index 0e2603354f..aa94140a98 100644 --- a/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp +++ b/apps/OpenSpace/ext/launcher/src/sgctedit/sgctedit.cpp @@ -78,7 +78,7 @@ void SgctEdit::createWidgets() { } { layoutMainV->addLayout(layoutMainH); - _orientationWidget->addButtonToLayout(layoutMainV); + _orientationWidget->addControlsToParentLayout(layoutMainV); _fileSupportWidget = new FileSupport( layoutMainV, _monitorSizeList,