MRU1/airobj.h
2025-07-02 08:18:27 +03:00

80 lines
1.6 KiB
C++

#ifndef AIROBJ_H
#define AIROBJ_H
#include <QGraphicsItem>
#include <QGraphicsColorizeEffect>
#include <QPainter>
#include <QPixmap>
#include <QBitmap>
#include <QImage>
#include <cmath>
#include <QTime>
class airObj : public QGraphicsItem
{
QObject *pParent;
public:
airObj();
int uid;
qreal x, y, h;
qreal vx, vy, v0;
int alt;
bool exist;
QTime lastTime;
int priznakAction;
QColor priznakColor;
int aType;
int gType; // 0 - unkn, 1 - foe, 2 - own, 3 - own garant
QColor col;
int numer;
QImage pic, picAlt;
/*
ïî öåëè ñòîèò ÖÓ îò àáîíåíòà c 1 ïî 6é
ïðåäïîëîæèòåëüíî 1 - êîìàíäà óíè÷òîæèòü
2 - êîìàíäà çàïðåò
21 - ðåêîìåíäàöèÿ óíè÷òîæèòü
22 - ðåêîìåíäàöèÿ çàïðåò
*/
int CU[7];
QRectF boundingRect() const;
void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
void setGType(int g);
void setAType(int a);
void setColAsG();
void setPriznak(int pr);
bool haveCU();
void setCU(int ab, int code=1) { prepareGeometryChange(); CU[ab]=code; }
void setKZS(int ab) {prepareGeometryChange(); CU[ab]=2;}
void clearCU(int ab) {prepareGeometryChange(); CU[ab]=0;}
void deleteTarget();
void setCoord(qreal cx, qreal cy, qreal ch);
void setCoord(qreal cx, qreal cy);
void setSpeed(qreal vx, qreal vy);
QPointF getPos() {return QPointF(x, y);}
qreal kurs();
void setPic();
void setExist(bool fl);
};
#endif // AIROBJ_H