博客
关于我
VTK:PolyData之CellLocatorVisualization
阅读量:538 次
发布时间: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/

你可能感兴趣的文章
MySQL Binlog 日志监听与 Spring 集成实战
查看>>
MySQL binlog三种模式
查看>>
multi-angle cosine and sines
查看>>
Mysql Can't connect to MySQL server
查看>>
mysql case when 乱码_Mysql CASE WHEN 用法
查看>>
Multicast1
查看>>
mysql client library_MySQL数据库之zabbix3.x安装出现“configure: error: Not found mysqlclient library”的解决办法...
查看>>
MySQL Cluster 7.0.36 发布
查看>>
Multimodal Unsupervised Image-to-Image Translation多通道无监督图像翻译
查看>>
MySQL Cluster与MGR集群实战
查看>>
multipart/form-data与application/octet-stream的区别、application/x-www-form-urlencoded
查看>>
mysql cmake 报错,MySQL云服务器应用及cmake报错解决办法
查看>>
Multiple websites on single instance of IIS
查看>>
mysql CONCAT()函数拼接有NULL
查看>>
multiprocessing.Manager 嵌套共享对象不适用于队列
查看>>
multiprocessing.pool.map 和带有两个参数的函数
查看>>
MYSQL CONCAT函数
查看>>
multiprocessing.Pool:map_async 和 imap 有什么区别?
查看>>
MySQL Connector/Net 句柄泄露
查看>>
multiprocessor(中)
查看>>