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

Function setAllAttributes

Utilities/vtk2xml.py:88–112  ·  view source on GitHub ↗
(reader)

Source from the content-addressed store, hash-verified

86
87
88def setAllAttributes(reader):
89 s_name = []
90 v_name = []
91 t_name = []
92 for i in range(reader.GetNumberOfScalarsInFile()):
93 s_name.append(reader.GetScalarsNameInFile(i))
94 for i in range(reader.GetNumberOfVectorsInFile()):
95 v_name.append(reader.GetVectorsNameInFile(i))
96 for i in range(reader.GetNumberOfTensorsInFile()):
97 t_name.append(reader.GetTensorsNameInFile(i))
98
99 p_s, c_s = _getAttr(reader, s_name, 'Scalars')
100 p_v, c_v = _getAttr(reader, v_name, 'Vectors')
101 p_t, c_t = _getAttr(reader, t_name, 'Tensors')
102
103 o = reader.GetOutput()
104 pd = o.GetPointData()
105 for i in p_s + p_v + p_t:
106 pd.AddArray(i)
107
108 cd = o.GetCellData()
109 for i in c_s + c_v + c_t:
110 cd.AddArray(i)
111
112 return o
113
114
115def usage():

Callers 1

mainFunction · 0.85

Calls 10

_getAttrFunction · 0.85
GetScalarsNameInFileMethod · 0.80
GetVectorsNameInFileMethod · 0.80
GetTensorsNameInFileMethod · 0.80
rangeClass · 0.50
appendMethod · 0.45
GetOutputMethod · 0.45
GetPointDataMethod · 0.45
AddArrayMethod · 0.45
GetCellDataMethod · 0.45

Tested by

no test coverage detected