vtkmodules.util.information#

Pythonic interfaces for vtkInformation and vtkInformationVector.

Makes vtkInformation behave like a Python dictionary (key -> value)::

from vtkmodules.vtkCommonDataModel import vtkDataObject
info = vtkInformation()
info[vtkDataObject.FIELD_NAME()] = "Pressure"
info[vtkDataObject.FIELD_NAME()]           # "Pressure"
vtkDataObject.FIELD_NAME() in info         # True
del info[vtkDataObject.FIELD_NAME()]       # Remove entry
len(info)                                  # entry count
for key in info: ...                       # iterate vtkInformationKey objects
info.keys()                                # list of vtkInformationKey objects
info.string_keys()                         # list of key name strings
info.values(), info.items()                # dict-like views

Makes vtkInformationVector behave like a Python list::

vec = vtkInformationVector()
vec.append(vtkInformation())
len(vec)          # 1
vec[0]            # vtkInformation
for info in vec:  # iterate

Module Contents#

Classes#

Functions#

_resolve_key

Resolve a string key name (case-insensitive) to its vtkInformationKey object.

Data#

API#

vtkmodules.util.information._SCALAR_KEY_TYPES#

()

vtkmodules.util.information._VECTOR_KEY_TYPES#

()

vtkmodules.util.information._OBJECT_KEY_TYPES#

()

vtkmodules.util.information._OBJECT_VECTOR_KEY_TYPES#

()

vtkmodules.util.information._resolve_key(name_or_key)#

Resolve a string key name (case-insensitive) to its vtkInformationKey object.

class vtkmodules.util.information._InformationMixin#
__getitem__(key)#
__setitem__(key, value)#
__delitem__(key)#
__contains__(key)#
__len__()#
__iter__()#
keys()#

Return the list of vtkInformationKey objects in this information.

values()#
items()#

Return [(key_object, value), …] for all entries.

string_keys()#

Return the names of the keys in this information as strings.

get(key, default=None)#
update(other)#

Merge entries from another vtkInformation or a Python mapping.

clear()#
__repr__()#
class vtkmodules.util.information.Information#

Bases: vtkmodules.util.information._InformationMixin, vtkmodules.vtkCommonCore.vtkInformation

class vtkmodules.util.information._InformationVectorMixin#
__len__()#
__getitem__(index)#
__setitem__(index, info)#
__delitem__(index)#
__iter__()#
__contains__(info)#
append(info)#
__repr__()#
class vtkmodules.util.information.InformationVector#

Bases: vtkmodules.util.information._InformationVectorMixin, vtkmodules.vtkCommonCore.vtkInformationVector