|
Krita Source Code Documentation
|
#include <SvgMeshPatch.h>
Public Types | |
| enum | Type { Top = 0 , Right , Bottom , Left , Size } |
| Position of stop in the patch. More... | |
Public Member Functions | |
| void | addStop (const QString &pathStr, QColor color, Type edge, bool pathIncomplete=false, QPointF lastPoint=QPointF()) |
| void | addStop (const std::array< QPointF, 4 > &pathPoints, QColor color, Type edge) |
| Adds path to the shape. | |
| void | addStopLinear (const std::array< QPointF, 2 > &pathPoints, QColor color, Type edge) |
| Adds linear path to the shape. | |
| QRectF | boundingRect () const |
| int | countPoints () const |
| void | curveTo (const QPointF &c1, const QPointF &c2, const QPointF &p) |
| add points as curve. | |
| std::array< QPointF, 4 > | getMidCurve (bool isVertical) const |
| Gets the curve passing through the middle of meshpatch. | |
| QPointF | getMidpointParametric (Type type) const |
| returns the midPoint in parametric space | |
| QPainterPath | getPath () const |
| Get full (closed) meshpath. | |
| std::array< QPointF, 4 > | getSegment (Type type) const |
| Get a segment of the path in the meshpatch. | |
| SvgMeshStop | getStop (Type type) const |
| returns the starting point of the stop | |
| bool | isDivisibleHorizontally () const |
| bool | isDivisibleVertically () const |
| void | lineTo (const QPointF &p) |
| Helper to convert to a cubic curve internally. | |
| void | modifyCorner (SvgMeshPatch::Type type, const QPointF &delta) |
| void | modifyPath (SvgMeshPatch::Type type, std::array< QPointF, 4 > newPath) |
| void | moveTo (const QPointF &p) |
| QPointF | segmentPointAt (Type type, qreal t) const |
| get the point on a segment using De Casteljau's algorithm | |
| QPair< std::array< QPointF, 4 >, std::array< QPointF, 4 > > | segmentSplitAt (Type type, qreal t) const |
| split a segment using De Casteljau's algorithm | |
| void | setStopColor (SvgMeshPatch::Type type, const QColor &color) |
| void | setTransform (const QTransform &matrix) |
| QSizeF | size () const |
| Get size swept by mesh in pts. | |
| void | subdivide (QVector< SvgMeshPatch * > &subdivided, const QVector< QColor > &colors) const |
| void | subdivideHorizontally (QVector< SvgMeshPatch * > &subdivided, const QVector< QColor > &colors) const |
| void | subdivideVertically (QVector< SvgMeshPatch * > &subdivided, const QVector< QColor > &colors) const |
| SvgMeshPatch (const SvgMeshPatch &other) | |
| SvgMeshPatch (QPointF startingPoint) | |
Private Member Functions | |
| const char * | getCoord (const char *ptr, qreal &number) |
| QPointF | parseMeshPath (const QString &path, bool pathIncomplete=false, const QPointF lastPoint=QPointF()) |
Private Attributes | |
| std::array< std::array< QPointF, 4 >, 4 > | controlPoints |
| int | counter {0} |
| bool | m_newPath |
| std::array< SvgMeshStop, Size > | m_nodes |
| std::array< QPointF, 4 > | m_parametricCoords |
| Coordinates in UV space. | |
| QPointF | m_startingPoint |
| This is the starting point for each path. | |
Definition at line 35 of file SvgMeshPatch.h.
| enum SvgMeshPatch::Type |
| SvgMeshPatch::SvgMeshPatch | ( | QPointF | startingPoint | ) |
Definition at line 62 of file SvgMeshPatch.cpp.
| SvgMeshPatch::SvgMeshPatch | ( | const SvgMeshPatch & | other | ) |
Definition at line 69 of file SvgMeshPatch.cpp.
| void SvgMeshPatch::addStop | ( | const QString & | pathStr, |
| QColor | color, | ||
| Type | edge, | ||
| bool | pathIncomplete = false, | ||
| QPointF | lastPoint = QPointF() ) |
Definition at line 466 of file SvgMeshPatch.cpp.
References m_nodes, m_startingPoint, and parseMeshPath().
Adds path to the shape.
Definition at line 478 of file SvgMeshPatch.cpp.
References curveTo(), m_newPath, m_nodes, m_startingPoint, moveTo(), and Top.
| void SvgMeshPatch::addStopLinear | ( | const std::array< QPointF, 2 > & | pathPoints, |
| QColor | color, | ||
| Type | edge ) |
Adds linear path to the shape.
Definition at line 493 of file SvgMeshPatch.cpp.
References lineTo(), m_newPath, m_nodes, m_startingPoint, moveTo(), and Top.
| QRectF SvgMeshPatch::boundingRect | ( | ) | const |
Definition at line 135 of file SvgMeshPatch.cpp.
References getPath().
| int SvgMeshPatch::countPoints | ( | ) | const |
Definition at line 539 of file SvgMeshPatch.cpp.
References m_nodes.
| void SvgMeshPatch::curveTo | ( | const QPointF & | c1, |
| const QPointF & | c2, | ||
| const QPointF & | p ) |
add points as curve.
Definition at line 93 of file SvgMeshPatch.cpp.
References controlPoints, counter, p, and Size.
|
private |
Definition at line 630 of file SvgMeshPatch.cpp.
References sign().
| std::array< QPointF, 4 > SvgMeshPatch::getMidCurve | ( | bool | isVertical | ) | const |
Gets the curve passing through the middle of meshpatch.
Definition at line 145 of file SvgMeshPatch.cpp.
References Bottom, getSegment(), Left, lerp(), p, Right, segmentPointAt(), and Top.
|
inline |
returns the midPoint in parametric space
Definition at line 62 of file SvgMeshPatch.h.
| QPainterPath SvgMeshPatch::getPath | ( | ) | const |
Get full (closed) meshpath.
Definition at line 125 of file SvgMeshPatch.cpp.
References controlPoints, and Top.
| std::array< QPointF, 4 > SvgMeshPatch::getSegment | ( | Type | type | ) | const |
Get a segment of the path in the meshpatch.
Definition at line 120 of file SvgMeshPatch.cpp.
References controlPoints.
| SvgMeshStop SvgMeshPatch::getStop | ( | SvgMeshPatch::Type | type | ) | const |
returns the starting point of the stop
Definition at line 103 of file SvgMeshPatch.cpp.
References m_nodes.
| bool SvgMeshPatch::isDivisibleHorizontally | ( | ) | const |
Definition at line 445 of file SvgMeshPatch.cpp.
References controlPoints, controlrectLen(), getSegment(), Left, and Right.
| bool SvgMeshPatch::isDivisibleVertically | ( | ) | const |
Definition at line 424 of file SvgMeshPatch.cpp.
References Bottom, controlPoints, controlrectLen(), getSegment(), and Top.
| void SvgMeshPatch::lineTo | ( | const QPointF & | p | ) |
Helper to convert to a cubic curve internally.
Definition at line 83 of file SvgMeshPatch.cpp.
References controlPoints, counter, lerp(), p, and Size.
| void SvgMeshPatch::modifyCorner | ( | SvgMeshPatch::Type | type, |
| const QPointF & | delta ) |
Definition at line 513 of file SvgMeshPatch.cpp.
References controlPoints, m_nodes, and Size.
| void SvgMeshPatch::modifyPath | ( | SvgMeshPatch::Type | type, |
| std::array< QPointF, 4 > | newPath ) |
Definition at line 507 of file SvgMeshPatch.cpp.
References controlPoints, and m_nodes.
| void SvgMeshPatch::moveTo | ( | const QPointF & | p | ) |
Definition at line 78 of file SvgMeshPatch.cpp.
References controlPoints, counter, and p.
|
private |
Definition at line 545 of file SvgMeshPatch.cpp.
References curveTo(), getCoord(), lineTo(), m_newPath, m_startingPoint, and moveTo().
| QPointF SvgMeshPatch::segmentPointAt | ( | Type | type, |
| qreal | t ) const |
get the point on a segment using De Casteljau's algorithm
Definition at line 108 of file SvgMeshPatch.cpp.
References controlPoints, deCasteljau(), and p.
| QPair< std::array< QPointF, 4 >, std::array< QPointF, 4 > > SvgMeshPatch::segmentSplitAt | ( | Type | type, |
| qreal | t ) const |
split a segment using De Casteljau's algorithm
Definition at line 115 of file SvgMeshPatch.cpp.
References controlPoints, and splitAt().
| void SvgMeshPatch::setStopColor | ( | SvgMeshPatch::Type | type, |
| const QColor & | color ) |
Definition at line 523 of file SvgMeshPatch.cpp.
References m_nodes.
| void SvgMeshPatch::setTransform | ( | const QTransform & | matrix | ) |
Definition at line 528 of file SvgMeshPatch.cpp.
References controlPoints, m_nodes, m_startingPoint, and Size.
| QSizeF SvgMeshPatch::size | ( | ) | const |
Get size swept by mesh in pts.
Definition at line 140 of file SvgMeshPatch.cpp.
References boundingRect().
| void SvgMeshPatch::subdivide | ( | QVector< SvgMeshPatch * > & | subdivided, |
| const QVector< QColor > & | colors ) const |
Definition at line 295 of file SvgMeshPatch.cpp.
References addStop(), Bottom, SvgMeshStop::color, getMidCurve(), getMidpointParametric(), getStop(), KIS_ASSERT, Left, m_parametricCoords, Right, segmentSplitAt(), splitAt(), SvgMeshPatch(), and Top.
| void SvgMeshPatch::subdivideHorizontally | ( | QVector< SvgMeshPatch * > & | subdivided, |
| const QVector< QColor > & | colors ) const |
Definition at line 201 of file SvgMeshPatch.cpp.
References addStop(), Bottom, SvgMeshStop::color, getMidCurve(), getMidpointParametric(), getSegment(), getStop(), Left, m_parametricCoords, Right, segmentSplitAt(), SvgMeshPatch(), and Top.
| void SvgMeshPatch::subdivideVertically | ( | QVector< SvgMeshPatch * > & | subdivided, |
| const QVector< QColor > & | colors ) const |
Definition at line 248 of file SvgMeshPatch.cpp.
References addStop(), Bottom, SvgMeshStop::color, getMidCurve(), getMidpointParametric(), getSegment(), getStop(), Left, m_parametricCoords, Right, segmentSplitAt(), SvgMeshPatch(), and Top.
|
private |
Definition at line 134 of file SvgMeshPatch.h.
|
private |
Definition at line 128 of file SvgMeshPatch.h.
|
private |
Definition at line 127 of file SvgMeshPatch.h.
|
private |
Definition at line 133 of file SvgMeshPatch.h.
|
private |
Coordinates in UV space.
Definition at line 136 of file SvgMeshPatch.h.
|
private |
This is the starting point for each path.
Definition at line 131 of file SvgMeshPatch.h.