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

Method ReadVariableFiles

IO/EnSight/vtkEnSightReader.cxx:2414–2720  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

2412
2413//------------------------------------------------------------------------------
2414int vtkEnSightReader::ReadVariableFiles(vtkMultiBlockDataSet* output)
2415{
2416 int i, j;
2417 char description[256];
2418 int timeSet, fileSet, timeStep, timeStepInFile, numSteps;
2419 vtkDataArray* times;
2420 double newTime;
2421 vtkIdList *numStepsList, *filenameNumbers;
2422 int fileNum;
2423 int validTime, filenameNum;
2424 char *fileName, *fileName2;
2425
2426 for (i = 0; i < this->NumberOfVariables; i++)
2427 {
2428 switch (this->VariableTypes[i])
2429 {
2430 case SCALAR_PER_NODE:
2431 case VECTOR_PER_NODE:
2432 case TENSOR_ASYM_PER_NODE:
2433 case TENSOR_SYMM_PER_NODE:
2434 case SCALAR_PER_MEASURED_NODE:
2435 case VECTOR_PER_MEASURED_NODE:
2436 if (!this->GetPointArrayStatus(this->VariableDescriptions[i]))
2437 {
2438 continue;
2439 }
2440 break;
2441 case SCALAR_PER_ELEMENT:
2442 case VECTOR_PER_ELEMENT:
2443 case TENSOR_ASYM_PER_ELEMENT:
2444 case TENSOR_SYMM_PER_ELEMENT:
2445 if (!this->GetCellArrayStatus(this->VariableDescriptions[i]))
2446 {
2447 continue;
2448 }
2449 break;
2450 }
2451
2452 timeStep = 0;
2453 timeStepInFile = 1;
2454 fileNum = 0;
2455 validTime = 1;
2456 fileName = new char[strlen(this->VariableFileNames[i]) + 10];
2457 strcpy(fileName, this->VariableFileNames[i]);
2458 if (this->UseTimeSets)
2459 {
2460 validTime = 0;
2461 timeSet = this->VariableTimeSetIds->GetId(i);
2462 times = this->TimeSets->GetItem(this->TimeSetIds->IsId(timeSet));
2463 for (j = 0; j < times->GetNumberOfTuples(); j++)
2464 {
2465 newTime = times->GetComponent(j, 0);
2466 if (newTime <= this->ActualTimeValue)
2467 {
2468 timeStep++;
2469 if (this->VariableTypes[i] == SCALAR_PER_MEASURED_NODE ||
2470 this->VariableTypes[i] == VECTOR_PER_MEASURED_NODE)
2471 {

Callers 1

RequestDataMethod · 0.95

Calls 15

IsIdMethod · 0.80
GetItemAsObjectMethod · 0.80
GetPointArrayStatusMethod · 0.45
GetCellArrayStatusMethod · 0.45
GetIdMethod · 0.45
GetItemMethod · 0.45
GetNumberOfTuplesMethod · 0.45
GetComponentMethod · 0.45
GetNumberOfItemsMethod · 0.45
GetNumberOfIdsMethod · 0.45
ReadScalarsPerNodeMethod · 0.45
ReadVectorsPerNodeMethod · 0.45

Tested by

no test coverage detected