vtk3———System Overview

来源:互联网 发布:手机饰品网络市场现状 编辑:程序博客网 时间:2024/06/05 15:36

System Architecture

the visualization pipeline

  • The visualization pipeline is used to acquire or create data, process that data, and either write the results to a file or pass the results to the rendering engine for display.
  • Algorithms and data objects are connected together to form visualization pipelines.
    • vtkDataObject
    • vtkAlgorithm
  • the construction of the visualization pipeline
    • methods :aFilter->SetInputConnection( anotherFilter->GetOutputPort() );
    • a lazy evaluation scheme ((executes only when when the data is requested)
    • only those objects compatible with one another can fit together with the SetInputConnection() and GetOutputPort() methods
    • decide whether to cache, or retain, the dataobjects once the pipeline has executed.
  • Pipeline Execution: do not need to manually invoke Update() because the filters are connected into visualization pipeline.(when rendering,data is requested,pipeline execution)
  • Image Precessing: Almost all algorithms in the imaging pipeline are
    multithreaded and are capable of streaming data in pieces to satisfy a user-specified memory limit

the rendering engine

  • The rendering engine is responsible for creating a visual representation of the data.
  • vtkProp – know position size and orientation
    • 3D vtkActor(geometric data) and vtkVolume(volumetric data)
    • 2D vtkActor2D
    • 2D annotation vtkScalarBarActor
    • vtkImageActor (used to display an image)
    • vtkPieChartActor
    • vtkFollower
    • vtkLODActor
  • vtkAbstractMapper
  • vtkProperty and vtkVolumProperty
  • vtkCamera
  • vtkLight
  • vktRender
  • vtkRenderWindow
  • vtkRenderWindowInteractor
  • vtkTransform.
  • vtkLookupTable, vtkColorTransferFunction, and vtkPiecewiseFunction.

Low-Level Object Model

  • root class vtkObject vtkObjectBase
  • new() —— delete()
  • 引用计数 —— Set…(..)
  • GetClassName()
  • IsA(” “) / SafeDownCast()
  • Print(cout)

Create An Application

  • using the Subject/Observer and Command design pattern
  • AddObserver() method that can be used to setup callbacks
  • compulsory type conversion operator:reinterpret_cast

    vtkRenderer *renderer = reinterpret_cast<vtkRenderer*>(caller); vtkRenderer *ren = vtkRenderer::SafeDownCast(caller);
  • create your subclass of vtkCommand and add an observer that will call your command on certain events.
    (/Example/Tutorial/step2/Cxx——class vtkMyCallback : public vtkCommand)
原创粉丝点击