[vtkusers] Cannot recover user defined vtkInformation from vtkUnstructuredGrid

scotsman60 doug at beachmailing.com
Sun Dec 3 18:00:22 EST 2017


Hello!!

I'm using the Python API to vtk and I'm unable to import custom
vtkInformation from a vtkUnstructuredGrid.

First of all I'm associating custom information to CellData in a
vtkUnstructuredGrid using the following code - where self.mesh is the
vtkUnstructuredGrid

    #Add the information keys 
    info = densityScalars.GetInformation()

    # First the Quantity type          
    quantity_key = keys.MakeKey(vtk.vtkInformationStringKey, "Quantity",
"1")
    quantity_key.Set(info, "Topology Density")

    #Now the Increment number
    increment_key = keys.MakeKey(vtk.vtkInformationIntegerKey, "Increment",
"2")
    increment_key.Set(info, increment)


    #Add the array to the mesh    
    self.mesh.GetCellData().AddArray(densityScalars)


Later I save the vtkUnstructuredGrid using vtkUnstructuredGridWriter, then
Import it into a new Python session (Basically my program uses the
vtkUnstructuredGrid as its persistence mechanism.........)

When I read the grid using vtkUnstructuredGridReader I get a whole bunch of
warnings from vtk

    Warning: In ..\IO\Legacy\vtkDataReader.cxx, line 2668
    vtkUnstructuredGridReader (00000000044D7520): Could not locate key
2::Increment. Is the module 
    in which it is defined linked?

    Warning: In ..\IO\Legacy\vtkDataReader.cxx, line 2907
    vtkUnstructuredGridReader (00000000044D7520): Ignoring line in
INFORMATION block: DATA 1

    Warning: In ..\IO\Legacy\vtkDataReader.cxx, line 2668
    vtkUnstructuredGridReader (00000000044D7520): Could not locate key
2::Increment. Is the module 
    in which it is defined linked?

    Warning: In ..\IO\Legacy\vtkDataReader.cxx, line 2907
    vtkUnstructuredGridReader (00000000044D7520): Ignoring line in
INFORMATION block: DATA 2
 
    Warning: In ..\IO\Legacy\vtkDataReader.cxx, line 2668
    vtkUnstructuredGridReader (00000000044D7520): Could not locate key
1::Quantity. Is the module in 
    which it is defined linked?

    Warning: In ..\IO\Legacy\vtkDataReader.cxx, line 2907
    vtkUnstructuredGridReader (00000000044D7520): Ignoring line in
INFORMATION block: DATA 
    Topology%20Density


Any ideas on what's going on here?

Thanks in advance,

Doug



--
Sent from: http://vtk.1045678.n5.nabble.com/VTK-Users-f1224199.html


More information about the vtkusers mailing list