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

Method ReadCellConnectivity

IO/Geometry/vtkGAMBITReader.cxx:346–450  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

344
345//------------------------------------------------------------------------------
346void vtkGAMBITReader::ReadCellConnectivity(vtkUnstructuredGrid* output)
347{
348 int i, k;
349 vtkIdType list[27];
350 char c, buf[128];
351
352 output->Allocate();
353
354 this->FileStream->get(buf, 128, '\n');
355 this->FileStream->get(c);
356
357 for (i = 1; i <= this->NumberOfCells; i++)
358 {
359 int id; // no check is done to see that they are monotonously increasing
360 int ntype, ndp;
361 *(this->FileStream) >> id >> ntype >> ndp;
362
363 switch (ntype)
364 {
365 case EDGE:
366 {
367 for (k = 0; k < 2; k++)
368 {
369 *(this->FileStream) >> list[k];
370 list[k]--;
371 }
372 output->InsertNextCell(VTK_LINE, 2, list);
373 }
374 break;
375 case TRI:
376 {
377 for (k = 0; k < 3; k++)
378 {
379 *(this->FileStream) >> list[k];
380 list[k]--;
381 }
382 output->InsertNextCell(VTK_TRIANGLE, 3, list);
383 }
384 break;
385 case QUAD:
386 {
387 for (k = 0; k < 4; k++)
388 {
389 *(this->FileStream) >> list[k];
390 list[k]--;
391 }
392 output->InsertNextCell(VTK_QUAD, 4, list);
393 }
394 break;
395 case TETRA:
396 {
397 for (k = 0; k < 4; k++)
398 {
399 *(this->FileStream) >> list[k];
400 list[k]--;
401 }
402 output->InsertNextCell(VTK_TETRA, 4, list);
403 }

Callers 1

ReadGeometryMethod · 0.95

Calls 3

AllocateMethod · 0.45
getMethod · 0.45
InsertNextCellMethod · 0.45

Tested by

no test coverage detected