5#ifndef vtkLabeledFormatter_h
6#define vtkLabeledFormatter_h
18VTK_ABI_NAMESPACE_BEGIN
64 char formatedString[1024];
65 for (
int i = 0; i < this->NumCurLabels; i++)
68 auto result = vtk::format_to_n(formatedString,
sizeof(formatedString), FormatString, i);
69 *result.out =
'\0', );
77 template <
class TArray>
80 char formatedString[1024];
83 for (
int i = 0; i < this->NumCurLabels; i++)
86 auto result = vtk::format_to_n(formatedString,
sizeof(formatedString), FormatString,
87 static_cast<ValueType
>(a[i][activeComp]));
88 *result.out =
'\0', );
96 template <
class TArray>
99 char formatedString[1024];
100 std::string ResultString;
103 for (
int i = 0; i < this->NumCurLabels; i++)
106 for (
int j = 0; j < numComp; ++j)
109 auto result = vtk::format_to_n(
110 formatedString,
sizeof(formatedString), FormatString,
static_cast<ValueType
>(a[i][j]));
111 *result.out =
'\0', );
112 ResultString += formatedString;
113 if (j < (numComp - 1))
128 char formatedString[1024];
129 for (
int i = 0; i < this->NumCurLabels; i++)
132 if (!labelFormat || std::string_view(labelFormat).empty())
139 auto result = vtk::format_to_n(formatedString,
sizeof(formatedString), FormatString,
140 static_cast<std::string&
>(array->
GetValue(i)));
141 *result.out =
'\0', );
157 if (!vtkArrayDispatch::Dispatch::Execute(
165 if (!vtkArrayDispatch::Dispatch::Execute(
dynamic, self-adjusting array of int
draw text labels at dataset points
virtual char * GetLabelFormat()
Set/Get the std::format or printf style format with which to print the labels.
virtual char GetComponentSeparator()
Set/Get the separator between components.
a vtkAbstractArray subclass for strings
const ValueType & GetValue(vtkIdType id) const
Read-access of string at a particular index.
VTK_ITER_INLINE auto DataArrayTupleRange(const ArrayTypePtr &array, TupleIdType start=-1, TupleIdType end=-1) -> typename detail::SelectTupleRange< ArrayTypePtr, TupleSize >::type
Generate an stl and for-range compatible range of tuple iterators from a vtkDataArray.
typename detail::GetAPITypeImpl< ArrayType, ForceValueTypeForVtkDataArray >::APIType GetAPIType
STL-compatible iterable ranges that provide access to vtkDataArray elements.