For ASE, the vtk interface consists of Python modules for automatic visualization of positions, bonds, forces and volume data (e.g. wave functions) from an Atoms object, provided such data is made available by the calculator.
Note
The Python modules in ASE are intended to wrap lower-level functionality of the VTK object models in small and easy-to-comprehend classes. To be able to distinguish between build-in VTK objects and their wrappers, and because VTK uses the CamelCase naming convention whereas ASE uses lower-case cf. our coding conventions, all variables referring to VTK built-in types are prefixed by vtk_. However, both VTK and wrapper classes are named according to the standard vtkFooBar.
Bases: ase.visualize.vtk.module.vtkModuleAnchor, ase.visualize.vtk.grid.vtkAtomicPositions
Provides fundamental representation for Atoms-specific data in VTK.
The vtkAtoms class plots atoms during simulations, extracting the relevant information from the list of atoms. It is created using the list of atoms as an argument to the constructor. Then one or more visualization modules can be attached using add_module(name, module).
Example:
>>> va = vtkAtoms(atoms)
>>> va.add_forces()
>>> va.add_axes()
>>> XXX va.add_to_renderer(vtk_ren)
Construct a fundamental VTK-representation of atoms.
Add an orientation indicator for the cartesian axes. An appropriate vtkAxesModule is added to the module anchor under axes.
Add a box outline of the cell using atoms.get_cell(). The existing vtkUnitCellModule is added to the module anchor under cell.
The superclass vtkAtomicPositions implements the basic concepts for representing atomic-centered data in VTK.
Provides an interface for adding Atoms-centered data to VTK modules. Atomic positions, e.g. obtained using atoms.get_positions(), constitute an unstructured grid in VTK, to which scalar and vector can be added as point data sets.
Just like Atoms, instances of vtkAtomicPositions can be divided into subsets, which makes it easy to select atoms and add properties.
Example:
>>> cell = vtkUnitCellModule(atoms)
>>> apos = vtkAtomicPositions(atoms.get_positions(), cell)
>>> apos.add_scalar_property(atoms.get_charges(), 'charges')
>>> apos.add_vector_property(atoms.get_forces(), 'forces')
Construct basic VTK-representation of a set of atomic positions.
Add VTK-representation of scalar data at the atomic positions.
Add VTK-representation of vector data at the atomic positions.
The class vtkGlyphModule implements the lower-level objects for representing predefined shapes (glyphs) in VTK.
Modules represent a unified collection of VTK objects needed for introducing basic visualization concepts such as surfaces or shapes.
A common trait of all modules is the need for an actor representation and corresponding generic properties such as lighting, color and transparency.
Poly data modules are based on polygonal data sets, which can be mapped into graphics primitives suitable for rendering within the VTK framework.
Glyph modules construct these polygonal data sets by replicating a glyph source across a specific set of points, using available scalar or vector point data to scale and orientate the glyph source if desired.
Example:
>>> atoms = molecule('C60')
>>> cell = vtkUnitCellModule(atoms)
>>> apos = vtkAtomicPositions(atoms.get_positions(), cell)
>>> vtk_ugd = apos.get_unstructured_grid()
>>> glyph_source = vtkAtomSource('C')
>>> glyph_module = vtkGlyphModule(vtk_ugd, glyph_source)
Construct VTK-representation of a module containing glyphs. These glyphs share a common source, defining their geometrical shape, which is cloned and oriented according to the input data.
Return the actor representing this module in a rendering scene.
Set the actor representing this module in a rendering scene.
Set the property of the actor representing this module.