| |
- pyvtk.common.Common
-
- VtkData
class VtkData(pyvtk.common.Common) |
|
VtkData
=======
Represents VTK file that has four relevant parts:
header - string up to length 255
format - string: ascii | binary
DataSet - StructuredPoints | StructuredGrid | UnstructuredGrid
| RectilinearGrid | PolyData
Data - PointData | CellData
Usage:
------
v = VtkData(<DataSet instance> [,<header string>,<Data instances>,..])
v = VtkData(<filename>, only_structure = 0) - read VTK data from file.
v.tofile(filename, format = 'ascii') - save VTK data to file.
Attributes:
header
structure
point_data
cell_data
Public methods:
to_string(format = 'ascii')
tofile(filename, format = 'ascii')
DataSet
=======
StructuredPoints(<3-sequence of dimensions>
[,<3-sequence of origin> [, <3-sequence of spacing>]])
StructuredGrid(<3-sequence of dimensions>,
<sequence of 3-sequences of points>)
UnstructuredGrid(<sequence of 3-sequences of points>
[,<cell> = <sequence of (sequences of) integers>])
cell - vertex | poly_vertex | line | poly_line | triangle
| triangle_strip | polygon | pixel | quad | tetra
| voxel | hexahedron | wedge | pyramid
RectilinearGrid([x = <sequence of x-coordinates>],
[y = <sequence of y-coordinates>],
[z = <sequence of z-coordinates>])
PolyData(<sequence of 3-sequences of points>,
[vertices = <sequence of (sequences of) integers>],
[lines = <sequence of (sequences of) integers>],
[polygons = <sequence of (sequences of) integers>],
[triangle_strips = <sequence of (sequences of) integers>])
Data
====
PointData | CellData ([<DataSetAttr instances>]) - construct Data instance
DataSetAttr
===========
DataSetAttr - Scalars | ColorScalars | LookupTable | Vectors
| Normals | TextureCoordinates | Tensors | Field
Scalars(<sequence of scalars> [,name[, lookup_table]])
ColorScalars(<sequence of scalar sequences> [,name])
LookupTable(<sequence of 4-sequences> [,name])
Vectors(<sequence of 3-sequences> [,name])
Normals(<sequence of 3-sequences> [,name])
TextureCoordinates(<sequence of (1,2, or 3)-sequences> [,name])
Tensors(<sequence of (3x3)-sequences> [,name])
Field([name,] [arrayname_1 = sequence of n_1-sequences, ...
arrayname_m = sequence of n_m-sequences,])
where len(array_1) == .. == len(array_m) must hold. |
|
Methods defined here:
- __init__(self, *args, **kws)
- fromfile(self, filename, only_structure=0)
- to_string(self, format='ascii')
- tofile(self, filename, format='ascii')
- Save VTK data to file.
Data and other attributes defined here:
- cell_data = None
- header = None
- point_data = None
Methods inherited from pyvtk.common.Common:
- __str__(self)
- error(self, m='')
- float01_to_int255(self, seq)
- get_3_3_tuple(self, obj, default=None)
- Return tuple of 3-tuples
- get_3_3_tuple_list(self, obj, default=None)
- Return list of 3x3-tuples.
- get_3_tuple(self, obj, default=None)
- Return 3-tuple from
number -> (obj,default[1],default[2])
0-sequence|None -> default
1-sequence -> (obj[0],default[1],default[2])
2-sequence -> (obj[0],obj[1],default[2])
(3 or more)-sequence -> (obj[0],obj[1],obj[2])
- get_3_tuple_list(self, obj, default=None)
- Return list of 3-tuples from
sequence of a sequence,
sequence - it is mapped to sequence of 3-sequences if possible
number
- get_datatype(self, obj)
- get_n_seq_seq(self, obj, default)
- get_seq(self, obj, default=None)
- Return sequence.
- get_seq_seq(self, obj, default=None)
- Return sequence of sequences.
- int255_to_float01(self, seq)
- message(self, m='')
- seq_to_string(self, seq, format, datatype)
- skipping(self, m='')
- warning(self, m='')
Data and other attributes inherited from pyvtk.common.Common:
- default_float = 'float'
- default_int = 'int'
- struct_fmt_map = {'char': 'c', 'double': 'd', 'float': 'f', 'int': 'i', 'long': 'l', 'unsigned char': 'B'}
| |