| 105 | } |
| 106 | |
| 107 | int vtkBezierInterpolation::FlattenSimplex(int dim, int deg, vtkVector3i coord) |
| 108 | { |
| 109 | switch (dim) |
| 110 | { |
| 111 | case 2: |
| 112 | { |
| 113 | return ((deg + 1) * (deg + 2) - (deg + 1 - coord[1]) * (deg + 2 - coord[1])) / 2 + coord[0]; |
| 114 | } |
| 115 | case 3: |
| 116 | { |
| 117 | int num_before_level = 0; |
| 118 | for (int i = 0; i < coord[2]; ++i) |
| 119 | { |
| 120 | num_before_level += NumberOfSimplexFunctions(2, deg - i); |
| 121 | } |
| 122 | return num_before_level + FlattenSimplex(2, deg - coord[2], coord); |
| 123 | } |
| 124 | default: |
| 125 | throw "flattenSimplex unsupported dim"; |
| 126 | } |
| 127 | } |
| 128 | |
| 129 | vtkVector3i vtkBezierInterpolation::UnFlattenSimplex(int dim, int deg, vtkIdType flat) |
| 130 | { |
nothing calls this directly
no test coverage detected