File indexing completed on 2024-04-28 03:50:12

0001 // SPDX-License-Identifier: LGPL-2.1-or-later
0002 //
0003 // SPDX-FileCopyrightText: 2010 Wes Hardaker <hardaker@users.sourceforge.net>
0004 //
0005 
0006 #ifndef APRSOBJECT_H
0007 #define APRSOBJECT_H
0008 
0009 #include <QString>
0010 #include <QPixmap>
0011 
0012 #include "GeoAprsCoordinates.h"
0013 
0014 namespace Marble
0015 {
0016 
0017 class ViewportParams;
0018 class GeoPainter;
0019 
0020     class AprsObject
0021     {
0022 
0023       public:
0024         AprsObject( const GeoAprsCoordinates &at, const QString &name );
0025         ~AprsObject();
0026 
0027         void setLocation( const GeoAprsCoordinates &location );
0028         void setPixmapId( QString &pixmap );
0029         GeoAprsCoordinates location() const;
0030 
0031         static QColor calculatePaintColor( int from, const QElapsedTimer &time, int fadetime = 10*60*1000 );
0032         void render( GeoPainter *painter, ViewportParams *viewport,
0033                      int fadeTime = 10*60, int hideTime = 30*60 );
0034 
0035       private:
0036         QList<GeoAprsCoordinates>     m_history;
0037         QString                       m_myName;
0038         int                           m_seenFrom;
0039         bool                          m_havePixmap;
0040         QString                       m_pixmapFilename;
0041         QPixmap                       *m_pixmap;
0042     };
0043 
0044 }
0045 
0046 #endif /* APRSOBJECT_H */