19#include "ui_control3dview.h"
38#include <QStyledItemDelegate>
39#include <QStandardItemModel>
40#include <QColorDialog>
54 const QStringList& slFlags,
57,
m_pUi(new 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,
93 if(slFlags.contains(
"Data")) {
94 m_pUi->m_treeView_loadedData->show();
96 m_pUi->m_treeView_loadedData->hide();
99 if(slFlags.contains(
"View")) {
100 m_pUi->m_groupBox_viewOptions->show();
102 connect(
m_pUi->m_pushButton_sceneColorPicker,
static_cast<void (QPushButton::*)(
bool)
>(&QPushButton::clicked),
104 connect(
m_pUi->m_checkBox_showFullScreen, &QCheckBox::clicked,
107 connect(
m_pUi->m_checkBox_rotate, &QCheckBox::clicked,
110 connect(
m_pUi->m_checkBox_coordAxis, &QCheckBox::clicked,
113 connect(
m_pUi->m_pushButton_takeScreenshot,
static_cast<void (QPushButton::*)(
bool)
>(&QPushButton::clicked),
116 connect(
m_pUi->m_radioButton_single, &QRadioButton::pressed,
119 connect(
m_pUi->m_radioButton_multi, &QRadioButton::pressed,
122 m_pUi->m_groupBox_viewOptions->hide();
125 if(slFlags.contains(
"Light")) {
126 m_pUi->m_groupBox_lightOptions->show();
128 connect(
m_pUi->m_pushButton_lightColorPicker,
static_cast<void (QPushButton::*)(
bool)
>(&QPushButton::clicked),
130 connect(
m_pUi->m_doubleSpinBox_colorIntensity,
static_cast<void (QDoubleSpinBox::*)(
double)
>(&QDoubleSpinBox::valueChanged),
133 m_pUi->m_groupBox_lightOptions->hide();
142 m_pUi->m_treeView_loadedData->setItemDelegate(pItemDelegate);
143 m_pUi->m_treeView_loadedData->setHeaderHidden(
false);
144 m_pUi->m_treeView_loadedData->setEditTriggers(QAbstractItemView::CurrentChanged);
152 m_pUi->m_treeView_loadedData->setModel(pDataTreeModel);
162 if(!
m_pUi->m_treeView_loadedData->isHeaderHidden()) {
163 m_pUi->m_treeView_loadedData->setHeaderHidden(
true);
165 m_pUi->m_treeView_loadedData->setHeaderHidden(
false);
173 if(index.isValid()) {
174 m_pUi->m_treeView_loadedData->model()->removeRow(index.row(), index.parent());
182 if(
m_pUi->m_treeView_loadedData->isColumnHidden(1)) {
183 m_pUi->m_treeView_loadedData->setColumnHidden(1,
false);
185 m_pUi->m_treeView_loadedData->setColumnHidden(1,
true);
198 QSettings settings(
"MNECPP");
210 QSettings settings(
"MNECPP");
241 this->setWindowOpacity(1/(100.0/value));
248 QColorDialog* pDialog =
new QColorDialog(
this);
252 connect(pDialog, &QColorDialog::currentColorChanged,
267 QMenu *menu =
new QMenu(
this);
270 QAction* pHideHeader = menu->addAction(tr(
"Toggle header"));
271 connect(pHideHeader, &QAction::triggered,
275 QAction* pRemoveItem = menu->addAction(tr(
"Remove"));
276 connect(pRemoveItem, &QAction::triggered, [=,
this]() {
277 if (QMessageBox::question(
this,
279 tr(
"Are you sure you want to delete the item?")) == QMessageBox::Yes) {
289 menu->popup(
m_pUi->m_treeView_loadedData->viewport()->mapToGlobal(pos));
297 this->setWindowFlags(this->windowFlags() | Qt::WindowStaysOnTopHint);
300 this->setWindowFlags(this->windowFlags() & ~Qt::WindowStaysOnTopHint);
337 QColorDialog* pDialog =
new QColorDialog(
this);
341 connect(pDialog, &QColorDialog::currentColorChanged,
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)
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)
Ui::Control3DViewWidget * m_pUi
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()