MCPcopy Create free account
hub / github.com/Kitware/VTK / deserialize

Function deserialize

Serialization/Manager/Testing/Python/TestDataSetImportExport.py:41–51  ·  view source on GitHub ↗
(serialized_data: vtkCharArray)

Source from the content-addressed store, hash-verified

39
40
41def deserialize(serialized_data: vtkCharArray) -> vtkObjectBase:
42 manager = vtkObjectManager()
43 manager.Initialize()
44 # return value is a list of strong objects
45 strong_objects = manager.ImportFromBytes(serialized_data)
46 # Return the first object which is the deserialized object
47 return strong_objects[0]
48 # Equivalent to when using files:
49 # manager.Import("data_object.states.json", "data_object.blobs.json")
50 # strong_object = manager.GetObjectAtId(1) # Assuming the first object has ID 1
51 # return strong_object
52
53
54class TestDataSetImportExport(vtkTesting.vtkTest):

Callers 11

testMethod · 0.85
testSceneManagementMethod · 0.85
test_polydataMethod · 0.85
test_image_dataMethod · 0.85
testMethod · 0.85
testMethod · 0.85
testMethod · 0.85
testMethod · 0.85
testMethod · 0.85

Calls 2

ImportFromBytesMethod · 0.80
InitializeMethod · 0.45

Tested by

no test coverage detected