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

Method ParseGeometrySection

IO/EnSight/core/EnSightDataSet.cxx:632–733  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

630
631//------------------------------------------------------------------------------
632void EnSightDataSet::ParseGeometrySection()
633{
634 auto result = this->CaseFile.ReadNextLine(MAX_CASE_LINE_LENGTH);
635 while (result.first)
636 {
637 std::string line = result.second;
638 if (this->IsSectionHeader(line))
639 {
640 this->CaseFile.GoBackOneLine();
641 break;
642 }
643
644 // break the line into its parts
645 // e.g. model ts fs filename
646 std::string lineType, option, fileName;
647 int timeSet = -1, fileSet = -1;
648
649 if (!extractLinePart(GetLineTypeRegEx(), line, lineType))
650 {
651 vtkGenericWarningMacro("could not extract the line type from " << result.second);
652 }
653 extractLinePart(GetIntRegEx(), line, timeSet);
654
655 extractLinePart(GetIntRegEx(), line, fileSet);
656 if (!extractFileName(line, fileName))
657 {
658 vtkGenericWarningMacro("could not extract file name from " << result.second);
659 }
660
661 if (lineType == "model:")
662 {
663 this->GeometryFileName = this->GetFullPath(fileName);
664 this->GeometryFile.SetFileNamePattern(this->GeometryFileName);
665 extractLinePart(GetFileNameRegEx(), line, option);
666
667 // option can be empty, 'change_coords_only', 'change_coords_only cstep', or
668 // 'changing_geometry_per_part'. changing_geometry_per_part signals that part lines will have
669 // a mandatory additional option in the part lines of the geometry file
670 this->GeometryChangeCoordsOnly = option == "change_coords_only";
671 if (this->GeometryChangeCoordsOnly)
672 {
673 // change_coords_only indicates that only coords change in geometry, otherwise connectivity
674 // changes too. cstep means the zero-based time step that contains the connectivity
675 extractLinePart(GetIntRegEx(), line, this->GeometryCStep);
676 }
677
678 // check to see if we do indeed have a static geometry
679 if (timeSet == -1 && this->GeometryFile.CheckForMultipleTimeSteps())
680 {
681 // old reader seems to just automatically have a time set id 1 even if it's not specified
682 // I have run into some customer data that used wildcards in filenames, but did not
683 // specify the time set
684 timeSet = 1;
685 }
686 this->GeometryFile.SetTimeAndFileSetInfo(timeSet, fileSet);
687
688 if (this->GeometryFile.TimeSet == -1)
689 {

Callers 1

ParseCaseFileMethod · 0.95

Calls 10

IsSectionHeaderMethod · 0.95
GetFullPathMethod · 0.95
extractLinePartFunction · 0.85
extractFileNameFunction · 0.85
ReadNextLineMethod · 0.80
GoBackOneLineMethod · 0.80
SetFileNamePatternMethod · 0.80
SetTimeAndFileSetInfoMethod · 0.80
NewFunction · 0.50

Tested by

no test coverage detected