feat: 新增PEBI结果区域平均压力统计

- 新增二维多边形绘制交互及闭合区域轮廓显示
- 按与区域相交的PEBI单元计算孔隙体积加权平均压力
- 展示压力上下限、压力时间和相交单元数量
- 压力帧变化时重新计算,切换静态属性时保留统计结果
- 绘制期间锁定播放、属性切换和通用视图命令
- 关闭统计面板时清除区域并结束本次统计
- 补充中文翻译
feature/PEBI-Region-Average-Pressure-20261102
lh 3 weeks ago
parent d25fd02de2
commit 645c98f512

Binary file not shown.

@ -3428,6 +3428,28 @@ No valid error was returned; keep the last accepted result and reduce the step.<
<message><source>Scale Grid</source><translation>比例网格</translation></message>
<message><source>Well Names</source><translation>井名</translation></message>
<message><source>Data Filtering...</source><translation>数据筛选...</translation></message>
<message><source>Region Average Pressure</source><translation>区域平均压力</translation></message>
<message><source>Statistics</source><translation>统计结果</translation></message>
<message><source>Cancel Region Drawing</source><translation>取消区域绘制</translation></message>
<message><source>Switch to Top View or Isometric View before drawing a pressure region.</source><translation>请切换到顶视图或等轴视图后再绘制压力统计区域。</translation></message>
<message><source>Unable to start region pressure drawing.</source><translation>无法开始绘制压力统计区域。</translation></message>
<message><source>Draw a non-degenerate region with at least three points.</source><translation>请绘制一个至少包含三个点且非退化的区域。</translation></message>
<message><source>The displayed result changed while the region was drawn.</source><translation>绘制区域期间,当前显示结果已发生变化。</translation></message>
<message><source>Unable to prepare the selected pressure region.</source><translation>无法准备所选压力统计区域。</translation></message>
<message><source>Unable to calculate region pressure statistics.</source><translation>无法计算区域压力统计。</translation></message>
<message><source>Unable to preserve the selected pressure region.</source><translation>无法保留所选压力统计区域。</translation></message>
<message><source>Region average pressure</source><translation>区域平均压力</translation></message>
<message><source>Weighted by cell area, thickness and porosity.</source><translation>按单元面积、厚度和孔隙度加权。</translation></message>
<message><source>Minimum pressure</source><translation>压力下限</translation></message>
<message><source>Maximum pressure</source><translation>压力上限</translation></message>
<message><source>Pressure time</source><translation>压力时间</translation></message>
<message><source>Selected cells</source><translation>选中单元</translation></message>
<message><source>MPa</source><translation>MPa</translation></message>
<message><source>Unable to calculate region average pressure.</source><translation>无法计算区域平均压力。</translation></message>
<message><source>No cells intersect the selected region.</source><translation>所选区域内没有相交单元。</translation></message>
<message><source>No valid cells are available for region average pressure.</source><translation>所选区域内没有可用于计算平均压力的有效单元。</translation></message>
<message><source>%1 selected cells were excluded because their data is invalid.</source><translation>有 %1 个选中单元因数据无效未参与统计。</translation></message>
<message><source>Close</source><translation>关闭</translation></message>
<message><source>Unable to display the latest result.</source><translation>无法显示最新结果。</translation></message>
<message><source>Unable to display the latest result: %1</source><translation>无法显示最新结果:%1</translation></message>
<message><source>Current inputs have changed. Showing the last successful result.</source><translation>当前输入已修改,正在显示上一次成功求解的结果。</translation></message>

@ -0,0 +1,94 @@
#ifndef NMPEBIREGIONPRESSURECALCULATOR_H
#define NMPEBIREGIONPRESSURECALCULATOR_H
#include "nmData_global.h"
#include <QPointF>
#include <QSharedPointer>
#include <QString>
#include <QVector>
#include <vtkType.h>
class nmPebiRegionPressureCalculatorPrivate;
class nmPebiResultSnapshot;
/**
* @brief 一帧区域压力的孔隙体积加权统计结果。
*
* 压力使用快照基础单位 MPa;面积和孔隙体积的单位分别为 m2 和 m3。
* m_bAvailable 为 false 时,计数仍可用于解释没有有效加权结果的原因。
*/
struct NM_DATA_EXPORT nmPebiRegionPressureStatistics
{
/** @brief 初始化为空且不可用的统计结果。 */
nmPebiRegionPressureStatistics();
/** @brief 清除所有计数和值,使对象恢复到默认状态。 */
void clear();
bool m_bAvailable; ///< 是否存在至少一个可用于压力加权的有效单元。
int m_nPressureFrameIndex; ///< 本结果对应的零基压力帧。
double m_dPressureTimeHours; ///< 压力帧求解时间,单位 h。
vtkIdType m_nIntersectingCellCount; ///< 与选区存在正面积交叠的二维单元数。
vtkIdType m_nValidCellCount; ///< 实际参与本帧压力统计的单元数。
vtkIdType m_nIgnoredCellCount; ///< 因权重或压力无效而忽略的相交单元数。
double m_dSelectedCellAreaSquareMeters; ///< 相交单元完整面积之和,单位 m2。
double m_dEffectivePoreVolumeCubicMeters; ///< 有效单元孔隙体积之和,单位 m3。
double m_dMinimumPressureMpa; ///< 有效单元最小压力,单位 MPa。
double m_dMaximumPressureMpa; ///< 有效单元最大压力,单位 MPa。
double m_dPoreVolumeWeightedPressureMpa; ///< 孔隙体积加权压力,单位 MPa。
};
/**
* @brief 在不可变 PEBI 快照上准备区域并逐帧计算压力统计。
*
* 准备阶段基于基础网格执行真实二维多边形相交判定;只要交叠面积为正,
* 整个单元即被选中。相交基础 Cell ID、完整面积和 A*h*phi 权重会被缓存,
* 后续切帧只读取已缓存单元的压力,不依赖 Mapper 或显示筛选管线。
*/
class NM_DATA_EXPORT nmPebiRegionPressureCalculator
{
public:
/** @brief 创建尚未绑定快照和区域的计算器。 */
nmPebiRegionPressureCalculator();
/** @brief 释放快照强引用和全部区域缓存。 */
~nmPebiRegionPressureCalculator();
/**
* @brief 事务式准备一份简单二维多边形选区。
* @param pSnapshot 只读结果快照,成功后由计算器保持强引用。
* @param vecPolygonPoints 按边界顺序给出的 XY 世界坐标;首点无需重复。
* @note 非有限、退化或自相交多边形会失败并保留旧区域缓存。
*/
bool prepare(
const QSharedPointer<const nmPebiResultSnapshot>& pSnapshot,
const QVector<QPointF>& vecPolygonPoints,
QString* pError = NULL);
/** @brief 清除当前区域、快照引用和所有相交单元缓存。 */
void clear();
/** @brief 返回是否已经成功准备过一份快照区域。 */
bool isPrepared() const;
/** @brief 返回当前区域所属快照 ID;未准备时为空。 */
QString getSnapshotId() const;
/** @brief 返回规范化后的区域顶点,引用在下次 prepare 或 clear 前有效。 */
const QVector<QPointF>& getPolygonPoints() const;
/** @brief 返回相交基础 VTK Cell ID,引用在下次 prepare 或 clear 前有效。 */
const QVector<vtkIdType>& getIntersectingCellIds() const;
/**
* @brief 使用缓存权重计算指定压力帧的最小、最大和加权平均值。
* @note 无相交单元或无有效权重属于成功的不可用结果,不返回伪造的零压力。
*/
bool calculateFrame(int nPressureFrameIndex,
nmPebiRegionPressureStatistics& oStatistics,
QString* pError = NULL) const;
private:
Q_DISABLE_COPY(nmPebiRegionPressureCalculator)
nmPebiRegionPressureCalculatorPrivate* m_pPrivate; ///< 独占区域缓存实现。
};
#endif // NMPEBIREGIONPRESSURECALCULATOR_H

@ -16,6 +16,7 @@
class vtkDoubleArray;
class vtkUnstructuredGrid;
class nmPebiRegionPressureCalculator;
class nmPebiResultSnapshotBuilder;
class nmPebiResultSnapshotRenderAdapter;
class nmPebiResultSnapshotSerializer;
@ -392,7 +393,8 @@ private:
/** @brief 求解时冻结的求解设置。 */
nmPebiResultSolverSettings m_oSolverSettings;
// 只有 Builder 和快照序列化器可以在发布前填充私有数据。
// 只有发布构建、序列化和只读区域统计服务可访问私有快照数据。
friend class nmPebiRegionPressureCalculator;
friend class nmPebiResultSnapshotBuilder;
friend class nmPebiResultSnapshotRenderAdapter;
friend class nmPebiResultSnapshotSerializer;

@ -0,0 +1,77 @@
#ifndef NMVTKPLANARPOLYGONINTERACTORSTYLE_H
#define NMVTKPLANARPOLYGONINTERACTORSTYLE_H
#include "nmRender_global.h"
#include <QPointF>
#include <QVector>
#include <vtkCommand.h>
#include <vtkInteractorStyle.h>
/**
* @brief 在世界坐标 Z=0 平面逐点绘制多边形的临时 VTK 交互样式。
*
* 本类不持有任何业务窗口或渲染图层。调用方通过 VTK Observer 监听点集变化、
* 完成、取消和无效完成事件,并在回调中复制当前点集。样式不修改相机。
*/
class NM_RENDER_EXPORT nmVTKPlanarPolygonInteractorStyle
: public vtkInteractorStyle
{
public:
static nmVTKPlanarPolygonInteractorStyle* New();
vtkTypeMacro(nmVTKPlanarPolygonInteractorStyle, vtkInteractorStyle);
enum InteractionEvent
{
PolygonChangedEvent = vtkCommand::UserEvent + 310,
PolygonCompletedEvent,
PolygonCancelledEvent,
PolygonInvalidEvent
};
/** @brief 左键添加点;双击的第二次按下尝试完成当前多边形。 */
virtual void OnLeftButtonDown();
/** @brief 右键取消当前绘制。 */
virtual void OnRightButtonDown();
/** @brief Enter 完成、Backspace 撤销、Esc 取消。 */
virtual void OnKeyPress();
/** @brief 绘制期间屏蔽基类的退出、复位和拾取字符快捷键。 */
virtual void OnChar();
/** @brief 清空节点并恢复未完成状态,不发出事件且不主动 Render。 */
void reset();
/** @brief 复制当前按绘制顺序保存的世界坐标点。 */
QVector<QPointF> getPoints() const;
/** @brief 返回当前点数。 */
int getPointCount() const;
/** @brief 返回是否已经成功发出完成事件。 */
bool isCompleted() const;
protected:
nmVTKPlanarPolygonInteractorStyle();
virtual ~nmVTKPlanarPolygonInteractorStyle();
private:
nmVTKPlanarPolygonInteractorStyle(
const nmVTKPlanarPolygonInteractorStyle&);
void operator=(const nmVTKPlanarPolygonInteractorStyle&);
/** @brief 把当前显示坐标射线与 Z=0 平面求交。 */
bool projectEventPositionToPlane(QPointF& oPoint);
/** @brief 添加非重复有限点并同步发出变化事件。 */
bool appendCurrentPoint();
/** @brief 校验点数和面积,成功后依次发出变化及完成事件。 */
bool completePolygon();
/** @brief 撤销最后一个点并发出变化事件。 */
void removeLastPoint();
/** @brief 发出取消事件;点集保留到调用方回调结束。 */
void cancelPolygon();
/** @brief 请求 Interactor 重绘当前视图。 */
void renderInteractor();
QVector<QPointF> m_vecPoints; ///< 当前候选多边形世界坐标。
bool m_bCompleted; ///< 成功完成后阻止重复输入。
};
#endif // NMVTKPLANARPOLYGONINTERACTORSTYLE_H

@ -0,0 +1,47 @@
#ifndef NMVTKPLANARPOLYGONLAYER_H
#define NMVTKPLANARPOLYGONLAYER_H
#include "nmVTKRenderLayer.h"
#include <QPointF>
#include <QVector>
class nmVTKPlanarPolygonLayerPrivate;
/**
* @brief 在固定 XY 平面显示多边形绘制节点和折线的通用业务图层。
*
* 图层不参与拾取和相机边界计算,也不主动触发 Render。调用方可以在绘制
* 期间显示开放折线,在完成后显示闭合多边形。所有接口只能在 Qt GUI 线程调用。
*/
class NM_RENDER_EXPORT nmVTKPlanarPolygonLayer
: public nmVTKRenderLayer
{
public:
/** @brief 创建初始为空且可见的多边形图层。 */
explicit nmVTKPlanarPolygonLayer(const QString& sLayerId);
/** @brief 释放独占的 PolyData、Mapper 和 Actor。 */
virtual ~nmVTKPlanarPolygonLayer();
/**
* @brief 用有限 XY 点替换当前轮廓,不主动渲染。
* @param vecPoints 按绘制顺序排列的世界坐标点。
* @param bClosed 为 true 且至少有三个点时连接末点和首点。
* @return 所有点有效且 VTK 几何更新成功时返回 true。
*/
bool setPolygon(const QVector<QPointF>& vecPoints, bool bClosed);
/** @brief 清空全部节点和线段,不主动渲染。 */
void clear();
/** @brief 返回当前保存的世界坐标点副本。 */
QVector<QPointF> getPoints() const;
/** @brief 返回当前是否以闭合多边形显示。 */
bool isClosed() const;
private:
Q_DISABLE_COPY(nmVTKPlanarPolygonLayer)
nmVTKPlanarPolygonLayerPrivate* m_pPrivate; ///< 独占实现对象。
};
#endif // NMVTKPLANARPOLYGONLAYER_H

@ -83,6 +83,8 @@ private:
void setCapabilities(ViewCommands eCommands);
/** @brief 仅供容器同步就绪、空、错误和加载状态。 */
void setViewAvailable(bool bAvailable);
/** @brief 仅供容器在临时交互期间统一锁定全部公共命令。 */
void setInteractionCommandsAvailable(bool bAvailable);
QAction* createAction(ViewCommand eCommand,
const QString& sText,
const QString& sIconFile,
@ -101,6 +103,7 @@ private:
QAction* m_pActions[ViewCommandCount]; ///< 本对象通过 Qt 父子关系拥有。
ViewCommands m_eCapabilities;
bool m_bViewAvailable;
bool m_bInteractionCommandsAvailable; ///< 默认交互活动时公共命令才可用。
bool m_bRotationCenterPickingAvailable;
bool m_bRotationCenterMarkerAvailable; ///< 标记开关当前是否具备操作条件。
};

@ -49,6 +49,13 @@ public:
void setExportInProgress(bool bInProgress);
/** @brief 返回同步动画导出是否正在占用结果控制条。 */
bool isExportInProgress() const;
/**
* @brief 设置业务绘制等外部交互是否锁定全部结果身份控件。
* @note 进入锁定时会停止正在运行的回放;解除后按 Scene 当前状态恢复。
*/
void setExternalInteractionLocked(bool bLocked);
/** @brief 返回区域绘制等外部交互是否正在锁定控制条。 */
bool isExternalInteractionLocked() const;
signals:
/** @brief 一次明确的用户操作已经成功提交,供组合窗口清除旧普通错误。 */
@ -135,6 +142,8 @@ private:
QToolButton* m_pExportButton;
/** @brief 当前窗口是否正在执行参数选择、编码或文件发布事务。 */
bool m_bExportInProgress;
/** @brief 区域绘制等外部业务交互是否正在冻结结果身份。 */
bool m_bExternalInteractionLocked;
/** @brief 当前属性项对应的 Snapshot ID,仅用于避免重复重建 UI。 */
QString m_sDisplayedSnapshotId;
/** @brief 属性和时间列表最近一次完整展示的 Scene 成功绑定序号。 */

@ -22,10 +22,12 @@ class QToolBar;
class iUnitGroup;
class nmDataAnalyzeManager;
class nmWxPebiResultRegionState;
class nmPebiResultSceneController;
class nmPebiResultSnapshot;
class nmWxPebiResultControlBar;
class nmWxVTKRenderContainerWidget;
class vtkObject;
/** @brief 编辑并原子提交当前结果窗口的独立单元筛选条件。 */
class NM_SUB_WXS_EXPORT nmWxPebiResultFilterSettingsDlg : public iDlgBase
@ -142,7 +144,14 @@ private slots:
void onExportAnimationRequested();
/** @brief 在播放和导出状态防御后打开数据筛选对话框。 */
void onShowFilterSettings();
/** @brief 开始、取消区域压力绘制,或重新显示既有统计面板。 */
void onRegionPressureStatisticsTriggered();
/** @brief 在 VTK 观察者返回后安全处理完成、取消或无效绘制事件。 */
void processPendingRegionInteractionEvent();
/** @brief 同步业务动作并按当前 pressure 帧至多重算一次区域统计。 */
void onResultDisplayStateChanged();
/** @brief 关闭面板并清除区域、统计缓存和闭合轮廓。 */
void onCloseRegionPressureStatistics();
/** @brief 切换色标显隐。 */
void onScalarBarToggled(bool bVisible);
/** @brief 切换比例网格显隐。 */
@ -170,6 +179,31 @@ private:
void refreshStatusBar();
/** @brief 断开当前 Manager 的两个连接,不访问已经析构的对象。 */
void disconnectDataManager();
/** @brief 创建区域图层和临时交互样式,并冻结当前 pressure 显示身份。 */
bool startRegionPressureDrawing();
/** @brief 解除临时交互、观察者和控制条锁,不修改已准备的统计区域。 */
void stopRegionPressureDrawing();
/** @brief 清除区域计算与轮廓,可选择提交一次画面刷新。 */
void clearRegionPressureSelection(bool bRenderView);
/** @brief 移除区域图层和面板,供析构在其他渲染对象之前安全收尾。 */
void destroyRegionPressureState();
/** @brief 确保业务 Scene 中存在本窗口独占的区域轮廓图层。 */
bool ensureRegionPressureLayer();
/** @brief 按当前 pressure 帧刷新缓存和面板,相同帧不重复计算。 */
void updateRegionPressureStatistics();
/** @brief 首次需要时创建非模态区域统计面板。 */
void ensureRegionPressureStatisticsDialog();
/** @brief 从最近一次统计结果刷新面板文字,不改变面板显隐。 */
void refreshRegionPressureStatisticsDialog();
/** @brief 显示、前置并激活已经创建的区域统计面板。 */
void showRegionPressureStatisticsDialog();
/** @brief 返回当前是否仍处于多边形绘制事务。 */
bool isRegionPressureDrawing() const;
/** @brief 将 VTK 多边形事件复制到窗口状态并排队到 Qt 事件循环。 */
static void handleRegionPolygonEvent(vtkObject* pCaller,
unsigned long nEventId,
void* pClientData,
void* pCallData);
QPointer<nmDataAnalyzeManager> m_pDataManager; ///< 当前显式注入的 Manager。
nmWxVTKRenderContainerWidget* m_pRenderContainer; ///< 唯一通用 VTK 容器。
@ -182,6 +216,9 @@ private:
QAction* m_pScaleGridAction; ///< 比例网格显隐动作。
QAction* m_pWellNamesAction; ///< 二维井名显隐动作。
QAction* m_pFilterAction; ///< 打开数据筛选设置的共享动作。
QAction* m_pRegionPressureAction; ///< 绘制区域或显示压力统计的共享动作。
nmWxPebiResultRegionState* m_pRegionState; ///< 独占区域交互、计算和面板状态。
/** @brief Manager 最近一次通知后观察到的快照强引用。 */
QSharedPointer<const nmPebiResultSnapshot> m_pObservedSnapshot;

@ -0,0 +1,774 @@
#include "nmPebiRegionPressureCalculator.h"
#include "nmPebiResultSnapshot.h"
#include <QRectF>
#include <vtkCell.h>
#include <vtkCellType.h>
#include <vtkDoubleArray.h>
#include <vtkPoints.h>
#include <vtkUnstructuredGrid.h>
#include <algorithm>
#include <float.h>
#include <math.h>
#if !defined(_MSC_VER)
#include <cmath>
#endif
namespace {
// 所有区域统计几何均投影到 XY 平面,三角形是剪裁和求交的最小单元。
struct Triangle2D
{
QPointF m_a;
QPointF m_b;
QPointF m_c;
};
struct PreparedPolygon
{
QVector<QPointF> m_vecPoints;
QVector<Triangle2D> m_vecTriangles;
QRectF m_oBounds;
double m_dArea;
};
struct CachedCell
{
CachedCell()
: m_nCellId(-1),
m_dArea(0.0),
m_dPoreVolumeWeight(0.0),
m_bWeightValid(false)
{
}
vtkIdType m_nCellId;
double m_dArea;
double m_dPoreVolumeWeight;
bool m_bWeightValid;
};
bool isFiniteValue(double dValue)
{
#if defined(_MSC_VER)
return _finite(dValue) != 0;
#else
return std::isfinite(dValue);
#endif
}
double crossProduct(const QPointF& a,
const QPointF& b,
const QPointF& c)
{
return (b.x() - a.x()) * (c.y() - a.y()) -
(b.y() - a.y()) * (c.x() - a.x());
}
double squaredDistance(const QPointF& a, const QPointF& b)
{
const double dX = a.x() - b.x();
const double dY = a.y() - b.y();
return dX * dX + dY * dY;
}
double signedDoubleArea(const QVector<QPointF>& vecPoints)
{
if(vecPoints.size() < 3) {
return 0.0;
}
// 先平移到首点附近再做鞋带求和,避免大地坐标中的大数相减吞掉小区域面积。
const QPointF oOrigin = vecPoints.first();
double dArea = 0.0;
for(int nIndex = 0; nIndex < vecPoints.size(); ++nIndex) {
const QPointF& a = vecPoints[nIndex];
const QPointF& b = vecPoints[(nIndex + 1) % vecPoints.size()];
const double dAx = a.x() - oOrigin.x();
const double dAy = a.y() - oOrigin.y();
const double dBx = b.x() - oOrigin.x();
const double dBy = b.y() - oOrigin.y();
dArea += dAx * dBy - dBx * dAy;
}
return dArea;
}
QRectF polygonBounds(const QVector<QPointF>& vecPoints)
{
double dMinimumX = vecPoints[0].x();
double dMaximumX = dMinimumX;
double dMinimumY = vecPoints[0].y();
double dMaximumY = dMinimumY;
for(int nIndex = 1; nIndex < vecPoints.size(); ++nIndex) {
dMinimumX = qMin(dMinimumX, vecPoints[nIndex].x());
dMaximumX = qMax(dMaximumX, vecPoints[nIndex].x());
dMinimumY = qMin(dMinimumY, vecPoints[nIndex].y());
dMaximumY = qMax(dMaximumY, vecPoints[nIndex].y());
}
return QRectF(QPointF(dMinimumX, dMinimumY),
QPointF(dMaximumX, dMaximumY));
}
bool pointOnSegment(const QPointF& p,
const QPointF& a,
const QPointF& b,
double dLinearTolerance,
double dAreaTolerance)
{
if(qAbs(crossProduct(a, b, p)) > dAreaTolerance) {
return false;
}
return p.x() >= qMin(a.x(), b.x()) - dLinearTolerance &&
p.x() <= qMax(a.x(), b.x()) + dLinearTolerance &&
p.y() >= qMin(a.y(), b.y()) - dLinearTolerance &&
p.y() <= qMax(a.y(), b.y()) + dLinearTolerance;
}
int orientationSign(const QPointF& a,
const QPointF& b,
const QPointF& c,
double dAreaTolerance)
{
const double dCross = crossProduct(a, b, c);
if(dCross > dAreaTolerance) {
return 1;
}
if(dCross < -dAreaTolerance) {
return -1;
}
return 0;
}
bool segmentsIntersect(const QPointF& a,
const QPointF& b,
const QPointF& c,
const QPointF& d,
double dLinearTolerance,
double dAreaTolerance)
{
const int nAbC = orientationSign(a, b, c, dAreaTolerance);
const int nAbD = orientationSign(a, b, d, dAreaTolerance);
const int nCdA = orientationSign(c, d, a, dAreaTolerance);
const int nCdB = orientationSign(c, d, b, dAreaTolerance);
if(nAbC * nAbD < 0 && nCdA * nCdB < 0) {
return true;
}
return (nAbC == 0 && pointOnSegment(c, a, b,
dLinearTolerance, dAreaTolerance)) ||
(nAbD == 0 && pointOnSegment(d, a, b,
dLinearTolerance, dAreaTolerance)) ||
(nCdA == 0 && pointOnSegment(a, c, d,
dLinearTolerance, dAreaTolerance)) ||
(nCdB == 0 && pointOnSegment(b, c, d,
dLinearTolerance, dAreaTolerance));
}
bool isSimplePolygon(const QVector<QPointF>& vecPoints,
double dLinearTolerance,
double dAreaTolerance)
{
// 只检查非相邻边;相邻边共享端点是合法多边形的必要条件。
const int nPointCount = vecPoints.size();
for(int nFirst = 0; nFirst < nPointCount; ++nFirst) {
const int nFirstNext = (nFirst + 1) % nPointCount;
for(int nSecond = nFirst + 1; nSecond < nPointCount; ++nSecond) {
const int nSecondNext = (nSecond + 1) % nPointCount;
if(nFirst == nSecond || nFirstNext == nSecond ||
nSecondNext == nFirst) {
continue;
}
if(segmentsIntersect(vecPoints[nFirst], vecPoints[nFirstNext],
vecPoints[nSecond], vecPoints[nSecondNext],
dLinearTolerance, dAreaTolerance)) {
return false;
}
}
}
return true;
}
bool pointInsideTriangle(const QPointF& p,
const QPointF& a,
const QPointF& b,
const QPointF& c,
double dAreaTolerance)
{
return crossProduct(a, b, p) >= -dAreaTolerance &&
crossProduct(b, c, p) >= -dAreaTolerance &&
crossProduct(c, a, p) >= -dAreaTolerance;
}
bool triangulatePolygon(const QVector<QPointF>& vecPoints,
double dAreaTolerance,
QVector<Triangle2D>& vecTriangles)
{
// 耳切法同时支持凸、凹简单多边形,无需依赖 VTK 的三维三角化管线。
vecTriangles.clear();
QVector<int> vecIndices;
for(int nIndex = 0; nIndex < vecPoints.size(); ++nIndex) {
vecIndices.append(nIndex);
}
while(vecIndices.size() > 3) {
bool bEarFound = false;
for(int nPosition = 0; nPosition < vecIndices.size(); ++nPosition) {
const int nPrevious = vecIndices[
(nPosition + vecIndices.size() - 1) % vecIndices.size()];
const int nCurrent = vecIndices[nPosition];
const int nNext = vecIndices[(nPosition + 1) % vecIndices.size()];
const QPointF& a = vecPoints[nPrevious];
const QPointF& b = vecPoints[nCurrent];
const QPointF& c = vecPoints[nNext];
if(crossProduct(a, b, c) <= dAreaTolerance) {
continue;
}
bool bContainsOtherPoint = false;
for(int nOtherPosition = 0;
nOtherPosition < vecIndices.size(); ++nOtherPosition) {
const int nOther = vecIndices[nOtherPosition];
if(nOther == nPrevious || nOther == nCurrent ||
nOther == nNext) {
continue;
}
if(pointInsideTriangle(vecPoints[nOther], a, b, c,
dAreaTolerance)) {
bContainsOtherPoint = true;
break;
}
}
if(bContainsOtherPoint) {
continue;
}
Triangle2D oTriangle;
oTriangle.m_a = a;
oTriangle.m_b = b;
oTriangle.m_c = c;
vecTriangles.append(oTriangle);
vecIndices.remove(nPosition);
bEarFound = true;
break;
}
if(!bEarFound) {
vecTriangles.clear();
return false;
}
}
if(vecIndices.size() != 3) {
vecTriangles.clear();
return false;
}
Triangle2D oTriangle;
oTriangle.m_a = vecPoints[vecIndices[0]];
oTriangle.m_b = vecPoints[vecIndices[1]];
oTriangle.m_c = vecPoints[vecIndices[2]];
if(crossProduct(oTriangle.m_a, oTriangle.m_b, oTriangle.m_c) <=
dAreaTolerance) {
vecTriangles.clear();
return false;
}
vecTriangles.append(oTriangle);
return true;
}
bool preparePolygon(const QVector<QPointF>& vecInput,
PreparedPolygon& oPolygon)
{
oPolygon = PreparedPolygon();
if(vecInput.size() < 3) {
return false;
}
for(int nIndex = 0; nIndex < vecInput.size(); ++nIndex) {
if(!isFiniteValue(vecInput[nIndex].x()) ||
!isFiniteValue(vecInput[nIndex].y())) {
return false;
}
}
// 容差跟随当前多边形尺度,兼容小尺寸网格和大地坐标。
const QRectF oInputBounds = polygonBounds(vecInput);
const double dScale = qMax(1.0, qMax(oInputBounds.width(),
oInputBounds.height()));
const double dLinearTolerance = dScale * 1.0e-10;
const double dAreaTolerance = dScale * dScale * 1.0e-12;
const double dSquaredTolerance =
dLinearTolerance * dLinearTolerance;
// 先去掉相邻重复点及显式闭合点,避免产生零长边。
QVector<QPointF> vecPoints;
for(int nIndex = 0; nIndex < vecInput.size(); ++nIndex) {
if(vecPoints.isEmpty() ||
squaredDistance(vecPoints.last(), vecInput[nIndex]) >
dSquaredTolerance) {
vecPoints.append(vecInput[nIndex]);
}
}
if(vecPoints.size() > 1 &&
squaredDistance(vecPoints.first(), vecPoints.last()) <=
dSquaredTolerance) {
vecPoints.remove(vecPoints.size() - 1);
}
// 反复清理共线中间点,直到点集稳定,降低耳切法退化风险。
bool bRemovedPoint = true;
while(bRemovedPoint && vecPoints.size() >= 3) {
bRemovedPoint = false;
for(int nIndex = 0; nIndex < vecPoints.size(); ++nIndex) {
const QPointF& a = vecPoints[
(nIndex + vecPoints.size() - 1) % vecPoints.size()];
const QPointF& p = vecPoints[nIndex];
const QPointF& b = vecPoints[(nIndex + 1) % vecPoints.size()];
if(pointOnSegment(p, a, b,
dLinearTolerance, dAreaTolerance)) {
vecPoints.remove(nIndex);
bRemovedPoint = true;
break;
}
}
}
if(vecPoints.size() < 3 ||
!isSimplePolygon(vecPoints,
dLinearTolerance, dAreaTolerance)) {
return false;
}
double dDoubleArea = signedDoubleArea(vecPoints);
if(!isFiniteValue(dDoubleArea) ||
qAbs(dDoubleArea) <= dAreaTolerance) {
return false;
}
// 后续半平面剪裁约定顶点为逆时针顺序。
if(dDoubleArea < 0.0) {
std::reverse(vecPoints.begin(), vecPoints.end());
dDoubleArea = -dDoubleArea;
}
QVector<Triangle2D> vecTriangles;
if(!triangulatePolygon(vecPoints,
dAreaTolerance, vecTriangles)) {
return false;
}
oPolygon.m_vecPoints = vecPoints;
oPolygon.m_vecTriangles = vecTriangles;
oPolygon.m_oBounds = polygonBounds(vecPoints);
oPolygon.m_dArea = dDoubleArea * 0.5;
return isFiniteValue(oPolygon.m_dArea) && oPolygon.m_dArea > 0.0;
}
QPointF segmentLineIntersection(const QPointF& s,
const QPointF& e,
double dStartDistance,
double dEndDistance)
{
const double dDenominator = dStartDistance - dEndDistance;
const double dT = dDenominator == 0.0
? 0.0 : dStartDistance / dDenominator;
return QPointF(s.x() + dT * (e.x() - s.x()),
s.y() + dT * (e.y() - s.y()));
}
QVector<QPointF> clipByEdge(const QVector<QPointF>& vecSubject,
const QPointF& a,
const QPointF& b,
double dAreaTolerance)
{
// Sutherland-Hodgman 半平面剪裁,裁剪边左侧视为三角形内部。
QVector<QPointF> vecOutput;
if(vecSubject.isEmpty()) {
return vecOutput;
}
QPointF s = vecSubject.last();
double dStartDistance = crossProduct(a, b, s);
bool bStartInside = dStartDistance >= -dAreaTolerance;
for(int nIndex = 0; nIndex < vecSubject.size(); ++nIndex) {
const QPointF e = vecSubject[nIndex];
const double dEndDistance = crossProduct(a, b, e);
const bool bEndInside = dEndDistance >= -dAreaTolerance;
if(bEndInside) {
if(!bStartInside) {
vecOutput.append(segmentLineIntersection(
s, e, dStartDistance, dEndDistance));
}
vecOutput.append(e);
} else if(bStartInside) {
vecOutput.append(segmentLineIntersection(
s, e, dStartDistance, dEndDistance));
}
s = e;
dStartDistance = dEndDistance;
bStartInside = bEndInside;
}
return vecOutput;
}
double triangleIntersectionArea(const Triangle2D& oSubject,
const Triangle2D& oClip,
double dAreaTolerance)
{
QVector<QPointF> vecClipped;
vecClipped.append(oSubject.m_a);
vecClipped.append(oSubject.m_b);
vecClipped.append(oSubject.m_c);
vecClipped = clipByEdge(vecClipped,
oClip.m_a, oClip.m_b, dAreaTolerance);
vecClipped = clipByEdge(vecClipped,
oClip.m_b, oClip.m_c, dAreaTolerance);
vecClipped = clipByEdge(vecClipped,
oClip.m_c, oClip.m_a, dAreaTolerance);
return vecClipped.size() >= 3
? qAbs(signedDoubleArea(vecClipped)) * 0.5 : 0.0;
}
bool rectanglesOverlap(const QRectF& a,
const QRectF& b,
double dTolerance)
{
return a.right() >= b.left() - dTolerance &&
b.right() >= a.left() - dTolerance &&
a.bottom() >= b.top() - dTolerance &&
b.bottom() >= a.top() - dTolerance;
}
bool polygonsHavePositiveAreaIntersection(
const PreparedPolygon& a,
const PreparedPolygon& b)
{
// 业务语义是“面积相交”:仅边界或顶点接触不把单元纳入统计。
const double dFirstScale =
qMax(a.m_oBounds.width(), a.m_oBounds.height());
const double dSecondScale =
qMax(b.m_oBounds.width(), b.m_oBounds.height());
// 交叠容差跟随较小多边形,避免大选区吞掉小单元的真实窄交叠。
const double dScale = qMax(1.0, qMin(dFirstScale, dSecondScale));
const double dLinearTolerance = dScale * 1.0e-10;
if(!rectanglesOverlap(a.m_oBounds, b.m_oBounds,
dLinearTolerance)) {
return false;
}
const double dAreaTolerance = dScale * dScale * 1.0e-13;
const double dPositiveAreaThreshold = qMax(
dAreaTolerance,
qMin(a.m_dArea, b.m_dArea) * 1.0e-12);
for(int nA = 0; nA < a.m_vecTriangles.size(); ++nA) {
for(int nB = 0; nB < b.m_vecTriangles.size(); ++nB) {
if(triangleIntersectionArea(
a.m_vecTriangles[nA], b.m_vecTriangles[nB],
dAreaTolerance) > dPositiveAreaThreshold) {
return true;
}
}
}
return false;
}
bool readCellPolygon(vtkCell* pCell,
QVector<QPointF>& vecPoints)
{
// 当前 PEBI 结果只接受可直接解释为平面多边形的单元类型。
vecPoints.clear();
if(pCell == NULL ||
(pCell->GetCellType() != VTK_TRIANGLE &&
pCell->GetCellType() != VTK_QUAD &&
pCell->GetCellType() != VTK_POLYGON) ||
pCell->GetPoints() == NULL ||
pCell->GetNumberOfPoints() < 3) {
return false;
}
double aPoint[3] = { 0.0, 0.0, 0.0 };
for(vtkIdType nPointIndex = 0;
nPointIndex < pCell->GetNumberOfPoints(); ++nPointIndex) {
pCell->GetPoints()->GetPoint(nPointIndex, aPoint);
if(!isFiniteValue(aPoint[0]) || !isFiniteValue(aPoint[1])) {
vecPoints.clear();
return false;
}
vecPoints.append(QPointF(aPoint[0], aPoint[1]));
}
return true;
}
void addCompensated(double dValue,
double& dSum,
double& dCorrection)
{
// Kahan 补偿求和用于缓解单元数量较多或权重差异较大时的累计误差。
const double dAdjusted = dValue - dCorrection;
const double dCandidate = dSum + dAdjusted;
dCorrection = (dCandidate - dSum) - dAdjusted;
dSum = dCandidate;
}
}
class nmPebiRegionPressureCalculatorPrivate
{
public:
nmPebiRegionPressureCalculatorPrivate()
: m_bPrepared(false),
m_dSelectedCellArea(0.0)
{
}
bool m_bPrepared;
QSharedPointer<const nmPebiResultSnapshot> m_pSnapshot;
QVector<QPointF> m_vecPolygonPoints;
QVector<vtkIdType> m_vecIntersectingCellIds;
QVector<CachedCell> m_vecCells;
double m_dSelectedCellArea;
};
nmPebiRegionPressureStatistics::nmPebiRegionPressureStatistics()
{
clear();
}
void nmPebiRegionPressureStatistics::clear()
{
m_bAvailable = false;
m_nPressureFrameIndex = -1;
m_dPressureTimeHours = 0.0;
m_nIntersectingCellCount = 0;
m_nValidCellCount = 0;
m_nIgnoredCellCount = 0;
m_dSelectedCellAreaSquareMeters = 0.0;
m_dEffectivePoreVolumeCubicMeters = 0.0;
m_dMinimumPressureMpa = 0.0;
m_dMaximumPressureMpa = 0.0;
m_dPoreVolumeWeightedPressureMpa = 0.0;
}
nmPebiRegionPressureCalculator::nmPebiRegionPressureCalculator()
: m_pPrivate(new nmPebiRegionPressureCalculatorPrivate)
{
}
nmPebiRegionPressureCalculator::~nmPebiRegionPressureCalculator()
{
delete m_pPrivate;
m_pPrivate = NULL;
}
bool nmPebiRegionPressureCalculator::prepare(
const QSharedPointer<const nmPebiResultSnapshot>& pSnapshot,
const QVector<QPointF>& vecPolygonPoints,
QString* pError)
{
if(pError != NULL) {
pError->clear();
}
const vtkIdType nCellCount = pSnapshot.isNull()
? 0 : pSnapshot->getResultCellCount();
if(m_pPrivate == NULL || pSnapshot.isNull() ||
!pSnapshot->m_bComplete || pSnapshot->m_pResultGrid == NULL ||
nCellCount <= 0 || pSnapshot->m_pPorosity == NULL ||
pSnapshot->m_pThickness == NULL ||
pSnapshot->m_pPorosity->GetNumberOfComponents() != 1 ||
pSnapshot->m_pThickness->GetNumberOfComponents() != 1 ||
pSnapshot->m_pPorosity->GetNumberOfTuples() != nCellCount ||
pSnapshot->m_pThickness->GetNumberOfTuples() != nCellCount ||
pSnapshot->m_vecPressureFrames.isEmpty()) {
if(pError != NULL) {
*pError = QString::fromLatin1(
"The PEBI result snapshot is invalid.");
}
return false;
}
PreparedPolygon oSelection;
if(!preparePolygon(vecPolygonPoints, oSelection)) {
if(pError != NULL) {
*pError = QString::fromLatin1(
"The region polygon is invalid or self-intersecting.");
}
return false;
}
// 先在候选状态中完成全部校验和缓存,失败时不破坏上一个可用区域。
nmPebiRegionPressureCalculatorPrivate oCandidate;
oCandidate.m_pSnapshot = pSnapshot;
oCandidate.m_vecPolygonPoints = oSelection.m_vecPoints;
vtkUnstructuredGrid* pGrid = pSnapshot->m_pResultGrid;
QVector<QPointF> vecCellPoints;
double dAreaCorrection = 0.0;
for(vtkIdType nCellId = 0;
nCellId < pGrid->GetNumberOfCells(); ++nCellId) {
vtkCell* pCell = pGrid->GetCell(nCellId);
if(!readCellPolygon(pCell, vecCellPoints)) {
continue;
}
PreparedPolygon oCellPolygon;
if(!preparePolygon(vecCellPoints, oCellPolygon) ||
!polygonsHavePositiveAreaIntersection(
oSelection, oCellPolygon)) {
continue;
}
CachedCell oCell;
oCell.m_nCellId = nCellId;
// 选中规则是“有正面积相交即纳入”,纳入后使用整个单元面积计算孔隙体积权重。
oCell.m_dArea = oCellPolygon.m_dArea;
const double dPorosity =
pSnapshot->m_pPorosity->GetValue(nCellId);
const double dThickness =
pSnapshot->m_pThickness->GetValue(nCellId);
const double dWeight = oCell.m_dArea * dThickness * dPorosity;
// 几何相交单元保留在计数中;非法物性只在压力统计时被忽略。
oCell.m_bWeightValid = isFiniteValue(dPorosity) &&
isFiniteValue(dThickness) && isFiniteValue(dWeight) &&
dPorosity > 0.0 && dThickness > 0.0 && dWeight > 0.0;
oCell.m_dPoreVolumeWeight = oCell.m_bWeightValid ? dWeight : 0.0;
oCandidate.m_vecCells.append(oCell);
oCandidate.m_vecIntersectingCellIds.append(nCellId);
addCompensated(oCell.m_dArea,
oCandidate.m_dSelectedCellArea,
dAreaCorrection);
}
if(!isFiniteValue(oCandidate.m_dSelectedCellArea)) {
if(pError != NULL) {
*pError = QString::fromLatin1(
"The selected cell area is invalid.");
}
return false;
}
oCandidate.m_bPrepared = true;
*m_pPrivate = oCandidate;
return true;
}
void nmPebiRegionPressureCalculator::clear()
{
if(m_pPrivate != NULL) {
*m_pPrivate = nmPebiRegionPressureCalculatorPrivate();
}
}
bool nmPebiRegionPressureCalculator::isPrepared() const
{
return m_pPrivate != NULL && m_pPrivate->m_bPrepared &&
!m_pPrivate->m_pSnapshot.isNull();
}
QString nmPebiRegionPressureCalculator::getSnapshotId() const
{
return isPrepared()
? m_pPrivate->m_pSnapshot->getSnapshotId() : QString();
}
const QVector<QPointF>&
nmPebiRegionPressureCalculator::getPolygonPoints() const
{
return m_pPrivate->m_vecPolygonPoints;
}
const QVector<vtkIdType>&
nmPebiRegionPressureCalculator::getIntersectingCellIds() const
{
return m_pPrivate->m_vecIntersectingCellIds;
}
bool nmPebiRegionPressureCalculator::calculateFrame(
int nPressureFrameIndex,
nmPebiRegionPressureStatistics& oStatistics,
QString* pError) const
{
oStatistics.clear();
if(pError != NULL) {
pError->clear();
}
if(!isPrepared() || nPressureFrameIndex < 0 ||
nPressureFrameIndex >=
m_pPrivate->m_pSnapshot->m_vecPressureFrames.size()) {
if(pError != NULL) {
*pError = QString::fromLatin1(
"The pressure frame is invalid.");
}
return false;
}
const nmPebiResultSnapshot::PressureFrame& oFrame =
m_pPrivate->m_pSnapshot->m_vecPressureFrames[
nPressureFrameIndex];
vtkDoubleArray* pPressure = oFrame.m_pPressure;
if(pPressure == NULL || pPressure->GetNumberOfComponents() != 1 ||
pPressure->GetNumberOfTuples() !=
m_pPrivate->m_pSnapshot->getResultCellCount() ||
!isFiniteValue(oFrame.m_dTime)) {
if(pError != NULL) {
*pError = QString::fromLatin1(
"The pressure frame data is invalid.");
}
return false;
}
oStatistics.m_nPressureFrameIndex = nPressureFrameIndex;
oStatistics.m_dPressureTimeHours = oFrame.m_dTime;
oStatistics.m_nIntersectingCellCount =
m_pPrivate->m_vecCells.size();
oStatistics.m_dSelectedCellAreaSquareMeters =
m_pPrivate->m_dSelectedCellArea;
// 交集及静态权重已在 prepare() 缓存,逐帧只读压力并做线性汇总。
double dPoreVolumeSum = 0.0;
double dPoreVolumeCorrection = 0.0;
double dWeightedPressureSum = 0.0;
double dWeightedPressureCorrection = 0.0;
double dMinimumPressure = DBL_MAX;
double dMaximumPressure = -DBL_MAX;
for(int nIndex = 0;
nIndex < m_pPrivate->m_vecCells.size(); ++nIndex) {
const CachedCell& oCell = m_pPrivate->m_vecCells[nIndex];
const double dPressure = pPressure->GetValue(oCell.m_nCellId);
if(!oCell.m_bWeightValid || !isFiniteValue(dPressure)) {
continue;
}
addCompensated(oCell.m_dPoreVolumeWeight,
dPoreVolumeSum, dPoreVolumeCorrection);
addCompensated(oCell.m_dPoreVolumeWeight * dPressure,
dWeightedPressureSum,
dWeightedPressureCorrection);
dMinimumPressure = qMin(dMinimumPressure, dPressure);
dMaximumPressure = qMax(dMaximumPressure, dPressure);
++oStatistics.m_nValidCellCount;
}
oStatistics.m_nIgnoredCellCount =
oStatistics.m_nIntersectingCellCount -
oStatistics.m_nValidCellCount;
// 空选区或全部权重无效都是可展示结果,不把它们当成计算错误。
if(oStatistics.m_nValidCellCount == 0) {
return true;
}
if(!isFiniteValue(dPoreVolumeSum) || dPoreVolumeSum <= 0.0 ||
!isFiniteValue(dWeightedPressureSum)) {
if(pError != NULL) {
*pError = QString::fromLatin1(
"The pore-volume weighted pressure is invalid.");
}
return false;
}
const double dAveragePressure =
dWeightedPressureSum / dPoreVolumeSum;
if(!isFiniteValue(dMinimumPressure) ||
!isFiniteValue(dMaximumPressure) ||
!isFiniteValue(dAveragePressure)) {
if(pError != NULL) {
*pError = QString::fromLatin1(
"The regional pressure statistics are invalid.");
}
return false;
}
oStatistics.m_bAvailable = true;
oStatistics.m_dEffectivePoreVolumeCubicMeters = dPoreVolumeSum;
oStatistics.m_dMinimumPressureMpa = dMinimumPressure;
oStatistics.m_dMaximumPressureMpa = dMaximumPressure;
oStatistics.m_dPoreVolumeWeightedPressureMpa = dAveragePressure;
return true;
}

@ -0,0 +1,301 @@
#include "nmVTKPlanarPolygonInteractorStyle.h"
#include <QtGlobal>
#include <vtkMath.h>
#include <vtkObjectFactory.h>
#include <vtkRenderer.h>
#include <vtkRenderWindowInteractor.h>
#include <cmath>
#include <cstring>
#include <limits>
vtkStandardNewMacro(nmVTKPlanarPolygonInteractorStyle);
namespace {
const double PLANAR_POLYGON_RAY_EPSILON = 1.0e-12;
bool isFinitePoint(const QPointF& oPoint)
{
return vtkMath::IsFinite(oPoint.x()) &&
vtkMath::IsFinite(oPoint.y());
}
bool displayToWorld(vtkRenderer* pRenderer,
double dX,
double dY,
double dZ,
double dWorld[3])
{
if(pRenderer == nullptr || dWorld == nullptr ||
!vtkMath::IsFinite(dX) || !vtkMath::IsFinite(dY) ||
!vtkMath::IsFinite(dZ)) {
return false;
}
// VTK 返回齐次世界坐标,必须先除以 w 才能参与射线计算。
pRenderer->SetDisplayPoint(dX, dY, dZ);
pRenderer->DisplayToWorld();
const double* pHomogeneous = pRenderer->GetWorldPoint();
if(pHomogeneous == nullptr ||
!vtkMath::IsFinite(pHomogeneous[0]) ||
!vtkMath::IsFinite(pHomogeneous[1]) ||
!vtkMath::IsFinite(pHomogeneous[2]) ||
!vtkMath::IsFinite(pHomogeneous[3]) ||
std::fabs(pHomogeneous[3]) <=
std::numeric_limits<double>::epsilon()) {
return false;
}
const double dInverseW = 1.0 / pHomogeneous[3];
dWorld[0] = pHomogeneous[0] * dInverseW;
dWorld[1] = pHomogeneous[1] * dInverseW;
dWorld[2] = pHomogeneous[2] * dInverseW;
return vtkMath::IsFinite(dWorld[0]) &&
vtkMath::IsFinite(dWorld[1]) &&
vtkMath::IsFinite(dWorld[2]);
}
double coordinateScale(const QPointF& oLeft, const QPointF& oRight)
{
double dScale = 1.0;
dScale = qMax(dScale, std::fabs(oLeft.x()));
dScale = qMax(dScale, std::fabs(oLeft.y()));
dScale = qMax(dScale, std::fabs(oRight.x()));
dScale = qMax(dScale, std::fabs(oRight.y()));
return dScale;
}
bool isSamePoint(const QPointF& oLeft, const QPointF& oRight)
{
const double dScale = coordinateScale(oLeft, oRight);
const double dTolerance = 1.0e-10 * dScale;
const double dX = oLeft.x() - oRight.x();
const double dY = oLeft.y() - oRight.y();
return dX * dX + dY * dY <= dTolerance * dTolerance;
}
bool hasNonZeroArea(const QVector<QPointF>& vecPoints)
{
if(vecPoints.size() < 3) {
return false;
}
// 以首点为局部原点计算面积,避免大坐标下的精度损失。
const QPointF oOrigin = vecPoints.first();
double dMinimumX = oOrigin.x();
double dMaximumX = oOrigin.x();
double dMinimumY = oOrigin.y();
double dMaximumY = oOrigin.y();
double dTwiceArea = 0.0;
for(int nIndex = 0; nIndex < vecPoints.size(); ++nIndex) {
const QPointF& oCurrent = vecPoints[nIndex];
const QPointF& oNext =
vecPoints[(nIndex + 1) % vecPoints.size()];
const double dCurrentX = oCurrent.x() - oOrigin.x();
const double dCurrentY = oCurrent.y() - oOrigin.y();
const double dNextX = oNext.x() - oOrigin.x();
const double dNextY = oNext.y() - oOrigin.y();
dTwiceArea += dCurrentX * dNextY - dNextX * dCurrentY;
dMinimumX = qMin(dMinimumX, oCurrent.x());
dMaximumX = qMax(dMaximumX, oCurrent.x());
dMinimumY = qMin(dMinimumY, oCurrent.y());
dMaximumY = qMax(dMaximumY, oCurrent.y());
}
const double dScale = qMax(1.0,
qMax(dMaximumX - dMinimumX, dMaximumY - dMinimumY));
return vtkMath::IsFinite(dTwiceArea) &&
std::fabs(dTwiceArea) > 1.0e-12 * dScale * dScale;
}
}
nmVTKPlanarPolygonInteractorStyle::
nmVTKPlanarPolygonInteractorStyle()
: m_bCompleted(false)
{
}
nmVTKPlanarPolygonInteractorStyle::
~nmVTKPlanarPolygonInteractorStyle()
{
}
void nmVTKPlanarPolygonInteractorStyle::OnLeftButtonDown()
{
if(m_bCompleted || this->Interactor == nullptr) {
return;
}
// 单击追加顶点,VTK 将双击的第二次按下标记为 RepeatCount > 0。
if(this->Interactor->GetRepeatCount() > 0) {
completePolygon();
return;
}
appendCurrentPoint();
}
void nmVTKPlanarPolygonInteractorStyle::OnRightButtonDown()
{
// 绘制模式下右键专用于取消,不传递给默认相机或右键菜单。
if(!m_bCompleted) {
cancelPolygon();
}
}
void nmVTKPlanarPolygonInteractorStyle::OnKeyPress()
{
if(m_bCompleted || this->Interactor == nullptr) {
return;
}
const char* pKeySym = this->Interactor->GetKeySym();
if(pKeySym == nullptr) {
return;
}
// Enter 完成、Backspace/Delete 撤回末点、Escape 取消,均由业务状态机收口。
if(std::strcmp(pKeySym, "Return") == 0 ||
std::strcmp(pKeySym, "KP_Enter") == 0) {
completePolygon();
} else if(std::strcmp(pKeySym, "BackSpace") == 0 ||
std::strcmp(pKeySym, "Delete") == 0) {
removeLastPoint();
} else if(std::strcmp(pKeySym, "Escape") == 0) {
cancelPolygon();
}
}
void nmVTKPlanarPolygonInteractorStyle::OnChar()
{
// 字符命令在绘制模式没有业务含义,不能触发基类的退出或相机复位。
}
void nmVTKPlanarPolygonInteractorStyle::reset()
{
m_vecPoints.clear();
m_bCompleted = false;
}
QVector<QPointF>
nmVTKPlanarPolygonInteractorStyle::getPoints() const
{
return m_vecPoints;
}
int nmVTKPlanarPolygonInteractorStyle::getPointCount() const
{
return m_vecPoints.size();
}
bool nmVTKPlanarPolygonInteractorStyle::isCompleted() const
{
return m_bCompleted;
}
bool nmVTKPlanarPolygonInteractorStyle::projectEventPositionToPlane(
QPointF& oPoint)
{
if(this->Interactor == nullptr) {
return false;
}
int* pEventPosition = this->Interactor->GetEventPosition();
if(pEventPosition == nullptr) {
return false;
}
this->FindPokedRenderer(pEventPosition[0], pEventPosition[1]);
vtkRenderer* pRenderer = this->CurrentRenderer;
if(pRenderer == nullptr) {
return false;
}
// 将同一屏幕点的近、远裁剪面坐标连成射线,再与 z=0 网格平面求交。
double dNearPoint[3];
double dFarPoint[3];
if(!displayToWorld(pRenderer,
pEventPosition[0], pEventPosition[1], 0.0,
dNearPoint) ||
!displayToWorld(pRenderer,
pEventPosition[0], pEventPosition[1], 1.0,
dFarPoint)) {
return false;
}
const double dDirectionZ = dFarPoint[2] - dNearPoint[2];
const double dRayScale = qMax(1.0,
qMax(std::fabs(dNearPoint[2]), std::fabs(dFarPoint[2])));
if(std::fabs(dDirectionZ) <=
PLANAR_POLYGON_RAY_EPSILON * dRayScale) {
return false;
}
const double dParameter = -dNearPoint[2] / dDirectionZ;
const QPointF oCandidate(
dNearPoint[0] +
dParameter * (dFarPoint[0] - dNearPoint[0]),
dNearPoint[1] +
dParameter * (dFarPoint[1] - dNearPoint[1]));
if(!isFinitePoint(oCandidate)) {
return false;
}
oPoint = oCandidate;
return true;
}
bool nmVTKPlanarPolygonInteractorStyle::appendCurrentPoint()
{
QPointF oPoint;
if(!projectEventPositionToPlane(oPoint) ||
(!m_vecPoints.isEmpty() &&
isSamePoint(m_vecPoints.last(), oPoint))) {
return false;
}
// 连续重合点不入队,否则会生成零长边并干扰后续三角化。
m_vecPoints.append(oPoint);
this->InvokeEvent(PolygonChangedEvent);
renderInteractor();
return true;
}
bool nmVTKPlanarPolygonInteractorStyle::completePolygon()
{
if(m_bCompleted) {
return true;
}
if(!hasNonZeroArea(m_vecPoints)) {
this->InvokeEvent(PolygonInvalidEvent);
return false;
}
// 先发变更事件绘制闭合边,再通知业务层离开 VTK 交互栈。
m_bCompleted = true;
this->InvokeEvent(PolygonChangedEvent);
renderInteractor();
this->InvokeEvent(PolygonCompletedEvent);
return true;
}
void nmVTKPlanarPolygonInteractorStyle::removeLastPoint()
{
if(m_vecPoints.isEmpty()) {
return;
}
m_vecPoints.remove(m_vecPoints.size() - 1);
this->InvokeEvent(PolygonChangedEvent);
renderInteractor();
}
void nmVTKPlanarPolygonInteractorStyle::cancelPolygon()
{
this->InvokeEvent(PolygonCancelledEvent);
}
void nmVTKPlanarPolygonInteractorStyle::renderInteractor()
{
if(this->Interactor != nullptr) {
this->Interactor->Render();
}
}

@ -0,0 +1,179 @@
#include "nmVTKPlanarPolygonLayer.h"
#include <QCoreApplication>
#include <QThread>
#include <vtkActor.h>
#include <vtkCellArray.h>
#include <vtkMath.h>
#include <vtkPoints.h>
#include <vtkPolyData.h>
#include <vtkPolyDataMapper.h>
#include <vtkProperty.h>
#include <vtkSmartPointer.h>
namespace {
bool isPlanarPolygonLayerGuiThread()
{
// VTK Prop 和 Qt 视图的生命周期都由 GUI 线程统一管理。
QCoreApplication* pApplication = QCoreApplication::instance();
return pApplication == nullptr ||
pApplication->thread() == QThread::currentThread();
}
bool isFinitePoint(const QPointF& oPoint)
{
return vtkMath::IsFinite(oPoint.x()) &&
vtkMath::IsFinite(oPoint.y());
}
}
class nmVTKPlanarPolygonLayerPrivate
{
public:
nmVTKPlanarPolygonLayerPrivate()
: m_pPoints(vtkSmartPointer<vtkPoints>::New()),
m_pVertices(vtkSmartPointer<vtkCellArray>::New()),
m_pLines(vtkSmartPointer<vtkCellArray>::New()),
m_pPolyData(vtkSmartPointer<vtkPolyData>::New()),
m_pMapper(vtkSmartPointer<vtkPolyDataMapper>::New()),
m_pActor(vtkSmartPointer<vtkActor>::New()),
m_bClosed(false)
{
m_pPoints->SetDataTypeToDouble();
m_pPolyData->SetPoints(m_pPoints);
m_pPolyData->SetVerts(m_pVertices);
m_pPolyData->SetLines(m_pLines);
m_pMapper->SetInputData(m_pPolyData);
// 黄色点线只是业务覆盖层:不参与拾取,也不扩大相机自适应范围。
m_pActor->SetMapper(m_pMapper);
m_pActor->GetProperty()->SetColor(1.0, 1.0, 0.0);
m_pActor->GetProperty()->SetLineWidth(2.0f);
m_pActor->GetProperty()->SetPointSize(7.0f);
m_pActor->GetProperty()->LightingOff();
m_pActor->PickableOff();
m_pActor->UseBoundsOff();
}
vtkActor* getActor() const
{
return m_pActor;
}
bool setPolygon(const QVector<QPointF>& vecPoints, bool bClosed)
{
for(int nIndex = 0; nIndex < vecPoints.size(); ++nIndex) {
if(!isFinitePoint(vecPoints[nIndex])) {
return false;
}
}
// 先构建完整候选 PolyData,成功后再一次替换,避免视图看到半更新状态。
vtkSmartPointer<vtkPoints> pCandidatePoints =
vtkSmartPointer<vtkPoints>::New();
vtkSmartPointer<vtkCellArray> pCandidateVertices =
vtkSmartPointer<vtkCellArray>::New();
vtkSmartPointer<vtkCellArray> pCandidateLines =
vtkSmartPointer<vtkCellArray>::New();
pCandidatePoints->SetDataTypeToDouble();
const vtkIdType nPointCount =
static_cast<vtkIdType>(vecPoints.size());
pCandidatePoints->SetNumberOfPoints(nPointCount);
for(vtkIdType nPointId = 0; nPointId < nPointCount; ++nPointId) {
const QPointF& oPoint = vecPoints[static_cast<int>(nPointId)];
pCandidatePoints->SetPoint(nPointId, oPoint.x(), oPoint.y(), 0.0);
pCandidateVertices->InsertNextCell(1, &nPointId);
}
const bool bCandidateClosed = bClosed && nPointCount >= 3;
if(nPointCount >= 2) {
// VTK 折线不会自动闭合,完成后需在索引尾部再写入首点。
const vtkIdType nLinePointCount =
nPointCount + (bCandidateClosed ? 1 : 0);
pCandidateLines->InsertNextCell(nLinePointCount);
for(vtkIdType nPointId = 0;
nPointId < nPointCount; ++nPointId) {
pCandidateLines->InsertCellPoint(nPointId);
}
if(bCandidateClosed) {
pCandidateLines->InsertCellPoint(0);
}
}
m_vecPoints = vecPoints;
m_bClosed = bCandidateClosed;
m_pPoints = pCandidatePoints;
m_pVertices = pCandidateVertices;
m_pLines = pCandidateLines;
m_pPolyData->SetPoints(m_pPoints);
m_pPolyData->SetVerts(m_pVertices);
m_pPolyData->SetLines(m_pLines);
m_pPolyData->Modified();
return true;
}
void clear()
{
setPolygon(QVector<QPointF>(), false);
}
vtkSmartPointer<vtkPoints> m_pPoints;
vtkSmartPointer<vtkCellArray> m_pVertices;
vtkSmartPointer<vtkCellArray> m_pLines;
vtkSmartPointer<vtkPolyData> m_pPolyData;
vtkSmartPointer<vtkPolyDataMapper> m_pMapper;
vtkSmartPointer<vtkActor> m_pActor;
QVector<QPointF> m_vecPoints;
bool m_bClosed;
};
nmVTKPlanarPolygonLayer::nmVTKPlanarPolygonLayer(
const QString& sLayerId)
: nmVTKRenderLayer(sLayerId),
m_pPrivate(new nmVTKPlanarPolygonLayerPrivate)
{
Q_ASSERT(isPlanarPolygonLayerGuiThread());
setRenderProp(m_pPrivate->getActor());
}
nmVTKPlanarPolygonLayer::~nmVTKPlanarPolygonLayer()
{
Q_ASSERT(isPlanarPolygonLayerGuiThread());
if(m_pPrivate != nullptr) {
detach();
delete m_pPrivate;
m_pPrivate = nullptr;
}
}
bool nmVTKPlanarPolygonLayer::setPolygon(
const QVector<QPointF>& vecPoints,
bool bClosed)
{
Q_ASSERT(isPlanarPolygonLayerGuiThread());
return isPlanarPolygonLayerGuiThread() && m_pPrivate != nullptr &&
m_pPrivate->setPolygon(vecPoints, bClosed);
}
void nmVTKPlanarPolygonLayer::clear()
{
Q_ASSERT(isPlanarPolygonLayerGuiThread());
if(isPlanarPolygonLayerGuiThread() && m_pPrivate != nullptr) {
m_pPrivate->clear();
}
}
QVector<QPointF> nmVTKPlanarPolygonLayer::getPoints() const
{
return m_pPrivate != nullptr
? m_pPrivate->m_vecPoints : QVector<QPointF>();
}
bool nmVTKPlanarPolygonLayer::isClosed() const
{
return m_pPrivate != nullptr && m_pPrivate->m_bClosed;
}

@ -28,6 +28,7 @@ nmVTKViewCommandController::nmVTKViewCommandController(
m_pContainer(pContainer),
m_eCapabilities(0),
m_bViewAvailable(false),
m_bInteractionCommandsAvailable(true),
m_bRotationCenterPickingAvailable(false),
m_bRotationCenterMarkerAvailable(false)
{
@ -228,6 +229,14 @@ bool nmVTKViewCommandController::isViewAvailable() const
return m_bViewAvailable;
}
void nmVTKViewCommandController::setInteractionCommandsAvailable(
bool bAvailable)
{
// 临时业务交互只冻结动作可用性,不改写容器已公布的能力集。
m_bInteractionCommandsAvailable = bAvailable;
updateActionStates();
}
void nmVTKViewCommandController::setRotationCenterPickingAvailable(
bool bAvailable)
{
@ -338,7 +347,8 @@ void nmVTKViewCommandController::updateActionStates()
QAction* pAction = m_pActions[nIndex];
if(pAction != nullptr) {
const bool bSupported = supports(eCommands[nIndex]);
bool bEnabled = bSupported && m_bViewAvailable;
bool bEnabled = bSupported && m_bViewAvailable &&
m_bInteractionCommandsAvailable;
if(eCommands[nIndex] == ViewCommand_SetRotationCenter) {
bEnabled = bEnabled &&
m_bRotationCenterPickingAvailable;

@ -384,6 +384,12 @@ bool nmWxVTKRenderContainerWidget::installInteractionStyle(
const bool bSucceeded = isGuiThread() &&
m_pInteractionManager != nullptr &&
m_pInteractionManager->installInteractionStyle(pStyle);
// 自定义样式接管鼠标期间,禁用会切换相机或拾取模式的公共命令。
if(m_pViewCommandController != nullptr) {
m_pViewCommandController->setInteractionCommandsAvailable(
m_pInteractionManager != nullptr &&
m_pInteractionManager->isDefaultInteractionActive());
}
updateRotationCenterCommandAvailability();
return bSucceeded;
}
@ -395,6 +401,11 @@ bool nmWxVTKRenderContainerWidget::restoreDefaultInteraction()
const bool bSucceeded = isGuiThread() &&
m_pInteractionManager != nullptr &&
m_pInteractionManager->restoreDefaultInteraction();
if(m_pViewCommandController != nullptr) {
m_pViewCommandController->setInteractionCommandsAvailable(
m_pInteractionManager != nullptr &&
m_pInteractionManager->isDefaultInteractionActive());
}
updateRotationCenterCommandAvailability();
return bSucceeded;
}
@ -406,6 +417,9 @@ void nmWxVTKRenderContainerWidget::clearInteractionStyle()
if(isGuiThread() && m_pInteractionManager != nullptr) {
m_pInteractionManager->clearInteractionStyle();
}
if(m_pViewCommandController != nullptr) {
m_pViewCommandController->setInteractionCommandsAvailable(false);
}
updateRotationCenterCommandAvailability();
}
@ -786,6 +800,11 @@ bool nmWxVTKRenderContainerWidget::eventFilter(
if(pEvent->type() == QEvent::MouseButtonPress) {
QMouseEvent* pMouseEvent = static_cast<QMouseEvent*>(pEvent);
if(pMouseEvent->button() == Qt::RightButton) {
// 临时交互样式拥有右键语义;公共菜单只在默认相机模式下弹出。
if(m_pInteractionManager != nullptr &&
!m_pInteractionManager->isDefaultInteractionActive()) {
return false;
}
// 菜单引用命令控制器长期持有的 QAction,不在每次右键时重复创建。
QMenu oMenu(this);
if(m_pViewCommandController != nullptr) {

@ -70,6 +70,7 @@ nmWxPebiResultControlBar::nmWxPebiResultControlBar(
m_pExportAction(nullptr),
m_pExportButton(nullptr),
m_bExportInProgress(false),
m_bExternalInteractionLocked(false),
m_nDisplayedBindingRevision(0),
m_nDisplayedTimeFrameCount(-1),
m_bDisplayedPlaying(false)
@ -134,12 +135,32 @@ bool nmWxPebiResultControlBar::isExportInProgress() const
return m_bExportInProgress;
}
void nmWxPebiResultControlBar::setExternalInteractionLocked(bool bLocked)
{
if(m_bExternalInteractionLocked == bLocked) {
return;
}
// 该锁只保护当前结果身份,不改变 SceneController 中已选属性和帧。
m_bExternalInteractionLocked = bLocked;
if(bLocked && m_pPlaybackController != nullptr) {
// 防御外部调用顺序错误,绘制事务绝不能与仍在推进的 Timer 并存。
m_pPlaybackController->pause();
}
refreshFromController();
}
bool nmWxPebiResultControlBar::isExternalInteractionLocked() const
{
return m_bExternalInteractionLocked;
}
void nmWxPebiResultControlBar::onDisplayModeIndexChanged(int nIndex)
{
if(m_pDisplayModeCombo == nullptr ||
!m_pDisplayModeCombo->isEnabled() ||
m_pPlaybackController == nullptr || m_pSceneController == nullptr ||
m_bExportInProgress || m_pPlaybackController->isPlaying() ||
m_bExportInProgress || m_bExternalInteractionLocked ||
m_pPlaybackController->isPlaying() ||
!m_pSceneController->hasSnapshot() || nIndex < 0 ||
nIndex >= m_pDisplayModeCombo->count()) {
return;
@ -165,6 +186,7 @@ void nmWxPebiResultControlBar::onDisplayModeIndexChanged(int nIndex)
void nmWxPebiResultControlBar::onPropertyIndexChanged(int nIndex)
{
if(m_pPlaybackController == nullptr || m_bExportInProgress ||
m_bExternalInteractionLocked ||
m_pPlaybackController->isPlaying() || nIndex < 0) {
return;
}
@ -177,6 +199,7 @@ void nmWxPebiResultControlBar::onPropertyIndexChanged(int nIndex)
void nmWxPebiResultControlBar::onTimeIndexChanged(int nIndex)
{
if(m_pPlaybackController == nullptr || m_bExportInProgress ||
m_bExternalInteractionLocked ||
m_pPlaybackController->isPlaying() || nIndex < 0) {
return;
}
@ -190,6 +213,7 @@ void nmWxPebiResultControlBar::onColorSettingsClicked()
{
if(m_pPlaybackController == nullptr || m_pSceneController == nullptr ||
m_bExportInProgress ||
m_bExternalInteractionLocked ||
m_pPlaybackController->isPlaying() ||
!m_pSceneController->hasSnapshot()) {
return;
@ -207,6 +231,7 @@ void nmWxPebiResultControlBar::onColorSettingsClicked()
void nmWxPebiResultControlBar::onFirstFrameClicked()
{
if(m_pPlaybackController == nullptr || m_bExportInProgress ||
m_bExternalInteractionLocked ||
m_pPlaybackController->isPlaying()) {
return;
}
@ -218,6 +243,7 @@ void nmWxPebiResultControlBar::onFirstFrameClicked()
void nmWxPebiResultControlBar::onPreviousFrameClicked()
{
if(m_pPlaybackController == nullptr || m_bExportInProgress ||
m_bExternalInteractionLocked ||
m_pPlaybackController->isPlaying()) {
return;
}
@ -229,6 +255,7 @@ void nmWxPebiResultControlBar::onPreviousFrameClicked()
void nmWxPebiResultControlBar::onNextFrameClicked()
{
if(m_pPlaybackController == nullptr || m_bExportInProgress ||
m_bExternalInteractionLocked ||
m_pPlaybackController->isPlaying()) {
return;
}
@ -240,6 +267,7 @@ void nmWxPebiResultControlBar::onNextFrameClicked()
void nmWxPebiResultControlBar::onLastFrameClicked()
{
if(m_pPlaybackController == nullptr || m_bExportInProgress ||
m_bExternalInteractionLocked ||
m_pPlaybackController->isPlaying()) {
return;
}
@ -250,7 +278,8 @@ void nmWxPebiResultControlBar::onLastFrameClicked()
void nmWxPebiResultControlBar::onPlayPauseClicked()
{
if(m_pPlaybackController == nullptr || m_bExportInProgress) {
if(m_pPlaybackController == nullptr || m_bExportInProgress ||
m_bExternalInteractionLocked) {
return;
}
if(m_pPlaybackController->togglePlayback()) {
@ -261,6 +290,7 @@ void nmWxPebiResultControlBar::onPlayPauseClicked()
void nmWxPebiResultControlBar::onAnimationSettingsClicked()
{
if(m_pPlaybackController == nullptr || m_bExportInProgress ||
m_bExternalInteractionLocked ||
m_pPlaybackController->isPlaying()) {
return;
}
@ -279,6 +309,7 @@ void nmWxPebiResultControlBar::onAnimationSettingsClicked()
void nmWxPebiResultControlBar::onExportAnimationTriggered()
{
if(m_pPlaybackController == nullptr || m_bExportInProgress ||
m_bExternalInteractionLocked ||
m_pPlaybackController->isPlaying() ||
!m_pPlaybackController->isCurrentPropertyTimeDependent() ||
m_pPlaybackController->getCurrentPropertyFrameCount() <= 1) {
@ -392,7 +423,9 @@ void nmWxPebiResultControlBar::refreshFromController()
const bool bHasMultipleFrames = bHasCompleteTimeList &&
nFrameCount > 1;
const bool bPlaying = m_pPlaybackController->isPlaying();
const bool bLocked = bPlaying || m_bExportInProgress;
// 回放、导出和外部绘制互斥,三者共用同一套控件可用性规则。
const bool bLocked = bPlaying || m_bExportInProgress ||
m_bExternalInteractionLocked;
m_pDisplayModeCombo->setEnabled(!bLocked);
m_pPropertyCombo->setEnabled(!bLocked);
m_pColorSettingsButton->setEnabled(!bLocked);
@ -408,7 +441,8 @@ void nmWxPebiResultControlBar::refreshFromController()
bHasMultipleFrames &&
nCurrentFrame < nFrameCount - 1 && !bLocked);
m_pPlayPauseButton->setEnabled(
bHasMultipleFrames && !m_bExportInProgress);
bHasMultipleFrames && !m_bExportInProgress &&
!m_bExternalInteractionLocked);
m_pSettingsButton->setEnabled(bHasMultipleFrames && !bLocked);
QString sBackendError;

File diff suppressed because it is too large Load Diff

@ -21,6 +21,8 @@ SOURCES += $${wtSrc}/nmNum/nmRender/nmVTKCameraController.cpp \
$${wtSrc}/nmNum/nmRender/nmVTKImageExporter.cpp \
$${wtSrc}/nmNum/nmRender/nmVTKInteractionManager.cpp \
$${wtSrc}/nmNum/nmRender/nmVTKOrientationMarkerController.cpp \
$${wtSrc}/nmNum/nmRender/nmVTKPlanarPolygonInteractorStyle.cpp \
$${wtSrc}/nmNum/nmRender/nmVTKPlanarPolygonLayer.cpp \
$${wtSrc}/nmNum/nmRender/nmVTKPivotCameraInteractorStyle.cpp \
$${wtSrc}/nmNum/nmRender/nmVTKMeshLayer.cpp \
$${wtSrc}/nmNum/nmRender/nmVTKPlanarScaleGridLayer.cpp \
@ -39,6 +41,8 @@ HEADERS += $${wtInclude}/nmNum/nmRender/nmRender_global.h \
$${wtInclude}/nmNum/nmRender/nmVTKImageExporter.h \
$${wtInclude}/nmNum/nmRender/nmVTKInteractionManager.h \
$${wtInclude}/nmNum/nmRender/nmVTKOrientationMarkerController.h \
$${wtInclude}/nmNum/nmRender/nmVTKPlanarPolygonInteractorStyle.h \
$${wtInclude}/nmNum/nmRender/nmVTKPlanarPolygonLayer.h \
$${wtInclude}/nmNum/nmRender/nmVTKPivotCameraInteractorStyle.h \
$${wtInclude}/nmNum/nmRender/nmVTKMeshLayer.h \
$${wtInclude}/nmNum/nmRender/nmVTKPlanarScaleGridLayer.h \

Loading…
Cancel
Save