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 ***************************************************************************/
22 #include <QGraphicsPathItem>
27 class SplineItem : public QObject, public QGraphicsPathItem
32 explicit SplineItem(const QList <BPoint> &points, QGraphicsItem* parent = 0, QGraphicsScene *scene = 0);
34 enum { Type = UserType + 10 };
36 virtual int type() const;
40 void updateSpline(bool editing = false);
41 QList <BPoint> getPoints() const;
42 void setPoints(const QList <BPoint> &points);
44 void removeChild(QGraphicsItem *child);
47 void mousePressEvent(QGraphicsSceneMouseEvent *event);
48 void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
49 void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
50 void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
53 int getClosestPointOnCurve(const QPointF &point, double *tFinal);
57 QGraphicsView *m_view;
60 void changed(bool editing);