1 /***************************************************************************
2 * Copyright (C) 2011 by Till Theato (root@ttill.de) *
3 * This file is part of Kdenlive (www.kdenlive.org). *
5 * Kdenlive is free software: you can redistribute it and/or modify *
6 * it under the terms of the GNU General Public License as published by *
7 * the Free Software Foundation, either version 2 of the License, or *
8 * (at your option) any later version. *
10 * Kdenlive is distributed in the hope that it will be useful, *
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of *
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
13 * GNU General Public License for more details. *
15 * You should have received a copy of the GNU General Public License *
16 * along with Kdenlive. If not, see <http://www.gnu.org/licenses/>. *
17 ***************************************************************************/
23 #include <QGraphicsPathItem>
28 class SplineItem : public QObject, public QGraphicsPathItem
33 explicit SplineItem(const QList <BPoint> &points, QGraphicsItem* parent = 0, QGraphicsScene *scene = 0);
35 enum { Type = UserType + 10 };
37 virtual int type() const;
41 void updateSpline(bool editing = false);
42 QList <BPoint> getPoints() const;
43 void setPoints(const QList <BPoint> &points);
45 void removeChild(QGraphicsItem *child);
48 void mousePressEvent(QGraphicsSceneMouseEvent *event);
49 void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
50 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
51 void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
54 int getClosestPointOnCurve(const QPointF &point, double *tFinal);
58 QGraphicsView *m_view;
61 void changed(bool editing);