------------------------------------------------------------------------------
| 2412 | |
| 2413 | //------------------------------------------------------------------------------ |
| 2414 | int 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 | { |
no test coverage detected