fix: 修复 CountCellFaces 原模型修改及输入刷新风险 - #98
Open
GitHupMuxin wants to merge 2 commits into
Open
GitHupMuxin wants to merge 2 commits into
GitHupMuxin wants to merge 2 commits into
Conversation
Author
|
已继续更新本 PR,提交 b09a6b5。除独立输出和移除输入刷新路径外,补修了同名点属性被误删、已有属性范围未保留的问题,并加入自动回归入口。Quad_Plane_Tensor.vtk 的 161962 个单元与 VTK 9.5.2 vtkCountFaces 逐项对比,差异为 0;两个小模型也全部一致。新增回归在补修前失败、补修后通过。验证数据及圆柱模型读取警告已补充到 PR 描述。仍需区分:这是实际计算类对比与命令行回归,完整 GUI 交互尚未复核。未新建分支或 PR,未改动底层内核。 |
DFYCLBB
added a commit
to DFYCLBB/igamevis
that referenced
this pull request
Sep 14, 2026
按复测要求与同类 Filter(CountCellFaces dayuwan77#98)的整改方向,将 CountCellVertices 的独立输出从"浅共享"升级为"深拷贝完全独立": - 点坐标、单元连接表、单元类型表全部深拷贝,指针级独立,绝不共享输入内存 - 属性集新建,输入全部属性数组(含 Int/Char/Short/LongLong 等整数类型)逐个深拷贝, 补齐框架 AttributeSet::DeepCopy 只支持 Float/Double 的缺口 - 深拷贝属性时跳过旧 cell_vertex_count,重复执行不累积同名数组 - Execute() 增加 try/catch 异常安全,失败清空输出、不留残留 - 绕过框架 CellArray::DeepCopy 的 bug:它对变长单元(m_UseOffsets=true)的 m_Offsets 做追加而非覆盖(构造已预置 0),会导致偏移错位、GetCellSize 算错;改为逐单元 AddCellIds 重建连接表 测试加强:新增输出 points/cell array/attribute set 与输入"指针级独立"断言, 并验证混合单元网格(hexa/wedge/pyramid/tetra/quad/triangle/line)各单元顶点数正确。 本地 MSVC 编译通过,testCountCellVertices 全断言 PASS。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
错误修复
针对 CountCellFaces 的以下反馈进行后续修复,原 PR #14 已合并,本 PR 不改动旧 PR:
修改内容
修改范围共 4 个文件:CountCellFaces filter 实现、主窗口中该 filter 的调用处、独立输出回归入口 CountCellFacesOutput.cpp,以及 Examples/CMakeLists.txt 中的一行测试注册。没有修改底层网格、属性容器、渲染内核或其他 filter。新增测试模型和使用说明仍通过另外两个补充 PR 提交;本 PR 的新增入口专门用于错误回归,无参数即可自动运行。
验证与限制
使用 MinGW Debug 定向构建修改后的 filter,链接现有 iGameCore 库,本地回归通过:
原反馈的完整 GUI 崩溃尚未复现。本次已移除原地修改与输入刷新风险路径,但不能以命令行回归代替完整 GUI 交互验证;界面操作仍需复核。本次没有全项目重新构建。
9 月 13 日复核与补充修复
新增提交 b09a6b5:
对标计算
ParaView 的 CountCellFaces 代理对应 vtkCountFaces(见官方代理定义)。本次实际运行 VTK 9.5.2 的 vtkCountFaces,与本实现逐单元比较完整结果数组:
另测圆柱模型 7472 个单元,面数全部为 6,逐项一致。但 VTK 对该文件输出了 “Cannot read lookup table data” 错误,因此仅将其作为拓扑面数对比,不将此项标记为完整属性读取通过;没有改动模型或读取器。
Quad_Plane_Tensor.vtk 的 SHA-256:
836bc2df881227b3ef76b78b35d71fcc2183490869dfdeda8584bff721fb2ea3
构建和验证范围:MinGW Debug 定向构建 filter 与回归入口,链接现有 iGameCore 库;没有重新构建完整 GUI。上述参考对比使用 ParaView 对应的 VTK 计算类,不是运行完整 ParaView 界面。原反馈的 GUI 操作仍需交互复核,不能据此宣称所有界面崩溃均已排除。