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

Function vtkDefaultComponentName

Filters/General/vtkSplitColumnComponents.cxx:180–207  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

178{
179//------------------------------------------------------------------------------
180std::string vtkDefaultComponentName(int componentNumber, int componentCount)
181{
182 if (componentCount <= 1)
183 {
184 return "";
185 }
186 else if (componentNumber == -1)
187 {
188 return "Magnitude";
189 }
190 else if (componentCount <= 3 && componentNumber < 3)
191 {
192 const char* titles[] = { "X", "Y", "Z" };
193 return titles[componentNumber];
194 }
195 else if (componentCount == 6)
196 {
197 const char* titles[] = { "XX", "YY", "ZZ", "XY", "YZ", "XZ" };
198 // Assume this is a symmetric matrix.
199 return titles[componentNumber];
200 }
201 else
202 {
203 std::ostringstream buffer;
204 buffer << componentNumber;
205 return buffer.str();
206 }
207}
208std::string vtkGetComponentName(vtkAbstractArray* array, int component_no)
209{
210 const char* name = array->GetComponentName(component_no);

Callers 1

vtkGetComponentNameFunction · 0.85

Calls 1

strMethod · 0.45

Tested by

no test coverage detected