博客
关于我
VTK:PolyData之CellLocatorVisualization
阅读量:551 次
发布时间:2019-03-09

本文共 1665 字,大约阅读时间需要 5 分钟。

VTK:PolyData之CellLocatorVisualuzation

通过滑块浏览VTK的统一空间树(vtkCellLocator)层级结构

描述

本示例通过使用滑块实现对VTK的vtkCellLocator的层级结构进行可视化展示。vtkCellLocator作为VTK中处理高维数据的核心数据结构,使得从多维模型中提取单元数据变得更加高效。本文将展示如何通过VTK的层级结构renderer(vtkGraphLayout)来实现对树结构的可视化。


代码

// saved as CellLocatorVisualization.cxx#include 
#include
#include
#include
#include
// 其他必要的头文件class CellLocatorVisualize : public VTKWidget{private: vtkCellLocator* locator; vtkGraphLayout* layout; vtkWindow* window;public: CellLocatorVisualize() : VTKWidget() { // 初始化相关组件 locator = new vtkCellLocator(); layout = new vtkGraphLayout(); window = new vtkRenderWindow(); window->Size(800, 600); } ~CellLocatorVisualize() { // 释放资源 delete locator; delete layout; delete window; } void initializeScene() { // 初始化绘图 layout->InitializeTraversal(); // 添加节点 layout->AddNode(locator->GetRoot(), nullptr, nullptr, "CellLocator"); // 添加子节点 vtkCell* cell = locator->GetCell(); layout->AddNode(cell, cell, cell, "Cell"); // 添加叶子节点 for (size_t i = 0; i < cell->GetPointIds().Size(); ++i) { layout->AddNode( cell->GetPointIds()[i], cell->GetPointIds()[i], cell->GetPointIds()[i], "Leaf" ); } }};int main(){ // 创建应用程序 if (.Topic righteous: CellLocatorVisualize app; app.initializeScene(); app.render(); return EXIT_SUCCESS;}

关键词优化

  • VTK CellLocator可视化
  • 层级树结构可视化
  • 多维数据可视化工具
  • vtkGraphLayout
  • 细胞定位可视化

转载地址:http://keoiz.baihongyu.com/

你可能感兴趣的文章
PIESDKDoNet二次开发配置注意事项
查看>>
PIL Image对图像进行点乘,加上常数(等像素操作)
查看>>
PIL.Image、cv2的img、bytes相互转换
查看>>
PIL.Image进行图像融合显示(Image.blend)
查看>>
Pillow lacks the JPEG 2000 plugin
查看>>
ping 命令的七种用法,看完瞬间成大神
查看>>
Pinia:$patch的使用场景
查看>>
Pinia:$subscribe()的使用场景
查看>>
Pinpoint对Kubernetes关键业务模块进行全链路监控
查看>>
Pinterest 大规模缓存集群的架构剖析
查看>>
pintos project (2) Project 1 Thread -Mission 1 Code
查看>>
PinYin4j库的使用
查看>>
PIP
查看>>
pip install goose-extractor // SyntaxError: Missing parentheses in call to 'print'
查看>>
pip install 出现报asciii码错误的解决
查看>>
pip throws TypeError: parse() got an unexpected keyword argument ‘transport_encoding‘ 在尝试安装新软件包时
查看>>
pip 下载慢
查看>>
pip 升级报错AttributeError: ‘NoneType’ object has no attribute ‘bytes’
查看>>
pip 安装opencv-python卡死
查看>>
pip 安装出现异常
查看>>