WebCFace 2.9.0
Web-based Communication Framework & Dashboard-like UI
Loading...
Searching...
No Matches
component_canvas3d.h
Go to the documentation of this file.
1#pragma once
2#include <map>
4#include "webcface/geometry.h"
6#ifdef WEBCFACE_MESON
7#include "webcface-config.h"
8#else
9#include "webcface/common/webcface-config.h"
10#endif
11
13namespace message {
14struct Canvas3DComponentData;
15}
16namespace internal {
17struct TemporalCanvas3DComponentData;
18}
19
21 geometry = 0,
22 robot_model = 1,
23 // scatter = 2,
24};
25
34 std::shared_ptr<message::Canvas3DComponentData> msg_data;
35 std::weak_ptr<internal::ClientData> data_w;
36 SharedString id_;
37
38 void checkData() const;
39
40 public:
46
48 const std::shared_ptr<message::Canvas3DComponentData> &msg_data,
49 const std::weak_ptr<internal::ClientData> &data_w,
50 const SharedString &id);
51
62 StringView id() const;
73 WStringView idW() const;
74
78 bool operator==(const Canvas3DComponent &other) const;
82 bool operator!=(const Canvas3DComponent &other) const {
83 return !(*this == other);
84 }
85
90 Canvas3DComponentType type() const;
95 Transform origin() const;
100 ViewColor color() const;
105 std::optional<Geometry> geometry() const;
110 template <WEBCFACE_COMPLETE(RobotModel)>
111 std::optional<RobotModel_> robotModel() const;
112};
113extern template std::optional<RobotModel>
114Canvas3DComponent::robotModel<RobotModel, true>() const;
115
122 std::unique_ptr<internal::TemporalCanvas3DComponentData> msg_data;
123
124 public:
129 explicit TemporalCanvas3DComponent(std::nullptr_t = nullptr);
137 operator=(const TemporalCanvas3DComponent &other);
139
151 std::unique_ptr<internal::TemporalCanvas3DComponentData>
152 lockTmp(const std::shared_ptr<internal::ClientData> &data,
153 const SharedString &view_name,
154 std::unordered_map<Canvas3DComponentType, int> *idx_next = nullptr);
155
168 TemporalCanvas3DComponent &origin(const Transform &origin) &;
172 TemporalCanvas3DComponent &&origin(const Transform &origin) && {
173 this->origin(origin);
174 return std::move(*this);
175 }
180 TemporalCanvas3DComponent &color(ViewColor color) &;
185 this->color(color);
186 return std::move(*this);
187 }
197 this->geometry(g);
198 return std::move(*this);
199 }
200
201 TemporalCanvas3DComponent &robotModel(const RobotModel &field) &;
206 this->robotModel(field);
207 return std::move(*this);
208 }
218 angles(const std::map<std::string, double, std::less<>> &angles) &;
223 angles(const std::map<std::string, double, std::less<>> &angles) && {
224 this->angles(angles);
225 return std::move(*this);
226 }
227
238 angles(const std::map<std::wstring, double, std::less<>> &angles) &;
243 angles(const std::map<std::wstring, double, std::less<>> &angles) && {
244 this->angles(angles);
245 return std::move(*this);
246 }
247
256 TemporalCanvas3DComponent &angle(std::string_view joint_name,
257 double angle) &;
261 TemporalCanvas3DComponent &&angle(std::string_view joint_name,
262 double angle) && {
263 this->angle(joint_name, angle);
264 return std::move(*this);
265 }
275 TemporalCanvas3DComponent &angle(std::wstring_view joint_name,
276 double angle) &;
280 TemporalCanvas3DComponent &&angle(std::wstring_view joint_name,
281 double angle) && {
282 this->angle(joint_name, angle);
283 return std::move(*this);
284 }
285};
286
Canvas3Dに表示する要素
Definition component_canvas3d.h:33
bool operator!=(const Canvas3DComponent &other) const
Definition component_canvas3d.h:82
std::optional< RobotModel_ > robotModel() const
RobotModelを取得
RobotModelの送受信データを表すクラス
Definition robot_model.h:26
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition encoding.h:159
SharedString のpublicなコンストラクタインタフェース (入力専用)
Definition encoding.h:215
webcfaceで管理されている文字列を参照するstring_view
Definition encoding.h:60
Canvas3Dを構築するときに使う一時的なCanvas3DComponent.
Definition component_canvas3d.h:121
TemporalCanvas3DComponent && angle(std::wstring_view joint_name, double angle) &&
Definition component_canvas3d.h:280
TemporalCanvas3DComponent && geometry(const Geometry &g) &&
Definition component_canvas3d.h:196
TemporalCanvas3DComponent && angles(const std::map< std::wstring, double, std::less<> > &angles) &&
Definition component_canvas3d.h:243
TemporalCanvas3DComponent && robotModel(const RobotModel &field) &&
Definition component_canvas3d.h:205
TemporalCanvas3DComponent && color(ViewColor color) &&
Definition component_canvas3d.h:184
TemporalCanvas3DComponent && angles(const std::map< std::string, double, std::less<> > &angles) &&
Definition component_canvas3d.h:223
TemporalCanvas3DComponent && angle(std::string_view joint_name, double angle) &&
Definition component_canvas3d.h:261
3次元の平行移動と回転
Definition transform.h:656
bool operator==(const T &other, const InputRef &ref)
Definition text.h:638
ViewColor
Definition component_view.h:41
Canvas3DComponentType
Definition component_canvas3d.h:20
Definition geometry.h:26
#define WEBCFACE_DLL
Definition webcface-config.h:69
#define WEBCFACE_NS_END
Definition webcface-config.h:113
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:112