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

Method GetLocalDataType

IO/XML/vtkXMLReader.cxx:1499–1522  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

1497
1498//------------------------------------------------------------------------------
1499int vtkXMLReader::GetLocalDataType(vtkXMLDataElement* da, int dataType)
1500{
1501 int idType;
1502 if (da->GetScalarAttribute("IdType", idType) && idType == 1)
1503 {
1504 // For now, only uses vtkIdTypeArray when the size of the data is
1505 // consistent with the VTK build.
1506 // TODO create a smaller size array before converting to vtkIdTypeArray
1507 // TODO potentially truncate bigger size array into vtkIdTypeArray
1508 switch (dataType)
1509 {
1510 CaseIdTypeMacro(VTK_SHORT, VTK_SIZEOF_SHORT);
1511 CaseIdTypeMacro(VTK_INT, VTK_SIZEOF_INT);
1512 CaseIdTypeMacro(VTK_LONG, VTK_SIZEOF_LONG);
1513 CaseIdTypeMacro(VTK_LONG_LONG, VTK_SIZEOF_LONG_LONG);
1514 default:
1515 vtkWarningMacro("An array named " << da->GetAttribute("Name")
1516 << " was tagged as an IdType array with an invalid type."
1517 "The IdType tag has been ignored.");
1518 break;
1519 }
1520 }
1521 return dataType;
1522}
1523
1524//------------------------------------------------------------------------------
1525vtkAbstractArray* vtkXMLReader::CreateArray(vtkXMLDataElement* da)

Callers 2

CreateArrayMethod · 0.95
SetFieldDataInfoMethod · 0.95

Calls 2

GetScalarAttributeMethod · 0.80
GetAttributeMethod · 0.45

Tested by

no test coverage detected