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 ***************************************************************************/
25 * @brief Represents a point in a cubic Bézier spline.
31 /** @brief Sets the point to -1, -1 to mark it as unusable (until point + handles have proper values) */
33 /** @brief Sets up according to the params. Linking detecting is done using autoSetLinked(). */
34 BPoint(QPointF handle1, QPointF point, QPointF handle2);
36 bool operator==(const BPoint &point) const;
38 /** @brief Sets p to @param point.
39 * @param updateHandles (default = true) Whether to make sure the handles keep their position relative to p. */
40 void setP(QPointF point, bool updateHandles = true);
42 /** @brief Sets h1 to @param handle1.
44 * If handlesLinked is true h2 is updated. */
45 void setH1(QPointF handle1);
47 /** @brief Sets h2 to @param handle2.
49 * If handlesLinked is true h1 is updated. */
50 void setH2(QPointF handle2);
51 void keepInRange(qreal xMin, qreal xMax);
53 /** @brief Sets handlesLinked to true if the handles are in a linked state (line through h1, p, h2) otherwise to false. */
63 /** handles are locked to achieve a natural locking spline => PH1 = -r*PH2 ; a line can be drawn through h1, p, h2 */