| 101 | } |
| 102 | |
| 103 | std::vector<vtkCellGridSidesQuery::SideSetArray> vtkCellGridSidesQuery::GetSideSetArrays( |
| 104 | vtkStringToken cellType) |
| 105 | { |
| 106 | std::vector<SideSetArray> result; |
| 107 | auto cellTypeIt = this->Sides.find(cellType); |
| 108 | if (cellTypeIt == this->Sides.end()) |
| 109 | { |
| 110 | return result; |
| 111 | } |
| 112 | |
| 113 | for (const auto& sideShapeEntry : cellTypeIt->second) |
| 114 | { |
| 115 | vtkIdType sideCount = 0; |
| 116 | for (const auto& entry : sideShapeEntry.second) |
| 117 | { |
| 118 | sideCount += entry.second.size(); |
| 119 | } |
| 120 | auto sideArray = vtkSmartPointer<vtkIdTypeArray>::New(); |
| 121 | sideArray->SetName("conn"); |
| 122 | sideArray->SetNumberOfComponents(2); // tuples are (cell ID, side ID) |
| 123 | sideArray->SetNumberOfTuples(sideCount); |
| 124 | vtkIdType sideId = 0; |
| 125 | std::array<vtkIdType, 2> sideTuple; |
| 126 | for (const auto& entry : sideShapeEntry.second) |
| 127 | { |
| 128 | sideTuple[0] = entry.first; |
| 129 | for (const auto& ss : entry.second) |
| 130 | { |
| 131 | sideTuple[1] = ss; |
| 132 | sideArray->SetTypedTuple(sideId, sideTuple.data()); |
| 133 | ++sideId; |
| 134 | } |
| 135 | } |
| 136 | result.push_back({ cellTypeIt->first, sideShapeEntry.first, sideArray }); |
| 137 | } |
| 138 | |
| 139 | return result; |
| 140 | } |
| 141 | |
| 142 | vtkStringToken vtkCellGridSidesQuery::SelectionModeToLabel(SelectionMode mode) |
| 143 | { |
no test coverage detected