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

Method FlattenSimplex

Common/DataModel/vtkBezierInterpolation.cxx:107–127  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

105}
106
107int 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
129vtkVector3i vtkBezierInterpolation::UnFlattenSimplex(int dim, int deg, vtkIdType flat)
130{

Callers

nothing calls this directly

Calls 1

NumberOfSimplexFunctionsFunction · 0.85

Tested by

no test coverage detected