Merged in f5soh/librepilot/update_credits (pull request #529)
[librepilot.git] / ground / gcs / src / plugins / uavobjectwidgetutils / mixercurveline.h
blob7392ceff94b9c29892c9ab11d40d532293d9cb05
1 /**
2 ******************************************************************************
4 * @file mixercurveline.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
7 * @{
8 * @addtogroup UAVObjectWidgetUtils Plugin
9 * @{
10 * @brief Utility plugin for UAVObject to Widget relation management
11 *****************************************************************************/
13 * This program is free software; you can redistribute it and/or modify
14 * it under the terms of the GNU General Public License as published by
15 * the Free Software Foundation; either version 3 of the License, or
16 * (at your option) any later version.
18 * This program is distributed in the hope that it will be useful, but
19 * WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY
20 * or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License
21 * for more details.
23 * You should have received a copy of the GNU General Public License along
24 * with this program; if not, write to the Free Software Foundation, Inc.,
25 * 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
29 * This is inspired by the elastic nodes and edges demo in the Qt examples
30 * I have reinventing the wheel!
33 #ifndef MIXERCURVELINE_H
34 #define MIXERCURVELINE_H
36 #include <QGraphicsItem>
38 class MixerNode;
40 class Edge : public QGraphicsItem {
41 public:
42 Edge(MixerNode *sourceNode, MixerNode *destNode);
43 ~Edge();
45 MixerNode *sourceNode() const;
46 void setSourceNode(MixerNode *node);
48 MixerNode *destNode() const;
49 void setDestNode(MixerNode *node);
51 void adjust();
53 enum { Type = UserType + 12 };
54 int type() const
56 return Type;
59 protected:
60 QRectF boundingRect() const;
61 void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
63 private:
64 MixerNode *source, *dest;
66 QPointF sourcePoint;
67 QPointF destPoint;
68 qreal arrowSize;
71 #endif // MIXERCURVELINE_H