WebCFace 2.5.2
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 <unordered_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
61 std::string id() const;
71 std::wstring idW() const;
72
76 bool operator==(const Canvas3DComponent &other) const;
80 bool operator!=(const Canvas3DComponent &other) const {
81 return !(*this == other);
82 }
83
88 Canvas3DComponentType type() const;
93 Transform origin() const;
98 ViewColor color() const;
103 std::optional<Geometry> geometry() const;
108 std::optional<RobotModel> robotModel() const;
109};
110
117 std::unique_ptr<internal::TemporalCanvas3DComponentData> msg_data;
118
119 public:
124 explicit TemporalCanvas3DComponent(std::nullptr_t = nullptr);
132 operator=(const TemporalCanvas3DComponent &other);
134
146 std::unique_ptr<internal::TemporalCanvas3DComponentData>
147 lockTmp(const std::shared_ptr<internal::ClientData> &data,
148 const SharedString &view_name,
149 std::unordered_map<Canvas3DComponentType, int> *idx_next = nullptr);
150
155 TemporalCanvas3DComponent &id(std::string_view id);
160 TemporalCanvas3DComponent &id(std::wstring_view id);
165 TemporalCanvas3DComponent &origin(const Transform &origin) &;
170 this->origin(origin);
171 return std::move(*this);
172 }
177 TemporalCanvas3DComponent &color(ViewColor color) &;
182 this->color(color);
183 return std::move(*this);
184 }
194 this->geometry(g);
195 return std::move(*this);
196 }
197
198 TemporalCanvas3DComponent &robotModel(const RobotModel &field) &;
203 this->robotModel(field);
204 return std::move(*this);
205 }
212 angles(const std::unordered_map<std::string, double> &angles) &;
217 angles(const std::unordered_map<std::string, double> &angles) && {
218 this->angles(angles);
219 return std::move(*this);
220 }
221
229 angles(const std::unordered_map<std::wstring, double> &angles) &;
234 angles(const std::unordered_map<std::wstring, double> &angles) && {
235 this->angles(angles);
236 return std::move(*this);
237 }
238
245 TemporalCanvas3DComponent &angle(const std::string &joint_name,
246 double angle) &;
250 TemporalCanvas3DComponent &&angle(const std::string &joint_name,
251 double angle) && {
252 this->angle(joint_name, angle);
253 return std::move(*this);
254 }
262 TemporalCanvas3DComponent &angle(const std::wstring &joint_name,
263 double angle) &;
267 TemporalCanvas3DComponent &&angle(const std::wstring &joint_name,
268 double angle) && {
269 this->angle(joint_name, angle);
270 return std::move(*this);
271 }
272};
273
Canvas3Dに表示する要素
Definition component_canvas3d.h:33
bool operator!=(const Canvas3DComponent &other) const
Definition component_canvas3d.h:80
RobotModelの送受信データを表すクラス
Definition robot_model.h:26
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition encoding.h:69
Canvas3Dを構築するときに使う一時的なCanvas3DComponent.
Definition component_canvas3d.h:116
TemporalCanvas3DComponent && angle(const std::string &joint_name, double angle) &&
Definition component_canvas3d.h:250
TemporalCanvas3DComponent && geometry(const Geometry &g) &&
Definition component_canvas3d.h:193
TemporalCanvas3DComponent && origin(const Transform &origin) &&
Definition component_canvas3d.h:169
TemporalCanvas3DComponent && angles(const std::unordered_map< std::string, double > &angles) &&
Definition component_canvas3d.h:217
TemporalCanvas3DComponent && robotModel(const RobotModel &field) &&
Definition component_canvas3d.h:202
TemporalCanvas3DComponent && color(ViewColor color) &&
Definition component_canvas3d.h:181
TemporalCanvas3DComponent && angle(const std::wstring &joint_name, double angle) &&
Definition component_canvas3d.h:267
TemporalCanvas3DComponent && angles(const std::unordered_map< std::wstring, double > &angles) &&
Definition component_canvas3d.h:234
3次元の平行移動と回転
Definition transform.h:615
bool operator==(const T &other, const InputRef &ref)
Definition text.h:566
ViewColor
Definition component_view.h:40
Canvas3DComponentType
Definition component_canvas3d.h:20
Definition geometry.h:26
#define WEBCFACE_DLL
Definition webcface-config.h:60
#define WEBCFACE_NS_END
Definition webcface-config.h:104
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:103