-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathZenohShapeDynamics.hpp
106 lines (81 loc) · 1.92 KB
/
ZenohShapeDynamics.hpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
#ifndef _ZENOHSHAPEDYNAMICS_HPP
#define _ZENOHSHAPEDYNAMICS_HPP
/** @file */
#include <ShapeDynamics.hpp>
#include <QtCore/QRect>
#include <QtWidgets/QtWidgets>
#include <Shape.hpp>
// -- Shaped Include
#include "dds/dds.h"
#include "ishape.hpp"
#include "zenoh.hxx"
#include <vector>
#include<queue>
#include "org/eclipse/cyclonedds/topic/datatopic.hpp"
namespace demo { namespace ishapes {
#define CN 9
typedef ::std::shared_ptr<Shape> SharedShape;
typedef ::std::weak_ptr<Shape> WeakSharedShape;
/**
* @addtogroup demos_iShapes
*/
/** @{*/
class ZenohShapeDynamics : public ShapeDynamics
{
public:
enum
{
BLUE = 0,
RED = 1,
GREEN = 2,
ORANGE = 3,
YELLOW = 4,
MAGENTA = 5,
CYAN = 6,
GRAY = 7,
BLACK = 8
};
public:
ZenohShapeDynamics(
int x0, int y0,
std::shared_ptr<zenoh::Session> session,
const std::string& keyExpression,
const std::string& color,
int colorIdx,
bool dummy
);
int convert(const std::string& str);
virtual ~ZenohShapeDynamics();
public:
typedef ::std::shared_ptr<ZenohShapeDynamics> ref_type;
public:
void setShape(SharedShape shape)
{
shape_ = shape;
}
void setSession(std::shared_ptr<zenoh::Session> session)
{
session_ = std::move(session);
}
void setKeyExpression(const std::string& keyExpression);
virtual void simulate();
private:
WeakSharedShape shape_;
int x0_;
int y0_;
std::string keyexpr_;
bool attached_;
std::string color_;
int colorIdx_;
QColor colorList_[CN];
bool updateBounds_;
bool dummy_;
std::shared_ptr<zenoh::Session> session_;
// static zenoh::Subscriber<void> subscriber_;
//zenoh::Subscriber<void> subscriber_;
std::optional<zenoh::Subscriber<void>> subscriber_;
};
}
}
/** @}*/
#endif /* _ZENOHSHAPEDYNAMICS_HPP */