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 ***************************************************************************/
30 BPoint::BPoint(QPointF handle1, QPointF point, QPointF handle2) :
38 bool BPoint::operator==(const BPoint& point) const
40 return point.h1 == h1 &&
45 void BPoint::setP(QPointF point, bool updateHandles)
47 QPointF offset = point - p;
55 void BPoint::setH1(QPointF handle1)
59 qreal angle = QLineF(h1, p).angle();
60 QLineF l = QLineF(p, h2);
66 void BPoint::setH2(QPointF handle2)
70 qreal angle = QLineF(h2, p).angle();
71 QLineF l = QLineF(p, h1);
77 void BPoint::keepInRange(qreal xMin, qreal xMax)
81 void BPoint::autoSetLinked()
83 handlesLinked = !QLineF(h1, p).angleTo(QLineF(p, h2));