简体   繁体   English

如何在不删除点或线的情况下有选择地渲染VTK PolyData

[英]How can I selectively render VTK PolyData without deleting points or lines

I have a pipeline for rendering a PolyData. 我有一个渲染PolyData的管道。 The PolyData consists of points and lines only (specifically no faces). PolyData仅包含点和线(特别是没有面)。 I have normals for the points which would allow me to do some point based version of backface culling but I can't see how I can apply some sort of Filter to the pipeline to hide these nodes. 我拥有这些点的法线,这使我可以进行一些基于点的背面剔除,但是我看不到如何对管道应用某种“过滤器”以隐藏这些节点。 I'd like to do this so that I can pan, tilt and scroll the view using an interactor without having to rebuild the PolyData. 我想这样做,以便可以使用交互器来平移,倾斜和滚动视图,而不必重建PolyData。

It seems like this ought to be possible. 看来这应该是可能的。 Can someone direct me at the appopriate part of the API docs? 有人可以将我定向到API文档的适当部分吗?

You can look at vtkClipPolyData filter. 您可以查看vtkClipPolyData过滤器。 It clips the cells of the PolyData. 它裁剪PolyData的单元格 So it will work for lines in your PolyData. 因此它将适用于PolyData中的线。 If you want to make it work for the points as well then your points need to be stored as vtkVertex cells in your PolyData. 如果要使其也适用于点,则需要将点作为vtkVertex单元存储在PolyData中。 vtkVertexGlyphFilter can be used to create a vtkVertex for every point in your PolyData. vtkVertexGlyphFilter可用于为PolyData中的每个点创建一个vtkVertex。 Looking at this post it seems that backface culling is not possible for lines even if the points have normals. 看一下这篇文章,似乎线条的背面剔除是不可能的,即使这些点具有法线也是如此。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM