|
|
|
|
@ -1,4 +1,4 @@
|
|
|
|
|
#include "nmWxPostprocessingAnimationWidget.h"
|
|
|
|
|
#include "nmWxPostprocessingAnimationWidget.h"
|
|
|
|
|
#include <QDebug> // 用于调试输出
|
|
|
|
|
#include <algorithm> // 用于 std::sort 排序算法
|
|
|
|
|
|
|
|
|
|
@ -10,6 +10,7 @@
|
|
|
|
|
#include <QLabel>
|
|
|
|
|
#include <QTimer>
|
|
|
|
|
#include <QComboBox>
|
|
|
|
|
#include <QCheckBox>
|
|
|
|
|
#include <QSlider>
|
|
|
|
|
#include <QList>
|
|
|
|
|
#include <QEvent>
|
|
|
|
|
@ -177,6 +178,7 @@ nmWxPostprocessingAnimationWidget::nmWxPostprocessingAnimationWidget(QWidget* pa
|
|
|
|
|
m_dMinValue = 0.0;
|
|
|
|
|
m_bBelowMaxEnabled = false;
|
|
|
|
|
m_dMaxValue = 0.0;
|
|
|
|
|
m_bShowWellActors = true;
|
|
|
|
|
|
|
|
|
|
// 初始化区域平均压力计算内容
|
|
|
|
|
m_bIsDrawingMode = false;
|
|
|
|
|
@ -593,6 +595,7 @@ void nmWxPostprocessingAnimationWidget::initWellDrawing()
|
|
|
|
|
textProperty->SetColor(0.898, 0.898, 0.0);
|
|
|
|
|
textProperty->SetBold(true); // 文本加粗
|
|
|
|
|
//textActor->GetTextProperty()->SetJustificationToCentered(); // 文本中心对齐到其位置点
|
|
|
|
|
textActor->SetVisibility(m_bShowWellActors ? 1 : 0);
|
|
|
|
|
|
|
|
|
|
m_renderer->AddActor(textActor); // 对于所有 3D Actor,都使用 m_renderer->AddActor()
|
|
|
|
|
m_mapWellNameActors.insert(sWellName, textActor); // 将 Actor 存储在 QMap 中,以便后续管理和清除
|
|
|
|
|
@ -628,6 +631,7 @@ void nmWxPostprocessingAnimationWidget::initWellDrawing()
|
|
|
|
|
lineActor->SetMapper(lineMapper);
|
|
|
|
|
lineActor->GetProperty()->SetColor(0.647, 0.165, 0.165);
|
|
|
|
|
lineActor->GetProperty()->SetLineWidth(1.1);
|
|
|
|
|
lineActor->SetVisibility(m_bShowWellActors ? 1 : 0);
|
|
|
|
|
|
|
|
|
|
m_renderer->AddActor(lineActor); // 将 3D Actor 添加到渲染器
|
|
|
|
|
m_mapWellLineActors.insert(sWellName, lineActor); // 存储井线 Actor
|
|
|
|
|
@ -664,6 +668,27 @@ void nmWxPostprocessingAnimationWidget::clearWellActors()
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxPostprocessingAnimationWidget::slotSetWellActorsVisible(bool visible)
|
|
|
|
|
{
|
|
|
|
|
m_bShowWellActors = visible;
|
|
|
|
|
|
|
|
|
|
for(auto it = m_mapWellNameActors.begin(); it != m_mapWellNameActors.end(); ++it) {
|
|
|
|
|
if(it.value()) {
|
|
|
|
|
it.value()->SetVisibility(visible ? 1 : 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
for(auto it = m_mapWellLineActors.begin(); it != m_mapWellLineActors.end(); ++it) {
|
|
|
|
|
if(it.value()) {
|
|
|
|
|
it.value()->SetVisibility(visible ? 1 : 0);
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
if(m_pVtkWidget && m_pVtkWidget->GetRenderWindow()) {
|
|
|
|
|
m_pVtkWidget->GetRenderWindow()->Render();
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
void nmWxPostprocessingAnimationWidget::initOperPannel()
|
|
|
|
|
{
|
|
|
|
|
QHBoxLayout* operLayout = new QHBoxLayout; // 创建操作面板的水平布局
|
|
|
|
|
@ -717,6 +742,12 @@ void nmWxPostprocessingAnimationWidget::initOperPannel()
|
|
|
|
|
operLayout->addWidget(drawButton, 2);
|
|
|
|
|
connect(drawButton, SIGNAL(clicked()), this, SLOT(slotStartDrawPolygon()));
|
|
|
|
|
|
|
|
|
|
QCheckBox* wellActorsCheckBox = new QCheckBox(tr("Wells"), this);
|
|
|
|
|
wellActorsCheckBox->setToolTip(tr("Show or hide well names and well lines"));
|
|
|
|
|
wellActorsCheckBox->setChecked(m_bShowWellActors);
|
|
|
|
|
operLayout->addWidget(wellActorsCheckBox, 1);
|
|
|
|
|
connect(wellActorsCheckBox, SIGNAL(toggled(bool)), this, SLOT(slotSetWellActorsVisible(bool)));
|
|
|
|
|
|
|
|
|
|
// 创建切换显示模式的下拉框
|
|
|
|
|
QComboBox* showModeSelector = new QComboBox(this); // 创建下拉框
|
|
|
|
|
showModeSelector->addItem(tr("face")); // 添加“面”模式
|
|
|
|
|
|