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

Method SetUpEmptyGrid

IO/Parallel/vtkPChacoReader.cxx:242–298  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

240}
241//------------------------------------------------------------------------------
242void vtkPChacoReader::SetUpEmptyGrid(vtkUnstructuredGrid* output)
243{
244 int i;
245 // Note: The cell and point arrays should be added in the same order in
246 // which they are added in vtkChacoReader::BuildOutputGrid. See "Note" in
247 // vtkChacoReader.cxx.
248
249 output->Initialize();
250
251 if (this->GetGenerateVertexWeightArrays())
252 {
253 for (i = 0; i < this->NumberOfVertexWeights; i++)
254 {
255 vtkDoubleArray* da = vtkDoubleArray::New();
256 da->SetNumberOfTuples(0);
257 da->SetNumberOfComponents(1);
258 da->SetName(this->GetVertexWeightArrayName(i + 1));
259 output->GetPointData()->AddArray(da);
260 da->Delete();
261 }
262
263 this->NumberOfPointWeightArrays = this->NumberOfVertexWeights;
264 }
265
266 if (this->GetGenerateEdgeWeightArrays())
267 {
268 for (i = 0; i < this->NumberOfEdgeWeights; i++)
269 {
270 vtkDoubleArray* da = vtkDoubleArray::New();
271 da->SetNumberOfTuples(0);
272 da->SetNumberOfComponents(1);
273 da->SetName(this->GetEdgeWeightArrayName(i + 1));
274 output->GetCellData()->AddArray(da);
275 da->Delete();
276 }
277
278 this->NumberOfCellWeightArrays = this->NumberOfEdgeWeights;
279 }
280
281 if (this->GetGenerateGlobalElementIdArray())
282 {
283 vtkIntArray* ia = vtkIntArray::New();
284 ia->SetNumberOfTuples(0);
285 ia->SetNumberOfComponents(1);
286 ia->SetName(vtkPChacoReader::GetGlobalElementIdArrayName());
287 output->GetCellData()->AddArray(ia);
288 }
289
290 if (this->GetGenerateGlobalNodeIdArray())
291 {
292 vtkIntArray* ia = vtkIntArray::New();
293 ia->SetNumberOfTuples(0);
294 ia->SetNumberOfComponents(1);
295 ia->SetName(vtkPChacoReader::GetGlobalNodeIdArrayName());
296 output->GetPointData()->AddArray(ia);
297 }
298}
299//------------------------------------------------------------------------------

Callers 3

RequestDataMethod · 0.95
SubGridMethod · 0.95
RequestDataMethod · 0.45

Calls 15

DeleteMethod · 0.65
NewFunction · 0.50
GetGlobalNodeIdArrayNameFunction · 0.50
InitializeMethod · 0.45
SetNumberOfTuplesMethod · 0.45
SetNumberOfComponentsMethod · 0.45
SetNameMethod · 0.45

Tested by

no test coverage detected