-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathDDSShapeDynamics.hpp
83 lines (67 loc) · 1.5 KB
/
DDSShapeDynamics.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
#ifndef _DDSSHAPEDYNAMICS_HPP
#define _DDSSHAPEDYNAMICS_HPP
/** @file */
#include <dds/dds.hpp>
#include <ShapeDynamics.hpp>
#include <QtCore/QRect>
#include <QtWidgets/QtWidgets>
#include <Shape.hpp>
// -- Shaped Include
#include <topic-traits.hpp>
namespace demo { namespace ishapes {
#define CN 9
typedef ::dds::core::smart_ptr_traits<Shape>::ref_type SharedShape;
typedef ::dds::core::smart_ptr_traits<Shape>::weak_ref_type WeakSharedShape;
/**
* @addtogroup demos_iShapes
*/
/** @{*/
class DDSShapeDynamics : public ShapeDynamics
{
public:
enum
{
BLUE = 0,
RED = 1,
GREEN = 2,
ORANGE = 3,
YELLOW = 4,
MAGENTA = 5,
CYAN = 6,
GRAY = 7,
BLACK = 8
};
public:
DDSShapeDynamics(
int x0, int y0,
dds::sub::DataReader<ShapeType> shapeReader,
const std::string& color,
int colorIdx,
bool dummy
);
virtual ~DDSShapeDynamics();
public:
typedef ::dds::core::smart_ptr_traits<DDSShapeDynamics>::ref_type ref_type;
public:
void setShape(SharedShape shape)
{
shape_ = shape;
}
virtual void simulate();
private:
WeakSharedShape shape_;
int x0_;
int y0_;
dds::sub::DataReader<ShapeType> shapeReader_;
bool attached_;
std::string color_;
int colorIdx_;
QColor colorList_[CN];
bool updateBounds_;
dds::sub::LoanedSamples<ShapeType> samples;
bool dummy_;
};
}
}
/** @}*/
#endif /* _DDSSHAPEDYNAMICS_HPP */