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

Method ReadMeasuredGeometryFile

IO/EnSight/vtkEnSight6BinaryReader.cxx:696–850  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

694
695//------------------------------------------------------------------------------
696int vtkEnSight6BinaryReader::ReadMeasuredGeometryFile(
697 const char* fileName, int timeStep, vtkMultiBlockDataSet* output)
698{
699 char line[81];
700 vtkIdType i;
701 int* pointIds;
702 float* coords;
703 vtkPoints* points = vtkPoints::New();
704 vtkPolyData* pd = vtkPolyData::New();
705
706 this->NumberOfNewOutputs++;
707
708 // Initialize
709 //
710 if (!fileName)
711 {
712 vtkErrorMacro("A MeasuredFileName must be specified in the case file.");
713 points->Delete();
714 pd->Delete();
715 return 0;
716 }
717 std::string sfilename;
718 if (this->FilePath)
719 {
720 sfilename = this->FilePath;
721 if (sfilename.at(sfilename.length() - 1) != '/')
722 {
723 sfilename += "/";
724 }
725 sfilename += fileName;
726 vtkDebugMacro("full path to measured geometry file: " << sfilename);
727 }
728 else
729 {
730 sfilename = fileName;
731 }
732
733 if (this->OpenFile(sfilename.c_str()) == 0)
734 {
735 vtkErrorMacro("Unable to open file: " << sfilename);
736 points->Delete();
737 pd->Delete();
738 return 0;
739 }
740
741 this->ReadLine(line);
742 auto resultSubLine =
743 vtk::scan<std::string_view, std::string_view>(std::string_view(line), "{:s} {:s}");
744 auto subLine = std::get<1>(resultSubLine->values());
745 if (subLine != "Binary")
746 {
747 vtkErrorMacro("This is not a binary data set. Try "
748 << "vtkEnSightGoldReader.");
749 points->Delete();
750 pd->Delete();
751 return 0;
752 }
753

Callers

nothing calls this directly

Calls 15

OpenFileMethod · 0.95
ReadLineMethod · 0.95
ReadIntNumberMethod · 0.95
ReadIntArrayMethod · 0.95
ReadFloatArrayMethod · 0.95
AllocateEstimateMethod · 0.80
AddToBlockMethod · 0.80
DeleteMethod · 0.65
NewFunction · 0.50
atMethod · 0.45
lengthMethod · 0.45
c_strMethod · 0.45

Tested by

no test coverage detected