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

76 lines
3.1 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 NMWXPEBIGRIDVIEWWIDGET_H
#define NMWXPEBIGRIDVIEWWIDGET_H
#include "nmSubWxs_global.h"
#include <QWidget>
class QAction;
class QLabel;
class QMenu;
class QToolBar;
class nmPebiGridSceneController;
class nmPebiGridViewData;
class nmWxVTKRenderContainerWidget;
/**
* @brief 二维 PEBI 网格预览业务组合控件。
*
* 本类定位为网格几何检查窗口,只显示固定灰色表面、黑色单元边线和
* 可选的 XY 比例网格,不解释输入数据中的历史属性数组。右侧工具栏和
* 右键菜单复用同一批 QAction通用导航、旋转中心、截图和打印能力由
* 内部 nmRender 容器提供,不继承业务视图基类。
*
* 窗口状态由 setViewData/showLoading/showFailure/clearView 统一切换。
* 建网失败且存在旧数据时,场景继续显示上一次成功网格,黄色状态栏
* 单独提示失败原因;底部信息栏始终只描述当前保留的 PEBI 二维网格。
*/
class NM_SUB_WXS_EXPORT nmWxPebiGridViewWidget : public QWidget
{
Q_OBJECT
public:
explicit nmWxPebiGridViewWidget(QWidget* pParent = nullptr);
virtual ~nmWxPebiGridViewWidget();
/** @brief 装入完整数据并复用现有 Renderer、Scene、图层和工具栏。 */
bool setViewData(const nmPebiGridViewData& oViewData,
QString* pError = nullptr);
/** @brief 保留当前成功数据,只切换到渲染中状态页。 */
void showLoading();
/** @brief 有旧数据时恢复画面并显示提示,否则显示错误状态页。 */
void showFailure(const QString& sMessage);
/** @brief 清除旧分析网格和视图命令状态。 */
void clearView();
/** @brief 当前场景是否保留一份绑定成功的网格数据。 */
bool hasViewData() const;
private slots:
/** @brief 切换世界坐标中的 XY 比例网格,不改变相机。 */
void onBoundsGridToggled(bool bVisible);
/** @brief 向通用右键菜单追加本窗口独占的比例网格动作。 */
void appendContextMenuActions(QMenu* pMenu);
private:
Q_DISABLE_COPY(nmWxPebiGridViewWidget)
/** @brief 创建右侧命令栏、状态提示栏和底部网格信息栏。 */
void createUi();
/** @brief 恢复无数据时的比例网格偏好和底栏文字。 */
void resetControls();
/** @brief 统一启停依赖有效网格的业务动作。 */
void setControlsEnabled(bool bEnabled);
nmWxVTKRenderContainerWidget* m_pRenderContainer; ///< Qt 父对象拥有的通用渲染容器。
nmPebiGridSceneController* m_pSceneController; ///< 本类独占,必须先于容器销毁。
QToolBar* m_pToolBar; ///< Qt 父对象拥有的右侧竖向工具栏。
QAction* m_pBoundsGridAction; ///< 工具栏和右键菜单共享的比例网格动作。
QLabel* m_pGridInfoLabel; ///< 底栏左侧的网格类型、单元数和平面信息。
QLabel* m_pStatusLabel; ///< 建网失败且保留旧网格时使用的黄色提示栏。
bool m_bHasViewData; ///< 与场景控制器的成功数据状态保持同步。
};
#endif // NMWXPEBIGRIDVIEWWIDGET_H