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

#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