forked from OpenDDS/OpenDDS
-
Notifications
You must be signed in to change notification settings - Fork 0
/
BouncingShapeDynamics.hpp
52 lines (40 loc) · 1.31 KB
/
BouncingShapeDynamics.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
#ifndef _BOUNCINGSHAPEDYNAMICS_HPP
#define _BOUNCINGSHAPEDYNAMICS_HPP
#include "ShapeTypeTypeSupportC.h"
#include <ShapeDynamics.hpp>
// Tell GCC to ignore implicitly declared copy methods as long as
// Qt is not compliant.
#ifdef __GNUC__
# pragma GCC diagnostic push
# pragma GCC diagnostic ignored "-Wdeprecated-copy"
#endif
#include <QtCore/QRect>
#ifdef __GNUC__
# pragma GCC diagnostic pop
#endif
class BouncingShapeDynamics : public ShapeDynamics {
public:
BouncingShapeDynamics(int x0, int y0,
const QRect& shapeBounds,
const QRect& constraints,
float speed,
float angle,
const org::omg::dds::demo::ShapeType& shape,
org::omg::dds::demo::ShapeTypeDataWriter_var& shapeWriter);
virtual ~BouncingShapeDynamics();
public:
virtual void simulate();
private:
BouncingShapeDynamics(const BouncingShapeDynamics& orig);
BouncingShapeDynamics& operator=(const BouncingShapeDynamics&);
private:
bool flip();
private:
QRect shapeBounds_;
float alpha_;
float angle_;
float speed_;
org::omg::dds::demo::ShapeType shape_;
org::omg::dds::demo::ShapeTypeDataWriter_var shapeWriter_;
};
#endif /* _BOUNCINGSHAPEDYNAMICS_HPP */