the visualization toolkit (vtk) and why you might care about it

10
The Visualization Toolkit (VTK) and why you might care about it Jiahao Chen May 8, 2007

Upload: jiahao-chen

Post on 27-Jan-2015

109 views

Category:

Technology


1 download

DESCRIPTION

Slides for my group meeting of Spring 2007, describing my visualization project for visualizing population transfer between trajectories on two different electronic states in the full multiple spawning (FMS) method.

TRANSCRIPT

Page 1: The Visualization Toolkit (VTK) and why you might care about it

The Visualization Toolkit (VTK)and why you might care about it

Jiahao ChenMay 8, 2007

Page 2: The Visualization Toolkit (VTK) and why you might care about it

Why VTK?

• More control than regular application• You don’t need to care about hardware-

and OS-specific details, e.g.– OpenGL vs. Mesa– X Windows vs. DirectX

Page 3: The Visualization Toolkit (VTK) and why you might care about it

VTK abstracts away details

(Your Program Here)

Application Library

Graphics Library

OS, hardware etc.

talks to

talks to

talks to

VTK

OpenGL

example of

example of

calc. contour

draw a triangle

visualize data does,e.g.

does,e.g.

does,e.g.

does,e.g.add numbers

Page 4: The Visualization Toolkit (VTK) and why you might care about it

How VTK works

• Stage 1: Visualization Model– What data to show?– How to visualize?– Converts data into 3D graphical elements

• Stage 2: Graphics Model– What needs to be drawn?– Where to draw it?– Converts abstract graphical elements into a

displayed picture

Page 5: The Visualization Toolkit (VTK) and why you might care about it

Stage 1: Visualization Model

• Abstract objects handle data flow

Source Filter Mapper

raw data data processing how to draw thingsmakes actors

Point cloud Construct isosurface Triangle strips

e.g. to draw an orbital,

Page 6: The Visualization Toolkit (VTK) and why you might care about it

Stage 2: Graphics Model

• Rendering pipeline• Data flow between

objects• Implemented as C++

objects• Wrappers for Java,

Python and TclRenderer

Render Window

Actor

CameraLight

Scene

Mapper

“canvas”

where todraw things

Trans-form

end user

viewpoint

Props

Page 7: The Visualization Toolkit (VTK) and why you might care about it

Execution Control

• Visualization model isdemand driven– Data processed from

source only whenneeded to

• Graphics model isevent driven– Draws only when user

wants it

End user

Graphics Model

Visualization Model

1. “Show methe money!”

2. “ok,now what?”

3. createsgraphics

4. drawsgraphics

5. Userhappy

Page 8: The Visualization Toolkit (VTK) and why you might care about it

VisTraj

• Want to see how if trajectories from FMSdynamics ever come close to model (ideal)cone computed from CI point parameters

• Want to visualize spawning events• Example data: 12 trajectories around an

ethylidene intersection in ethylene

Page 9: The Visualization Toolkit (VTK) and why you might care about it

instanceof

VisTraj.py data flow

Molecule

simulation parametersFMSTrajectory

PopulationvtkDoubleArray

ConicalIntersectionModelCone

ModelCone

ConfigurationMolecule

instanceof

Trajectorynumpy.array

Energiesnumpy.array

attributedata in

g vectornumpy.array

h vectornumpy.array

Energyfloat

Structurenumpy.array

ProjectedTrajectoryvtkPoints

InputDatavtkPolyData

ProjectedMomentavtkDoubleArray[3]

used to calculate

props in

GlyphActorvtkConeSourcevtkGlyph3DvtkPolyData

vtkPolyDataMappervtkActor

SparkActorvtkSphereSourcevtkPolyDataMapper

vtkActor

OutlinevtkOutlineSourcevtkPolyDataMapper

vtkActor

Main DisplayvtkRenderer

vtkRenderWindowvtkRenderWindowInteractor

vtkPNGWriter

ConeActorvtkQuadric

vtkSampleFunctionvtkContourFilter

vtkPolyDataMappervtkActor

AxesvtkAxesActor

CouplingvtkDoubleArray

Page 10: The Visualization Toolkit (VTK) and why you might care about it

Plot: 1 parent and 1 child

Spawnpoint

child

parentOrigin = 2CI

GlyphActorvtkSphereSourcevtkGlyph3DvtkPolyData

vtkPolyDataMappervtkActor

TubeActorvtkPolyDatavtkTubeFilter

vtkPolyDataMappervtkActor

ProjectedTrajectoryvtkPoints

InputDatavtkPolyData

no attribute data

X