VTK初入门径--第四只小板凳

时间:2022-12-22 17:17:29

春节一过,人们又进入了忙忙碌碌的状态中,
我也该为我的blog增添点新鲜活力了,
伴随着第四只小板凳的新鲜出炉,
越来越体会到了技术的无穷!

在这节中,
我们将会用到vtkDebugLeaks与vtkGlyph3D,
我把它们的相关介绍和具体描述翻译了一下,
------这是我的第一次翻译(所以请大家谅解)
发现原本简简单单的英文,
经过翻译就缺乏了其原本的通达和文雅,
翻译需要的是信,达,雅
奈何自己的水平有限,
但我坚信,
经过自己的不断努力,
我一定能把它做好,
让我们共同努力吧,
如果你发现了问题,
请及时给我留言,
在此表示感谢!!!

 

 

 

 

 

相关类介绍


vtkDebugLeaks:
详细描述:在程序结束时识别内存是否泄漏.
在程序结束时可通过vtkDebugLeaks记录内存的泄漏情况.
vtkDebugLeaks通过vtkObjectFactory来截取所有VTK对象的构造,vtkObject的

UnRegister方法来截获所有VTK对象的析构.所创建的对象名称和实例号对应的存

放在哈希表中,在程序结束时,如果发现仍存在VTK对象,程序将把它们打印出来.

注意如使用这个类需要在编译时添加DVTK_DEBUG_LEAKS宏.

vtkGlyph3D:
详细描述:为每个输入点拷贝相应方向和伸缩比例的轮廓几何体
vtkGlyph3d是一个过滤器,当拷贝几何体到每个输入点时,它起到滤波作用.glyph

从过滤输入源中以多边形数据形式定义,glyph根据输入的矢量和法向量来确定方

向,根据伸缩数据和矢量大小来确定伸缩比例.当glyph较多时,可能通过对象源与

其相应的定义信息来创建glyph表.glyph表可以通过伸缩值或矢量大小来索引相

应的gpyph对象.

要使用vtkGlyph3D对象,我们首先需要提供一个输入集和一个对象源来定义

ghyph.然后决定是否对ghyph进行伸缩,以及怎样对其进行伸缩,接下来决定是否

对glyph设置方向,以及如何根据矢量及法向量来设置它,最终决定我们是用glyph

表还是仅仅是单一的ghyph.如果使用了glyph表,我们还需要考虑相应的索引值.

 

 

运行结果:

VTK初入门径--第四只小板凳

 


附上vtkDebugLeaks和vtkGlyph3D的原文:
vtkDebugLeaks:
Detailed Description
identify memory leaks at program termination
vtkDebugLeaks is used to report memory leaks at the exit of the program. It uses the vtkObjectFactory to intercept the construction of all VTK objects. It uses the UnRegister method of vtkObject to intercept the destruction of all objects. A table of object name to number of instances is kept. At the exit of the program if there are still VTK objects around it will print them out. To enable this class add the flag -DVTK_DEBUG_LEAKS to the compile line, and rebuild vtkObject and vtkObjectFactory.

 

vtkGlyph3D:
Detailed Description
copy oriented and scaled glyph geometry to every input point
vtkGlyph3D is a filter that copies a geometric representation (called a glyph) to every point in the input dataset. The glyph is defined with polygonal data from a source filter input. The glyph may be oriented along the input vectors or normals, and it may be scaled according to scalar data or vector magnitude. More than one glyph may be used by creating a table of source objects, each defining a different glyph. If a table of glyphs is defined, then the table can be indexed into by using either scalar value or vector magnitude.

To use this object you'll have to provide an input dataset and a source to define the glyph. Then decide whether you want to scale the glyph and how to scale the glyph (using scalar value or vector magnitude). Next decide whether you want to orient the glyph, and whether to use the vector data or normal data to orient it. Finally, decide whether to use a table of glyphs, or just a single glyph. If you use a table of glyphs, you'll have to decide whether to index into it with scalar value or with vector magnitude.