Space Comps
 All Classes Files Functions Variables
qparticle2d.h
1 #ifndef DRAWNPARTICLE_H
2 #define DRAWNPARTICLE_H
3 
4 #include <QGraphicsItem>
5 #include <QPainter>
6 #include "particle.h"
7 
8 
9 
10 class QParticle2D : public QGraphicsItem
11 {
12 public:
13  explicit QParticle2D(Particle *p);
14  ~QParticle2D();
15 
16  QRectF boundingRect() const;
17  void paint(QPainter*painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
18 
19  Particle* getParticle();
20 
21  void setPosition(Position* position);
22  void setCollisionTimestep(int t);
23 
24  void incrementTimestep();
25 
26 public slots:
27  void advance(int step);
28 
29 private:
30  Particle* particle;
31  qreal radius;
32  qreal diameter;
33  QColor color;
34 
35  int timestep;
36  int collisionTimestep;
37 
38 };
39 
40 #endif // DRAWNPARTICLE_H
Definition: position.h:8
Definition: particle.h:12
Definition: qparticle2d.h:10