------------------------------------------------------------------------------
| 369 | |
| 370 | //------------------------------------------------------------------------------ |
| 371 | void vtkXMLUnstructuredDataReader::SetupOutputData() |
| 372 | { |
| 373 | this->Superclass::SetupOutputData(); |
| 374 | |
| 375 | // Create the points array. |
| 376 | vtkPoints* points = vtkPoints::New(); |
| 377 | |
| 378 | // Use the configuration of the first piece since all are the same. |
| 379 | vtkXMLDataElement* ePoints = this->PointElements[0]; |
| 380 | if (ePoints) |
| 381 | { |
| 382 | // Non-zero volume. |
| 383 | vtkAbstractArray* aa = this->CreateArray(ePoints->GetNestedElement(0)); |
| 384 | vtkDataArray* a = vtkArrayDownCast<vtkDataArray>(aa); |
| 385 | if (a) |
| 386 | { |
| 387 | // Allocate the points array. |
| 388 | a->SetNumberOfTuples(this->GetNumberOfPoints()); |
| 389 | points->SetData(a); |
| 390 | a->Delete(); |
| 391 | } |
| 392 | else |
| 393 | { |
| 394 | if (aa) |
| 395 | { |
| 396 | aa->Delete(); |
| 397 | } |
| 398 | this->DataError = 1; |
| 399 | } |
| 400 | } |
| 401 | else if (this->NumberOfPoints[0] > 0) |
| 402 | { |
| 403 | vtkWarningMacro( |
| 404 | "No Points element available in first piece found in file. Reading file may fail."); |
| 405 | } |
| 406 | |
| 407 | vtkPointSet::SafeDownCast(this->GetCurrentOutput())->SetPoints(points); |
| 408 | points->Delete(); |
| 409 | } |
| 410 | |
| 411 | //------------------------------------------------------------------------------ |
| 412 | int vtkXMLUnstructuredDataReader::ReadPiece(vtkXMLDataElement* ePiece) |
nothing calls this directly
no test coverage detected