You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
nmWTAI-Platform/Include/nmNum/nmSubWxs/nmWxPropertyInterpolationDlg.h

122 lines
3.6 KiB
C++

#ifndef NMWXPROPERTYINTERPOLATIONDLG_H
#define NMWXPROPERTYINTERPOLATIONDLG_H
#include "iDlgBase.h"
#include "nmDataAnalyzeManager.h"
#include "nmSubWxs_global.h"
#include <QPointer>
#include <QStringList>
#include <QVector>
class QCheckBox;
class QComboBox;
class QDoubleSpinBox;
class QEvent;
class QLineEdit;
class QPointF;
class QPushButton;
class QTableWidget;
class QTableWidgetItem;
class nmGuiPlot;
class nmObjPoint;
class NM_SUB_WXS_EXPORT nmWxPropertyInterpolationDlg : public iDlgBase
{
Q_OBJECT
public:
explicit nmWxPropertyInterpolationDlg(nmGuiPlot* plot,
nmDataAnalyzeManager* dataManager,
QWidget* parent = 0);
~nmWxPropertyInterpolationDlg();
protected:
bool eventFilter(QObject* watched, QEvent* event);
private slots:
void onDataSetChanged(int index);
void onAddDataSet();
void onDeleteDataSet();
void onDataSetNameChanged(const QString& name);
void onCurrentDataSetEdited();
void onMapPickToggled(bool checked);
void onMapClicked(const QPointF& position);
void onPointSelectionChanged();
void onPointItemChanged(QTableWidgetItem* item);
void onDeleteSelectedPoint();
void onClearPoints();
void onShowPointsToggled(bool checked);
void onShowLabelsToggled(bool checked);
private:
// 初始化界面及持久化数据组.
void initInterpolationUI();
void initializeDataSets();
nmPropertyInterpolationDataSet createDefaultDataSet();
QString nextDataSetName();
void loadDataSet(int index);
void clearCurrentDataSet();
void saveCurrentDataSet();
void syncDataSetsToManager(bool markModified);
void updateDataSetButtons();
// 管理测点表格和地图上的临时标记.
void appendPoint(const QPointF& valuePoint);
void appendPointRow(const nmPropertyInterpolationPointData& point,
const QString& markerName);
QString createMarker(const QPointF& valuePosition,
double value,
bool showPoints,
bool showLabels);
void createMarkersForAllDataSets();
void removeDataSetMarkers(int dataSetIndex);
void removeAllMarkers();
QString markerNameAt(int row) const;
nmObjPoint* markerByName(const QString& markerName) const;
nmObjPoint* markerAt(int row) const;
void removeMarkerByName(const QString& markerName);
void clearTableSelection();
void updatePointButtons();
void updateCurrentMarkerVisibility();
private:
QPointer<nmGuiPlot> m_pPlot;
QPointer<nmDataAnalyzeManager> m_pDataManager;
// 多组插值数据.
QComboBox* m_pDataSetCombo;
QPushButton* m_pAddDataSetButton;
QPushButton* m_pDeleteDataSetButton;
QVector<nmPropertyInterpolationDataSet> m_vecDataSets;
QVector<QStringList> m_vecMarkerNames;
int m_nCurrentDataSetIndex;
int m_nNextPointId;
bool m_bUpdatingUi;
// 当前数据组的属性及名称.
QComboBox* m_pPropertyCombo;
QLineEdit* m_pNameEdit;
// 测点数据录入.
QDoubleSpinBox* m_pNewValueSpin;
QPushButton* m_pMapPickButton;
QTableWidget* m_pPointTable;
QPushButton* m_pDeletePointButton;
QPushButton* m_pClearPointsButton;
QCheckBox* m_pShowPointsCheck;
QCheckBox* m_pShowLabelsCheck;
// Kriging插值参数.
QDoubleSpinBox* m_pNuggetSpin;
QDoubleSpinBox* m_pSillSpin;
QDoubleSpinBox* m_pRangeSpin;
QComboBox* m_pModelCombo;
// 结果预览及应用.
QPushButton* m_pPreviewButton;
QPushButton* m_pApplyButton;
};
#endif // NMWXPROPERTYINTERPOLATIONDLG_H