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

Method SetupOutputData

IO/XML/vtkXMLRectilinearGridReader.cxx:113–166  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

111
112//------------------------------------------------------------------------------
113void vtkXMLRectilinearGridReader::SetupOutputData()
114{
115 this->Superclass::SetupOutputData();
116
117 if (!this->CoordinateElements)
118 {
119 // Empty volume.
120 return;
121 }
122
123 // Allocate the coordinate arrays.
124 vtkRectilinearGrid* output = vtkRectilinearGrid::SafeDownCast(this->GetCurrentOutput());
125
126 vtkXMLDataElement* xc = this->CoordinateElements[0]->GetNestedElement(0);
127 vtkXMLDataElement* yc = this->CoordinateElements[0]->GetNestedElement(1);
128 vtkXMLDataElement* zc = this->CoordinateElements[0]->GetNestedElement(2);
129
130 // Create the coordinate arrays.
131 vtkAbstractArray* xa = this->CreateArray(xc);
132 vtkAbstractArray* ya = this->CreateArray(yc);
133 vtkAbstractArray* za = this->CreateArray(zc);
134
135 vtkDataArray* x = vtkArrayDownCast<vtkDataArray>(xa);
136 vtkDataArray* y = vtkArrayDownCast<vtkDataArray>(ya);
137 vtkDataArray* z = vtkArrayDownCast<vtkDataArray>(za);
138 if (x && y && z)
139 {
140 x->SetNumberOfTuples(this->PointDimensions[0]);
141 y->SetNumberOfTuples(this->PointDimensions[1]);
142 z->SetNumberOfTuples(this->PointDimensions[2]);
143 output->SetXCoordinates(x);
144 output->SetYCoordinates(y);
145 output->SetZCoordinates(z);
146 x->Delete();
147 y->Delete();
148 z->Delete();
149 }
150 else
151 {
152 if (xa)
153 {
154 xa->Delete();
155 }
156 if (ya)
157 {
158 ya->Delete();
159 }
160 if (za)
161 {
162 za->Delete();
163 }
164 this->DataError = 1;
165 }
166}
167
168//------------------------------------------------------------------------------
169int vtkXMLRectilinearGridReader::ReadPieceData()

Callers

nothing calls this directly

Calls 8

GetCurrentOutputMethod · 0.80
GetNestedElementMethod · 0.80
DeleteMethod · 0.65
CreateArrayMethod · 0.45
SetNumberOfTuplesMethod · 0.45
SetXCoordinatesMethod · 0.45
SetYCoordinatesMethod · 0.45
SetZCoordinatesMethod · 0.45

Tested by

no test coverage detected