| 29 | } |
| 30 | |
| 31 | std::string componentName(vtkAbstractArray* array, int component) |
| 32 | { |
| 33 | std::string cname; |
| 34 | bool isIndex = false; |
| 35 | switch (component) |
| 36 | { |
| 37 | case vtkArrayComponents::L1Norm: |
| 38 | cname = "L₁"; |
| 39 | break; |
| 40 | case vtkArrayComponents::L2Norm: |
| 41 | cname = "L₂"; |
| 42 | break; |
| 43 | case vtkArrayComponents::LInfNorm: |
| 44 | cname = "L∞"; |
| 45 | break; |
| 46 | default: |
| 47 | isIndex = component >= 0; |
| 48 | break; |
| 49 | } |
| 50 | |
| 51 | if (isIndex) |
| 52 | { |
| 53 | if (array->HasAComponentName()) |
| 54 | { |
| 55 | auto* compName = array->GetComponentName(component); |
| 56 | if (compName && compName[0]) |
| 57 | { |
| 58 | cname = compName; |
| 59 | } |
| 60 | } |
| 61 | |
| 62 | if (cname.empty()) |
| 63 | { |
| 64 | cname = vtk::to_string(component); |
| 65 | } |
| 66 | } |
| 67 | |
| 68 | return cname; |
| 69 | } |
| 70 | |
| 71 | #if defined(_MSC_VER) |
| 72 | #pragma warning(push) |
no test coverage detected