|
Krita Source Code Documentation
|
Namespaces | |
| namespace | Private |
Classes | |
| struct | DecomposedMatrix |
| class | HaltonSequenceGenerator |
| a simple class to generate Halton sequence More... | |
| class | OuterCircle |
| struct | PointTypeTraits |
| struct | PointTypeTraits< QPoint > |
| struct | PointTypeTraits< QPointF > |
| class | RightHalfPlane |
Functions | |
| template<class Point > | |
| Point | abs (const Point &pt) |
| QPointF | absoluteToRelative (const QPointF &pt, const QRectF &rc) |
| qreal | absoluteToRelative (const qreal value, const QRectF &rc) |
| QRectF | absoluteToRelative (const QRectF &rel, const QRectF &rc) |
| template<template< class T > class Container, class Point > | |
| PointTypeTraits< Point >::rect_type | accumulateBounds (const Container< Point > &points) |
| template<template< class T > class Container, class Point , class Rect > | |
| void | accumulateBounds (const Container< Point > &points, Rect *bounds) |
| template<class Point , class Rect > | |
| void | accumulateBounds (const Point &pt, Rect *bounds) |
| template<class Point , class Rect > | |
| void | accumulateBoundsNonEmpty (const Point &pt, Rect *bounds) |
| void | adjustIfOnPolygonBoundary (const QPolygonF &poly, int polygonDirection, QPointF *pt) |
| QPointF | alignForZoom (const QPointF &pt, qreal zoom) |
| qreal | angleBetweenVectors (const QPointF &v1, const QPointF &v2) |
| QRect | approximateRectFromPoints (const QVector< QPoint > &points) |
| QRectF | approximateRectFromPoints (const QVector< QPointF > &points) |
| template<class Rect , class Point , bool alignPixels> | |
| Rect | approximateRectFromPointsImpl (const QVector< Point > &points) |
| QRect | approximateRectWithPointTransform (const QRect &rect, std::function< QPointF(QPointF)> func) |
| template<class Rect > | |
| Rect | blowRect (const Rect &rect, qreal coeff) |
| template<class Point , class Rect > | |
| Point | clampPoint (Point pt, const Rect &bounds) |
| template<typename T > | |
| T | copysign (T x, T y) |
| void | cropLineToConvexPolygon (QLineF &line, const QPolygonF polygon, bool extendFirst, bool extendSecond) |
| void | cropLineToRect (QLineF &line, const QRect rect, bool extendFirst, bool extendSecond) |
| template<class T > | |
| PointTypeTraits< T >::value_type | crossProduct (const T &a, const T &b) |
| QRectF | cutOffRect (const QRectF &rc, const KisAlgebra2D::RightHalfPlane &p) |
| qreal | directionBetweenPoints (const QPointF &p1, const QPointF &p2, qreal defaultAngle) |
| template<class T > | |
| std::enable_if< std::is_integral< T >::value, T >::type | divideFloor (T a, T b) |
| template<class T > | |
| PointTypeTraits< T >::value_type | dotProduct (const T &a, const T &b) |
| QPoint | ensureInRect (QPoint pt, const QRect &bounds) |
| QPointF | ensureInRect (QPointF pt, const QRectF &bounds) |
| template<class Point , class Rect > | |
| Point | ensureInRectImpl (Point pt, const Rect &bounds) |
| template<class Rect > | |
| Rect | ensureRectNotSmaller (Rect rc, const decltype(Rect().size()) &size) |
| template<class Size > | |
| Size | ensureSizeNotSmaller (const Size &size, const Size &bounds) |
| qreal | findMinimumGoldenSection (std::function< qreal(qreal)> f, qreal xA, qreal xB, qreal eps, int maxIter=100) |
| qreal | findMinimumTernarySection (std::function< qreal(qreal)> f, qreal xA, qreal xB, qreal eps, int maxIter=100) |
| QVector< QPointF > | findTrianglePoint (const QPointF &p1, const QPointF &p2, qreal a, qreal b) |
| boost::optional< QPointF > | findTrianglePointNearest (const QPointF &p1, const QPointF &p2, qreal a, qreal b, const QPointF &nearest) |
| Eigen::Matrix3d | fromQTransformStraight (const QTransform &t) |
| template<class Rect , typename Difference = decltype(Rect::width())> | |
| bool | fuzzyCompareRects (const Rect &r1, const Rect &r2, Difference tolerance) |
| bool | fuzzyMatrixCompare (const QTransform &t1, const QTransform &t2, qreal delta) |
| template<template< typename > class Cont, class Point > | |
| bool | fuzzyPointCompare (const Cont< Point > &c1, const Cont< Point > &c2, qreal delta) |
| bool | fuzzyPointCompare (const QPointF &p1, const QPointF &p2) |
| bool | fuzzyPointCompare (const QPointF &p1, const QPointF &p2, qreal delta) |
| bool | intersectLineConvexPolygon (QLineF &line, const QPolygonF polygon, bool extendFirst, bool extendSecond) |
| bool | intersectLineRect (QLineF &line, const QRect rect, bool extend) |
| bool | intersectLineRect (QLineF &line, const QRect rect, bool extendFirst, bool extendSecond) |
| boost::optional< QPointF > | intersectLines (const QLineF &boundedLine, const QLineF &unboundedLine) |
| boost::optional< QPointF > | intersectLines (const QPointF &p1, const QPointF &p2, const QPointF &q1, const QPointF &q2) |
| QVector< QPointF > | intersectTwoCircles (const QPointF ¢er1, qreal r1, const QPointF ¢er2, qreal r2) |
| template<class T > | |
| T | inwardUnitNormal (const T &a, int polygonDirection) |
| template<typename T > | |
| bool | isInRange (T x, T a, T b) |
| template<typename R > | |
| R | lazyRound (qreal value) |
| template<> | |
| int | lazyRound< int > (qreal value) |
| template<> | |
| qreal | lazyRound< qreal > (qreal value) |
| template<class T > | |
| T | leftUnitNormal (const T &a) |
| template<typename Point > | |
| Point | lerp (const Point &pt1, const Point &pt2, qreal t) |
| template<typename T > | |
| T | linearReshapeFunc (T x, T x0, T x1, T y0, T y1) |
| QTransform | mapToRect (const QRectF &rect) |
| QTransform | mapToRectInverse (const QRectF &rect) |
| template<class Size > | |
| auto | maxDimension (Size size) -> decltype(size.width()) |
| template<class Size > | |
| auto | minDimension (Size size) -> decltype(size.width()) |
| QPointF | moveElasticPoint (const QPointF &pt, const QPointF &base, const QPointF &newBase, const QPointF &wingA, const QPointF &wingB) |
moveElasticPoint moves point pt based on the model of elasticity | |
| QPointF | moveElasticPoint (const QPointF &pt, const QPointF &base, const QPointF &newBase, const QVector< QPointF > &anchorPoints) |
moveElasticPoint moves point pt based on the model of elasticity | |
| template<class T > | |
| qreal | norm (const T &a) |
| template<class Point > | |
| Point | normalize (const Point &a) |
| qreal | pointToLineDistSquared (const QPointF &pt, const QLineF &line) |
| template<class T > | |
| int | polygonDirection (const QVector< T > &polygon) |
| int | quadraticEquation (qreal a, qreal b, qreal c, qreal *x1, qreal *x2) |
| QPointF | relativeToAbsolute (const QPointF &pt, const QRectF &rc) |
| QRectF | relativeToAbsolute (const QRectF &rel, const QRectF &rc) |
| qreal | relativeToAbsolute (qreal value, const QRectF &rc) |
| template<class T > | |
| T | rightUnitNormal (const T &a) |
| QVector< QPoint > | sampleRectWithPoints (const QRect &rect) |
| QVector< QPointF > | sampleRectWithPoints (const QRectF &rect) |
| template<class Rect , class Point > | |
| QVector< Point > | sampleRectWithPoints (const Rect &rect) |
| template<typename T > | |
| T | signPZ (T x) |
| template<typename T > | |
| T | signZZ (T x) |
| QPainterPath | smallArrow () |
| QTransform | toQTransformStraight (const Eigen::Matrix3d &m) |
| QPointF | transformAsBase (const QPointF &pt, const QPointF &base1, const QPointF &base2) |
| std::pair< QPointF, QTransform > | transformEllipse (const QPointF &axes, const QTransform &fullLocalToGlobal) |
| template<typename T > | |
| T | wrapValue (T value, T min, T max) |
| template<typename T , typename std::enable_if< std::is_integral< T >::value, T >::type * = nullptr> | |
| T | wrapValue (T value, T wrapBounds) |
|
inline |
Definition at line 446 of file kis_algebra_2d.h.
|
inline |
Get the relative position of pt inside rectangle rc. The point can be outside the rectangle.
Definition at line 615 of file kis_algebra_2d.h.
|
inline |
Scales absolute isotropic value from absolute to relative coordinate system using SVG 1.1 rules (see chapter 7.10)
Definition at line 635 of file kis_algebra_2d.h.
|
inline |
Scales absolute isotropic value from absolute to relative coordinate system using SVG 1.1 rules (see chapter 7.10)
Definition at line 652 of file kis_algebra_2d.h.
References absoluteToRelative().
|
inline |
Definition at line 280 of file kis_algebra_2d.h.
References accumulateBounds().
|
inline |
Definition at line 271 of file kis_algebra_2d.h.
References accumulateBounds(), and bounds.
|
inline |
Rect::left() is cheaper than Rect::right(), so check it first
Rect::top() is cheaper than Rect::bottom(), so check it first
Definition at line 227 of file kis_algebra_2d.h.
References bounds, and KisAlgebra2D::Private::resetEmptyRectangle().
|
inline |
| void KRITAGLOBAL_EXPORT KisAlgebra2D::adjustIfOnPolygonBoundary | ( | const QPolygonF & | poly, |
| int | polygonDirection, | ||
| QPointF * | pt ) |
Definition at line 36 of file kis_algebra_2d.cpp.
References crossProduct(), dbgKrita, inwardUnitNormal(), isInRange(), KIS_ASSERT_RECOVER_NOOP, kisDistanceToLine(), p0, p1, polygonDirection(), ppVar, and salt.
| QPointF KRITAGLOBAL_EXPORT KisAlgebra2D::alignForZoom | ( | const QPointF & | pt, |
| qreal | zoom ) |
Definition at line 969 of file kis_algebra_2d.cpp.
| qreal KRITAGLOBAL_EXPORT KisAlgebra2D::angleBetweenVectors | ( | const QPointF & | v1, |
| const QPointF & | v2 ) |
Definition at line 110 of file kis_algebra_2d.cpp.
| QRect KRITAGLOBAL_EXPORT KisAlgebra2D::approximateRectFromPoints | ( | const QVector< QPoint > & | points | ) |
Definition at line 544 of file kis_algebra_2d.cpp.
| QRectF KRITAGLOBAL_EXPORT KisAlgebra2D::approximateRectFromPoints | ( | const QVector< QPointF > & | points | ) |
Definition at line 549 of file kis_algebra_2d.cpp.
| Rect KisAlgebra2D::approximateRectFromPointsImpl | ( | const QVector< Point > & | points | ) |
Definition at line 520 of file kis_algebra_2d.cpp.
| QRect KRITAGLOBAL_EXPORT KisAlgebra2D::approximateRectWithPointTransform | ( | const QRect & | rect, |
| std::function< QPointF(QPointF)> | func ) |
Definition at line 554 of file kis_algebra_2d.cpp.
References sampleRectWithPoints().
| Rect KisAlgebra2D::blowRect | ( | const Rect & | rect, |
| qreal | coeff ) |
Multiply width and height of rect by coeff keeping the center of the rectangle pinned
Definition at line 330 of file kis_algebra_2d.h.
|
inline |
|
inline |
Copies the sign of y into x and returns the result
Definition at line 99 of file kis_algebra_2d.h.
| void KRITAGLOBAL_EXPORT KisAlgebra2D::cropLineToConvexPolygon | ( | QLineF & | line, |
| const QPolygonF | polygon, | ||
| bool | extendFirst, | ||
| bool | extendSecond ) |
Definition at line 1299 of file kis_algebra_2d.cpp.
References intersectLineConvexPolygon().
| void KRITAGLOBAL_EXPORT KisAlgebra2D::cropLineToRect | ( | QLineF & | line, |
| const QRect | rect, | ||
| bool | extendFirst, | ||
| bool | extendSecond ) |
Crop line to rect; if it doesn't intersect, just return an empty line (QLineF()).
This is using intersectLineRect, but with the difference that it doesn't require the user to check the return value. It's useful for drawing code, since it let the developer not use if before drawing.
If the line intersects the rectangle, it will be modified to represent the intersecting line segment. If the line does not intersect the area, it will return an empty one-point line.
extendFirst and extendSecond parameters allow one to use this function in case of unbounded lines (if both are true), line segments (if both are false) or half-lines/rays (if one is true and another is false). Note that which point is the "first" and which is the "second" is determined by which is the p1() and which is p2() in QLineF.
| line | line segment |
| rect | area |
| extendFirst | extend the line to the edge of the rect area even if the first point of the line segment lies inside the rectangle |
| extendSecond | extend the line to the edge of the rect area even if the second point of the line segment lies inside the rectangle |
Definition at line 1291 of file kis_algebra_2d.cpp.
References intersectLineRect().
| PointTypeTraits< T >::value_type KisAlgebra2D::crossProduct | ( | const T & | a, |
| const T & | b ) |
Definition at line 55 of file kis_algebra_2d.h.
| KRITAGLOBAL_EXPORT QRectF KisAlgebra2D::cutOffRect | ( | const QRectF & | rc, |
| const KisAlgebra2D::RightHalfPlane & | p ) |
Cuts off a portion of a rect rc defined by a half-plane p
Definition at line 577 of file kis_algebra_2d.cpp.
References approximateRectFromPoints(), p, p1, and p2.
| qreal KRITAGLOBAL_EXPORT KisAlgebra2D::directionBetweenPoints | ( | const QPointF & | p1, |
| const QPointF & | p2, | ||
| qreal | defaultAngle ) |
Computes an angle indicating the direction from p1 to p2. If p1 and p2 are too close together to compute an angle, defaultAngle is returned.
Definition at line 118 of file kis_algebra_2d.cpp.
References fuzzyPointCompare(), p1, and p2.
| std::enable_if< std::is_integral< T >::value, T >::type KisAlgebra2D::divideFloor | ( | T | a, |
| T | b ) |
Definition at line 106 of file kis_algebra_2d.h.
| PointTypeTraits< T >::value_type KisAlgebra2D::dotProduct | ( | const T & | a, |
| const T & | b ) |
Definition at line 49 of file kis_algebra_2d.h.
| QPoint KRITAGLOBAL_EXPORT KisAlgebra2D::ensureInRect | ( | QPoint | pt, |
| const QRect & | bounds ) |
Definition at line 162 of file kis_algebra_2d.cpp.
References bounds, and ensureInRectImpl().
| QPointF KRITAGLOBAL_EXPORT KisAlgebra2D::ensureInRect | ( | QPointF | pt, |
| const QRectF & | bounds ) |
Definition at line 167 of file kis_algebra_2d.cpp.
References bounds, and ensureInRectImpl().
|
inline |
| Rect KisAlgebra2D::ensureRectNotSmaller | ( | Rect | rc, |
| const decltype(Rect().size()) & | size ) |
Definition at line 344 of file kis_algebra_2d.h.
| Size KisAlgebra2D::ensureSizeNotSmaller | ( | const Size & | size, |
| const Size & | bounds ) |
Definition at line 362 of file kis_algebra_2d.h.
References bounds, and copysign().
| qreal KisAlgebra2D::findMinimumGoldenSection | ( | std::function< qreal(qreal)> | f, |
| qreal | xA, | ||
| qreal | xB, | ||
| qreal | eps, | ||
| int | maxIter = 100 ) |
Definition at line 1308 of file kis_algebra_2d.cpp.
References eps.
| qreal KisAlgebra2D::findMinimumTernarySection | ( | std::function< qreal(qreal)> | f, |
| qreal | xA, | ||
| qreal | xB, | ||
| qreal | eps, | ||
| int | maxIter = 100 ) |
Definition at line 1341 of file kis_algebra_2d.cpp.
References eps.
| QVector< QPointF > KRITAGLOBAL_EXPORT KisAlgebra2D::findTrianglePoint | ( | const QPointF & | p1, |
| const QPointF & | p2, | ||
| qreal | a, | ||
| qreal | b ) |
Find possible positions for point p3, such that points \p1, \p2 and p3 form a triangle, such that the distance between p1 ad p3 is a and the distance between p2 and p3 is b. There might be 0, 1 or 2 such positions.
Definition at line 1016 of file kis_algebra_2d.cpp.
References A, B2(), C, dotProduct(), norm(), p, p1, p2, pow2(), and qFuzzyIsNull().
| boost::optional< QPointF > KRITAGLOBAL_EXPORT KisAlgebra2D::findTrianglePointNearest | ( | const QPointF & | p1, |
| const QPointF & | p2, | ||
| qreal | a, | ||
| qreal | b, | ||
| const QPointF & | nearest ) |
Find a point p3 that forms a triangle with \p1 and \p2 and is the nearest possible point to nearest
Definition at line 1080 of file kis_algebra_2d.cpp.
References findTrianglePoint(), kisDistance(), p1, and p2.
|
inline |
Definition at line 775 of file kis_algebra_2d.cpp.
| bool KisAlgebra2D::fuzzyCompareRects | ( | const Rect & | r1, |
| const Rect & | r2, | ||
| Difference | tolerance ) |
Compare two rectangles with tolerance tolerance. The tolerance means that the coordinates of top left and bottom right corners should not differ more than tolerance pixels.
Definition at line 697 of file kis_algebra_2d.h.
| bool KRITAGLOBAL_EXPORT KisAlgebra2D::fuzzyMatrixCompare | ( | const QTransform & | t1, |
| const QTransform & | t2, | ||
| qreal | delta ) |
Compare the matrices with tolerance delta
Definition at line 743 of file kis_algebra_2d.cpp.
| bool KisAlgebra2D::fuzzyPointCompare | ( | const Cont< Point > & | c1, |
| const Cont< Point > & | c2, | ||
| qreal | delta ) |
Returns true if points in two containers are equal with specified tolerance
Definition at line 676 of file kis_algebra_2d.h.
References eps.
| bool KRITAGLOBAL_EXPORT KisAlgebra2D::fuzzyPointCompare | ( | const QPointF & | p1, |
| const QPointF & | p2 ) |
Returns true if the two points are equal within some tolerance, where the tolerance is determined by Qt's built-in fuzzy comparison functions.
Definition at line 756 of file kis_algebra_2d.cpp.
References p1, p2, and qFuzzyCompare().
| bool KRITAGLOBAL_EXPORT KisAlgebra2D::fuzzyPointCompare | ( | const QPointF & | p1, |
| const QPointF & | p2, | ||
| qreal | delta ) |
| bool KRITAGLOBAL_EXPORT KisAlgebra2D::intersectLineConvexPolygon | ( | QLineF & | line, |
| const QPolygonF | polygon, | ||
| bool | extendFirst, | ||
| bool | extendSecond ) |
Definition at line 250 of file kis_algebra_2d.cpp.
References A, B, intersectLines(), p1, p2, and qFuzzyCompare().
| bool KRITAGLOBAL_EXPORT KisAlgebra2D::intersectLineRect | ( | QLineF & | line, |
| const QRect | rect, | ||
| bool | extend ) |
Attempt to intersect a line to the area of the a rectangle.
If the line intersects the rectangle, it will be modified to represent the intersecting line segment and true is returned. If the line does not intersect the area, it remains unmodified and false will be returned. If the line is fully inside the rectangle, it's considered "intersecting" so true will be returned.
| line | line segment |
| rect | area |
| extend | extend the line to the edges of the rect area even if the line segment fits inside the rectangle (so, consider the line to be a line defined by those two points, not a line segment) |
Definition at line 172 of file kis_algebra_2d.cpp.
References intersectLineRect().
| bool KRITAGLOBAL_EXPORT KisAlgebra2D::intersectLineRect | ( | QLineF & | line, |
| const QRect | rect, | ||
| bool | extendFirst, | ||
| bool | extendSecond ) |
Attempt to intersect a line to the area of the a rectangle.
If the line intersects the rectangle, it will be modified to represent the intersecting line segment and true is returned. If the line does not intersect the area, it remains unmodified and false will be returned. If the line is fully inside the rectangle, it's considered "intersecting" so true will be returned.
extendFirst and extendSecond parameters allow one to use this function in case of unbounded lines (if both are true), line segments (if both are false) or half-lines/rays (if one is true and another is false). Note that which point is the "first" and which is the "second" is determined by which is the p1() and which is p2() in QLineF.
| line | line segment |
| rect | area |
| extendFirst | extend the line to the edge of the rect area even if the first point of the line segment lies inside the rectangle |
| extendSecond | extend the line to the edge of the rect area even if the second point of the line segment lies inside the rectangle |
Definition at line 177 of file kis_algebra_2d.cpp.
| KRITAGLOBAL_EXPORT boost::optional< QPointF > KisAlgebra2D::intersectLines | ( | const QLineF & | boundedLine, |
| const QLineF & | unboundedLine ) |
Find intersection of a bounded line boundedLine with unbounded line unboundedLine (if an intersection exists)
Definition at line 974 of file kis_algebra_2d.cpp.
References A, B, B1(), B2(), and qFuzzyIsNull().
| KRITAGLOBAL_EXPORT boost::optional< QPointF > KisAlgebra2D::intersectLines | ( | const QPointF & | p1, |
| const QPointF & | p2, | ||
| const QPointF & | q1, | ||
| const QPointF & | q2 ) |
Find intersection of a bounded line p1, p2 with unbounded line q1, q2 (if an intersection exists)
Definition at line 1010 of file kis_algebra_2d.cpp.
References intersectLines(), p1, p2, q1, and q2.
| KRITAGLOBAL_EXPORT QVector< QPointF > KisAlgebra2D::intersectTwoCircles | ( | const QPointF & | c1, |
| qreal | r1, | ||
| const QPointF & | c2, | ||
| qreal | r2 ) |
Finds the points of intersections between two circles
Definition at line 637 of file kis_algebra_2d.cpp.
References A, C, dbgKrita, eps, KIS_SAFE_ASSERT_RECOVER, norm(), p, p1, p2, pow2(), ppVar, quadraticEquation(), r1, and r2.
| T KisAlgebra2D::inwardUnitNormal | ( | const T & | a, |
| int | polygonDirection ) |
Definition at line 140 of file kis_algebra_2d.h.
References leftUnitNormal(), and polygonDirection().
| bool KisAlgebra2D::isInRange | ( | T | x, |
| T | a, | ||
| T | b ) |
Definition at line 191 of file kis_algebra_2d.h.
References length().
Helper function to convert a qreal to int lazily. If the passed type is an integer, then the value is rounded. Otherwise it is just passed forward.
|
inline |
Definition at line 154 of file kis_algebra_2d.h.
References value().
|
inline |
| T KisAlgebra2D::leftUnitNormal | ( | const T & | a | ) |
Definition at line 124 of file kis_algebra_2d.h.
References crossProduct(), length(), and norm().
| Point KisAlgebra2D::lerp | ( | const Point & | pt1, |
| const Point & | pt2, | ||
| qreal | t ) |
Definition at line 74 of file kis_algebra_2d.h.
|
inline |
Linearly reshape function x so that in range [x0, x1] it would cross points (x0, y0) and (x1, y1).
Definition at line 782 of file kis_algebra_2d.h.
| KRITAGLOBAL_EXPORT QTransform KisAlgebra2D::mapToRect | ( | const QRectF & | rect | ) |
| KRITAGLOBAL_EXPORT QTransform KisAlgebra2D::mapToRectInverse | ( | const QRectF & | rect | ) |
| auto KisAlgebra2D::maxDimension | ( | Size | size | ) | -> decltype(size.width()) |
Definition at line 314 of file kis_algebra_2d.h.
| auto KisAlgebra2D::minDimension | ( | Size | size | ) | -> decltype(size.width()) |
Definition at line 319 of file kis_algebra_2d.h.
| QPointF KRITAGLOBAL_EXPORT KisAlgebra2D::moveElasticPoint | ( | const QPointF & | pt, |
| const QPointF & | base, | ||
| const QPointF & | newBase, | ||
| const QPointF & | wingA, | ||
| const QPointF & | wingB ) |
moveElasticPoint moves point pt based on the model of elasticity
| pt | point in question, tied to points base, wingA and wingB using springs |
| base | initial position of the dragged point |
| newBase | final position of the dragged point |
| wingA | first anchor point |
| wingB | second anchor point |
pt The function requires (newBase - base) be much smaller than any of the distances between other points. If larger distances are necessary, then use integration.
Definition at line 1095 of file kis_algebra_2d.cpp.
References crossProduct(), dotProduct(), findTrianglePointNearest(), and norm().
| QPointF KRITAGLOBAL_EXPORT KisAlgebra2D::moveElasticPoint | ( | const QPointF & | pt, |
| const QPointF & | base, | ||
| const QPointF & | newBase, | ||
| const QVector< QPointF > & | anchorPoints ) |
moveElasticPoint moves point pt based on the model of elasticity
| pt | point in question, tied to points base, anchorPoints using springs |
| base | initial position of the dragged point |
| newBase | final position of the dragged point |
| anchorPoints | anchor points |
pt The function expects (newBase - base) be much smaller than any of the distances between other points. If larger distances are necessary, then use integration.
Definition at line 1201 of file kis_algebra_2d.cpp.
References ENTER_FUNCTION, and ppVar.
| qreal KisAlgebra2D::norm | ( | const T & | a | ) |
Definition at line 61 of file kis_algebra_2d.h.
References pow2().
| Point KisAlgebra2D::normalize | ( | const Point & | a | ) |
| qreal KRITAGLOBAL_EXPORT KisAlgebra2D::pointToLineDistSquared | ( | const QPointF & | pt, |
| const QLineF & | line ) |
Definition at line 1379 of file kis_algebra_2d.cpp.
| int KisAlgebra2D::polygonDirection | ( | const QVector< T > & | polygon | ) |
Note: the sign is flipped because our 0y axis is reversed
Definition at line 173 of file kis_algebra_2d.h.
| KRITAGLOBAL_EXPORT int KisAlgebra2D::quadraticEquation | ( | qreal | a, |
| qreal | b, | ||
| qreal | c, | ||
| qreal * | x1, | ||
| qreal * | x2 ) |
Solves a quadratic equation in a form:
a * x^2 + b * x + c = 0
WARNING: Please note that a must be nonzero! Otherwise the equation is not quadratic! And this function doesn't check that!
x1, x2 — the found solution. The variables are filled with data iff the corresponding solution is found. That is: 0 solutions — variables are not touched, 1 solution — x1 is filled with the result, 2 solutions — x1 and x2 are filled.
Definition at line 614 of file kis_algebra_2d.cpp.
|
inline |
Scale the relative point \pt into the bounds of rc. The point might be outside the rectangle.
Definition at line 607 of file kis_algebra_2d.h.
|
inline |
Scales relative isotropic value from relative to absolute coordinate system using SVG 1.1 rules (see chapter 7.10)
Definition at line 644 of file kis_algebra_2d.h.
References relativeToAbsolute().
|
inline |
Scales relative isotropic value from relative to absolute coordinate system using SVG 1.1 rules (see chapter 7.10)
Definition at line 626 of file kis_algebra_2d.h.
| T KisAlgebra2D::rightUnitNormal | ( | const T & | a | ) |
Definition at line 134 of file kis_algebra_2d.h.
References leftUnitNormal().
| QVector< QPoint > KRITAGLOBAL_EXPORT KisAlgebra2D::sampleRectWithPoints | ( | const QRect & | rect | ) |
Definition at line 508 of file kis_algebra_2d.cpp.
| QVector< QPointF > KRITAGLOBAL_EXPORT KisAlgebra2D::sampleRectWithPoints | ( | const QRectF & | rect | ) |
Definition at line 513 of file kis_algebra_2d.cpp.
| QVector< Point > KisAlgebra2D::sampleRectWithPoints | ( | const Rect & | rect | ) |
Definition at line 486 of file kis_algebra_2d.cpp.
| T KisAlgebra2D::signPZ | ( | T | x | ) |
Usual sign() function with positive zero
Definition at line 83 of file kis_algebra_2d.h.
| T KisAlgebra2D::signZZ | ( | T | x | ) |
Usual sign() function with zero returning zero
Definition at line 91 of file kis_algebra_2d.h.
| QPainterPath KRITAGLOBAL_EXPORT KisAlgebra2D::smallArrow | ( | ) |
|
inline |
Definition at line 768 of file kis_algebra_2d.cpp.
| QPointF KRITAGLOBAL_EXPORT KisAlgebra2D::transformAsBase | ( | const QPointF & | pt, |
| const QPointF & | base1, | ||
| const QPointF & | base2 ) |
Let pt, base1 are two vectors. base1 is uniformly scaled and then rotated into base2 using transformation matrix S * R. The function applies the same transformation to \pt and returns the result.
Definition at line 88 of file kis_algebra_2d.cpp.
References norm().
| std::pair< QPointF, QTransform > KRITAGLOBAL_EXPORT KisAlgebra2D::transformEllipse | ( | const QPointF & | axes, |
| const QTransform & | fullLocalToGlobal ) |
Definition at line 912 of file kis_algebra_2d.cpp.
References fromQTransformStraight(), KIS_SAFE_ASSERT_RECOVER_NOOP, pow2(), KisAlgebra2D::DecomposedMatrix::rotateTransform(), KisAlgebra2D::DecomposedMatrix::scaleTransform(), KisAlgebra2D::DecomposedMatrix::shearTransform(), toQTransformStraight(), and KisAlgebra2D::DecomposedMatrix::translateTransform().
|
inline |
|
inline |