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

Method TraverseDualRecursively

Filters/HyperTree/vtkHyperTreeGridToDualGrid.cxx:219–256  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

217
218//------------------------------------------------------------------------------
219void vtkHyperTreeGridToDualGrid::TraverseDualRecursively(
220 vtkHyperTreeGridNonOrientedMooreSuperCursor* cursor, vtkHyperTreeGrid* input)
221{
222 // TODO - code duplication is evil, fold this with other TraverseDual
223 // Create cell corner if cursor is at leaf
224 if (cursor->IsLeaf())
225 {
226 // Center is a leaf, create dual items depending on dimension
227 switch (input->GetDimension())
228 {
229 case 1:
230 this->GenerateDualCornerFromLeaf1D(cursor, input);
231 break;
232 case 2:
233 this->GenerateDualCornerFromLeaf2D(cursor, input);
234 break;
235 case 3:
236 this->GenerateDualCornerFromLeaf3D(cursor, input);
237 break;
238 } // switch ( this->Dimension )
239 } // if ( cursor->IsLeaf() )
240 else
241 {
242 // Cursor is not at leaf, recurse to all children
243 int numChildren = input->GetNumberOfChildren();
244 for (int child = 0; child < numChildren; ++child)
245 {
246 if (this->CheckAbort())
247 {
248 break;
249 }
250 cursor->ToChild(child);
251 // Recurse
252 this->TraverseDualRecursively(cursor, input);
253 cursor->ToParent();
254 } // child
255 } // else
256}
257
258//------------------------------------------------------------------------------
259void vtkHyperTreeGridToDualGrid::GenerateDualCornerFromLeaf1D(

Callers 1

ProcessTreesMethod · 0.95

Calls 13

CheckAbortMethod · 0.80
IsLeafMethod · 0.45
GetDimensionMethod · 0.45
GetNumberOfChildrenMethod · 0.45
ToChildMethod · 0.45
ToParentMethod · 0.45
GetGlobalNodeIndexMethod · 0.45

Tested by

no test coverage detected