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

Function AddTransformToFieldData

IO/Geometry/vtkGLTFReader.cxx:240–260  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

238
239//------------------------------------------------------------------------------
240void AddTransformToFieldData(const vtkSmartPointer<vtkMatrix4x4> transform,
241 vtkSmartPointer<vtkFieldData> fieldData, const std::string& name)
242{
243 vtkSmartPointer<vtkDoubleArray> matrixArray;
244 if (fieldData->HasArray(name.c_str()))
245 {
246 matrixArray = vtkDoubleArray::SafeDownCast(fieldData->GetArray(name.c_str()));
247 matrixArray->Resize(0);
248 }
249 else
250 {
251 matrixArray = vtkSmartPointer<vtkDoubleArray>::New();
252 matrixArray->SetName(name.c_str());
253 fieldData->AddArray(matrixArray);
254 }
255 // Create array to store the matrix's values
256 for (int i = 0; i < 16; i++)
257 {
258 matrixArray->InsertNextValue(transform->GetElement(i / 4, i % 4));
259 }
260}
261
262//------------------------------------------------------------------------------
263void AddJointMatricesToFieldData(const std::vector<vtkSmartPointer<vtkMatrix4x4>>& jointMats,

Callers 2

Calls 8

NewFunction · 0.50
HasArrayMethod · 0.45
c_strMethod · 0.45
GetArrayMethod · 0.45
ResizeMethod · 0.45
SetNameMethod · 0.45
AddArrayMethod · 0.45
InsertNextValueMethod · 0.45

Tested by

no test coverage detected