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

Function ArrayComponents

Common/Core/vtkArrayComponents.cxx:199–230  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

197{
198
199VTK_ABI_NAMESPACE_BEGIN
200
201int ArrayComponents(const std::string& enumerantStr)
202{
203 if (enumerantStr == "vtkArrayComponents::L1Norm" || enumerantStr == "L1Norm" ||
204 enumerantStr == "L₁norm" || enumerantStr == "L₁ norm" || enumerantStr == "||·||₁")
205 {
206 return static_cast<int>(vtkArrayComponents::L1Norm);
207 }
208 else if (enumerantStr == "vtkArrayComponents::L2Norm" || enumerantStr == "L2Norm" ||
209 enumerantStr == "L₂norm" || enumerantStr == "L₂ norm" || enumerantStr == "||·||₂")
210 {
211 return static_cast<int>(vtkArrayComponents::L2Norm);
212 }
213 else if (enumerantStr == "vtkArrayComponents::LInfNorm" || enumerantStr == "LInfNorm" ||
214 enumerantStr == "L∞norm" || enumerantStr == "L∞ norm" || enumerantStr == "||·||∞")
215 {
216 return static_cast<int>(vtkArrayComponents::LInfNorm);
217 }
218 else if (enumerantStr == "vtkArrayComponents::AllComponents" || enumerantStr == "AllComponents" ||
219 enumerantStr == "all components")
220 {
221 return static_cast<int>(vtkArrayComponents::AllComponents);
222 }
223 else if (enumerantStr == "vtkArrayComponents::Requested" || enumerantStr == "Requested" ||
224 enumerantStr == "requested" || enumerantStr == "requested components")
225 {
226 return static_cast<int>(vtkArrayComponents::Requested);
227 }
228 // No enumerants match; assume it is an integer.
229 return vtk::scan_int<int>(enumerantStr)->value();
230}
231
232std::string to_string(vtkArrayComponents enumerant)
233{

Callers 2

Calls 1

valueMethod · 0.45

Tested by

no test coverage detected