2 ******************************************************************************
4 * @file mixercurvepoint.h
5 * @author The OpenPilot Team, http://www.openpilot.org Copyright (C) 2010.
6 * @addtogroup GCSPlugins GCS Plugins
8 * @addtogroup UAVObjectWidgetUtils Plugin
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
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
28 #ifndef MIXERCURVEPOINT_H
29 #define MIXERCURVEPOINT_H
31 #include <QGraphicsItem>
35 #include "uavobjectwidgetutils_global.h"
38 class MixerCurveWidget
;
40 class QGraphicsSceneMouseEvent
;
44 class UAVOBJECTWIDGETUTILS_EXPORT MixerNode
: public QObject
, public QGraphicsItem
{
46 Q_INTERFACES(QGraphicsItem
)
48 MixerNode(MixerCurveWidget
*graphWidget
, QGraphicsItem
*graphItem
);
49 void addEdge(Edge
*edge
);
50 QList
<Edge
*> edges() const;
52 enum { Type
= UserType
+ 10 };
58 void verticalMove(bool flag
);
60 void setPositiveColor(QColor color
= "#609FF2")
62 m_positiveColor
= color
;
65 void setNegativeColor(QColor color
= "#EF5F5F")
67 m_negativeColor
= color
;
70 void setAlpha(qreal alpha
)
75 void setImage(QImage img
)
80 void setDrawNode(bool draw
)
85 void setDrawText(bool draw
)
90 QRectF
boundingRect() const;
91 QPainterPath
shape() const;
92 void paint(QPainter
*painter
, const QStyleOptionGraphicsItem
*option
, QWidget
*widget
);
97 QVariant
itemChange(GraphicsItemChange change
, const QVariant
&val
);
99 void mousePressEvent(QGraphicsSceneMouseEvent
*event
);
100 void mouseReleaseEvent(QGraphicsSceneMouseEvent
*event
);
103 QList
<Edge
*> m_edgeList
;
105 MixerCurveWidget
*m_graph
;
106 QGraphicsItem
*m_graphItem
;
109 QColor m_positiveColor
;
110 QColor m_neutralColor
;
111 QColor m_negativeColor
;
112 QColor m_disabledColor
;
113 QColor m_disabledTextColor
;
123 #endif // MIXERCURVEPOINT_H