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

Function Create

Common/DataModel/vtkDataSetAttributesFieldList.cxx:103–128  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

101 bool IsEmpty() const { return this->Type == VTK_VOID; }
102
103 static FieldInfo Create(vtkAbstractArray* array, int loc)
104 {
105 FieldInfo info;
106 if (array)
107 {
108 info.Name = array->GetName() ? std::string(array->GetName()) : std::string();
109 info.Type = array->GetDataType();
110 info.NumberOfComponents = array->GetNumberOfComponents();
111 if (auto da = vtkDataArray::SafeDownCast(array))
112 {
113 info.LUT = da->GetLookupTable();
114 }
115 info.Information = array->GetInformation();
116
117 info.ComponentNames.resize(info.NumberOfComponents);
118 for (int cc = 0; cc < info.NumberOfComponents; ++cc)
119 {
120 if (auto name = array->GetComponentName(cc))
121 {
122 info.ComponentNames[cc] = name;
123 }
124 }
125 info.Location.push_back(loc);
126 }
127 return info;
128 }
129
130 void InitializeArray(vtkAbstractArray* array, vtkIdType sz, vtkIdType ext) const
131 {

Callers 1

GetFieldsFunction · 0.70

Calls 9

GetComponentNameMethod · 0.80
stringClass · 0.50
GetNameMethod · 0.45
GetDataTypeMethod · 0.45
GetNumberOfComponentsMethod · 0.45
GetLookupTableMethod · 0.45
GetInformationMethod · 0.45
resizeMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected