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

Method SetupCompressor

IO/XML/vtkXMLReader.cxx:494–532  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

492
493//------------------------------------------------------------------------------
494void vtkXMLReader::SetupCompressor(const char* type)
495{
496 // Instantiate a compressor of the given type.
497 if (!type)
498 {
499 vtkErrorMacro("Compressor has no type.");
500 return;
501 }
502 vtkObject* object = nullptr;
503 vtkDataCompressor* compressor = vtkDataCompressor::SafeDownCast(object);
504
505 if (!compressor)
506 {
507 if (strcmp(type, "vtkZLibDataCompressor") == 0)
508 {
509 compressor = vtkZLibDataCompressor::New();
510 }
511 else if (strcmp(type, "vtkLZ4DataCompressor") == 0)
512 {
513 compressor = vtkLZ4DataCompressor::New();
514 }
515 else if (strcmp(type, "vtkLZMADataCompressor") == 0)
516 {
517 compressor = vtkLZMADataCompressor::New();
518 }
519 }
520
521 if (!compressor)
522 {
523 vtkErrorMacro("Error creating " << type);
524 if (object)
525 {
526 object->Delete();
527 }
528 return;
529 }
530 this->XMLParser->SetCompressor(compressor);
531 compressor->Delete();
532}
533
534//------------------------------------------------------------------------------
535int vtkXMLReader::ReadXMLInformation()

Callers 1

ReadVTKFileMethod · 0.95

Calls 2

DeleteMethod · 0.65
NewFunction · 0.50

Tested by

no test coverage detected