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/nmSubWnd/nmAnalyzeLayerGeometryDataS...

30 lines
1.6 KiB
C++

This file contains ambiguous Unicode characters!

This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.

#ifndef NMANALYZELAYERGEOMETRYDATASOURCE_H
#define NMANALYZELAYERGEOMETRYDATASOURCE_H
#include "nmLayerGeometryDataSource.h"
#include <QPointer>
class nmDataAnalyzeManager;
// 入口适配器:绑定地图所属分析,把 Manager 的持久化对象转换为编辑值副本。
// 弱引用不延长工程生命周期;原始快照用于提交前检查,防止模态期间覆盖外部修改。
class nmAnalyzeLayerGeometryDataSource : public nmLayerGeometryDataSource
{
public:
// manager 由入口从所属地图取得;构造过程不加载数据,也不回退到全局当前分析。
explicit nmAnalyzeLayerGeometryDataSource(nmDataAnalyzeManager* manager);
// 优先读取已有层;只有列表为空时才从所属分析生成初始编辑内容。
virtual bool load(nmLayerGeometry& geometry);
// 通过 Manager 的上下文接口读取完整分析层列表及颜色,适配器不依赖具体基础参数窗口。
virtual bool loadFromAnalysis(double firstTop, nmLayerGeometry& geometry);
// 将本次副本和打开时的原始快照一起交给 Manager,校验通过后统一替换持久化对象。
virtual bool commit(const nmLayerGeometry& geometry);
private:
QPointer<nmDataAnalyzeManager> m_pDataManager; // 非拥有型引用;工程释放后自动置空,后续读写失败。
nmLayerGeometry m_oOriginalGeometry; // 打开时保存的真实层快照;界面重置不能覆盖它。
bool m_bLoaded; // 是否成功取得原始快照,防止未经加载直接提交。
};
#endif // NMANALYZELAYERGEOMETRYDATASOURCE_H