The VTK rendering engine consists of the classes in VTK that are responsible for taking the results of the visualization pipeline and displaying them into a window(渲染引擎的工作在于获得可视化管道的结果,然后将他们显示在窗口上). This involves the following components. Note that this is not an exhaustive list(此处没有给出详细的清单), but rather a sense of the most commonly used objects in the rendering engine. The subheadings used here are the highest level superclass in VTK that represents this type of object, and in many cases where there are multiple choices these are abstract classes defining the basic API across the various concrete subclasses that implement the functionality.
3.1 vtkProp(道具?)
Visible depictions of data that exist in the scene are represented by a subclass of vtkProp(vtkProp子类用来呈现数据的可视化).The most commonly used subclasses of vtkProp for displaying objects in 3D are vtkActor (used to
represent geometric data in the scene) and vtkVolume (used to represent volumetric data in the scene).There are also props that represent data in 2D such as vtkActor2D. The vtkProp subclass is generally responsible for knowing its position, size, and orientation in the scene(vtkProp子类通常负责知晓视图的位置、尺寸和方向). The parameters used to control the placement of the prop generally depend on whether the prop is for example a 3D object in the scene, or a 2D annotation. For 3D props such as vtkActor and vtkVolume , you can either directly control parameters such as the object's 3D position, orientation and scale, or you can use a 4x4 transformation matrix(利用一个4*4的矩阵直接控制3D立体的位置、方向和尺寸). For 2D props that provide annotation such as the vtkScalarBarActor, the size and position of the annotation can be defined in a variety of ways including specifying a position, width, and height relative to the size of the entire viewport. In addition to providing placement control, props generally have a mapper object that holds the data and knows how to render it, and a property object that controls parameters such as color and opacity.(除了提供位置上的控制,Prop通常也会提供一个映射器对象,这个映射其对象持有数据并且知道如何渲染这些数据;此外还控制一个属性对象,控制颜色和透明度参数)

There are a large number (over 50) of specialized props(专用道具) such as vtkImageActor (used to display
an image) and vtkPieChartActor (used to create a pie chart visual representation of an array of datavalues). Some of these specialized props directly contain the parameters that control appearance, and directly have a reference to the input data to be rendered, and therefore do not require the use of a property or a mapper. The vtkFollower prop is a specialized subclass of vtkActor that will automatically update its orientation in order to continually face a specified camera. This is useful for displaying billboards or text in the 3D scene and having them remain visible as the user rotates. The vtkLODActor is also a subclass of vtkActor that automatically changes its geometric representation in order to maintain interactive frame rates, and vtkLODProp3D is a subclass of vtkProp3D that
selects between a number of different mappers (perhaps even a mixture of volumetric and geometric
mappers) in order to provide interactivity. vtkAssembly allows hierarchies of actors, properly managing the transformations when the hierarchy is translated, rotated or scaled.
3.1 vtkAbstractMapper 抽象映射器
Some props such as vtkActor and vtkVolume use a subclass of vtkAbstractMapper to hold a reference to the input data(保持对输入数据的引用) and to provide the actual rendering functionality(提供实际的渲染功能). The vtkPolyDataMapper is the primary mapper for rendering polygonal geometry.(对于渲染多边形几何 vtkPolyDataMapper是最主要的映射器) For volumetric objects(对于容积对象), VTK provides several rendering techniques including the vtkFixedPointVolumeRayCastMapper that can be used to rendering vtkImageData, and the vtkProjectedTetrahedra mapper that can be used to
render vtkUnstructuredGrid data.
3.2 vtkProperty and vtkVolumeProperty 属性和体积属性
Some props use a separate property object to hold the various parameters that control the appearance of the data.(属性对象用来控制数据的外观) This allows you to more easily share appearance settings between different objects in your scene. The vtkActor object uses a vtkProperty to store parameters such as color, opacity, and the ambient, diffuse, and specular coefficient of the material.(颜色、透明度、阴影、镜面反射系数)The vtkVolume object instead uses a vtkVolumeProperty to capture the parameters that are applicable to a volumetric object, such as the transfer functions that map the scalar value to color and opacity. Many mappers also provide functionality to set clipping planes that can be used to reveal interior structure.
3.3 vtkCamera 摄像机
The vtkCamera contains the parameters that control how you view the scene.(如何去看一个场景) The vtkCamera has a position, a focal point, and a vector defining the direction of "up" in the scene(位置信息、焦点信息、定义“向上”). Other parameters control the specific viewing transformation (parallel or perspective), the scale or view angle of the image, and the near and far clipping planes of the view frustum.(*行/透视、尺寸、角度、视锥体的远*裁剪*面).
3.4 vtkLight 灯光
When lighting is computed for a scene, one or more vtkLight objects are required. The vtkLight objects store the position and orientation of the light, as well as the color and intensity.(该对象储存着灯光的位置的方向信息,以及灯光的颜色和强度信息) Lights also have a type that describes how the light will move with respect to the camera.(灯光还有一个参数信息,那就是定义灯光如何相对于摄像机移动) For example, a Headlight is always located at the camera's position and shines on the camera's focal point, whereas a SceneLight is located at a stationary position in the scene.
3.5 vtkRenderer 渲染器
The objects that make up a scene including the props, the camera and the lights are collected together in a vtkRenderer. (渲染器对象用于将道具、摄像机、灯光收集到一起组成一个场景)The vtkRenderer is responsible for managing the rendering process for the scene. Multiple vtkRenderer objects can be used together in a single vtkRenderWindow. (在一个舞台上我们可以构建多个渲染器对象,这就是我们*常说的多视窗技术)These renderers may render into different rectangular regions (known as viewports) of the render window,or may be overlapping.
3.6 vtkRenderWindow 渲染窗口
The vtkRenderWindow provides a connection between the operating system and the VTK rendering engine(渲染窗口类用于联系当地操作系统和VTK渲染引擎). Platform specific subclasses of vtkRenderWindow are responsible for opening a window in the native windowing system on your computer and managing the display pro-cess(主要负责打开一个本地的窗口,然后管理图像显示过程). When you develop with VTK, you simply use the platform-independent vtkRenderWindow which is automatically replaced with the correct platform-specific subclass at runtime. The vtkRenderWindow contains a collection of vtkRenderers, and parameters that control rendering features such as stereo, anti-aliasing, motion blur and focal depth(渲染窗口类主要负责收集渲染器信息以及控制渲染特征的信息,比如立体?运动模糊?焦点深度?).
3.7 vtkRenderWindowInteractor 渲染窗口交互
The vtkRenderWindowInteractor is responsible for processing mouse, key, and timer events (负责处理鼠标、键盘和定时器事件的消息)and routing these through VTK's implementation of the command /observer design pattern. A vtkInteractorStyle listens for these events and processes them in order to provide motion controls such as rotating, panning and zooming. (可以提供类似*移、旋转、缩放的功能)The vtkRenderWindowInteractor automatically creates a default interactor style that works well for 3D scenes, but you can instead select one for 2D image viewing for example, or create your own custom interactor style.
3.8 vtkLookupTable, vtkColorTransferFunction, and vtkPiecewiseFunction
Visualizing scalar data often involves defining a mapping from a scalar value to a color and opacity(标量数据可视化通常会涉及到定义一个标量值到颜色/透明度的映射). This is true both in geometric surface rendering where the opacity will define the translucency of the surface, and in volume rendering where the opacity will represent the opacity accumulated along some length of of ray passing through the volume. For geometric rendering, this mapping is typically created using a vtkLookupTable, and in volume rendering both the vtkColorTransferFunction and the vtkPiecewiseFunction will be utilized.