Compare commits
No commits in common. "d14e69682ee7e32e8262dcb7108166a3e43364f1" and "bb71bfb65237a0ad5370578d8d3ff2c996962a5a" have entirely different histories.
d14e69682e
...
bb71bfb652
@ -14,25 +14,6 @@ SurfacePanel::SurfacePanel(int index, const QString& filePath, QWidget* parent)
|
|||||||
m_iMinY = 0; m_iMaxY = 0;
|
m_iMinY = 0; m_iMaxY = 0;
|
||||||
m_iMinZ = 0; m_iMaxZ = 0;
|
m_iMinZ = 0; m_iMaxZ = 0;
|
||||||
|
|
||||||
m_surfaceContainer = nullptr;
|
|
||||||
m_surface = nullptr;
|
|
||||||
m_p3DXAxis = nullptr;
|
|
||||||
m_p3DYAxis = nullptr;
|
|
||||||
m_p3DZAxis = nullptr;
|
|
||||||
m_pSeries = nullptr;
|
|
||||||
|
|
||||||
m_countX = 0;
|
|
||||||
m_countY = 0;
|
|
||||||
m_countZ = 0;
|
|
||||||
|
|
||||||
m_xTitle = "";
|
|
||||||
m_yTitle = "";
|
|
||||||
m_zTitle = "";
|
|
||||||
|
|
||||||
m_time = -1.0;
|
|
||||||
|
|
||||||
m_thread = nullptr;
|
|
||||||
|
|
||||||
LOG_INFO("Created SurfacePanel {} for file: {}", index, filePath.toStdString());
|
LOG_INFO("Created SurfacePanel {} for file: {}", index, filePath.toStdString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -43,25 +24,6 @@ SurfacePanel::SurfacePanel(int index, std::shared_ptr<FileEntrySurface> fileEntr
|
|||||||
m_iMinY = 0; m_iMaxY = 0;
|
m_iMinY = 0; m_iMaxY = 0;
|
||||||
m_iMinZ = 0; m_iMaxZ = 0;
|
m_iMinZ = 0; m_iMaxZ = 0;
|
||||||
|
|
||||||
m_surfaceContainer = nullptr;
|
|
||||||
m_surface = nullptr;
|
|
||||||
m_p3DXAxis = nullptr;
|
|
||||||
m_p3DYAxis = nullptr;
|
|
||||||
m_p3DZAxis = nullptr;
|
|
||||||
m_pSeries = nullptr;
|
|
||||||
|
|
||||||
m_countX = 0;
|
|
||||||
m_countY = 0;
|
|
||||||
m_countZ = 0;
|
|
||||||
|
|
||||||
m_xTitle = "";
|
|
||||||
m_yTitle = "";
|
|
||||||
m_zTitle = "";
|
|
||||||
|
|
||||||
m_time = -1.0;
|
|
||||||
|
|
||||||
m_thread = nullptr;
|
|
||||||
|
|
||||||
if (fileEntry) {
|
if (fileEntry) {
|
||||||
LOG_INFO("Created SurfacePanel {} for chart: {}", index, fileEntry->GetName().toStdString());
|
LOG_INFO("Created SurfacePanel {} for chart: {}", index, fileEntry->GetName().toStdString());
|
||||||
// Override the title with chart name
|
// Override the title with chart name
|
||||||
@ -75,50 +37,6 @@ SurfacePanel::SurfacePanel(int index, std::shared_ptr<FileEntrySurface> fileEntr
|
|||||||
SurfacePanel::~SurfacePanel()
|
SurfacePanel::~SurfacePanel()
|
||||||
{
|
{
|
||||||
LOG_INFO("Destroyed SurfacePanel {}", GetIndex());
|
LOG_INFO("Destroyed SurfacePanel {}", GetIndex());
|
||||||
|
|
||||||
if (m_pSeries)
|
|
||||||
{
|
|
||||||
m_surface->removeSeries(m_pSeries);
|
|
||||||
m_pSeries->deleteLater();
|
|
||||||
m_pSeries = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_surface)
|
|
||||||
{
|
|
||||||
m_surface->deleteLater();
|
|
||||||
m_surface = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_surfaceContainer)
|
|
||||||
{
|
|
||||||
m_surfaceContainer->deleteLater();
|
|
||||||
m_surfaceContainer = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (auto* layout = qobject_cast<QHBoxLayout*>(this->layout()))
|
|
||||||
{
|
|
||||||
while (layout->count() > 0)
|
|
||||||
{
|
|
||||||
QLayoutItem* item = layout->takeAt(0);
|
|
||||||
if (item)
|
|
||||||
{
|
|
||||||
delete item;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_mutex)
|
|
||||||
{
|
|
||||||
delete m_mutex;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_thread)
|
|
||||||
{
|
|
||||||
m_thread->requestExit();
|
|
||||||
m_thread->wait();
|
|
||||||
m_thread->deleteLater();
|
|
||||||
m_thread = nullptr;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SurfacePanel::RefreshPanel()
|
void SurfacePanel::RefreshPanel()
|
||||||
@ -135,14 +53,51 @@ void SurfacePanel::RefreshPanel()
|
|||||||
|
|
||||||
void SurfacePanel::InitUI()
|
void SurfacePanel::InitUI()
|
||||||
{
|
{
|
||||||
createSurface();
|
m_Surface.setFlags(m_Surface.flags());
|
||||||
|
m_Surface.setFlipHorizontalGrid(false);
|
||||||
|
|
||||||
|
m_p3DXAxis = new QValue3DAxis;
|
||||||
|
m_p3DXAxis->setSegmentCount(10);
|
||||||
|
m_p3DXAxis->setRange(-10, 10);
|
||||||
|
|
||||||
|
m_p3DYAxis = new QValue3DAxis;
|
||||||
|
m_p3DYAxis->setSegmentCount(10);
|
||||||
|
m_p3DYAxis->setRange(-10, 10);
|
||||||
|
|
||||||
|
m_p3DZAxis = new QValue3DAxis;
|
||||||
|
m_p3DZAxis->setSegmentCount(10);
|
||||||
|
m_p3DZAxis->setRange(-10, 10);
|
||||||
|
|
||||||
|
m_Surface.setAxisX(m_p3DXAxis);
|
||||||
|
m_Surface.setAxisY(m_p3DYAxis);
|
||||||
|
m_Surface.setAxisZ(m_p3DZAxis);
|
||||||
|
|
||||||
|
m_Surface.activeTheme()->setType(Q3DTheme::Theme(2));
|
||||||
|
|
||||||
|
m_pSeries = new QSurface3DSeries;
|
||||||
|
m_pSeries->setDrawMode(QSurface3DSeries::DrawSurface);
|
||||||
|
m_Surface.addSeries(m_pSeries);
|
||||||
|
|
||||||
|
QWidget* containerHandle = QWidget::createWindowContainer(&m_Surface);
|
||||||
|
containerHandle->setAutoFillBackground(true);
|
||||||
|
containerHandle->setAttribute(Qt::WA_OpaquePaintEvent, true);
|
||||||
|
containerHandle->setAttribute(Qt::WA_NoSystemBackground, false);
|
||||||
|
containerHandle->setUpdatesEnabled(false);
|
||||||
|
containerHandle->setMinimumHeight(100);
|
||||||
|
|
||||||
|
m_pSeries->setBaseColor(Qt::green);
|
||||||
|
m_pSeries->setColorStyle(Q3DTheme::ColorStyleUniform);
|
||||||
|
m_pSeries->setSingleHighlightColor(Qt::green);
|
||||||
|
|
||||||
|
m_pSeries->setMeshSmooth(false);
|
||||||
|
m_pSeries->setFlatShadingEnabled(false);
|
||||||
|
|
||||||
|
m_Surface.scene()->activeCamera()->setCameraPreset(Q3DCamera::CameraPreset(13));
|
||||||
|
|
||||||
QHBoxLayout* mainLayout = new QHBoxLayout(this);
|
QHBoxLayout* mainLayout = new QHBoxLayout(this);
|
||||||
mainLayout->setContentsMargins(0, 0, 0, 0);
|
mainLayout->setContentsMargins(0, 0, 0, 0);
|
||||||
mainLayout->addWidget(m_surfaceContainer);
|
mainLayout->addWidget(containerHandle);
|
||||||
setLayout(mainLayout);
|
setLayout(mainLayout);
|
||||||
|
|
||||||
m_mutex = new QMutex;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
QString SurfacePanel::GetTypeDisplayName() const
|
QString SurfacePanel::GetTypeDisplayName() const
|
||||||
@ -169,12 +124,6 @@ void SurfacePanel::OnDataPanelUpdated(FileEntrySurface* fileEntry)
|
|||||||
|
|
||||||
void SurfacePanel::OnTimeChanged(double time)
|
void SurfacePanel::OnTimeChanged(double time)
|
||||||
{
|
{
|
||||||
m_time = time;
|
|
||||||
|
|
||||||
if (m_surface)
|
|
||||||
{
|
|
||||||
QMutexLocker locker(m_mutex);
|
|
||||||
|
|
||||||
if (m_data.size() > 0)
|
if (m_data.size() > 0)
|
||||||
{
|
{
|
||||||
m_pSeries->dataProxy()->resetArray(nullptr);
|
m_pSeries->dataProxy()->resetArray(nullptr);
|
||||||
@ -211,8 +160,7 @@ void SurfacePanel::OnTimeChanged(double time)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
m_surface->setShadowQuality(QAbstract3DGraph::ShadowQuality::ShadowQualityNone);
|
m_Surface.setShadowQuality(QAbstract3DGraph::ShadowQuality::ShadowQualityNone);
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void SurfacePanel::updateTitle(const QString & title)
|
void SurfacePanel::updateTitle(const QString & title)
|
||||||
@ -220,18 +168,11 @@ void SurfacePanel::updateTitle(const QString & title)
|
|||||||
if (nullptr != dockWidget_)
|
if (nullptr != dockWidget_)
|
||||||
{
|
{
|
||||||
dockWidget_->setWindowTitle(title);
|
dockWidget_->setWindowTitle(title);
|
||||||
|
|
||||||
connect(dockWidget_, &QDockWidget::visibilityChanged,
|
|
||||||
this, &SurfacePanel::onVisibilityChanged);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
void SurfacePanel::updateTitleAxis(const QString & xTitle, const QString & yTitle, const QString & zTitle)
|
void SurfacePanel::updateTitleAxis(const QString & xTitle, const QString & yTitle, const QString & zTitle)
|
||||||
{
|
{
|
||||||
m_xTitle = xTitle;
|
|
||||||
m_yTitle = yTitle;
|
|
||||||
m_zTitle = zTitle;
|
|
||||||
|
|
||||||
m_p3DXAxis->setTitle(xTitle);
|
m_p3DXAxis->setTitle(xTitle);
|
||||||
m_p3DXAxis->setTitleVisible(true);
|
m_p3DXAxis->setTitleVisible(true);
|
||||||
m_p3DYAxis->setTitle(yTitle);
|
m_p3DYAxis->setTitle(yTitle);
|
||||||
@ -249,7 +190,6 @@ void SurfacePanel::updateMinMaxX(float min, float max, int count)
|
|||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
m_countX = count;
|
|
||||||
m_p3DXAxis->setSegmentCount(count);
|
m_p3DXAxis->setSegmentCount(count);
|
||||||
}
|
}
|
||||||
m_p3DXAxis->setRange(min, max);
|
m_p3DXAxis->setRange(min, max);
|
||||||
@ -265,7 +205,6 @@ void SurfacePanel::updateMinMaxY(float min, float max, int count)
|
|||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
m_countY = count;
|
|
||||||
m_p3DYAxis->setSegmentCount(count);
|
m_p3DYAxis->setSegmentCount(count);
|
||||||
}
|
}
|
||||||
m_p3DYAxis->setRange(min, max);
|
m_p3DYAxis->setRange(min, max);
|
||||||
@ -281,7 +220,6 @@ void SurfacePanel::updateMinMaxZ(float min, float max, int count)
|
|||||||
|
|
||||||
if (count > 0)
|
if (count > 0)
|
||||||
{
|
{
|
||||||
m_countZ = count;
|
|
||||||
m_p3DZAxis->setSegmentCount(count);
|
m_p3DZAxis->setSegmentCount(count);
|
||||||
}
|
}
|
||||||
m_p3DZAxis->setRange(min, max);
|
m_p3DZAxis->setRange(min, max);
|
||||||
@ -296,18 +234,16 @@ void SurfacePanel::updateParseFile(const QString & strFile, int nT, FileEntrySur
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
|
||||||
QMutexLocker locker(m_mutex);
|
|
||||||
m_data.clear();
|
m_data.clear();
|
||||||
m_pSeries->dataProxy()->resetArray(nullptr);
|
m_pSeries->dataProxy()->resetArray(nullptr);
|
||||||
}
|
|
||||||
|
|
||||||
|
QFile file(strFile);
|
||||||
|
if (file.open(QIODevice::ReadOnly))
|
||||||
|
{
|
||||||
for (int nI = 0; nI < listCurve.size(); nI++)
|
for (int nI = 0; nI < listCurve.size(); nI++)
|
||||||
{
|
{
|
||||||
FileEntrySurface::SurfaceProperty surface = listCurve.at(nI);
|
FileEntrySurface::SurfaceProperty surface = listCurve.at(nI);
|
||||||
|
|
||||||
m_color = surface.color;
|
|
||||||
|
|
||||||
QLinearGradient gr;
|
QLinearGradient gr;
|
||||||
gr.setColorAt(0.0, surface.color);
|
gr.setColorAt(0.0, surface.color);
|
||||||
gr.setColorAt(0.5, Qt::yellow);
|
gr.setColorAt(0.5, Qt::yellow);
|
||||||
@ -319,213 +255,34 @@ void SurfacePanel::updateParseFile(const QString & strFile, int nT, FileEntrySur
|
|||||||
//m_pSeries->setSingleHighlightColor(Qt::green);
|
//m_pSeries->setSingleHighlightColor(Qt::green);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_thread)
|
bool bResetAxisX = false;
|
||||||
{
|
|
||||||
m_thread->requestExit();
|
|
||||||
m_thread->wait();
|
|
||||||
m_thread->deleteLater();
|
|
||||||
m_thread = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
m_thread = new LoadDataThread(this, strFile, nT, listCurve);
|
|
||||||
m_thread->setMutex(m_mutex);
|
|
||||||
m_thread->start();
|
|
||||||
|
|
||||||
FinalParseFile();
|
|
||||||
}
|
|
||||||
|
|
||||||
void SurfacePanel::onVisibilityChanged(bool visible)
|
|
||||||
{
|
|
||||||
if (visible)
|
|
||||||
{
|
|
||||||
if (!m_surfaceContainer)
|
|
||||||
{
|
|
||||||
createSurface();
|
|
||||||
|
|
||||||
updateTitleAxis(m_xTitle, m_yTitle, m_zTitle);
|
|
||||||
|
|
||||||
if (m_iMaxX == m_iMinX)
|
if (m_iMaxX == m_iMinX)
|
||||||
{
|
{
|
||||||
m_p3DXAxis->setAutoAdjustRange(true);
|
bResetAxisX = true;
|
||||||
}
|
}
|
||||||
else
|
bool bResetAxisY = false;
|
||||||
{
|
|
||||||
updateMinMaxX(m_iMinX, m_iMaxX, m_countX);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_iMaxZ == m_iMinZ)
|
if (m_iMaxZ == m_iMinZ)
|
||||||
{
|
{
|
||||||
m_p3DZAxis->setAutoAdjustRange(true);
|
bResetAxisY = true;
|
||||||
}
|
}
|
||||||
else
|
bool bResetAxisZ = false;
|
||||||
{
|
|
||||||
updateMinMaxZ(m_iMinZ, m_iMaxZ, m_countZ);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_iMaxY == m_iMinY)
|
if (m_iMaxY == m_iMinY)
|
||||||
{
|
{
|
||||||
m_p3DYAxis->setAutoAdjustRange(true);
|
bResetAxisZ = true;
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
updateMinMaxY(m_iMaxY, m_iMinY, m_countY);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
{
|
while (!file.atEnd())
|
||||||
QLinearGradient gr;
|
|
||||||
gr.setColorAt(0.0, m_color);
|
|
||||||
gr.setColorAt(0.5, Qt::yellow);
|
|
||||||
gr.setColorAt(0.8, Qt::red);
|
|
||||||
gr.setColorAt(1.0, Qt::darkRed);
|
|
||||||
|
|
||||||
m_pSeries->setBaseGradient(gr);
|
|
||||||
m_pSeries->setColorStyle(Q3DTheme::ColorStyleRangeGradient);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_surface->setHorizontalAspectRatio(1.0);
|
|
||||||
|
|
||||||
QHBoxLayout* layout = qobject_cast<QHBoxLayout*>(this->layout());
|
|
||||||
if (layout)
|
|
||||||
{
|
|
||||||
layout->addWidget(m_surfaceContainer);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_time > -1.0)
|
|
||||||
{
|
|
||||||
OnTimeChanged(m_time);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
|
||||||
if (m_pSeries)
|
|
||||||
{
|
|
||||||
m_surface->removeSeries(m_pSeries);
|
|
||||||
m_pSeries->deleteLater();
|
|
||||||
m_pSeries = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_surface)
|
|
||||||
{
|
|
||||||
m_surface->deleteLater();
|
|
||||||
m_surface = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (m_surfaceContainer)
|
|
||||||
{
|
|
||||||
m_surfaceContainer->deleteLater();
|
|
||||||
m_surfaceContainer = nullptr;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (auto* layout = qobject_cast<QHBoxLayout*>(this->layout()))
|
|
||||||
{
|
|
||||||
while (layout->count() > 0)
|
|
||||||
{
|
|
||||||
QLayoutItem* item = layout->takeAt(0);
|
|
||||||
if (item)
|
|
||||||
{
|
|
||||||
delete item;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void SurfacePanel::createSurface()
|
|
||||||
{
|
|
||||||
m_surface = new Q3DSurface();
|
|
||||||
m_surface->setFlags(m_surface->flags());
|
|
||||||
m_surface->setFlipHorizontalGrid(false);
|
|
||||||
|
|
||||||
m_p3DXAxis = new QValue3DAxis;
|
|
||||||
m_p3DXAxis->setSegmentCount(10);
|
|
||||||
m_p3DXAxis->setRange(-10, 10);
|
|
||||||
|
|
||||||
m_p3DYAxis = new QValue3DAxis;
|
|
||||||
m_p3DYAxis->setSegmentCount(10);
|
|
||||||
m_p3DYAxis->setRange(-10, 10);
|
|
||||||
|
|
||||||
m_p3DZAxis = new QValue3DAxis;
|
|
||||||
m_p3DZAxis->setSegmentCount(10);
|
|
||||||
m_p3DZAxis->setRange(-10, 10);
|
|
||||||
|
|
||||||
m_surface->setAxisX(m_p3DXAxis);
|
|
||||||
m_surface->setAxisY(m_p3DYAxis);
|
|
||||||
m_surface->setAxisZ(m_p3DZAxis);
|
|
||||||
|
|
||||||
m_surface->activeTheme()->setType(Q3DTheme::Theme(2));
|
|
||||||
|
|
||||||
m_pSeries = new QSurface3DSeries;
|
|
||||||
m_pSeries->setDrawMode(QSurface3DSeries::DrawSurface);
|
|
||||||
m_surface->addSeries(m_pSeries);
|
|
||||||
|
|
||||||
m_surfaceContainer = QWidget::createWindowContainer(m_surface);
|
|
||||||
m_surfaceContainer->setAutoFillBackground(true);
|
|
||||||
m_surfaceContainer->setAttribute(Qt::WA_OpaquePaintEvent, true);
|
|
||||||
m_surfaceContainer->setAttribute(Qt::WA_NoSystemBackground, false);
|
|
||||||
m_surfaceContainer->setUpdatesEnabled(true);
|
|
||||||
m_surfaceContainer->setMinimumHeight(100);
|
|
||||||
|
|
||||||
m_pSeries->setBaseColor(Qt::green);
|
|
||||||
m_pSeries->setColorStyle(Q3DTheme::ColorStyleUniform);
|
|
||||||
m_pSeries->setSingleHighlightColor(Qt::green);
|
|
||||||
|
|
||||||
m_pSeries->setMeshSmooth(false);
|
|
||||||
m_pSeries->setFlatShadingEnabled(false);
|
|
||||||
|
|
||||||
m_surface->scene()->activeCamera()->setCameraPreset(Q3DCamera::CameraPreset(13));
|
|
||||||
}
|
|
||||||
|
|
||||||
void SurfacePanel::FinalParseFile()
|
|
||||||
{
|
|
||||||
if (m_iMaxX == m_iMinX)
|
|
||||||
{
|
|
||||||
m_p3DXAxis->setAutoAdjustRange(true);
|
|
||||||
}
|
|
||||||
if (m_iMaxZ == m_iMinZ)
|
|
||||||
{
|
|
||||||
m_p3DZAxis->setAutoAdjustRange(true);
|
|
||||||
}
|
|
||||||
if (m_iMaxY == m_iMinY)
|
|
||||||
{
|
|
||||||
m_p3DYAxis->setAutoAdjustRange(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
m_surface->setHorizontalAspectRatio(1.0);
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
LoadDataThread::LoadDataThread(SurfacePanel *panel, QString file, int nT, FileEntrySurface::SurfaceProperties listCurve)
|
|
||||||
{
|
|
||||||
m_panel = panel;
|
|
||||||
m_file = file;
|
|
||||||
m_nT = nT;
|
|
||||||
m_listCurve = listCurve;
|
|
||||||
m_exit = false;
|
|
||||||
}
|
|
||||||
|
|
||||||
void LoadDataThread::run()
|
|
||||||
{
|
|
||||||
QFile file(m_file);
|
|
||||||
if (file.open(QIODevice::ReadOnly))
|
|
||||||
{
|
|
||||||
while (!file.atEnd() && !m_exit)
|
|
||||||
{
|
{
|
||||||
QString strLine = file.readLine().simplified();
|
QString strLine = file.readLine().simplified();
|
||||||
if (!strLine.isEmpty())
|
if (!strLine.isEmpty())
|
||||||
{
|
{
|
||||||
QStringList listLine = strLine.split(" ");
|
QStringList listLine = strLine.split(" ");
|
||||||
double t = listLine.at(m_nT).toDouble();
|
double t = listLine.at(nT).toDouble();
|
||||||
|
|
||||||
QMap< int, QVector< QVector<QVector3D> > > mapData;
|
QMap< int, QVector< QVector<QVector3D> > > mapData;
|
||||||
for (int nI = 0; nI < m_listCurve.size(); nI++)
|
for (int nI = 0; nI < listCurve.size(); nI++)
|
||||||
{
|
{
|
||||||
if (m_exit)
|
FileEntrySurface::SurfaceProperty surface = listCurve.at(nI);
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
FileEntrySurface::SurfaceProperty surface = m_listCurve.at(nI);
|
|
||||||
int nStart = surface.start;
|
int nStart = surface.start;
|
||||||
int nStop = surface.stop;
|
int nStop = surface.stop;
|
||||||
if (nStart == 0)
|
if (nStart == 0)
|
||||||
@ -548,11 +305,6 @@ void LoadDataThread::run()
|
|||||||
int nCol = 0;
|
int nCol = 0;
|
||||||
for (int nJ = nStart; nJ < nStop; nJ += 3)
|
for (int nJ = nStart; nJ < nStop; nJ += 3)
|
||||||
{
|
{
|
||||||
if (m_exit)
|
|
||||||
{
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
|
|
||||||
int x = listLine.at(nJ).toDouble();
|
int x = listLine.at(nJ).toDouble();
|
||||||
int y = listLine.at(nJ + 1).toDouble();
|
int y = listLine.at(nJ + 1).toDouble();
|
||||||
double z = listLine.at(nJ + 2).toDouble();
|
double z = listLine.at(nJ + 2).toDouble();
|
||||||
@ -616,14 +368,25 @@ void LoadDataThread::run()
|
|||||||
}
|
}
|
||||||
mapData.insert(nI, listRowData);
|
mapData.insert(nI, listRowData);
|
||||||
}
|
}
|
||||||
|
m_data.insert(t, mapData);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
if (m_iMaxX == m_iMinX)
|
||||||
{
|
{
|
||||||
QMutexLocker locker(m_mutex);
|
m_p3DXAxis->setAutoAdjustRange(true);
|
||||||
m_panel->m_data.insert(t, mapData);
|
|
||||||
}
|
}
|
||||||
|
if (m_iMaxZ == m_iMinZ)
|
||||||
|
{
|
||||||
|
m_p3DZAxis->setAutoAdjustRange(true);
|
||||||
}
|
}
|
||||||
|
if (m_iMaxY == m_iMinY)
|
||||||
|
{
|
||||||
|
m_p3DYAxis->setAutoAdjustRange(true);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
m_Surface.setHorizontalAspectRatio(1.0);
|
||||||
|
|
||||||
file.close();
|
file.close();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -6,12 +6,9 @@
|
|||||||
|
|
||||||
#include <Q3DSurface>
|
#include <Q3DSurface>
|
||||||
#include <QValue3DAxis>
|
#include <QValue3DAxis>
|
||||||
#include <QMutex>
|
|
||||||
|
|
||||||
using namespace QtDataVisualization;
|
using namespace QtDataVisualization;
|
||||||
|
|
||||||
class LoadDataThread;
|
|
||||||
|
|
||||||
class SurfacePanel : public DataPanel
|
class SurfacePanel : public DataPanel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
@ -49,8 +46,6 @@ public:
|
|||||||
*/
|
*/
|
||||||
void RefreshPanel() override;
|
void RefreshPanel() override;
|
||||||
|
|
||||||
void FinalParseFile();
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/**
|
/**
|
||||||
* @brief Initialize UI for curve-specific layout
|
* @brief Initialize UI for curve-specific layout
|
||||||
@ -75,12 +70,8 @@ private:
|
|||||||
void updateMinMaxZ(float min, float max, int count);
|
void updateMinMaxZ(float min, float max, int count);
|
||||||
void updateParseFile(const QString& strFile, int nT, FileEntrySurface::SurfaceProperties listCurve);
|
void updateParseFile(const QString& strFile, int nT, FileEntrySurface::SurfaceProperties listCurve);
|
||||||
|
|
||||||
void onVisibilityChanged(bool visible);
|
|
||||||
void createSurface();
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
Q3DSurface *m_surface;
|
Q3DSurface m_Surface;
|
||||||
QWidget *m_surfaceContainer;
|
|
||||||
|
|
||||||
QSurface3DSeries* m_pSeries;
|
QSurface3DSeries* m_pSeries;
|
||||||
|
|
||||||
@ -95,46 +86,6 @@ private:
|
|||||||
float m_iMinZ = 0;
|
float m_iMinZ = 0;
|
||||||
float m_iMaxZ = 10;
|
float m_iMaxZ = 10;
|
||||||
|
|
||||||
int m_countX;
|
|
||||||
int m_countY;
|
|
||||||
int m_countZ;
|
|
||||||
|
|
||||||
QString m_xTitle;
|
|
||||||
QString m_yTitle;
|
|
||||||
QString m_zTitle;
|
|
||||||
|
|
||||||
QColor m_color;
|
|
||||||
|
|
||||||
double m_time;
|
|
||||||
|
|
||||||
QMutex *m_mutex;
|
|
||||||
LoadDataThread *m_thread;
|
|
||||||
|
|
||||||
public:
|
|
||||||
QMap< double, QMap< int, QVector< QVector<QVector3D> > > > m_data;
|
QMap< double, QMap< int, QVector< QVector<QVector3D> > > > m_data;
|
||||||
};
|
};
|
||||||
|
|
||||||
#include <QThread>
|
|
||||||
class LoadDataThread : public QThread
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
LoadDataThread(SurfacePanel *panel, QString file, int nT, FileEntrySurface::SurfaceProperties listCurve);
|
|
||||||
virtual void run();
|
|
||||||
|
|
||||||
void setMutex(QMutex *mutex)
|
|
||||||
{
|
|
||||||
m_mutex = mutex;
|
|
||||||
}
|
|
||||||
|
|
||||||
void requestExit() { m_exit = true; }
|
|
||||||
|
|
||||||
private:
|
|
||||||
SurfacePanel *m_panel;
|
|
||||||
QString m_file;
|
|
||||||
int m_nT;
|
|
||||||
FileEntrySurface::SurfaceProperties m_listCurve;
|
|
||||||
QMutex *m_mutex;
|
|
||||||
bool m_exit;
|
|
||||||
};
|
|
||||||
File diff suppressed because it is too large
Load Diff
@ -38,7 +38,6 @@ private:
|
|||||||
private:
|
private:
|
||||||
class QtTreePropertyBrowser* browser_{ nullptr };
|
class QtTreePropertyBrowser* browser_{ nullptr };
|
||||||
|
|
||||||
class QtEnumPropertyManager* enumManager_{ nullptr };
|
|
||||||
class QtIntPropertyManager* intManager_{ nullptr };
|
class QtIntPropertyManager* intManager_{ nullptr };
|
||||||
class QtBoolPropertyManager* boolManager_{ nullptr };
|
class QtBoolPropertyManager* boolManager_{ nullptr };
|
||||||
class QtDoublePropertyManager* doubleManager_{ nullptr };
|
class QtDoublePropertyManager* doubleManager_{ nullptr };
|
||||||
@ -67,8 +66,5 @@ private:
|
|||||||
|
|
||||||
// Write-back hooks for color properties
|
// Write-back hooks for color properties
|
||||||
QMap<class QtProperty*, std::function<void(const QColor&)>> colorSetters_;
|
QMap<class QtProperty*, std::function<void(const QColor&)>> colorSetters_;
|
||||||
QMap<class QtProperty*, std::function<void(const QString&)>> stringSetters_;
|
|
||||||
QMap<class QtProperty*, std::function<void(const int&)>> intSetters_;
|
|
||||||
QMap<class QtProperty*, std::function<void(const double&)>> doubleSetters_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@ -21,9 +21,9 @@ void CommandExecutor::Execute(WorkSpace* ws, WorkSpace::CommandWhen when) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
//if (!cmd_.rawArgs.isEmpty()) {
|
if (!cmd_.rawArgs.isEmpty()) {
|
||||||
// pushArgs(cmd_.rawArgs);
|
pushArgs(cmd_.rawArgs);
|
||||||
//}
|
}
|
||||||
|
|
||||||
const QString programLower = cmd_.program.toLower();
|
const QString programLower = cmd_.program.toLower();
|
||||||
if (!cmd_.path.isEmpty()) {
|
if (!cmd_.path.isEmpty()) {
|
||||||
|
|||||||
@ -469,13 +469,6 @@ bool FileEntryTable::ParseFiles(const tinyxml2::XMLElement * element)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileEntryCurve::SetCurveProperty(int index, const CurveProperty & prop)
|
|
||||||
{
|
|
||||||
if (index >= 0 && index < curveProperties_.size()) {
|
|
||||||
curveProperties_[index] = prop;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// FileEntryCurve SaveFiles implementation
|
// FileEntryCurve SaveFiles implementation
|
||||||
bool FileEntryCurve::SaveFiles(tinyxml2::XMLElement* scene, tinyxml2::XMLDocument* doc) {
|
bool FileEntryCurve::SaveFiles(tinyxml2::XMLElement* scene, tinyxml2::XMLDocument* doc) {
|
||||||
if (!scene || !doc) {
|
if (!scene || !doc) {
|
||||||
@ -522,13 +515,6 @@ bool FileEntryCurve::SaveFiles(tinyxml2::XMLElement* scene, tinyxml2::XMLDocumen
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileEntryLight::SetLightProperty(int index, const LightRowProperty & prop)
|
|
||||||
{
|
|
||||||
if (index >= 0 && index < lightProperties_.size()) {
|
|
||||||
lightProperties_[index] = prop;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
// FileEntryLight SaveFiles implementation
|
// FileEntryLight SaveFiles implementation
|
||||||
bool FileEntryLight::SaveFiles(tinyxml2::XMLElement* scene, tinyxml2::XMLDocument* doc) {
|
bool FileEntryLight::SaveFiles(tinyxml2::XMLElement* scene, tinyxml2::XMLDocument* doc) {
|
||||||
if (!scene || !doc) {
|
if (!scene || !doc) {
|
||||||
@ -729,54 +715,6 @@ const FileEntryPolar::ChartProperties& FileEntryPolar::GetChartProperties() cons
|
|||||||
return chartProperties_;
|
return chartProperties_;
|
||||||
}
|
}
|
||||||
|
|
||||||
void FileEntryPolar::UpdateChartProperties(const QString & key, QVariant var)
|
|
||||||
{
|
|
||||||
if (key == "AngularCount")
|
|
||||||
{
|
|
||||||
chartProperties_.AngularCount = var.toInt();
|
|
||||||
}
|
|
||||||
else if (key == "RadialCount")
|
|
||||||
{
|
|
||||||
chartProperties_.RadialCount = var.toInt();
|
|
||||||
}
|
|
||||||
else if (key == "AngularTitle")
|
|
||||||
{
|
|
||||||
chartProperties_.AngularTitle = var.toString();
|
|
||||||
}
|
|
||||||
else if (key == "RadialTitle")
|
|
||||||
{
|
|
||||||
chartProperties_.RadialTitle = var.toString();
|
|
||||||
}
|
|
||||||
else if (key == "AngularMin")
|
|
||||||
{
|
|
||||||
chartProperties_.AngularMin = var.toDouble();
|
|
||||||
}
|
|
||||||
else if (key == "AngularMax")
|
|
||||||
{
|
|
||||||
chartProperties_.AngularMax = var.toDouble();
|
|
||||||
}
|
|
||||||
else if (key == "RadialMin")
|
|
||||||
{
|
|
||||||
chartProperties_.RadialMin = var.toDouble();
|
|
||||||
}
|
|
||||||
else if (key == "RadialMax")
|
|
||||||
{
|
|
||||||
chartProperties_.RadialMax = var.toDouble();
|
|
||||||
}
|
|
||||||
else if (key == "AngularUnit")
|
|
||||||
{
|
|
||||||
chartProperties_.AngularUnit = var.toString();
|
|
||||||
}
|
|
||||||
else if (key == "RadialUnit")
|
|
||||||
{
|
|
||||||
chartProperties_.RadialUnit = var.toString();
|
|
||||||
}
|
|
||||||
else if (key == "timeParam")
|
|
||||||
{
|
|
||||||
chartProperties_.timeParam = var.toDouble();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
void FileEntryPolar::AddLineProperty(const LineProperty& line) {
|
void FileEntryPolar::AddLineProperty(const LineProperty& line) {
|
||||||
lineProperties_.append(line);
|
lineProperties_.append(line);
|
||||||
}
|
}
|
||||||
|
|||||||
@ -2,7 +2,6 @@
|
|||||||
|
|
||||||
#include <QString>
|
#include <QString>
|
||||||
#include <QColor>
|
#include <QColor>
|
||||||
#include <QVariant>
|
|
||||||
#include "xml/tinyxml2.h"
|
#include "xml/tinyxml2.h"
|
||||||
|
|
||||||
enum class FileEntryType {
|
enum class FileEntryType {
|
||||||
@ -167,7 +166,6 @@ public:
|
|||||||
|
|
||||||
void AddCurveProperty(const CurveProperty& prop) { curveProperties_.append(prop); }
|
void AddCurveProperty(const CurveProperty& prop) { curveProperties_.append(prop); }
|
||||||
void RemoveCurveProperty(int index) { curveProperties_.removeAt(index); }
|
void RemoveCurveProperty(int index) { curveProperties_.removeAt(index); }
|
||||||
void SetCurveProperty(int index, const CurveProperty& prop);
|
|
||||||
const CurveProperties& GetCurveProperties() const { return curveProperties_; }
|
const CurveProperties& GetCurveProperties() const { return curveProperties_; }
|
||||||
|
|
||||||
FileEntryCurve* AsCurve() override { return this; }
|
FileEntryCurve* AsCurve() override { return this; }
|
||||||
@ -299,7 +297,6 @@ public:
|
|||||||
|
|
||||||
void AddLightProperty(const LightRowProperty& prop) { lightProperties_.append(prop); }
|
void AddLightProperty(const LightRowProperty& prop) { lightProperties_.append(prop); }
|
||||||
void RemoveLightProperty(int index) { lightProperties_.removeAt(index); }
|
void RemoveLightProperty(int index) { lightProperties_.removeAt(index); }
|
||||||
void SetLightProperty(int index, const LightRowProperty& prop);
|
|
||||||
const LightRowProperties& GetLightProperties() const { return lightProperties_; }
|
const LightRowProperties& GetLightProperties() const { return lightProperties_; }
|
||||||
|
|
||||||
FileEntryLight* AsLight() override { return this; }
|
FileEntryLight* AsLight() override { return this; }
|
||||||
@ -344,8 +341,6 @@ public:
|
|||||||
void SetChartProperties(const ChartProperties& properties);
|
void SetChartProperties(const ChartProperties& properties);
|
||||||
const ChartProperties& GetChartProperties() const;
|
const ChartProperties& GetChartProperties() const;
|
||||||
|
|
||||||
void UpdateChartProperties(const QString& key, QVariant var);
|
|
||||||
|
|
||||||
// Line properties management
|
// Line properties management
|
||||||
void AddLineProperty(const LineProperty& line);
|
void AddLineProperty(const LineProperty& line);
|
||||||
void RemoveLineProperty(int index);
|
void RemoveLineProperty(int index);
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user