------------------------------------------------------------------------------
| 578 | |
| 579 | //------------------------------------------------------------------------------ |
| 580 | vtkExtractDataArraysOverTime::vtkInternal::vtkValue* |
| 581 | vtkExtractDataArraysOverTime::vtkInternal::GetOutput( |
| 582 | const vtkKey& key, vtkDataSetAttributes* inDSA, bool using_gid) |
| 583 | { |
| 584 | MapType::iterator iter = this->OutputGrids.find(key); |
| 585 | if (iter == this->OutputGrids.end()) |
| 586 | { |
| 587 | vtkValue value; |
| 588 | vtkTable* output = vtkTable::New(); |
| 589 | value.Output.TakeReference(output); |
| 590 | |
| 591 | vtkDataSetAttributes* rowData = output->GetRowData(); |
| 592 | rowData->CopyAllocate(inDSA, this->NumberOfTimeSteps); |
| 593 | // since CopyAllocate only allocates memory, but doesn't change the number |
| 594 | // of tuples in each of the arrays, we need to do this explicitly. |
| 595 | // see (paraview/paraview#18090). |
| 596 | rowData->SetNumberOfTuples(this->NumberOfTimeSteps); |
| 597 | |
| 598 | // Add an array to hold the time at each step |
| 599 | vtkDoubleArray* timeArray = this->TimeArray; |
| 600 | if (inDSA && inDSA->GetArray("Time")) |
| 601 | { |
| 602 | timeArray->SetName("TimeData"); |
| 603 | } |
| 604 | else |
| 605 | { |
| 606 | timeArray->SetName("Time"); |
| 607 | } |
| 608 | |
| 609 | if (this->Self->GetFieldAssociation() == vtkDataObject::POINT && |
| 610 | !this->Self->GetReportStatisticsOnly()) |
| 611 | { |
| 612 | // These are the point coordinates of the original data |
| 613 | vtkDoubleArray* coordsArray = vtkDoubleArray::New(); |
| 614 | coordsArray->SetNumberOfComponents(3); |
| 615 | coordsArray->SetNumberOfTuples(this->NumberOfTimeSteps); |
| 616 | if (inDSA && inDSA->GetArray("Point Coordinates")) |
| 617 | { |
| 618 | coordsArray->SetName("Points"); |
| 619 | } |
| 620 | else |
| 621 | { |
| 622 | coordsArray->SetName("Point Coordinates"); |
| 623 | } |
| 624 | std::fill_n(coordsArray->WritePointer(0, 3 * this->NumberOfTimeSteps), |
| 625 | 3 * this->NumberOfTimeSteps, 0.0); |
| 626 | value.PointCoordinatesArray.TakeReference(coordsArray); |
| 627 | } |
| 628 | |
| 629 | // This array is used to make particular samples as invalid. |
| 630 | // This happens when we are looking at a location which is not contained |
| 631 | // by a cell or at a cell or point id that is destroyed. |
| 632 | // It is used in the parallel subclass as well. |
| 633 | vtkCharArray* validPts = vtkCharArray::New(); |
| 634 | validPts->SetName("vtkValidPointMask"); |
| 635 | validPts->SetNumberOfComponents(1); |
| 636 | validPts->SetNumberOfTuples(this->NumberOfTimeSteps); |
| 637 | std::fill_n(validPts->WritePointer(0, this->NumberOfTimeSteps), this->NumberOfTimeSteps, |