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

Method Next

Testing/GenericBridge/vtkBridgeCellIteratorOnCellBoundaries.cxx:167–218  ·  view source on GitHub ↗

------------------------------------------------------------------------------ Description: Move iterator to next position. (loop progression). \pre not_at_end: !IsAtEnd()

Source from the content-addressed store, hash-verified

165// Move iterator to next position. (loop progression).
166// \pre not_at_end: !IsAtEnd()
167void 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:

Callers

nothing calls this directly

Calls 2

assertFunction · 0.50
IsAtEndFunction · 0.50

Tested by

no test coverage detected