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

Method GetOutput

Filters/Extraction/vtkExtractDataArraysOverTime.cxx:580–653  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

578
579//------------------------------------------------------------------------------
580vtkExtractDataArraysOverTime::vtkInternal::vtkValue*
581vtkExtractDataArraysOverTime::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,

Callers 15

AddTimeStepInternalMethod · 0.95
ToSelectionTypeMethod · 0.45
ExtractElementsMethod · 0.45
ExtractSelectedCellsMethod · 0.45
SummarizeMethod · 0.45
RequestDataMethod · 0.45
GetVxComponentMethod · 0.45
GetVyComponentMethod · 0.45
GetVzComponentMethod · 0.45
SetInputDataMethod · 0.45

Calls 14

fill_nFunction · 0.85
GetRowDataMethod · 0.80
GetFieldAssociationMethod · 0.80
NewFunction · 0.50
findMethod · 0.45
endMethod · 0.45
TakeReferenceMethod · 0.45
CopyAllocateMethod · 0.45
SetNumberOfTuplesMethod · 0.45
GetArrayMethod · 0.45
SetNameMethod · 0.45
SetNumberOfComponentsMethod · 0.45

Tested by 11

TestExtractionFunction · 0.36
TestExtractValuesFunction · 0.36
TestExtractRowsFunction · 0.36
TestExtractTimeStepsFunction · 0.36
TestExtractionExpressionFunction · 0.36
GetSphereFunction · 0.36