#ifndef NMWXPROPERTYINTERPOLATIONDLG_H #define NMWXPROPERTYINTERPOLATIONDLG_H #include "iDlgBase.h" #include "nmDataAnalyzeManager.h" #include "nmSubWxs_global.h" #include #include #include 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); void onPreview(); 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 m_pPlot; QPointer m_pDataManager; // 多组插值数据. QComboBox* m_pDataSetCombo; QPushButton* m_pAddDataSetButton; QPushButton* m_pDeleteDataSetButton; QVector m_vecDataSets; // 与数据组、测点下标一一对应,仅保存地图临时标记的对象名称. QVector 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