|
| control_point_iterator | beginControlPoints () |
| |
| control_point_const_iterator | beginControlPoints () const |
| |
| patch_iterator | beginPatches () |
| |
| patch_const_iterator | beginPatches () const |
| |
| segment_iterator | beginSegments () |
| |
| segment_const_iterator | beginSegments () const |
| |
| control_point_const_iterator | constBeginControlPoints () const |
| |
| patch_const_iterator | constBeginPatches () const |
| |
| segment_const_iterator | constBeginSegments () const |
| |
| control_point_const_iterator | constEndControlPoints () const |
| |
| patch_const_iterator | constEndPatches () const |
| |
| segment_const_iterator | constEndSegments () const |
| |
| control_point_const_iterator | constFind (const ControlPointIndex &index) const |
| |
| control_point_const_iterator | constFind (const NodeIndex &index) const |
| |
| patch_const_iterator | constFind (const PatchIndex &index) const |
| |
| segment_const_iterator | constFind (const SegmentIndex &index) const |
| |
| QRectF | dstBoundingRect () const |
| |
| control_point_iterator | endControlPoints () |
| |
| control_point_const_iterator | endControlPoints () const |
| |
| patch_iterator | endPatches () |
| |
| patch_const_iterator | endPatches () const |
| |
| segment_iterator | endSegments () |
| |
| segment_const_iterator | endSegments () const |
| |
| control_point_iterator | find (const ControlPointIndex &index) |
| |
| control_point_const_iterator | find (const ControlPointIndex &index) const |
| |
| control_point_iterator | find (const NodeIndex &index) |
| |
| control_point_const_iterator | find (const NodeIndex &index) const |
| |
| patch_iterator | find (const PatchIndex &index) |
| |
| patch_const_iterator | find (const PatchIndex &index) const |
| |
| segment_iterator | find (const SegmentIndex &index) |
| |
| segment_const_iterator | find (const SegmentIndex &index) const |
| |
| ControlPointIndex | hitTestControlPoint (const QPointF &pt, qreal distanceThreshold) const |
| |
| ControlPointIndex | hitTestNode (const QPointF &pt, qreal distanceThreshold) const |
| |
| SegmentIndex | hitTestSegment (const QPointF &pt, qreal distanceThreshold, qreal *t=0) const |
| |
| bool | isIdentity () const |
| |
| template<typename T > |
| bool | isIndexValid (const T &index) const |
| |
| Patch | makePatch (const PatchIndex &index) const |
| |
| Patch | makePatch (int col, int row) const |
| |
| | Mesh () |
| |
| | Mesh (const QRectF &mapRect, const QSize &size=QSize(2, 2)) |
| |
| Node & | node (const NodeIndex &index) |
| |
| const Node & | node (const NodeIndex &index) const |
| |
| Node & | node (int col, int row) |
| |
| const Node & | node (int col, int row) const |
| |
| bool | operator== (const Mesh &rhs) const |
| |
| QRectF | originalRect () const |
| |
| void | removeColumn (int column) |
| |
| void | removeColumnOrRow (NodeIndex index, bool row) |
| |
| void | removeRow (int row) |
| |
| void | reshapeMeshHorizontally (int numColumns) |
| |
| void | reshapeMeshVertically (int numRows) |
| |
| QSize | size () const |
| |
| int | subdivideColumn (int leftColumn, qreal relProportionalT) |
| |
| int | subdivideColumn (qreal proportionalT) |
| |
| int | subdivideRow (int topRow, qreal relProportionalT) |
| |
| int | subdivideRow (qreal proportionalT) |
| |
| void | subdivideSegment (SegmentIndex index, qreal proportionalT) |
| |
| void | transform (const QTransform &t) |
| |
| void | transformSrcAndDst (const QTransform &t) |
| |
| void | translate (const QPointF &offset) |
| |
|
| template<class MeshType , class IteratorType = control_point_iterator_impl<std::is_const<MeshType>::value>> |
| static IteratorType | beginControlPoints (MeshType &mesh) |
| |
| template<class MeshType , class IteratorType = patch_iterator_impl<std::is_const<MeshType>::value>> |
| static IteratorType | beginPatches (MeshType &mesh) |
| |
| template<class MeshType , class IteratorType = segment_iterator_impl<std::is_const<MeshType>::value>> |
| static IteratorType | beginSegments (MeshType &mesh) |
| |
| template<class MeshType , class IteratorType = control_point_iterator_impl<std::is_const<MeshType>::value>> |
| static IteratorType | endControlPoints (MeshType &mesh) |
| |
| template<class MeshType , class IteratorType = patch_iterator_impl<std::is_const<MeshType>::value>> |
| static IteratorType | endPatches (MeshType &mesh) |
| |
| template<class MeshType , class IteratorType = segment_iterator_impl<std::is_const<MeshType>::value>> |
| static IteratorType | endSegments (MeshType &mesh) |
| |
| template<class MeshType , class IteratorType = control_point_iterator_impl<std::is_const<MeshType>::value>> |
| static IteratorType | find (MeshType &mesh, const ControlPointIndex &index) |
| |
| template<class MeshType , class IteratorType = control_point_iterator_impl<std::is_const<MeshType>::value>> |
| static IteratorType | find (MeshType &mesh, const NodeIndex &index) |
| |
| template<class MeshType , class IteratorType = patch_iterator_impl<std::is_const<MeshType>::value>> |
| static IteratorType | find (MeshType &mesh, const PatchIndex &index) |
| |
| template<class MeshType , class IteratorType = segment_iterator_impl<std::is_const<MeshType>::value>> |
| static IteratorType | find (MeshType &mesh, const SegmentIndex &index) |
| |
template<typename NodeArg = BaseMeshNode, typename PatchArg = KisBezierPatch>
class KisBezierMeshDetails::Mesh< NodeArg, PatchArg >
Definition at line 128 of file KisBezierMesh.h.
template<typename NodeArg = BaseMeshNode, typename PatchArg = KisBezierPatch>
Definition at line 931 of file KisBezierMesh.h.
932 {
934 const Node &tr =
node(col + 1, row);
935 const Node &bl =
node(col, row + 1);
936 const Node &br =
node(col + 1, row + 1);
937
939
940 patch.points[Patch::TL] = tl.
node;
941 patch.points[Patch::TL_HC] = tl.rightControl;
942 patch.points[Patch::TL_VC] = tl.bottomControl;
943
944 patch.points[Patch::TR] = tr.
node;
945 patch.points[Patch::TR_HC] = tr.leftControl;
946 patch.points[Patch::TR_VC] = tr.bottomControl;
947
948 patch.points[Patch::BL] = bl.
node;
949 patch.points[Patch::BL_HC] = bl.rightControl;
950 patch.points[Patch::BL_VC] = bl.topControl;
951
952 patch.points[Patch::BR] = br.
node;
953 patch.points[Patch::BR_HC] = br.leftControl;
954 patch.points[Patch::BR_VC] = br.topControl;
955
960
962 tl, tr, bl, br);
963
964 return patch;
965 }
QPointF relativeToAbsolute(const QPointF &pt, const QRectF &rc)
void assignPatchData(KisBezierPatch *patch, const QRectF &srcRect, const BaseMeshNode &tl, const BaseMeshNode &tr, const BaseMeshNode &bl, const BaseMeshNode &br)
References KisBezierMeshDetails::assignPatchData(), KisBezierMeshDetails::Mesh< NodeArg, PatchArg >::m_columns, KisBezierMeshDetails::Mesh< NodeArg, PatchArg >::m_originalRect, KisBezierMeshDetails::Mesh< NodeArg, PatchArg >::m_rows, Node::node(), KisBezierMeshDetails::Mesh< NodeArg, PatchArg >::node(), and KisAlgebra2D::relativeToAbsolute().
template<typename NodeArg = BaseMeshNode, typename PatchArg = KisBezierPatch>
Definition at line 1130 of file KisBezierMesh.h.
1130 {
1133
1135
1138
1139 left.rightControl =
p1;
1140 newNode.leftControl =
p2;
1142 newNode.rightControl =
q1;
1143 right.leftControl =
q2;
1144
1145 newNode.topControl = newNode.
node +
lerp(left.topControl - left.
node, right.topControl - right.
node, t);
1146 newNode.bottomControl = newNode.
node +
lerp(left.bottomControl - left.
node, right.bottomControl - right.
node, t);
1147
1149 }
QPointF lerp(const QPointF &p1, const QPointF &p2, qreal t)
void deCasteljau(const std::array< QPointF, 4 > &points, qreal t, QPointF *p1, QPointF *p2, QPointF *p3, QPointF *p4, QPointF *p5)
Point lerp(const Point &pt1, const Point &pt2, qreal t)
void lerpNodeData(const BaseMeshNode &left, const BaseMeshNode &right, qreal t, BaseMeshNode &dst)
void deCasteljau(const QPointF &q0, const QPointF &q1, const QPointF &q2, const QPointF &q3, qreal t, QPointF *p0, QPointF *p1, QPointF *p2, QPointF *p3, QPointF *p4)
References KisBezierUtils::deCasteljau(), deCasteljau(), KisAlgebra2D::lerp(), lerp(), KisBezierMeshDetails::lerpNodeData(), Node::node(), p1, p2, p3, q1, and q2.
template<typename NodeArg = BaseMeshNode, typename PatchArg = KisBezierPatch>
Definition at line 1151 of file KisBezierMesh.h.
1151 {
1154
1156
1159
1160 top.bottomControl =
p1;
1161 newNode.topControl =
p2;
1163 newNode.bottomControl =
q1;
1164 bottom.topControl =
q2;
1165
1166 newNode.leftControl = newNode.
node +
lerp(top.leftControl - top.
node, bottom.leftControl - bottom.
node, t);
1167 newNode.rightControl = newNode.
node +
lerp(top.rightControl - top.
node, bottom.rightControl - bottom.
node, t);
1168
1170 }
References KisBezierUtils::deCasteljau(), deCasteljau(), KisAlgebra2D::lerp(), lerp(), KisBezierMeshDetails::lerpNodeData(), Node::node(), p1, p2, p3, q1, and q2.
template<typename NodeArg = BaseMeshNode, typename PatchArg = KisBezierPatch>
Definition at line 843 of file KisBezierMesh.h.
843 {
844 const auto it =
m_columns.begin() + leftColumn;
845 const int rightColumn = leftColumn + 1;
847
848 std::vector<Node> newColumn;
849 newColumn.resize(
m_size.height());
850 for (
int row = 0; row <
m_size.height(); row++) {
851 const qreal t =
853 node(leftColumn, row).rightControl,
854 node(rightColumn, row).leftControl,
856 relProportionalT,
857 0.01);
858
860 }
861
862 auto dstIt =
m_nodes.begin() + rightColumn;
863 for (auto columnIt = newColumn.begin(); columnIt != newColumn.end(); ++columnIt) {
864 dstIt =
m_nodes.insert(dstIt, *columnIt);
865 dstIt +=
m_size.width() + 1;
866 }
867
869 auto insertedIt =
m_columns.insert(
next(it), absProportionalT);
871 }
qreal distance(const QPointF &p1, const QPointF &p2)
void splitCurveHorizontally(Node &left, Node &right, qreal t, Node &newNode)
QAction * next(const QObject *recvr, const char *slot, QObject *parent)
qreal curveParamByProportion(const QPointF p0, const QPointF p1, const QPointF p2, const QPointF p3, qreal proportion, const qreal error)
References KisBezierUtils::curveParamByProportion(), distance(), KisAlgebra2D::lerp(), KisBezierMeshDetails::Mesh< NodeArg, PatchArg >::m_columns, KisBezierMeshDetails::Mesh< NodeArg, PatchArg >::m_nodes, KisBezierMeshDetails::Mesh< NodeArg, PatchArg >::m_size, KisBezierMeshDetails::Mesh< NodeArg, PatchArg >::node(), and KisBezierMeshDetails::Mesh< NodeArg, PatchArg >::splitCurveHorizontally().
template<typename NodeArg = BaseMeshNode, typename PatchArg = KisBezierPatch>
Definition at line 798 of file KisBezierMesh.h.
798 {
799 const auto it =
m_rows.begin() + topRow;
800 const int bottomRow = topRow + 1;
802
803 std::vector<Node> newRow;
804 newRow.resize(
m_size.width());
805 for (
int col = 0; col <
m_size.width(); col++) {
806 const qreal t =
808 node(col, topRow).bottomControl,
809 node(col, bottomRow).topControl,
811 relProportionalT,
812 0.01);
813
815 }
816
818 newRow.begin(), newRow.end());
819
821 auto insertedIt =
m_rows.insert(
next(it), absProportionalT);
823 }
void splitCurveVertically(Node &top, Node &bottom, qreal t, Node &newNode)
References KisBezierUtils::curveParamByProportion(), distance(), KisAlgebra2D::lerp(), KisBezierMeshDetails::Mesh< NodeArg, PatchArg >::m_nodes, KisBezierMeshDetails::Mesh< NodeArg, PatchArg >::m_rows, KisBezierMeshDetails::Mesh< NodeArg, PatchArg >::m_size, KisBezierMeshDetails::Mesh< NodeArg, PatchArg >::node(), and KisBezierMeshDetails::Mesh< NodeArg, PatchArg >::splitCurveVertically().