------------------------------------------------------------------------------
| 21 | |
| 22 | //------------------------------------------------------------------------------ |
| 23 | void vtkHyperTreeGridNonOrientedMooreSuperCursor::Initialize( |
| 24 | vtkHyperTreeGrid* grid, vtkIdType treeIndex, bool create) |
| 25 | { |
| 26 | assert("pre: Non_valid_dimension" && grid->GetDimension() >= 1 && grid->GetDimension() <= 3); |
| 27 | assert( |
| 28 | "pre: Non_valid_branchfactor" && grid->GetBranchFactor() >= 2 && grid->GetBranchFactor() <= 3); |
| 29 | |
| 30 | if (this->Grid == nullptr) |
| 31 | { |
| 32 | this->Grid = grid; |
| 33 | } |
| 34 | assert("pre: Non_same_grid" && this->Grid == grid); |
| 35 | |
| 36 | // Initialize features |
| 37 | switch (grid->GetNumberOfChildren()) |
| 38 | { |
| 39 | case 2: |
| 40 | { |
| 41 | // dimension = 1, branch factor = 2 |
| 42 | this->IndiceCentralCursor = 1; |
| 43 | this->NumberOfCursors = 3; |
| 44 | this->ChildCursorToParentCursorTable = MooreChildCursorToParentCursorTable[0][0]; |
| 45 | this->ChildCursorToChildTable = MooreChildCursorToChildTable[0][0]; |
| 46 | break; |
| 47 | } |
| 48 | case 3: |
| 49 | { |
| 50 | // dimension = 1, branch factor = 3 |
| 51 | this->IndiceCentralCursor = 1; |
| 52 | this->NumberOfCursors = 3; |
| 53 | this->ChildCursorToParentCursorTable = MooreChildCursorToParentCursorTable[0][1]; |
| 54 | this->ChildCursorToChildTable = MooreChildCursorToChildTable[0][1]; |
| 55 | break; |
| 56 | } |
| 57 | case 4: |
| 58 | { |
| 59 | // dimension = 2, branch factor = 2 |
| 60 | this->IndiceCentralCursor = 4; |
| 61 | this->NumberOfCursors = 9; |
| 62 | this->ChildCursorToParentCursorTable = MooreChildCursorToParentCursorTable[1][0]; |
| 63 | this->ChildCursorToChildTable = MooreChildCursorToChildTable[1][0]; |
| 64 | break; |
| 65 | } |
| 66 | case 9: |
| 67 | { |
| 68 | // dimension = 2, branch factor = 3 |
| 69 | this->IndiceCentralCursor = 4; |
| 70 | this->NumberOfCursors = 9; |
| 71 | this->ChildCursorToParentCursorTable = MooreChildCursorToParentCursorTable[1][1]; |
| 72 | this->ChildCursorToChildTable = MooreChildCursorToChildTable[1][1]; |
| 73 | break; |
| 74 | } |
| 75 | case 8: |
| 76 | { |
| 77 | // dimension = 3, branch factor = 2 |
| 78 | this->IndiceCentralCursor = 13; |
| 79 | this->NumberOfCursors = 27; |
| 80 | this->ChildCursorToParentCursorTable = MooreChildCursorToParentCursorTable[2][0]; |
nothing calls this directly
no test coverage detected