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/nmLayerGeometryDataSource.h

25 lines
1.4 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 NMLAYERGEOMETRYDATASOURCE_H
#define NMLAYERGEOMETRYDATASOURCE_H
#include "nmLayerGeometry.h"
// 分层编辑器的数据边界。调用方持有数据源,生命周期必须覆盖整个模态编辑会话。
// 窗口仅处理值副本,不认识 DataManager、分析窗口或任何全局当前对象。
class nmLayerGeometryDataSource
{
public:
// 接口不持有业务对象;具体实现负责自身资源,窗口不能销毁调用方提供的数据源。
virtual ~nmLayerGeometryDataSource() {}
// 建立本次编辑会话并返回初始副本;实现应记录提交时用于对照的原始数据。
// 返回 false 时调用方不进入模态编辑,避免把未加载的数据当作可保存内容。
virtual bool load(nmLayerGeometry& geometry) = 0;
// 重置从所属分析读取全部层及其颜色,保留用户指定的首层顶深,重新连续排列。
// firstTop 的单位为米;这里只更新输出副本,不立即写入工程,也不更新原始对照快照。
virtual bool loadFromAnalysis(double firstTop, nmLayerGeometry& geometry) = 0;
// 只在确定时调用;失败不关闭窗口,也不覆盖已经发生变化的外部数据。
// 无变化也可返回 true;取消不调用此方法,不需要额外的回滚接口。
virtual bool commit(const nmLayerGeometry& geometry) = 0;
};
#endif // NMLAYERGEOMETRYDATASOURCE_H