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

Method SetupOutputData

IO/XML/vtkXMLStructuredGridReader.cxx:113–146  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

111
112//------------------------------------------------------------------------------
113void vtkXMLStructuredGridReader::SetupOutputData()
114{
115 this->Superclass::SetupOutputData();
116
117 // Create the points array.
118 vtkPoints* points = vtkPoints::New();
119
120 // Use the configuration of the first piece since all are the same.
121 vtkXMLDataElement* ePoints = this->PointElements[0];
122 if (ePoints)
123 {
124 // Non-zero volume.
125 vtkAbstractArray* aa = this->CreateArray(ePoints->GetNestedElement(0));
126 vtkDataArray* a = vtkArrayDownCast<vtkDataArray>(aa);
127 if (a)
128 {
129 // Allocate the points array.
130 a->SetNumberOfTuples(this->GetNumberOfPoints());
131 points->SetData(a);
132 a->Delete();
133 }
134 else
135 {
136 if (aa)
137 {
138 aa->Delete();
139 }
140 this->DataError = 1;
141 }
142 }
143
144 vtkStructuredGrid::SafeDownCast(this->GetCurrentOutput())->SetPoints(points);
145 points->Delete();
146}
147
148//------------------------------------------------------------------------------
149int vtkXMLStructuredGridReader::ReadPieceData()

Callers

nothing calls this directly

Calls 9

GetNestedElementMethod · 0.80
GetCurrentOutputMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
CreateArrayMethod · 0.45
SetNumberOfTuplesMethod · 0.45
GetNumberOfPointsMethod · 0.45
SetDataMethod · 0.45
SetPointsMethod · 0.45

Tested by

no test coverage detected