22 lines
598 B
C++
22 lines
598 B
C++
#ifndef AGENTITEM_H
|
|
#define AGENTITEM_H
|
|
|
|
#include <QGraphicsItem>
|
|
#include "agent.h"
|
|
|
|
class AgentItem : public QGraphicsItem
|
|
{
|
|
public:
|
|
explicit AgentItem(Agent *agent, QColor col);
|
|
|
|
QRectF boundingRect() const; // ограничивающий прямоугольник
|
|
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget); // отрисовка
|
|
void agentEvent(); // событие: обновление текущих координат
|
|
|
|
private:
|
|
Agent *agent;
|
|
QColor color;
|
|
};
|
|
|
|
#endif // AGENTITEM_H
|