Renamed Display class to DisplayWindowUnion

This commit is contained in:
GPayne
2022-02-25 23:56:20 -07:00
parent d73fd4e242
commit 3d24835c77
9 changed files with 30 additions and 42 deletions
+3 -3
View File
@@ -42,7 +42,7 @@ set(HEADER_FILES
include/profile/timedialog.h
include/profile/profileedit.h
include/profile/propertiesdialog.h
include/sgctedit/display.h
include/sgctedit/displaywindowunion.h
include/sgctedit/filesupport.h
include/sgctedit/monitorbox.h
include/sgctedit/orientation.h
@@ -70,7 +70,7 @@ set(SOURCE_FILES
src/profile/profileedit.cpp
src/profile/propertiesdialog.cpp
src/sgctedit/sgctedit.cpp
src/sgctedit/display.cpp
src/sgctedit/displaywindowunion.cpp
src/sgctedit/filesupport.cpp
src/sgctedit/monitorbox.cpp
src/sgctedit/orientation.cpp
@@ -93,7 +93,7 @@ set(HEADER_SOURCE
include/profile/timedialog.h
include/profile/profileedit.h
include/profile/propertiesdialog.h
include/sgctedit/display.h
include/sgctedit/displaywindowunion.h
include/sgctedit/filesupport.h
include/sgctedit/monitorbox.h
include/sgctedit/orientation.h
@@ -21,8 +21,8 @@
* CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE *
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#ifndef __OPENSPACE_UI_LAUNCHER___DISPLAY___H__
#define __OPENSPACE_UI_LAUNCHER___DISPLAY___H__
#ifndef __OPENSPACE_UI_LAUNCHER___DISPLAYWINDOWUNION___H__
#define __OPENSPACE_UI_LAUNCHER___DISPLAYWINDOWUNION___H__
#include <QWidget>
@@ -42,12 +42,12 @@
#include <QVector>
#include <vector>
class Display : public QWidget {
class DisplayWindowUnion : public QWidget {
Q_OBJECT
public:
/**
* Constructor for Display class, which manages the overall control layout including
* monitorBox, multiple WindowControl columns, and additional controls
* Constructor for DisplayWindowUnion 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
@@ -58,7 +58,7 @@ public:
* this array matches the window indexing used elsewhere in the
* class. This allows for a unique color for each window.
*/
Display(std::shared_ptr<MonitorBox> monitorRenderBox,
DisplayWindowUnion(std::shared_ptr<MonitorBox> monitorRenderBox,
std::vector<QRect>& monitorSizeList, unsigned int nMaxWindows,
const std::array<QColor, 4>& winColors);
/**
@@ -98,4 +98,4 @@ private:
QFrame* _borderFrame = nullptr;
};
#endif // __OPENSPACE_UI_LAUNCHER___DISPLAY___H__
#endif // __OPENSPACE_UI_LAUNCHER___DISPLAYWINDOWUNION___H__
@@ -28,7 +28,7 @@
#include <QWidget>
#include <ghoul/filesystem/filesystem.h>
#include <sgctedit/display.h>
#include <sgctedit/displaywindowunion.h>
#include <sgctedit/orientation.h>
#include <sgct/config.h>
#include <QFileDialog>
@@ -59,7 +59,7 @@ struct SgctConfigElements {
struct UserConfigurationElements {
std::vector<QRect>& monitorList;
std::shared_ptr<Display> display;
std::shared_ptr<DisplayWindowUnion> display;
Orientation* orientation;
const std::string configSavePath;
};
@@ -105,7 +105,7 @@ private:
QPushButton* _saveButton = nullptr;
QPushButton* _cancelButton = nullptr;
QPushButton* _applyButton = nullptr;
std::shared_ptr<Display> _displayWidget;
std::shared_ptr<DisplayWindowUnion> _displayWidget;
Orientation* _orientationWidget;
std::vector<QRect>& _monitors;
sgct::config::Cluster& _cluster;
@@ -27,7 +27,7 @@
#include <QDialog>
#include <sgctedit/display.h>
#include <sgctedit/displaywindowunion.h>
#include <sgctedit/filesupport.h>
#include <sgctedit/monitorbox.h>
#include <sgctedit/orientation.h>
@@ -41,8 +41,7 @@
class QWidget;
class SgctEdit final : public QDialog
{
class SgctEdit final : public QDialog {
Q_OBJECT
public:
/**
@@ -86,7 +85,7 @@ private:
std::vector<QRect> _monitorSizeList;
QVBoxLayout* _displayLayout = nullptr;
QFrame* _displayFrame = nullptr;
std::shared_ptr<Display> _displayWidget = nullptr;
std::shared_ptr<DisplayWindowUnion> _displayWidget = nullptr;
QRect _monitorWidgetSize = {0, 0, 500, 500};
FileSupport* _fileSupportWidget = nullptr;
Orientation* _orientationWidget = nullptr;
@@ -310,17 +310,6 @@ QWidget* LauncherWindow::createCentralWidget() {
newWindowButton->setGeometry(geometry::NewWindowButton);
newWindowButton->setCursor(Qt::PointingHandCursor);
//QPushButton* editWindowButton = new QPushButton("Edit", centralWidget);
//connect(
// editWindowButton, &QPushButton::released,
// [this]() {
// openWindowEditor();
// }
//);
//editWindowButton->setObjectName("small");
//editWindowButton->setGeometry(geometry::EditWindowButton);
//editWindowButton->setCursor(Qt::PointingHandCursor);
return centralWidget;
}
@@ -22,7 +22,7 @@
* OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. *
****************************************************************************************/
#include "sgctedit/display.h"
#include "sgctedit/displaywindowunion.h"
#include <ghoul/fmt.h>
#include "sgctedit/monitorbox.h"
@@ -32,7 +32,7 @@
#include <QScreen>
#include <string>
Display::Display(std::shared_ptr<MonitorBox> monitorRenderBox,
DisplayWindowUnion::DisplayWindowUnion(std::shared_ptr<MonitorBox> monitorRenderBox,
std::vector<QRect>& monitorSizeList, unsigned int nMaxWindows,
const std::array<QColor, 4>& winColors)
: _monBox(monitorRenderBox)
@@ -46,12 +46,12 @@ Display::Display(std::shared_ptr<MonitorBox> monitorRenderBox,
for (unsigned int i = 0; i < _nMaxWindows; ++i) {
initializeWindowControl();
}
connect(_addWindowButton, &QPushButton::clicked, this, &Display::addWindow);
connect(_removeWindowButton, &QPushButton::clicked, this, &Display::removeWindow);
connect(_addWindowButton, &QPushButton::clicked, this, &DisplayWindowUnion::addWindow);
connect(_removeWindowButton, &QPushButton::clicked, this, &DisplayWindowUnion::removeWindow);
initializeLayout();
}
void Display::initializeLayout() {
void DisplayWindowUnion::initializeLayout() {
QVBoxLayout* layout = new QVBoxLayout(this);
{
QHBoxLayout* layoutMonButton = new QHBoxLayout;
@@ -89,15 +89,15 @@ void Display::initializeLayout() {
layout->addLayout(layoutWindows);
}
std::vector<std::shared_ptr<WindowControl>> Display::windowControls() const {
std::vector<std::shared_ptr<WindowControl>> DisplayWindowUnion::windowControls() const {
return _windowControl;
}
unsigned int Display::nWindows() const {
unsigned int DisplayWindowUnion::nWindows() const {
return _nWindowsDisplayed;
}
void Display::addWindow() {
void DisplayWindowUnion::addWindow() {
if (_nWindowsDisplayed < _nMaxWindows) {
_windowControl[_nWindowsDisplayed]->resetToDefaults();
_nWindowsDisplayed++;
@@ -105,14 +105,14 @@ void Display::addWindow() {
}
}
void Display::removeWindow() {
void DisplayWindowUnion::removeWindow() {
if (_nWindowsDisplayed > 1) {
_nWindowsDisplayed--;
showWindows();
}
}
void Display::showWindows() {
void DisplayWindowUnion::showWindows() {
for (size_t i = 0; i < _layoutWindowWrappers.size(); ++i) {
_layoutWindowWrappers[i]->setVisible(i < _nWindowsDisplayed);
}
@@ -127,7 +127,7 @@ void Display::showWindows() {
_monBox->setNumWindowsDisplayed(_nWindowsDisplayed);
}
void Display::initializeWindowControl() {
void DisplayWindowUnion::initializeWindowControl() {
if (_nWindowsAllocated < _nMaxWindows) {
unsigned int monitorNumForThisWindow = 0;
if (_nMaxWindows > 3 && _nWindowsAllocated >= 2) {
@@ -24,7 +24,7 @@
#include "sgctedit/orientationdialog.h"
#include "sgctedit/display.h"
#include "sgctedit/displaywindowunion.h"
OrientationDialog::OrientationDialog(sgct::quat& orientation, QWidget* parent)
: QDialog(parent)
@@ -113,7 +113,7 @@ void SgctEdit::createWidgets() {
void SgctEdit::addDisplayLayout(QHBoxLayout* layout) {
_displayLayout = new QVBoxLayout;
_displayWidget = std::make_shared<Display>(
_displayWidget = std::make_shared<DisplayWindowUnion>(
_monBox,
_monitorSizeList,
_nMaxWindows,
@@ -25,7 +25,7 @@
#include "sgctedit/windowcontrol.h"
#include <ghoul/fmt.h>
#include "sgctedit/display.h"
#include "sgctedit/displaywindowunion.h"
#include "sgctedit/monitorbox.h"
const std::string ProjectionTypeNames[5] = {"Planar", "Fisheye", "Spherical Mirror",