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

Method ReadOutputType

IO/Legacy/vtkDataSetReader.cxx:297–364  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

295}
296
297int vtkDataSetReader::ReadOutputType()
298{
299 char line[256];
300
301 vtkDebugMacro(<< "Reading vtk dataset...");
302
303 if (!this->OpenVTKFile() || !this->ReadHeader())
304 {
305 return -1;
306 }
307
308 // Determine dataset type
309 //
310 if (!this->ReadString(line))
311 {
312 vtkDebugMacro(<< "Premature EOF reading dataset keyword");
313 return -1;
314 }
315
316 if (!strncmp(this->LowerCase(line), "dataset", 7))
317 {
318 // See if type is recognized.
319 //
320 if (!this->ReadString(line))
321 {
322 vtkDebugMacro(<< "Premature EOF reading type");
323 this->CloseVTKFile();
324 return -1;
325 }
326
327 this->CloseVTKFile();
328 if (!strncmp(this->LowerCase(line), "polydata", 8))
329 {
330 return VTK_POLY_DATA;
331 }
332 else if (!strncmp(line, "structured_points", 17))
333 {
334 return VTK_STRUCTURED_POINTS;
335 }
336 else if (!strncmp(line, "structured_grid", 15))
337 {
338 return VTK_STRUCTURED_GRID;
339 }
340 else if (!strncmp(line, "rectilinear_grid", 16))
341 {
342 return VTK_RECTILINEAR_GRID;
343 }
344 else if (!strncmp(line, "unstructured_grid", 17))
345 {
346 return VTK_UNSTRUCTURED_GRID;
347 }
348 else
349 {
350 vtkDebugMacro(<< "Cannot read dataset type: " << line);
351 return -1;
352 }
353 }
354 else if (!strncmp(this->LowerCase(line), "field", (unsigned long)5))

Callers 4

CreateOutputMethod · 0.95
ReadMetaDataSimpleMethod · 0.95
ReadMeshSimpleMethod · 0.95
CanReadFileMethod · 0.45

Calls 5

ReadStringMethod · 0.80
OpenVTKFileMethod · 0.45
ReadHeaderMethod · 0.45
LowerCaseMethod · 0.45
CloseVTKFileMethod · 0.45

Tested by

no test coverage detected