------------------------------------------------------------------------------
| 96 | |
| 97 | //------------------------------------------------------------------------------ |
| 98 | vtkXMLDataElement* vtkXMLUnstructuredDataReader ::FindDataArrayWithName( |
| 99 | vtkXMLDataElement* eParent, const char* name) |
| 100 | { |
| 101 | // Find a nested element that represents a data array with the given name. |
| 102 | // and proper TimeStep |
| 103 | int i; |
| 104 | for (i = 0; i < eParent->GetNumberOfNestedElements(); ++i) |
| 105 | { |
| 106 | vtkXMLDataElement* eNested = eParent->GetNestedElement(i); |
| 107 | if (strcmp(eNested->GetName(), "DataArray") == 0) |
| 108 | { |
| 109 | const char* aName = eNested->GetAttribute("Name"); |
| 110 | if (aName && (strcmp(aName, name) == 0)) |
| 111 | { |
| 112 | int numTimeSteps = |
| 113 | eNested->GetVectorAttribute("TimeStep", this->NumberOfTimeSteps, this->TimeSteps); |
| 114 | assert(numTimeSteps <= this->NumberOfTimeSteps); |
| 115 | // Check if CurrentTimeStep is in the array and particular field is also: |
| 116 | int isCurrentTimeInArray = |
| 117 | vtkXMLReader::IsTimeStepInArray(this->CurrentTimeStep, this->TimeSteps, numTimeSteps); |
| 118 | // If no time is specified or if time is specified and match then read |
| 119 | if (!numTimeSteps || isCurrentTimeInArray) |
| 120 | { |
| 121 | return eNested; |
| 122 | } |
| 123 | } |
| 124 | } |
| 125 | } |
| 126 | return nullptr; |
| 127 | } |
| 128 | |
| 129 | //------------------------------------------------------------------------------ |
| 130 | vtkIdTypeArray* vtkXMLUnstructuredDataReader::ConvertToIdTypeArray(vtkDataArray* a) |
no test coverage detected