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

Method GetComponentLabel

Filters/General/vtkSplitColumnComponents.cxx:220–259  ·  view source on GitHub ↗

------------------------------------------------------------------------------

Source from the content-addressed store, hash-verified

218
219//------------------------------------------------------------------------------
220std::string vtkSplitColumnComponents::GetComponentLabel(vtkAbstractArray* array, int component_no)
221{
222 std::ostringstream stream;
223 switch (this->NamingMode)
224 {
225 case NUMBERS_WITH_PARENS:
226 stream << array->GetName() << " (";
227 if (component_no == -1)
228 {
229 stream << "Magnitude)";
230 }
231 else
232 {
233 stream << component_no << ")";
234 }
235 break;
236
237 case NUMBERS_WITH_UNDERSCORES:
238 stream << array->GetName() << "_";
239 if (component_no == -1)
240 {
241 stream << "Magnitude";
242 }
243 else
244 {
245 stream << component_no;
246 }
247 break;
248
249 case NAMES_WITH_PARENS:
250 stream << array->GetName() << " (" << vtkGetComponentName(array, component_no) << ")";
251 break;
252
253 case NAMES_WITH_UNDERSCORES:
254 default:
255 stream << array->GetName() << "_" << vtkGetComponentName(array, component_no);
256 break;
257 }
258 return stream.str();
259}
260
261//------------------------------------------------------------------------------
262void vtkSplitColumnComponents::PrintSelf(ostream& os, vtkIndent indent)

Callers 1

RequestDataMethod · 0.95

Calls 3

vtkGetComponentNameFunction · 0.85
GetNameMethod · 0.45
strMethod · 0.45

Tested by

no test coverage detected