------------------------------------------------------------------------------
| 2485 | |
| 2486 | //------------------------------------------------------------------------------ |
| 2487 | void EnSightDataSet::PassThroughUnstructuredGrid(const GridOptions& vtkNotUsed(opts), int partId) |
| 2488 | { |
| 2489 | auto it = this->PartInfoMap.find(partId); |
| 2490 | if (it == this->PartInfoMap.end()) |
| 2491 | { |
| 2492 | // shouldn't happen but just in case |
| 2493 | vtkGenericWarningMacro("Part Id " << partId << " could not be found in PartInfoMap"); |
| 2494 | return; |
| 2495 | } |
| 2496 | auto& numPts = it->second.NumNodes; |
| 2497 | auto& numCellsPerType = it->second.NumElementsPerType; |
| 2498 | this->GeometryFile.ReadNumber(&numPts); |
| 2499 | |
| 2500 | if (this->NodeIdsListed) |
| 2501 | { |
| 2502 | this->GeometryFile.SkipNNumbers<int>(numPts); |
| 2503 | } |
| 2504 | |
| 2505 | // because of the way fortran binary files are, we have |
| 2506 | // call SkipNNumbers for each set of coordinates |
| 2507 | this->GeometryFile.SkipNNumbers<float>(numPts); |
| 2508 | this->GeometryFile.SkipNNumbers<float>(numPts); |
| 2509 | this->GeometryFile.SkipNNumbers<float>(numPts); |
| 2510 | |
| 2511 | // skip cell info |
| 2512 | auto result = this->GeometryFile.ReadNextLine(); |
| 2513 | if (result.second.find("part") != std::string::npos) |
| 2514 | { |
| 2515 | // reset this so part reading is correct when we leave this method |
| 2516 | this->GeometryFile.GoBackOneLine(); |
| 2517 | return; |
| 2518 | } |
| 2519 | auto elementType = getElementTypeFromString(result.second); |
| 2520 | while (result.first && elementType != ElementType::Unknown) |
| 2521 | { |
| 2522 | if (elementType == ElementType::NSided) |
| 2523 | { |
| 2524 | this->SkipNSidedSection(numCellsPerType[static_cast<int>(elementType)]); |
| 2525 | } |
| 2526 | else if (elementType == ElementType::NFaced) |
| 2527 | { |
| 2528 | this->SkipNFacedSection(numCellsPerType[static_cast<int>(elementType)]); |
| 2529 | } |
| 2530 | else |
| 2531 | { |
| 2532 | this->GeometryFile.ReadNumber(&numCellsPerType[static_cast<int>(elementType)]); |
| 2533 | |
| 2534 | if (this->ElementIdsListed) |
| 2535 | { |
| 2536 | this->GeometryFile.SkipNNumbers<int>(numCellsPerType[static_cast<int>(elementType)]); |
| 2537 | } |
| 2538 | auto cellInfo = getVTKCellType(elementType); |
| 2539 | if (this->GeometryFile.Format == FileType::ASCII) |
| 2540 | { |
| 2541 | this->GeometryFile.SkipNNumbers<float>( |
| 2542 | numCellsPerType[static_cast<int>(elementType)], cellInfo.second); |
| 2543 | } |
| 2544 | else |
no test coverage detected