Go to the documentation of this file.
24 template<
typename UpdateCacheT>
29 using CacheT = std::vector<std::array<double, 2>>;
35 "AbscissaOrdinate callback should update its cache");
42 builder.
write(
static_cast<uint64_t
>(
type));
70 mutable std::vector<std::array<double, 2>>
cache_;
76 template<
typename UpdateCacheT,
typename GetColor>
83 "AbscissaOrdinate color callback should return a color");
88 this->
color_ = get_color_();
101 template<
typename UpdateCacheT,
typename MaybeGetColor>
103 UpdateCacheT update_fn,
108 if constexpr(std::is_same_v<std::decay_t<MaybeGetColor>,
Color>)
116 template<
typename GetXT,
typename GetYT,
typename MaybeGetColor>
117 auto XY(std::string_view name,
125 "XY x-callback should return a single floating-point value");
127 "XY y-callback should return a single floating-point value");
128 using XYCacheT = std::vector<std::array<double, 2>>;
129 if constexpr(std::is_same_v<std::decay_t<MaybeGetColor>,
Color>)
132 name, [get_x_fn, get_y_fn](XYCacheT & cache) { cache.push_back({get_x_fn(), get_y_fn()}); }, color, style,
139 name, [get_x_fn, get_y_fn](XYCacheT & cache) { cache.push_back({get_x_fn(), get_y_fn()}); }, color, style,
Definition: MessagePackBuilder.h:86
void write(mc_rtc::MessagePackBuilder &builder) const
Definition: types.h:90
std::string name_
Definition: AbscissaOrdinate.h:67
void write(mc_rtc::MessagePackBuilder &builder) const
Definition: AbscissaOrdinate.h:86
Side side_
Definition: AbscissaOrdinate.h:72
Definition: AbscissaOrdinate.h:77
AbscissaOrdinate & side(Side side)
Definition: AbscissaOrdinate.h:60
Style style_
Definition: AbscissaOrdinate.h:71
std::vector< std::array< double, 2 > > CacheT
Definition: AbscissaOrdinate.h:29
AbscissaOrdinate(std::string_view name, UpdateCacheT update_fn, Color color, Style style, Side side)
Definition: AbscissaOrdinate.h:31
AbscissaOrdinate & style(Style style)
Definition: AbscissaOrdinate.h:54
std::vector< std::array< double, 2 > > cache_
Definition: AbscissaOrdinate.h:70
void update() const
Definition: AbscissaOrdinate.h:52
void start_array(size_t size)
Color color_
Definition: AbscissaOrdinate.h:69
Solid
Definition: types.h:146
constexpr bool has_compatible_signature_v
Definition: traits.h:104
static constexpr Type type
Definition: AbscissaOrdinate.h:27
AbscissaOrdinateWithColor(std::string_view name, UpdateCacheT update_cache, GetColor color, Style style, Side side)
Definition: AbscissaOrdinate.h:79
auto XY(std::string_view name, GetXT get_x_fn, GetYT get_y_fn, MaybeGetColor color, Style style=Style::Solid, Side side=Side::Left)
Definition: AbscissaOrdinate.h:117
Type
Definition: types.h:30
UpdateCacheT update_fn_
Definition: AbscissaOrdinate.h:68
void write(mc_rtc::MessagePackBuilder &builder) const
Definition: AbscissaOrdinate.h:39
auto XYChunk(std::string_view name, UpdateCacheT update_fn, MaybeGetColor color, Style style=Style::Solid, Side side=Side::Left)
Definition: AbscissaOrdinate.h:102
Left
Definition: types.h:158
Definition: AbscissaOrdinate.h:25