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

Method ParseTimeSection

IO/EnSight/core/EnSightDataSet.cxx:816–913  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

814
815//------------------------------------------------------------------------------
816void EnSightDataSet::ParseTimeSection()
817{
818 bool moreTimeSets = true;
819 auto result = this->CaseFile.ReadNextLine(MAX_CASE_LINE_LENGTH);
820 while (moreTimeSets && result.first)
821 {
822 std::shared_ptr<TimeSetInfo> tsInfo(new TimeSetInfo);
823 int timeSet, startNum = -1, increment = -1;
824
825 while (result.first)
826 {
827 std::string& line = result.second;
828 if (this->IsSectionHeader(line))
829 {
830 this->CaseFile.GoBackOneLine();
831 break;
832 }
833
834 std::string lineType;
835 extractLinePart(GetLineTypeRegEx(), line, lineType);
836 if (lineType == "time set:")
837 {
838 moreTimeSets = false;
839 extractLinePart(GetIntRegEx(), line, timeSet);
840 }
841 else if (lineType == "number of steps:")
842 {
843 extractLinePart(GetIntRegEx(), line, tsInfo->NumberOfSteps);
844 }
845 else if (lineType == "filename start number:")
846 {
847 extractLinePart(GetIntRegEx(), line, startNum);
848 }
849 else if (lineType == "filename increment:")
850 {
851 extractLinePart(GetIntRegEx(), line, increment);
852 }
853 else if (lineType == "time values:")
854 {
855 readCaseFileValues(this->CaseFile, line, tsInfo->TimeValues);
856 this->AllTimeSteps.insert(
857 this->AllTimeSteps.end(), tsInfo->TimeValues.begin(), tsInfo->TimeValues.end());
858 }
859 else if (lineType == "filename numbers:")
860 {
861 readCaseFileValues(this->CaseFile, line, tsInfo->FileNameNumbers);
862 }
863 else if (lineType == "filename numbers file:")
864 {
865 std::string filename;
866 extractFileName(line, filename);
867 readFileValues(this->GetFullPath(filename), tsInfo->FileNameNumbers);
868 }
869 else if (lineType == "time values file:")
870 {
871 std::string filename;
872 extractFileName(line, filename);
873 readFileValues(this->GetFullPath(filename), tsInfo->TimeValues);

Callers 1

ParseCaseFileMethod · 0.95

Calls 15

IsSectionHeaderMethod · 0.95
GetFullPathMethod · 0.95
extractLinePartFunction · 0.85
readCaseFileValuesFunction · 0.85
extractFileNameFunction · 0.85
readFileValuesFunction · 0.85
ReadNextLineMethod · 0.80
GoBackOneLineMethod · 0.80
sortFunction · 0.50
uniqueFunction · 0.50
insertMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected