#ifndef NMPEBIRESULTWELLANNOTATIONLAYER_H #define NMPEBIRESULTWELLANNOTATIONLAYER_H #include "nmSubWxs_global.h" #include "nmVTKRenderLayer.h" #include #include class nmPebiResultSnapshot; class vtkPropAssembly; /** * @brief 显示快照中全部二维井名和引线的业务图层。 * * 图层只读取快照冻结的 XY 和井名,不访问 DataManager,不伪造井深或轨迹。 * 稳定根 Assembly 始终挂在 Scene 中;新快照通过候选子 Assembly 无失败交换。 */ class NM_SUB_WXS_EXPORT nmPebiResultWellAnnotationLayer : public nmVTKRenderLayer { public: /** @brief 创建稳定根 Assembly,初始不包含任何快照井标注。 */ explicit nmPebiResultWellAnnotationLayer(const QString& sLayerId); /** @brief 先解除 Renderer,再释放活动和候选子 Assembly。 */ virtual ~nmPebiResultWellAnnotationLayer(); /** * @brief 在未挂载候选对象中构造快照全部井名和二维引线。 * @note 失败时活动子 Assembly 完全不变;再次准备会丢弃旧候选。 */ bool prepareCandidate( const QSharedPointer& pSnapshot); /** @brief 丢弃尚未提交的候选对象,不影响当前画面。 */ void discardCandidate(); /** * @brief 将已经验证的候选子 Assembly 替换为活动对象。 * @note 仅可在 prepareCandidate() 成功后调用;只执行无失败 VTK setter。 */ void commitCandidate(); /** @brief 移除活动和候选井标注,稳定根 Assembly 保持不变。 */ void clear(); /** @brief 返回活动快照是否已有完整井标注子树。 */ bool hasActiveAnnotations() const; private: Q_DISABLE_COPY(nmPebiResultWellAnnotationLayer) vtkSmartPointer m_pRootAssembly; ///< Scene 挂载的稳定根。 vtkSmartPointer m_pActiveSnapshotAssembly; ///< 当前快照子树。 vtkSmartPointer m_pCandidateSnapshotAssembly; ///< 待提交子树。 }; #endif // NMPEBIRESULTWELLANNOTATIONLAYER_H