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/nmPlot/nmPlotDialogContextProvider.h

70 lines
2.2 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.

#pragma once
#include "nmPlot_global.h"
#include <QPointF>
#include <QStringList>
class QWidget;
class ZxDataWell;
class nmDataWellBase;
/**
* @brief 编辑井窗口所需的完整只读上下文。
* @note 上下文由Binder组装使编辑器无需查询全局数据管理器。
*/
struct NM_PLOT_EXPORT nmWellEditContext
{
/** @brief 创建不引用任何井对象的空上下文。 */
nmWellEditContext()
: m_pFrameworkWell(nullptr),
m_pOriginalWell(nullptr)
{
}
const ZxDataWell* m_pFrameworkWell; ///< 工程树井数据,不转移所有权。
const nmDataWellBase* m_pOriginalWell; ///< 原始数值井,不转移所有权。
QStringList m_listOtherWellNames; ///< 用于唯一性校验的其他井名称。
};
// 绘图层访问界面弹窗能力的抽象接口
class NM_PLOT_EXPORT nmPlotDialogContextProvider
{
public:
virtual ~nmPlotDialogContextProvider() {}
/** @brief 组装编辑井窗口所需的只读上下文,不接管传入对象。 */
nmWellEditContext createWellEditContext(
const ZxDataWell* pFrameworkWell,
const nmDataWellBase* pOriginalWell,
const QStringList& listOtherWellNames) const
{
nmWellEditContext oContext;
oContext.m_pFrameworkWell = pFrameworkWell;
oContext.m_pOriginalWell = pOriginalWell;
oContext.m_listOtherWellNames = listOtherWellNames;
return oContext;
}
// 打开测量比例尺弹窗
virtual bool execMeasuringScaleDialog(const QPointF& pStart, const QPointF& pEnd, double* pLength) = 0;
// 创建测量工具弹窗
virtual QWidget* createMeasureDialog(QWidget* pParent) = 0;
// 创建坐标显示弹窗
virtual QWidget* createPointerPosDialog(QWidget* pParent) = 0;
// 确认是否删除图元
virtual bool confirmDeleteObject() = 0;
// 确认是否切换边界类型
virtual bool confirmSwitchOutline() = 0;
/**
* @brief 打开井编辑窗口并返回确认后的独立井副本。
* @param pModifiedWell 成功时由调用者接管所有权,取消时保持为空。
*/
virtual bool editWell(QWidget* pParent, const nmWellEditContext& oContext,
nmDataWellBase*& pModifiedWell) = 0;
};