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.
73 lines
2.2 KiB
C++
73 lines
2.2 KiB
C++
#ifndef NMWXPEBIGRIDVIEWWIDGET_H
|
|
#define NMWXPEBIGRIDVIEWWIDGET_H
|
|
|
|
#include "nmSubWxs_global.h"
|
|
|
|
#include <QWidget>
|
|
|
|
class QAction;
|
|
class QComboBox;
|
|
class QLabel;
|
|
class QMenu;
|
|
class QToolBar;
|
|
|
|
class nmPebiGridSceneController;
|
|
class nmPebiGridViewData;
|
|
class nmWxVTKRenderContainerWidget;
|
|
|
|
/**
|
|
* @brief 二维 PEBI 网格预览业务组合控件。
|
|
*
|
|
* 本类只组织工具栏、属性选择和网格场景控制器;通用导航、截图和打印
|
|
* 能力全部由内部 nmRender 容器提供,不继承业务视图基类。
|
|
*/
|
|
class NM_SUB_WXS_EXPORT nmWxPebiGridViewWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit nmWxPebiGridViewWidget(QWidget* pParent = NULL);
|
|
virtual ~nmWxPebiGridViewWidget();
|
|
|
|
/** @brief 装入完整数据并复用现有 Renderer、Scene、图层和工具栏。 */
|
|
bool setViewData(const nmPebiGridViewData& oViewData,
|
|
QString* pError = NULL);
|
|
/** @brief 保留当前成功数据,只切换到渲染中状态页。 */
|
|
void showLoading();
|
|
/** @brief 有旧数据时恢复画面并显示提示,否则显示错误状态页。 */
|
|
void showFailure(const QString& sMessage);
|
|
/** @brief 清除旧分析网格、属性选择和视图命令状态。 */
|
|
void clearView();
|
|
|
|
bool hasViewData() const;
|
|
|
|
private slots:
|
|
void onPropertyChanged(int nIndex);
|
|
void onGridLinesToggled(bool bVisible);
|
|
void onScalarBarToggled(bool bVisible);
|
|
void onBoundsGridToggled(bool bVisible);
|
|
void appendContextMenuActions(QMenu* pMenu);
|
|
|
|
private:
|
|
Q_DISABLE_COPY(nmWxPebiGridViewWidget)
|
|
|
|
void createUi();
|
|
void resetControls();
|
|
void setControlsEnabled(bool bEnabled);
|
|
void updateScalarBarActionState();
|
|
QString gridTypeText(int nGridType) const;
|
|
|
|
nmWxVTKRenderContainerWidget* m_pRenderContainer; ///< Qt 父对象拥有。
|
|
nmPebiGridSceneController* m_pSceneController; ///< 本类独占并先于容器销毁。
|
|
QToolBar* m_pToolBar;
|
|
QAction* m_pGridLinesAction;
|
|
QAction* m_pScalarBarAction;
|
|
QAction* m_pBoundsGridAction;
|
|
QComboBox* m_pPropertyComboBox;
|
|
QLabel* m_pGridInfoLabel;
|
|
QLabel* m_pStatusLabel;
|
|
bool m_bHasViewData;
|
|
};
|
|
|
|
#endif // NMWXPEBIGRIDVIEWWIDGET_H
|