API Reference for Enthought Tool Suite 3.2.0

A module that provides Matlab like 3d visualization functionality.

The general idea is shamelessly stolen from the high-level API provided by Octaviz. Some of the test cases and demos are also translated from there!

The implementation provided here is object oriented and each visualization capability is implemented as a class that has traits. So each of these may be configured. Each visualization class derives (ultimately) from MLabBase which is responsible for adding/removing its actors into the render window. The classes all require that the RenderWindow be a pyface.tvtk.scene.Scene instance (this constraint can be relaxed if necessary later on).

This module offers the following broad class of functionality:

Figure
This basically manages all of the objects rendered. Just like figure in any Matlab like environment. A convenience function called figure may be used to create a nice Figure instance.
Glyphs
This and its subclasses let one place glyphs at points specified as inputs. The subclasses are: Arrows, Cones, Cubes, Cylinders, Spheres, and Points.
Line3
Draws lines between the points specified at initialization time.
Outline
Draws an outline for the contained objects.
Title
Draws a title for the entire figure.
LUTBase
Manages a lookup table and a scalar bar (legend) for it. This is subclassed by all classes that need a LUT.
SurfRegular
MayaVi1's imv.surf like functionality that plots surfaces given x (1D), y(1D) and z (or a callable) arrays.
SurfRegularC
Also plots contour lines.
TriMesh
Given triangle connectivity and points, plots a mesh of them.
FancyTriMesh
Plots the mesh using tubes and spheres so its fancier.
Mesh
Given x, y generated from numpy.mgrid, and a z to go with it. Along with optional scalars. This class builds the triangle connectivity (assuming that x, y are from numpy.mgrid) and builds a mesh and shows it.
FancyMesh
Like mesh but shows the mesh using tubes and spheres.
Surf
This generates a surface mesh just like Mesh but renders the mesh as a surface.
Contour3
Shows contour for a mesh.
ImShow
Allows one to view large numeric arrays as image data using an image actor. This is just like MayaVi1's mayavi.tools.imv.viewi.

To see nice examples of all of these look at the test_* functions at the end of this file. Here is a quick example that uses these test functions:

>>> from enthought.tvtk.tools import mlab
>>> f = mlab.figure()
>>> mlab.test_surf(f) # Create a spherical harmonic.
>>> f.pop() # Remove it.
>>> mlab.test_molecule(f) # Show a caffeine molecule.
>>> f.renwin.reset_zoom() # Scale the view.
>>> f.pop() # Remove this.
>>> mlab.test_lines(f) # Show pretty lines.
>>> f.clear() # Remove all the stuff on screen.

Variables

Classes

Function summary

Functions

Imported Names

Local nameRefers to
Anyenthought.traits.trait_types.Any
Boolenthought.traits.trait_types.Bool
Floatenthought.traits.trait_types.Float
GUIenthought.pyface.gui.GUI
HasTraitsenthought.traits.has_traits.HasTraits
Instanceenthought.traits.trait_types.Instance
Intenthought.traits.trait_types.Int
Listenthought.traits.trait_types.List
numpynumpy
Strenthought.traits.trait_types.Str
Traitenthought.traits.traits.Trait
tvtkenthought.tvtk.tvtk.tvtk
TVTKBaseenthought.tvtk.tvtk_base.TVTKBase
vtk_color_traitenthought.tvtk.tvtk_base.vtk_color_trait

© Copyright 2002-2009 Enthought, Inc.