5#include "webcface/common/webcface-config.h"
13template <
typename Component>
27 std::shared_ptr<internal::DataSetBuffer<RobotLink>> sb;
39 using Field::lastName;
93 return child(std::to_string(index));
115 template <
typename F,
typename std::enable_if_t<std::is_invocable_v<F>,
116 std::
nullptr_t> =
nullptr>
119 [callback = std::move(callback)](
const auto &) { callback(); });
128 template <
typename T>
130 onChange(std::forward<T>(callback));
147 template <
typename T>
149 *this << std::forward<T>(rl);
162 const RobotModel &set(
const std::vector<RobotLink> &v)
const;
181 std::optional<std::vector<RobotLink>> tryGet()
const;
186 std::vector<RobotLink>
get()
const {
187 return tryGet().value_or(std::vector<RobotLink>{});
189 operator std::vector<RobotLink>()
const {
return get(); }
203 [[deprecated]] std::chrono::system_clock::time_point time()
const;
221 return toComponent3D().
origin(origin);
228 return toComponent3D().
color(color);
234 template <
typename... Args>
236 return toComponent3D().
angles(std::forward<Args>(args)...);
243 template <
typename T,
244 typename std::enable_if_t<std::is_same_v<T, RobotModel>,
245 std::nullptr_t> =
nullptr>
247 return static_cast<Field>(*this) ==
static_cast<Field>(other);
249 template <
typename T,
250 typename std::enable_if_t<std::is_same_v<T, RobotModel>,
251 std::nullptr_t> =
nullptr>
253 return static_cast<Field>(*this) !=
static_cast<Field>(other);
Canvas3Dの送受信データを表すクラス
Definition canvas3d.h:28
リンク1つを表すクラス
Definition robot_link.h:234
RobotModelの送受信データを表すクラス
Definition robot_model.h:26
RobotModel operator[](std::string_view field) const
Definition robot_model.h:69
bool operator==(const T &other) const
RobotModelの参照先を比較
Definition robot_model.h:246
RobotModel operator[](const char *field) const
Definition robot_model.h:81
RobotModel child(int index) const
Definition robot_model.h:62
RobotModel child(std::wstring_view field) const
「(thisの名前).(追加の名前)」を新しい名前とするField (wstring)
Definition robot_model.h:54
RobotModel operator[](std::wstring_view field) const
Definition robot_model.h:74
RobotModel operator[](int index) const
Definition robot_model.h:92
TemporalCanvas3DComponent origin(const Transform &origin) const
Canvas3DComponentに変換 + 要素の移動
Definition robot_model.h:220
const RobotModel & onChange(F callback) const
値が変化したときに呼び出されるコールバックを設定
Definition robot_model.h:117
bool operator!=(const T &other) const
Definition robot_model.h:252
RobotModel operator[](const wchar_t *field) const
Definition robot_model.h:85
const RobotModel & operator=(const std::vector< RobotLink > &v) const
モデルをセットする
Definition robot_model.h:167
void appendListener(T &&callback) const
Definition robot_model.h:129
TemporalCanvas3DComponent angles(Args &&...args) const
Canvas3DComponentに変換 + RobotModelの関節を設定
Definition robot_model.h:235
RobotModel(const Field &base, const SharedString &field)
Definition robot_model.h:32
RobotModel parent() const
nameの最後のピリオドの前までを新しい名前とするField
Definition robot_model.h:99
RobotModel child(std::string_view field) const
「(thisの名前).(追加の名前)」を新しい名前とするField
Definition robot_model.h:47
TemporalCanvas3DComponent color(ViewColor color) const
Canvas3DComponentに変換 + 色の指定
Definition robot_model.h:227
const RobotModel & add(T &&rl) const
モデルにlinkを追加
Definition robot_model.h:148
std::vector< RobotLink > get() const
モデルを返す
Definition robot_model.h:186
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition encoding.h:67
Canvas3Dを構築するときに使う一時的なCanvas3DComponent.
Definition component_canvas3d.h:119
TemporalCanvas3DComponent & color(ViewColor color) &
色
Definition component_canvas3d.cc:96
TemporalCanvas3DComponent & origin(const Transform &origin) &
要素の移動
Definition component_canvas3d.cc:87
TemporalCanvas3DComponent & angles(const std::unordered_map< std::string, double > &angles) &
RobotModelの関節をまとめて設定
Definition component_canvas3d.cc:137
View,Canvasなどで送信用にaddされたデータを管理する
Definition data_buffer.h:17
std::ostream & operator<<(std::ostream &os, const Arg &arg)
Definition func_info.cc:100
ViewColor
Definition component_view.h:40
const auto & get(const AxisAngle &aa)
Definition transform.h:231
ClientDataの参照とメンバ名とデータ名を持つクラス
Definition field.h:71
Field parent() const
nameの最後のピリオドの前までを新しい名前とするField
Definition field.cc:33
Field child(const SharedString &field) const
Definition field.cc:42
#define WEBCFACE_DLL
Definition webcface-config.h:69
#define WEBCFACE_NS_END
Definition webcface-config.h:118
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:117
#define WEBCFACE_CALL_FP
Definition webcface-config.h:107