------------------------------------------------------------------------------ Description: Move iterator to next position. (loop progression). \pre not_at_end: !IsAtEnd()
| 165 | // Move iterator to next position. (loop progression). |
| 166 | // \pre not_at_end: !IsAtEnd() |
| 167 | void vtkBridgeCellIteratorOnCellBoundaries::Next() |
| 168 | { |
| 169 | assert("pre: not_off" && !IsAtEnd()); |
| 170 | |
| 171 | int atEndOfDimension = 0; |
| 172 | |
| 173 | this->Id++; // next id of the current dimension |
| 174 | |
| 175 | switch (this->Dim) |
| 176 | { |
| 177 | case 2: |
| 178 | atEndOfDimension = Id >= this->NumberOfFaces; |
| 179 | break; |
| 180 | case 1: |
| 181 | atEndOfDimension = Id >= this->NumberOfEdges; |
| 182 | break; |
| 183 | case 0: |
| 184 | atEndOfDimension = Id >= this->NumberOfVertices; |
| 185 | break; |
| 186 | default: |
| 187 | assert("check: impossible case" && 0); |
| 188 | break; |
| 189 | } |
| 190 | |
| 191 | if (atEndOfDimension) |
| 192 | { |
| 193 | this->Id = 0; // first id of the next dimension |
| 194 | this->Dim--; |
| 195 | |
| 196 | if (this->Dim == 1) |
| 197 | { |
| 198 | if (this->NumberOfEdges == 0) |
| 199 | { |
| 200 | if (this->NumberOfVertices == 0) |
| 201 | { |
| 202 | this->Dim = -1; |
| 203 | } |
| 204 | else |
| 205 | { |
| 206 | this->Dim = 0; |
| 207 | } |
| 208 | } |
| 209 | } |
| 210 | else |
| 211 | { |
| 212 | if (this->NumberOfVertices == 0) |
| 213 | { |
| 214 | this->Dim = -1; |
| 215 | } |
| 216 | } |
| 217 | } |
| 218 | } |
| 219 | |
| 220 | //------------------------------------------------------------------------------ |
| 221 | // Description: |