UWBMarker.h 1.71 KB
Newer Older
flashingx's avatar
flashingx committed
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
//    Marker for the Crazyflie flying with UWB.
//
//    Copyright (C) 2018
//			Yvan Bosshard			byvan		@ee.ethz.ch
//			Michael Rogenmoser		michaero	@ee.ethz.ch
//			Tiago Salzmann			tiagos		@ee.ethz.ch
//	  
//	  Adapted from centerMarker of Angel Romero.
//
//    This program is free software: you can redistribute it and/or modify
//    it under the terms of the GNU General Public License as published by
//    the Free Software Foundation, either version 3 of the License, or
//    (at your option) any later version.
//
//    This program is distributed in the hope that it will be useful,
//    but WITHOUT ANY WARRANTY; without even the implied warranty of
//    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
//    GNU General Public License for more details.
//
//    You should have received a copy of the GNU General Public License
//    along with this program.  If not, see <http://www.gnu.org/licenses/>.

tiagos's avatar
tiagos committed
23
24
25
26
27
28
29
30
31
32
33
34
35
36
#ifndef UWBMARKER_H
#define UWBMARKER_H

#include <QGraphicsSvgItem>
#include <QSvgRenderer>

#include "globalDefinitions.h"

#include "d_fall_pps/UWBAnchor.h"

#define ANCHOR_HEIGHT	200 * FROM_MILIMETERS_TO_UNITS * 1.2
#define	ANCHOR_WIDTH	200 * FROM_MILIMETERS_TO_UNITS * 1.2
#define ANCHOR_OPACITY	0.7

flashingx's avatar
flashingx committed
37
38
using namespace d_fall_pps;

tiagos's avatar
tiagos committed
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
class UWBMarker : public QGraphicsSvgItem
{
public:
	explicit UWBMarker(const UWBAnchor* const anchor, QString filename, QGraphicsItem* parent = 0);
	~UWBMarker();

	void updateMarker(const UWBAnchor* const anchor);

	QRectF boundingRect() const;
	void paint(QPainter * painter, const QStyleOptionGraphicsItem * option, QWidget * widget);

private:
	// info for plotting anchor
    qreal m_width;
    qreal m_height;

    qreal m_x;
    qreal m_y;
    qreal m_z;
	
};

#endif