refactor(nmNum): 固定结果网格显示单元边线

- 删除结果视图中的单元边线工具栏和右键菜单动作
- 将业务显隐动作调整为色标、比例网格、井位和井名
- 移除SceneController中的边线显隐接口及偏好状态
- 固定结果网格使用彩色表面加黑色单元边线模式
- 保留nmVTKMeshLayer的通用表面及边线控制能力
- 清理单元边线翻译词条并更新中文翻译资源
feature/nmNum-postprocessing-view-20260910
lh 2 weeks ago
parent 2c48c6f793
commit 8c12fb5dd0

Binary file not shown.

@ -2888,7 +2888,6 @@ Reason: %1</source>
<message><source>No result data.</source><translation>暂无结果数据。</translation></message> <message><source>No result data.</source><translation>暂无结果数据。</translation></message>
<message><source>Color Scale</source><translation>色标</translation></message> <message><source>Color Scale</source><translation>色标</translation></message>
<message><source>Scale Grid</source><translation>比例网格</translation></message> <message><source>Scale Grid</source><translation>比例网格</translation></message>
<message><source>Cell Edges</source><translation>单元边线</translation></message>
<message><source>Well Markers</source><translation>井位标记</translation></message> <message><source>Well Markers</source><translation>井位标记</translation></message>
<message><source>Well Names</source><translation>井名</translation></message> <message><source>Well Names</source><translation>井名</translation></message>
<message><source>Unable to display the latest result.</source><translation>无法显示最新结果。</translation></message> <message><source>Unable to display the latest result.</source><translation>无法显示最新结果。</translation></message>

@ -69,8 +69,6 @@ public:
void setScalarBarVisible(bool bVisible); void setScalarBarVisible(bool bVisible);
/** @brief 设置平面比例网格显隐;偏好跨快照保留。 */ /** @brief 设置平面比例网格显隐;偏好跨快照保留。 */
void setScaleGridVisible(bool bVisible); void setScaleGridVisible(bool bVisible);
/** @brief 设置单元边线显隐;偏好跨快照保留。 */
void setCellEdgesVisible(bool bVisible);
/** @brief 设置二维井位标记显隐;偏好跨快照保留。 */ /** @brief 设置二维井位标记显隐;偏好跨快照保留。 */
void setWellMarkersVisible(bool bVisible); void setWellMarkersVisible(bool bVisible);
/** @brief 设置二维井名显隐;偏好跨快照保留。 */ /** @brief 设置二维井名显隐;偏好跨快照保留。 */
@ -113,8 +111,6 @@ public:
bool isScalarBarVisible() const; bool isScalarBarVisible() const;
/** @brief 返回比例网格显示偏好,不要求当前存在快照。 */ /** @brief 返回比例网格显示偏好,不要求当前存在快照。 */
bool isScaleGridVisible() const; bool isScaleGridVisible() const;
/** @brief 返回单元边线显示偏好,不要求当前存在快照。 */
bool areCellEdgesVisible() const;
/** @brief 返回二维井位标记显示偏好。 */ /** @brief 返回二维井位标记显示偏好。 */
bool areWellMarkersVisible() const; bool areWellMarkersVisible() const;
/** @brief 返回二维井名显示偏好。 */ /** @brief 返回二维井名显示偏好。 */

@ -67,8 +67,6 @@ private slots:
void onScalarBarToggled(bool bVisible); void onScalarBarToggled(bool bVisible);
/** @brief 切换比例网格显隐。 */ /** @brief 切换比例网格显隐。 */
void onScaleGridToggled(bool bVisible); void onScaleGridToggled(bool bVisible);
/** @brief 切换单元边线显隐。 */
void onCellEdgesToggled(bool bVisible);
/** @brief 切换二维井位标记显隐。 */ /** @brief 切换二维井位标记显隐。 */
void onWellMarkersToggled(bool bVisible); void onWellMarkersToggled(bool bVisible);
/** @brief 切换二维井名显隐。 */ /** @brief 切换二维井名显隐。 */
@ -88,7 +86,7 @@ private:
const QSharedPointer<const nmPebiResultSnapshot>& pSnapshot, const QSharedPointer<const nmPebiResultSnapshot>& pSnapshot,
const QString& sSnapshotId, const QString& sSnapshotId,
bool bCurrent); bool bCurrent);
/** @brief 从 SceneController 镜像五个业务 QAction 的勾选和可用状态。 */ /** @brief 从 SceneController 镜像四个业务 QAction 的勾选和可用状态。 */
void synchronizeBusinessActions(); void synchronizeBusinessActions();
/** @brief 根据“绑定失败、过期、操作错误”的固定优先级刷新提示栏。 */ /** @brief 根据“绑定失败、过期、操作错误”的固定优先级刷新提示栏。 */
void refreshStatusBar(); void refreshStatusBar();
@ -104,7 +102,6 @@ private:
QAction* m_pScalarBarAction; ///< 色标显隐动作。 QAction* m_pScalarBarAction; ///< 色标显隐动作。
QAction* m_pScaleGridAction; ///< 比例网格显隐动作。 QAction* m_pScaleGridAction; ///< 比例网格显隐动作。
QAction* m_pCellEdgesAction; ///< 单元边线显隐动作。
QAction* m_pWellMarkersAction; ///< 二维井位标记显隐动作。 QAction* m_pWellMarkersAction; ///< 二维井位标记显隐动作。
QAction* m_pWellNamesAction; ///< 二维井名显隐动作。 QAction* m_pWellNamesAction; ///< 二维井名显隐动作。

@ -403,7 +403,6 @@ public:
m_bHasBounds(false), m_bHasBounds(false),
m_bScalarBarVisible(true), m_bScalarBarVisible(true),
m_bScaleGridVisible(false), m_bScaleGridVisible(false),
m_bCellEdgesVisible(false),
m_bWellMarkersVisible(true), m_bWellMarkersVisible(true),
m_bWellNamesVisible(true) m_bWellNamesVisible(true)
{ {
@ -708,9 +707,9 @@ public:
{ {
synchronizeLayerPointers(); synchronizeLayerPointers();
if(m_pMeshLayer != nullptr) { if(m_pMeshLayer != nullptr) {
m_pMeshLayer->setDisplayMode(m_bCellEdgesVisible // 结果网格固定显示彩色表面和黑色单元边线,不保存可关闭的偏好。
? nmVTKMeshLayer::DisplayMode_SurfaceWithEdges m_pMeshLayer->setDisplayMode(
: nmVTKMeshLayer::DisplayMode_Surface); nmVTKMeshLayer::DisplayMode_SurfaceWithEdges);
m_pMeshLayer->setScalarVisibility(bHasData); m_pMeshLayer->setScalarVisibility(bHasData);
// 彩色结果网格是有效快照的主内容,不提供独立隐藏状态。 // 彩色结果网格是有效快照的主内容,不提供独立隐藏状态。
m_pMeshLayer->setVisible(bHasData); m_pMeshLayer->setVisible(bHasData);
@ -884,7 +883,6 @@ public:
bool m_bHasBounds; bool m_bHasBounds;
bool m_bScalarBarVisible; bool m_bScalarBarVisible;
bool m_bScaleGridVisible; bool m_bScaleGridVisible;
bool m_bCellEdgesVisible;
bool m_bWellMarkersVisible; bool m_bWellMarkersVisible;
bool m_bWellNamesVisible; bool m_bWellNamesVisible;
}; };
@ -1350,24 +1348,6 @@ void nmPebiResultSceneController::setScaleGridVisible(bool bVisible)
} }
} }
void nmPebiResultSceneController::setCellEdgesVisible(bool bVisible)
{
Q_ASSERT(isResultSceneGuiThread());
if(!isResultSceneGuiThread() || m_pPrivate == nullptr) {
return;
}
m_pPrivate->discardActiveDataIfLayersLost();
if(m_pPrivate->m_bCellEdgesVisible == bVisible) {
return;
}
m_pPrivate->m_bCellEdgesVisible = bVisible;
const bool bHasData = hasSnapshot();
m_pPrivate->applyLayerVisibility(bHasData);
if(bHasData) {
m_pPrivate->m_pContainer->renderView();
}
}
void nmPebiResultSceneController::setWellMarkersVisible(bool bVisible) void nmPebiResultSceneController::setWellMarkersVisible(bool bVisible)
{ {
Q_ASSERT(isResultSceneGuiThread()); Q_ASSERT(isResultSceneGuiThread());
@ -1526,11 +1506,6 @@ bool nmPebiResultSceneController::isScaleGridVisible() const
return m_pPrivate != nullptr && m_pPrivate->m_bScaleGridVisible; return m_pPrivate != nullptr && m_pPrivate->m_bScaleGridVisible;
} }
bool nmPebiResultSceneController::areCellEdgesVisible() const
{
return m_pPrivate != nullptr && m_pPrivate->m_bCellEdgesVisible;
}
bool nmPebiResultSceneController::areWellMarkersVisible() const bool nmPebiResultSceneController::areWellMarkersVisible() const
{ {
return m_pPrivate != nullptr && m_pPrivate->m_bWellMarkersVisible; return m_pPrivate != nullptr && m_pPrivate->m_bWellMarkersVisible;

@ -58,7 +58,6 @@ nmWxPebiResultViewWidget::nmWxPebiResultViewWidget(
m_pStatusLabel(nullptr), m_pStatusLabel(nullptr),
m_pScalarBarAction(nullptr), m_pScalarBarAction(nullptr),
m_pScaleGridAction(nullptr), m_pScaleGridAction(nullptr),
m_pCellEdgesAction(nullptr),
m_pWellMarkersAction(nullptr), m_pWellMarkersAction(nullptr),
m_pWellNamesAction(nullptr), m_pWellNamesAction(nullptr),
m_bObservedSnapshotCurrent(false), m_bObservedSnapshotCurrent(false),
@ -174,7 +173,6 @@ void nmWxPebiResultViewWidget::appendContextMenuActions(QMenu* pMenu)
} }
pMenu->addAction(m_pScalarBarAction); pMenu->addAction(m_pScalarBarAction);
pMenu->addAction(m_pScaleGridAction); pMenu->addAction(m_pScaleGridAction);
pMenu->addAction(m_pCellEdgesAction);
pMenu->addAction(m_pWellMarkersAction); pMenu->addAction(m_pWellMarkersAction);
pMenu->addAction(m_pWellNamesAction); pMenu->addAction(m_pWellNamesAction);
} }
@ -215,13 +213,6 @@ void nmWxPebiResultViewWidget::onScaleGridToggled(bool bVisible)
} }
} }
void nmWxPebiResultViewWidget::onCellEdgesToggled(bool bVisible)
{
if(m_pSceneController != nullptr && m_pSceneController->hasSnapshot()) {
m_pSceneController->setCellEdgesVisible(bVisible);
}
}
void nmWxPebiResultViewWidget::onWellMarkersToggled(bool bVisible) void nmWxPebiResultViewWidget::onWellMarkersToggled(bool bVisible)
{ {
if(m_pSceneController != nullptr && m_pSceneController->hasSnapshot()) { if(m_pSceneController != nullptr && m_pSceneController->hasSnapshot()) {
@ -278,9 +269,6 @@ void nmWxPebiResultViewWidget::createUi()
m_pScaleGridAction = new QAction( m_pScaleGridAction = new QAction(
QIcon(resultViewIconPath("NmScaleGrid.png")), QIcon(resultViewIconPath("NmScaleGrid.png")),
tr("Scale Grid"), this); tr("Scale Grid"), this);
m_pCellEdgesAction = new QAction(
QIcon(resultViewIconPath("SpecialLineVisible.png")),
tr("Cell Edges"), this);
m_pWellMarkersAction = new QAction( m_pWellMarkersAction = new QAction(
QIcon(resultViewIconPath("NmWell.png")), QIcon(resultViewIconPath("NmWell.png")),
tr("Well Markers"), this); tr("Well Markers"), this);
@ -289,10 +277,10 @@ void nmWxPebiResultViewWidget::createUi()
tr("Well Names"), this); tr("Well Names"), this);
QAction* const pBusinessActions[] = { QAction* const pBusinessActions[] = {
m_pScalarBarAction, m_pScaleGridAction, m_pCellEdgesAction, m_pScalarBarAction, m_pScaleGridAction,
m_pWellMarkersAction, m_pWellNamesAction m_pWellMarkersAction, m_pWellNamesAction
}; };
for(int nIndex = 0; nIndex < 5; ++nIndex) { for(int nIndex = 0; nIndex < 4; ++nIndex) {
pBusinessActions[nIndex]->setCheckable(true); pBusinessActions[nIndex]->setCheckable(true);
pBusinessActions[nIndex]->setToolTip( pBusinessActions[nIndex]->setToolTip(
pBusinessActions[nIndex]->text()); pBusinessActions[nIndex]->text());
@ -324,7 +312,7 @@ void nmWxPebiResultViewWidget::createUi()
if(pFrontAction != nullptr) m_pToolBar->addAction(pFrontAction); if(pFrontAction != nullptr) m_pToolBar->addAction(pFrontAction);
if(pPickCenterAction != nullptr) m_pToolBar->addAction(pPickCenterAction); if(pPickCenterAction != nullptr) m_pToolBar->addAction(pPickCenterAction);
m_pToolBar->addSeparator(); m_pToolBar->addSeparator();
for(int nIndex = 0; nIndex < 5; ++nIndex) { for(int nIndex = 0; nIndex < 4; ++nIndex) {
m_pToolBar->addAction(pBusinessActions[nIndex]); m_pToolBar->addAction(pBusinessActions[nIndex]);
} }
m_pToolBar->addSeparator(); m_pToolBar->addSeparator();
@ -335,8 +323,6 @@ void nmWxPebiResultViewWidget::createUi()
this, SLOT(onScalarBarToggled(bool))); this, SLOT(onScalarBarToggled(bool)));
connect(m_pScaleGridAction, SIGNAL(toggled(bool)), connect(m_pScaleGridAction, SIGNAL(toggled(bool)),
this, SLOT(onScaleGridToggled(bool))); this, SLOT(onScaleGridToggled(bool)));
connect(m_pCellEdgesAction, SIGNAL(toggled(bool)),
this, SLOT(onCellEdgesToggled(bool)));
connect(m_pWellMarkersAction, SIGNAL(toggled(bool)), connect(m_pWellMarkersAction, SIGNAL(toggled(bool)),
this, SLOT(onWellMarkersToggled(bool))); this, SLOT(onWellMarkersToggled(bool)));
connect(m_pWellNamesAction, SIGNAL(toggled(bool)), connect(m_pWellNamesAction, SIGNAL(toggled(bool)),
@ -498,8 +484,6 @@ void nmWxPebiResultViewWidget::synchronizeBusinessActions()
m_pScalarBarAction, m_pSceneController->isScalarBarVisible()); m_pScalarBarAction, m_pSceneController->isScalarBarVisible());
setActionCheckedWithoutSignal( setActionCheckedWithoutSignal(
m_pScaleGridAction, m_pSceneController->isScaleGridVisible()); m_pScaleGridAction, m_pSceneController->isScaleGridVisible());
setActionCheckedWithoutSignal(
m_pCellEdgesAction, m_pSceneController->areCellEdgesVisible());
setActionCheckedWithoutSignal( setActionCheckedWithoutSignal(
m_pWellMarkersAction, m_pSceneController->areWellMarkersVisible()); m_pWellMarkersAction, m_pSceneController->areWellMarkersVisible());
setActionCheckedWithoutSignal( setActionCheckedWithoutSignal(
@ -508,7 +492,6 @@ void nmWxPebiResultViewWidget::synchronizeBusinessActions()
const bool bEnabled = m_pSceneController->hasSnapshot(); const bool bEnabled = m_pSceneController->hasSnapshot();
m_pScalarBarAction->setEnabled(bEnabled); m_pScalarBarAction->setEnabled(bEnabled);
m_pScaleGridAction->setEnabled(bEnabled); m_pScaleGridAction->setEnabled(bEnabled);
m_pCellEdgesAction->setEnabled(bEnabled);
m_pWellMarkersAction->setEnabled(bEnabled); m_pWellMarkersAction->setEnabled(bEnabled);
m_pWellNamesAction->setEnabled(bEnabled); m_pWellNamesAction->setEnabled(bEnabled);
} }

Loading…
Cancel
Save