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

Method CheckForBeginTimeStepLine

IO/EnSight/core/EnSightFile.cxx:321–348  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

319
320//------------------------------------------------------------------------------
321void EnSightFile::CheckForBeginTimeStepLine()
322{
323 // When file sets are used, multiple time steps are in a single file.
324 // each time step is between lines saying BEGIN TIME STEP and END TIME STEP
325 if (this->FileSet == -1)
326 {
327 return;
328 }
329
330 auto result = this->ReadNextLine();
331 if (result.second.find("BEGIN TIME STEP") == std::string::npos)
332 {
333 // This isn't an error situation. We track positions of time steps starting just
334 // after BEGIN TIME STEP. So if the line doesn't end up containing that, reset back
335 // to the previous line so we don't mess up processing.
336 this->GoBackOneLine();
337 return;
338 }
339
340 // Adding positions to TimeStepBeginPositions should always happen in SetTimeStepToRead,
341 // but just in case it doesn't, we can add it here.
342 auto& beginPositions = this->TimeStepBeginPositions[this->CurrentFileIndex];
343 if (std::find(beginPositions.begin(), beginPositions.end(), this->GetCurrentPosition()) ==
344 beginPositions.end())
345 {
346 beginPositions.push_back(this->GetCurrentPosition());
347 }
348}
349
350//------------------------------------------------------------------------------
351bool EnSightFile::CheckForEndTimeStepLine()

Callers 6

ReadGeometryMethod · 0.80
ReadMeasuredGeometryMethod · 0.80
GetPartInfoMethod · 0.80
ReadVariableNodesMethod · 0.80
ReadVariableElementsMethod · 0.80

Calls 8

ReadNextLineMethod · 0.95
GoBackOneLineMethod · 0.95
GetCurrentPositionMethod · 0.95
findFunction · 0.50
findMethod · 0.45
beginMethod · 0.45
endMethod · 0.45
push_backMethod · 0.45

Tested by

no test coverage detected