# VTK The Visualization Toolkit Part II Visualization Model

• Slides: 19

VTK: The Visualization Toolkit Part II: Visualization Model March 30, 2001

VTK Visualization Models n Graphics and Visualization Model n n Graphics objects: rendering Visualization objects: generating geometry Data Flow System: Pipeline execution Data source Visualizatoin Graphics

What is visualization anyway? • Converting data from its original form into graphics • Deal with the issues of transformation and representation • Transformation: data to graphics • Representation: internal data structures Example: stock price display

Representations • Computational representation: An array of stock prices. • Price[i] = 9085, 9080, 9075, 9060, 9068, …. • Time[i] = 10(am), 10: 30, 11: 30, 12, … • Graphical Representation: x-y plot Y (price) Computational Graphics Transformation (visualization) X(time)

A 3 D example Quadric function: 2 2 2 f(x, y, z) = a 0 x + a 1 y + a 2 z + a 3 xy + a 4 yz + a 5 xz + a 6 x + a 7 y + a 8 z Visualization process: • Sample the function f(x, y, z) -> a 3 D array on a regular grid: F[x][y][z] = f ; (-1 <= x, y, z <= 1) • Generate a 3 D surface corresponding to f(x, y, z) = c • Display the surface Sample the function

Visualization Process f(x, y, z) sample Computational representation Transformation (visualization) Graphical representation

Object-oriented viewpoint VTK Visualization Model n Representation: Object model internal data structures n Transformation: Functional model the steps to create visualization (how data flow through the system)

VTK Functional Model Illustrate the steps to create visualization, also called Visualization Pipeline (visualization networks) Sample F(x, y, z) Point Array Extract Surface : process : data flow direction Polygon Display

VTK Object Model Describe which objects operate on the functional model (visualization pipeline) • Data Object: Represent information and methods to create, access, and delete the information example: the 3 D point array F(x, y, z) • Process Object: operates on (transform) the data objects example: generating surfaces from F(x, y, z)

Process Objects • Source: Interface to external data sources or generate data procedurally • Filter: Transform the data input • Mapper: The sink of the functional model, interface with the graphics model

Process Objects (cont’d) Sample F(x, y, z) Source Point Array Extract Surface Filter Polygon Display Mapper (and Graphics)

Data Objects Data Object: dataset (representation of information) • Structures: how the information is organized - Topology - Geometry • Attributes: store the information we want to visualize. e. g. function values

Data Objects: structures • Topology: - Invariant under geometric transformation (rotation, translation, scaling etc) - Topological structures: Cells • Geometry: - The instantiation of the topology - Geometric structures: cells with positions in 3 D space

VTK Cell Types (a) vertex (e) Quadrilateral (b) Polyvertex (c) line (e) Polygon (d) polyline (f) Tetrahedron And more (I am too tired drawing now …) (e) triangle (f) Hexahedron

VTK Data Attributes n The information stored at each corner of the cell n n n Scalars: temperature, pressure, etc Vector: velocitys Normals: surface directions Texture coordinates: graphics specific Tensors: matrices

Where are we now. . . Remember: Data Object: dataset (representation of information) • Structures: how the information is organized - Topology - Geometry • Attributes: store the information we want to visualize. e. g. function values

VTK Datasets A Collection of structures and attributes Structured Grid Rectilinear Grid Unstructured Points Polygonal Grid Unstructured Grid

Examples vol. cxx Ugrid. cxx

Pipeline Execution Direction of ‘update’ Visualization model Source Filter Direction of data flow Render Graphics model Mapper Actor