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

Function GetFieldAsFloat

IO/Geometry/vtkGLTFWriter.cxx:157–173  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

155}
156
157std::vector<float> GetFieldAsFloat(
158 vtkDataObject* obj, const char* name, const std::vector<float>& d)
159{
160 vtkFieldData* fd = obj->GetFieldData();
161 if (!fd)
162 {
163 return d;
164 }
165 vtkFloatArray* fa = vtkFloatArray::SafeDownCast(fd->GetAbstractArray(name));
166 if (!fa)
167 {
168 return d;
169 }
170 std::vector<float> v(d.size());
171 fa->GetTypedTuple(0, v.data());
172 return v;
173}
174
175vtkSmartPointer<vtkImageReader2> SetupTextureReader(const std::string& texturePath)
176{

Callers 1

WriteMaterialFunction · 0.85

Calls 5

GetAbstractArrayMethod · 0.80
GetFieldDataMethod · 0.45
sizeMethod · 0.45
GetTypedTupleMethod · 0.45
dataMethod · 0.45

Tested by

no test coverage detected