vtkmodules.util.vtkVariant

Utility functions to mimic the template support functions for vtkVariant

Module Contents

Classes

vtkVariantStrictWeakOrderKey

A key method (class, actually) for use with sort()

Functions

vtkVariantCreate

Create a vtkVariant of the specified type, where the type is in the following format: ‘int’, ‘unsigned int’, etc. for numeric types, and ‘string’ for strings. You can also use an integer VTK type constant for the type.

vtkVariantExtract

Extract the specified value type from the vtkVariant, where the type is in the following format: ‘int’, ‘unsigned int’, etc. for numeric types, and ‘string’ for strings. You can also use an integer VTK type constant for the type. Set the type to ‘None” to extract the value in its native type.

vtkVariantCast

Cast the vtkVariant to the specified value type, where the type is in the following format: ‘int’, ‘unsigned int’, etc. for numeric types, and ‘string’ for strings. You can also use an integer VTK type constant for the type.

vtkVariantStrictWeakOrder

Compare variants by type first, and then by value.

vtkVariantStrictEquality

Check two variants for strict equality of type and value.

vtkVariantLessThan

Return true if s1 < s2.

vtkVariantEqual

Return true if s1 == s2.

Data

API

vtkmodules.util.vtkVariant._variant_type_map

None

vtkmodules.util.vtkVariant._variant_method_map

None

vtkmodules.util.vtkVariant._variant_check_map

None

vtkmodules.util.vtkVariant.vtkVariantCreate(v, t)

Create a vtkVariant of the specified type, where the type is in the following format: ‘int’, ‘unsigned int’, etc. for numeric types, and ‘string’ for strings. You can also use an integer VTK type constant for the type.

vtkmodules.util.vtkVariant.vtkVariantExtract(v, t=None)

Extract the specified value type from the vtkVariant, where the type is in the following format: ‘int’, ‘unsigned int’, etc. for numeric types, and ‘string’ for strings. You can also use an integer VTK type constant for the type. Set the type to ‘None” to extract the value in its native type.

vtkmodules.util.vtkVariant.vtkVariantCast(v, t)

Cast the vtkVariant to the specified value type, where the type is in the following format: ‘int’, ‘unsigned int’, etc. for numeric types, and ‘string’ for strings. You can also use an integer VTK type constant for the type.

vtkmodules.util.vtkVariant.vtkVariantStrictWeakOrder(s1, s2)

Compare variants by type first, and then by value.

class vtkmodules.util.vtkVariant.vtkVariantStrictWeakOrderKey(obj, *args)

A key method (class, actually) for use with sort()

Initialization

__lt__(other)
vtkmodules.util.vtkVariant.vtkVariantStrictEquality(s1, s2)

Check two variants for strict equality of type and value.

vtkmodules.util.vtkVariant.vtkVariantLessThan(s1, s2)

Return true if s1 < s2.

vtkmodules.util.vtkVariant.vtkVariantEqual(s1, s2)

Return true if s1 == s2.