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

55 lines
2.0 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 NMPEBIGRIDVIEWDATA_H
#define NMPEBIGRIDVIEWDATA_H
#include "nmSubWxs_global.h"
#include "nmGridDefine.h"
#include <vtkSmartPointer.h>
#include <vtkType.h>
class nmPebiGridViewDataBuilder;
class vtkUnstructuredGrid;
/**
* @brief 已提交 PEBI 网格及其预览元数据的只读载体。
*
* VTK 网格通过 vtkSmartPointer 共享引用,不执行 DeepCopy也不保存
* nmDataAnalyzeManager 或其他 QObject 裸指针。本类型只描述二维网格
* 几何、输入版本和有效单元数,不探测或解释 VTK 数据对象中可能存在的
* 历史属性数组;属性模型和结果快照由后续独立阶段负责。
*
* Builder 使用局部候选对象完成全部校验后再整体赋值,因此构建失败不会
* 覆盖调用方仍在显示的上一份成功数据。
*/
class NM_SUB_WXS_EXPORT nmPebiGridViewData
{
public:
/** @brief 创建不持有网格的空预览数据。 */
nmPebiGridViewData();
/** @brief 释放共享网格并清空与该版本对应的预览元数据。 */
void clear();
/** @brief 网格、点和单元均存在时返回 true。 */
bool isValid() const;
/** @brief 返回共享网格的非所有权指针。 */
vtkUnstructuredGrid* getGrid() const;
/** @brief 返回已提交网格类型;当前 Builder 只接受 PEBI。 */
NM_Grid_Type getGridType() const;
/** @brief 返回生成当前网格时对应的输入版本。 */
quint64 getGridInputRevision() const;
/** @brief 返回最终 VTK 网格中的有效单元数量。 */
vtkIdType getValidCellCount() const;
private:
friend class nmPebiGridViewDataBuilder; ///< 仅 Builder 可提交完整候选数据。
vtkSmartPointer<vtkUnstructuredGrid> m_pGrid; ///< 共享已提交网格的 VTK 引用。
NM_Grid_Type m_eGridType; ///< 与共享网格对应的业务网格类型。
quint64 m_nGridInputRevision; ///< 构建该网格所使用的输入版本。
vtkIdType m_nValidCellCount; ///< 经过业务过滤后实际进入 VTK 的单元数。
};
#endif // NMPEBIGRIDVIEWDATA_H