69 return QString::number(
m_value);
74 , m_identifier(identifier)
93 return viewBox.left();
99 return viewBox.right();
102 return viewBox.bottom();
115 return viewBox.width();
118 return viewBox.height();
136 if (text.isEmpty()) {
138 }
else if (text ==
"pi") {
140 }
else if (text ==
"left") {
142 }
else if (text ==
"top") {
144 }
else if (text ==
"right") {
146 }
else if (text ==
"bottom") {
148 }
else if (text ==
"xstretch") {
150 }
else if (text ==
"ystretch") {
152 }
else if (text ==
"hasstroke") {
154 }
else if (text ==
"hasfill") {
156 }
else if (text ==
"width") {
158 }
else if (text ==
"height") {
160 }
else if (text ==
"logwidth") {
162 }
else if (text ==
"logheight") {
176 , m_reference(reference)
Identifier
the different possible identifiers, taken from the odf spec
@ IdentifierYstretch
The value of draw:path-stretchpoint-y is used.
@ IdentifierLogwidth
The width of the svg:viewBox in 1/100th mm is used.
@ IdentifierTop
top of svg:viewBox or draw:coordinate-origin-y
@ IdentifierRight
right of svg:viewBox or draw:coordinate-origin-x + draw:coordinate-width
@ IdentifierXstretch
The value of draw:path-stretchpoint-x is used.
@ IdentifierBottom
bottom of svg:viewBox or draw:coordinate-origin-y + draw:coordinate-height
@ IdentifierHasStroke
If the shape has a line style, a value of 1 is used.
@ IdentifierPi
value of pi.
@ IdentifierHasFill
If the shape has a fill style, a value of 1 is used.
@ IdentifierHeight
The height of the svg:viewBox is used.
@ IdentifierLogheight
The height of the svg:viewBox in 1/100th mm is used.
@ IdentifierLeft
left of svg:viewBox or draw:coordinate-origin-x
@ IdentifierWidth
The width of the svg:viewBox is used.
@ IdentifierUnknown
unknown identifier
float value(const T *src, size_t ch)
EnhancedPathConstantParameter(qreal value, EnhancedPathShape *parent)
Constructs the constant parameter with the given value.
qreal evaluate() override
evaluates the parameter using the given path
qreal m_value
the constant value
QString toString() const override
returns string representation of the parameter
EnhancedPathNamedParameter(Identifier identifier, EnhancedPathShape *parent)
Constructs named parameter from given identifier.
qreal evaluate() override
evaluates the parameter using the given path
QString toString() const override
returns string representation of the parameter
static Identifier identifierFromString(const QString &text)
Returns identifier type from given string.
Identifier m_identifier
the identifier type
The abstract parameter class.
virtual qreal evaluate()=0
evaluates the parameter using the given path
EnhancedPathParameter(EnhancedPathShape *parent)
virtual void modify(qreal value)
modifies the parameter if possible, using the new value
EnhancedPathShape * parent()
EnhancedPathShape * m_parent
virtual ~EnhancedPathParameter()
QString m_reference
the reference, formula or modifier
void modify(qreal value) override
modifies the parameter if possible, using the new value
QString toString() const override
returns string representation of the parameter
qreal evaluate() override
evaluates the parameter using the given path
EnhancedPathReferenceParameter(const QString &reference, EnhancedPathShape *parent)
Constructs reference parameter from the given reference string.
qreal evaluateReference(const QString &reference)
void modifyReference(const QString &reference, qreal value)
QRect viewBox() const
Returns the viewbox of the enhanced path shape.
virtual KoShapeStrokeModelSP stroke() const
virtual QSharedPointer< KoShapeBackground > background() const
qreal toUserValue(qreal ptValue, bool rounding=true) const