10#ifndef KOENHANCEDPATHSHAPE_H
11#define KOENHANCEDPATHSHAPE_H
19#define EnhancedPathShapeId "EnhancedPathShape"
71 void setSize(
const QSizeF &newSize)
override;
79 void addHandle(
const QMap<QString, QVariant> &handle);
116 void moveHandleAction(
int handleId,
const QPointF &point, Qt::KeyboardModifiers modifiers = Qt::NoModifier)
override;
130 void addCommand(
const QString &command,
bool triggerUpdate);
float value(const T *src, size_t ch)
The abstract parameter class.
ParameterStore m_parameters
the shared parameters
bool m_cacheResults
indicates if result cache is enabled
QList< EnhancedPathHandle * > m_enhancedHandles
the handles for modifying the shape
bool m_mirrorHorizontally
whether or not the shape is to be mirrored horizontally before transforming it
void updateTextArea()
Updates the size and position of an optionally existing text-on-shape text area.
QMap< QString, EnhancedPathParameter * > ParameterStore
void setPathStretchPointX(qreal pathStretchPointX)
void addCommand(const QString &command)
Add command for instance "M 0 0".
QMap< QString, EnhancedPathFormula * > FormulaStore
void parsePathData(const QString &data)
parses the enhanced path data
void moveHandleAction(int handleId, const QPointF &point, Qt::KeyboardModifiers modifiers=Qt::NoModifier) override
Updates the internal state of a KoParameterShape.
QList< qreal > ModifierStore
void setMirrorVertically(bool mirrorVertically)
Sets if the shape is to be mirrored vertically before applying any other transformations.
void addHandle(const QMap< QString, QVariant > &handle)
Add a single handle with format: x y minX maxX minY maxY.
qreal evaluateConstantOrReference(const QString &val)
FormulaStore m_formulae
the formulae
void setPathStretchPointY(qreal pathStretchPointY)
EnhancedPathShape(const QRect &viewBox)
QPointF shapeToViewbox(const QPointF &point) const
Converts from shape coordinates to viewbox coordinates.
void setMirrorHorizontally(bool mirrorHorizontally)
Sets if the shape is to be mirrored horizontally before applying any other transformations.
qreal m_pathStretchPointX
draw:path-stretchpoint-x attribute
QRectF m_viewBound
the bounding box of the path in viewbox coordinates
QTransform m_mirrorMatrix
matrix to used for mirroring
QList< EnhancedPathCommand * > m_commands
the commands creating the outline
QTransform m_viewMatrix
matrix to convert from viewbox coordinates to shape coordinates
~EnhancedPathShape() override
void setSize(const QSizeF &newSize) override
Resize the shape.
ModifierStore m_modifiers
the modifier values
void updatePath(const QSizeF &size) override
Update the path of the parameter shape.
bool m_mirrorVertically
whether or not the shape is to be mirrored vertically before transforming it
void addFormula(const QString &name, const QString &formula)
Add formula with given name and textual representation.
EnhancedPathParameter * parameter(const QString &text)
Returns parameter from given textual representation.
qreal evaluateReference(const QString &reference)
void modifyReference(const QString &reference, qreal value)
KoShape * cloneShape() const override
creates a deep copy of the shape or shape's subtree
QRect m_viewBox
the viewbox rectangle
void shapeChanged(ChangeType type, KoShape *shape=0) override
bool useStretchPoints(const QSizeF &size, qreal &scale)
QPointF normalize() override
Normalizes the path data.
void enableResultCache(bool enable)
Enables caching results.
QRect viewBox() const
Returns the viewbox of the enhanced path shape.
QHash< QString, qreal > m_resultCache
cache for intermediate results used when evaluating path
qreal m_pathStretchPointY
draw:path-stretchpoint-y attribute
void addModifiers(const QString &modifiers)
Add modifiers with format: modifier0 modifier1 modifier2 ...
QSizeF size() const override
reimplemented
ChangeType
Used by shapeChanged() to select which change was made.
void scale(qreal sx, qreal sy)
Scale the shape using the zero-point which is the top-left corner.