全文预览已结束
下载本文档
版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领
文档简介
How to handle large data sets in VTK One of the challenges in VTK is to efficiently handle large datasets. By default VTK is tuned towards smaller datasets. For large datasets there are a couple of changes you can make that should yield a much smaller memory footprint (less swapping) and also improve rendering performance. The solution is to: 1. Use ReleaseDataFlag, 2. Turn on ImmediateModeRendering 3. Use triangle strips via vtkStripper 4. Use a different filter or mapper Each of these will be discussed below. Using ReleaseDataFlag By default VTK keeps a copy of all intermediate results between filters in a pipeline. For a pipeline with five filters this can result in having six copies of the data in memory at once. This can be controlled using ReleaseDataFlag and GlobalReleaseDataFlag. If ReleaseDataFlag is set to one on a data object, then once a filter has finished using that data object, it will release its memory. Likewise, if GlobalReleaseDataFlag is set on ANY data object, all data objects will release their memory once their dependent filter has finished executing. For example in Tcl and C+ # Tcl vtkPolyDataReader reader reader GetOutput ReleaseDataFlagOn / C+ vtkPolyDataReader *reader = vtkPolyDataReader:New(); reader-GetOutput()-ReleaseDataFlagOn();or / C+ vtkPolyDataReader *reader = vtkPolyDataReader:New(); reader-GetOutput()-GlobalReleaseDataFlagOn();While turning on the ReleaseDataFlag will reduce your memory footprint, the disadvantage is that none of the intermediate results are kept in memory. So if you interactively change a parameter of a filter (such as the isosurface value), all the filters will have to re-execute to produce the new result. When the intermediate results are stored in memory, only the downstream filters would have to re-execute. One hint for good interactive performance. If only one stage of the pipeline can have its parameters changed interactively (such as the target reduction in a decimation filter), only retain the data just prior to that step (which is the default) and turn ReleaseDataFlag on for all other steps. Use ImmediateModeRendering By default, VTK uses OpenGL display lists which results in another copy of the data being stored in memory. For most large datasets you will be better off saving memory by not using display lists. You can turn off display lists by turning on ImmediateModeRendering. This can be controlled on a mapper by mapper basis using ImmediateModeRendering, or globally for all mappers in a process by using GlobalImmediateModeRendering. For example: # Tcl vtkPolyDataMapper mapper mapper ImmediateModeRenderingOn / C+ vtkPolyDataMapper *mapper = vtkPolyDataMapper:New(); mapper-ImmediateModeRenderingOn();or / C+ vtkPolyDataMapper *mapper = vtkPolyDataMapper:New(); mapper-GlobalImmediateModeRenderingOn();The disadvantage to using ImmediateModeRendering is that if memory is not a problem, your rendering rates will typically be slower with ImmediateModeRendering turned on. Use triangle strips via vtkStripper. Most filters in VTK produce independent triangles or polygons which are not the most compact or efficient to render. To create triangle strips from polydata you can first use vtkTriangleFilter to convert any polygons to triangles (not required if you only have triangles to start with) then run it through a vtkStipper to convert the triangles into triangle strips. For example in C+ vtkPolyDataReader *reader = vtkPolyDataReader:New(); reader-SetFileName(yourdatafile.vtk); reader-GetOutput()-ReleaseDataFlagOn(); vtkTriangleFilter *tris = vtkTriangleFilter:New(); tris-SetInput(reader-GetOutput(); tris-GetOutput()-ReleaseDataFlagOn(); vtkStripper *strip = vtkStripper:New(); strip-SetInput(tris-GetOutput(); strip-GetOutput()-ReleaseDataFlagOn(); vtkPolyDataMapper *mapper = vtkPolyDataMapper:New(); mapper-ImmediateModeRenderingOn(); mapper-SetInput(tris-GetOutput();The only disadvantage to using triangle strips is that they require time to compute, so if your data is changing every time you render, it could actually be slower. Use a different filter or mapper This is a tough issue. In VTK there are typically a couple of ways to solve any problem. For example an image can be rendered as a polygon for each pixel, or it can be rendered as a single polygon with a texture map on it. For almost all cases the second approach will be much faster than the first event though VT
温馨提示
- 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
- 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
- 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
- 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
- 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
- 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
- 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。
最新文档
- 2026酒精饮料行业市场现状供需调研投资评估发展研究报告
- 2025年互联网顾客互动模式创新研究报告
- GB/T 20219.1-2026硬质泡沫塑料绝热用喷涂聚氨酯泡沫第1部分:材料规范
- 2026年春招:长龙航空试题及答案
- 2026年春招:税务专员笔试题及答案
- 哈尔滨市依兰县残疾人联合会招聘公益性岗位人员笔试真题及答案
- 2026年陕西省城管协管人员招聘考试参考试题及答案详解
- 2026年西安市阎良区城管协管人员招聘笔试备考试题及答案详解
- 2026年宣城市宣州区城管协管人员招聘考试备考试题及答案详解
- 2026年吴忠市红寺堡区(中小学、幼儿园)教师招聘笔试备考试题及答案详解
- 2026年安庆岳西县公开选聘县属国有企业领导人员考试备考试题及答案详解
- 2026年社会保险法社保经办人员刷题题库及答案
- 部编版道法新教材四年级年级上册第2课-选举班委会-第2课时
- 全国OPC发展观察报告2026
- 旋喷桩施工安全培训
- 2026版公路水运工程试验检测专业技术人员职业资格考试《桥隧工程一本通》
- 2026年秋季开学初三新学期加速度心理调适课件
- 2026-2027学年第一学期学校1530安全教育记录
- 人工智能PID控制器
- 云南公务员(行测)真题及答案
- 2026-2030中国氘代化合物市场运行态势展望及发展现状调研报告
评论
0/150
提交评论