19#include "ui_control3dview.h"
38#include <QStyledItemDelegate>
39#include <QStandardItemModel>
40#include <QColorDialog>
54 const QStringList& slFlags,
57,
m_pUi(std::make_unique<Ui::Control3DViewWidget>())
67 m_pUi->m_pushButton_sceneColorPicker->setStyleSheet(QString(
"background-color: rgb(0, 0, 0);"));
68 m_pUi->m_pushButton_lightColorPicker->setStyleSheet(QString(
"background-color: rgb(255, 255, 255);"));
73 m_pUi->m_treeView_loadedData->setContextMenuPolicy(Qt::CustomContextMenu);
74 connect(
m_pUi->m_treeView_loadedData, &QWidget::customContextMenuRequested,
92 if (slFlags.contains(
"Data")) {
93 m_pUi->m_treeView_loadedData->show();
95 m_pUi->m_treeView_loadedData->hide();
98 if (slFlags.contains(
"View")) {
99 m_pUi->m_groupBox_viewOptions->show();
101 connect(
m_pUi->m_pushButton_sceneColorPicker,
static_cast<void (QPushButton::*)(
bool)
>(&QPushButton::clicked),
103 connect(
m_pUi->m_checkBox_showFullScreen, &QCheckBox::clicked,
106 connect(
m_pUi->m_checkBox_rotate, &QCheckBox::clicked,
109 connect(
m_pUi->m_checkBox_coordAxis, &QCheckBox::clicked,
112 connect(
m_pUi->m_pushButton_takeScreenshot,
static_cast<void (QPushButton::*)(
bool)
>(&QPushButton::clicked),
115 connect(
m_pUi->m_radioButton_single, &QRadioButton::pressed,
118 connect(
m_pUi->m_radioButton_multi, &QRadioButton::pressed,
121 m_pUi->m_groupBox_viewOptions->hide();
124 if (slFlags.contains(
"Light")) {
125 m_pUi->m_groupBox_lightOptions->show();
127 connect(
m_pUi->m_pushButton_lightColorPicker,
static_cast<void (QPushButton::*)(
bool)
>(&QPushButton::clicked),
129 connect(
m_pUi->m_doubleSpinBox_colorIntensity,
static_cast<void (QDoubleSpinBox::*)(
double)
>(&QDoubleSpinBox::valueChanged),
132 m_pUi->m_groupBox_lightOptions->hide();
141 m_pUi->m_treeView_loadedData->setItemDelegate(pItemDelegate);
142 m_pUi->m_treeView_loadedData->setHeaderHidden(
false);
143 m_pUi->m_treeView_loadedData->setEditTriggers(QAbstractItemView::CurrentChanged);
151 m_pUi->m_treeView_loadedData->setModel(pDataTreeModel);
161 if (!
m_pUi->m_treeView_loadedData->isHeaderHidden()) {
162 m_pUi->m_treeView_loadedData->setHeaderHidden(
true);
164 m_pUi->m_treeView_loadedData->setHeaderHidden(
false);
172 if (index.isValid()) {
173 m_pUi->m_treeView_loadedData->model()->removeRow(index.row(), index.parent());
181 if (
m_pUi->m_treeView_loadedData->isColumnHidden(1)) {
182 m_pUi->m_treeView_loadedData->setColumnHidden(1,
false);
184 m_pUi->m_treeView_loadedData->setColumnHidden(1,
true);
197 QSettings settings(
"MNECPP");
209 QSettings settings(
"MNECPP");
240 this->setWindowOpacity(1 / (100.0 / value));
250 connect(&dialog, &QColorDialog::currentColorChanged,
253 if (dialog.exec() == QDialog::Accepted) {
268 QMenu* menu =
new QMenu(
this);
269 menu->setAttribute(Qt::WA_DeleteOnClose);
272 QAction* pHideHeader = menu->addAction(tr(
"Toggle header"));
273 connect(pHideHeader, &QAction::triggered,
277 QAction* pRemoveItem = menu->addAction(tr(
"Remove"));
278 connect(pRemoveItem, &QAction::triggered, [=,
this]() {
279 if (QMessageBox::question(
this,
281 tr(
"Are you sure you want to delete the item?")) == QMessageBox::Yes) {
291 menu->popup(
m_pUi->m_treeView_loadedData->viewport()->mapToGlobal(pos));
299 this->setWindowFlags(this->windowFlags() | Qt::WindowStaysOnTopHint);
302 this->setWindowFlags(this->windowFlags() & ~Qt::WindowStaysOnTopHint);
342 connect(&dialog, &QColorDialog::currentColorChanged,
345 if (dialog.exec() == QDialog::Accepted) {
Tree-based control panel for the 3-D scene (visibility, colour, alpha, threshold per tree item).
2-D display widgets and visualisation helpers (charts, topography, colour maps).
AbstractView(QWidget *parent=0, Qt::WindowFlags f=Qt::Widget)
std::unique_ptr< Ui::Control3DViewWidget > m_pUi
void setDelegate(QStyledItemDelegate *pItemDelegate)
void sceneColorChanged(const QColor &color)
Control3DView(const QString &sSettingsPath="", QWidget *parent=0, const QStringList &slFlags=QStringList()<< "Data"<< "View"<< "Light", Qt::WindowType type=Qt::Widget)
void showFullScreen(bool bShowFullScreen)
void onSceneColorChanged(const QColor &color)
void setFlags(const QStringList &slFlags)
QColor m_colCurrentLightColor
void onOpacityChange(qint32 value)
void onTreeViewDescriptionHide()
void rotationChanged(bool bRotationChanged)
void onTreeViewHeaderHide()
void updateGuiMode(GuiMode mode)
void onCoordAxisClicked(bool checked)
void onLightColorPicker()
void onCustomContextMenuRequested(QPoint pos)
customContextMenuRequested
void updateProcessingMode(ProcessingMode mode)
QColor m_colCurrentSceneColor
void onTreeViewRemoveItem(const QModelIndex &index)
void lightIntensityChanged(double value)
void onRotationClicked(bool checked)
void onShowFullScreen(bool checked)
void showCoordAxis(bool bShowCoordAxis)
void onAlwaysOnTop(bool state)
void takeScreenshotChanged()
void lightColorChanged(const QColor &color)
void onLightColorChanged(const QColor &color)
void setModel(QStandardItemModel *pDataTreeModel)
void onLightIntensityChanged(double value)
void onSceneColorPicker()