您的位置:首页 > 其它

VTK/Tutorials/New Pipeline文档翻译

2016-02-16 23:50 357 查看
本文由Markdown编辑器编辑而成。

1. 前言:

最近的工作任务,主要围绕创建VTK的filter,及其将filter植入到ParaView的源代码中,为ParaView增加新的filter。

为了完成这个工作,首先必须了解VTK管道机制的工作原理。为此有必要阅读vtk的关于Pipeline的官方文档。经查阅,该文档的链接为:http://www.vtk.org/Wiki/VTK/Tutorials/New_Pipeline

通过阅读文档,为之后阅读和理解vtk中的filter源码以及创建自己的filter都有很大的帮助。

以下是相关文档中主要部分的翻译:

2. VTK管道机制

This section will introduce the classes and concepts used in the new VTK pipeline. You should be familiar with the very basic design of the old pipeline before delving into this. The new pipeline was designed to reduce complexity while at the same time provide more flexibility. In the old pipeline the pipeline functionality and mechanics were contained in the data object and filters. In the new pipeline this functionality is contained in a new class (and its subclasses) called vtkExecutive.

本部分将主要介绍在vtk新的管道机制中会被用到的类和概念。在深入钻研这部分前,你应该熟悉在旧的管道机制中最基本的设计。新的管道机制是为了降低复杂度,同时提供更多的灵活性。在旧的管道机制中,管道的功能和机制被包含在数据体和滤波器中。在新的管道中,这个功能被包含在一个新的名为vtkExecutive的类(和它的子类)中。

Contents:

Introduction

Typical Pipeline Execution

Request Information

Request Update Extent

Request Data

Executives

vtkExecutive

vtkDemandDrivenPipeline

vtkStreamingDemanDrivenPipeline

vtkCompositeDataPipeline

Converting an Existing Filter to the New Pipeline

2.1 Introduction

There are four key classes that make up the new pipeline. They are:

新的管道是由四个关键的类构成的,这四个类分别是:

vtkInformation, vtkDataObject, vtkAlgorithm和vtkExecutive.

vtkInformation:

provides the flexibility to grow. Most of the methods and meta information storage make use of this class. vtkInformation is a map-based data structure that supports heterogeneous key-value operations with compile time type checking. There is also a vtkInformationVector class for storing vectors of information objects. When passing information up or down the pipeline (or from the executive to the algorithm) this is the class to use.

为扩展增加了灵活性。大部分的方法和头信息的存储都会用到这个类。vtkInformation是一个基于Map的数据结构,它支持与编译时类型检查异构的键值操作。这也是一个用于存储information数据体的向量类vtkInformationVector。当向管道的上方或下方传递信息时(或从执行到算法),这个类将会被用到。

vtkDataObject:

in the past this class both stored data and handled some of the pipeline logic. In the new pipeline this class is only supposed to store data. In practice there are some pipeline methods in the class for backwards compatibility so that all of VTK doesn’t break, but the goal is that vtkDataObject should only be about storing data. vtkDataObject has an instance of vtkInformation that can be used to store key-value pairs in. For example the current extent of the data object is stored in there but the whole extent is not, because that is a pipeline attribute containing information about a specific pipeline topology .

vtkAlgorithm:

an algorithm is the new superclass for all filters/sources/sinks in VTK. It is basically the replacement for vtkSource. Like vtkDataObject, vtkAlgorithm should know nothing about the pipeline and should only be an algorithm/function/filter. Call it with the correct arguments and it will produce results. It also has a vtkInformation instance that describes the properties of the algorithm and it has information objects that describe its input and output port characteristics. The main method of an algorithm is ProcessRequest.

在VTK中,vtkAlgorithm是对于所有的filters/sources/sinks的一个新的基类。它基本上可以替换vtkSource。和vtkDataObject一样,vtkAlgorithm不应该知道关于pipeline的任何环节,而仅仅只是一个algorithm/function/filter。输入正确的参数调用它,它便会产生结果。它也有一个vtkInformation的实例,用来描述算法的特征和属性,而且拥有描述算法输入和输出端口属性的信息。

vtkExecutive:

contains the logic of how to connect and execute a pipeline. This class is the superclass of all executives. Executives are distributed (as opposed to centralized) and each filter/algorithm has its own executive that communicates with other executives. vtkExecutive has a subclass called vtkDemandDrivenPipeline which in turn has a subclass called vtkStreamingDemandDrivenPipeline. vtkStreamingDemandDrivenPipeline provides most of the functionality that was found in the old VTK pipeline and is the default executive for all algorithms if you do not specify one.

2.2 Typical Pipeline Execution

2.3 Executives

2.4 Converting an Existing Filter to the New Pipeline

内容来自用户分享和网络整理,不保证内容的准确性,如有侵权内容,可联系管理员处理 点击这里给我发消息
标签: