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 <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 template <WEBCFACE_COMPLETE(RobotModel)>
109 std::optional<RobotModel_> robotModel() const;
110};
111extern template std::optional<RobotModel>
112Canvas3DComponent::robotModel<RobotModel, true>() const;
113
120 std::unique_ptr<internal::TemporalCanvas3DComponentData> msg_data;
121
122 public:
127 explicit TemporalCanvas3DComponent(std::nullptr_t = nullptr);
135 operator=(const TemporalCanvas3DComponent &other);
137
149 std::unique_ptr<internal::TemporalCanvas3DComponentData>
150 lockTmp(const std::shared_ptr<internal::ClientData> &data,
151 const SharedString &view_name,
152 std::unordered_map<Canvas3DComponentType, int> *idx_next = nullptr);
153
158 TemporalCanvas3DComponent &id(std::string_view id);
163 TemporalCanvas3DComponent &id(std::wstring_view id);
168 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 }
215 angles(const std::unordered_map<std::string, double> &angles) &;
220 angles(const std::unordered_map<std::string, double> &angles) && {
221 this->angles(angles);
222 return std::move(*this);
223 }
224
232 angles(const std::unordered_map<std::wstring, double> &angles) &;
237 angles(const std::unordered_map<std::wstring, double> &angles) && {
238 this->angles(angles);
239 return std::move(*this);
240 }
241
248 TemporalCanvas3DComponent &angle(const std::string &joint_name,
249 double angle) &;
253 TemporalCanvas3DComponent &&angle(const std::string &joint_name,
254 double angle) && {
255 this->angle(joint_name, angle);
256 return std::move(*this);
257 }
265 TemporalCanvas3DComponent &angle(const std::wstring &joint_name,
266 double angle) &;
270 TemporalCanvas3DComponent &&angle(const std::wstring &joint_name,
271 double angle) && {
272 this->angle(joint_name, angle);
273 return std::move(*this);
274 }
275};
276
Canvas3Dに表示する要素
Definition component_canvas3d.h:33
bool operator!=(const Canvas3DComponent &other) const
Definition component_canvas3d.h:80
std::optional< RobotModel_ > robotModel() const
RobotModelを取得
RobotModelの送受信データを表すクラス
Definition robot_model.h:26
u8stringとstringとwstringをshared_ptrで持ち共有する
Definition encoding.h:67
Canvas3Dを構築するときに使う一時的なCanvas3DComponent.
Definition component_canvas3d.h:119
TemporalCanvas3DComponent && angle(const std::string &joint_name, double angle) &&
Definition component_canvas3d.h:253
TemporalCanvas3DComponent && geometry(const Geometry &g) &&
Definition component_canvas3d.h:196
TemporalCanvas3DComponent && origin(const Transform &origin) &&
Definition component_canvas3d.h:172
TemporalCanvas3DComponent && angles(const std::unordered_map< std::string, double > &angles) &&
Definition component_canvas3d.h:220
TemporalCanvas3DComponent && robotModel(const RobotModel &field) &&
Definition component_canvas3d.h:205
TemporalCanvas3DComponent && color(ViewColor color) &&
Definition component_canvas3d.h:184
TemporalCanvas3DComponent && angle(const std::wstring &joint_name, double angle) &&
Definition component_canvas3d.h:270
TemporalCanvas3DComponent && angles(const std::unordered_map< std::wstring, double > &angles) &&
Definition component_canvas3d.h:237
3次元の平行移動と回転
Definition transform.h:652
bool operator==(const T &other, const InputRef &ref)
Definition text.h:574
ViewColor
Definition component_view.h:40
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:118
#define WEBCFACE_NS_BEGIN
Definition webcface-config.h:117