38 Status createDomElement(QXmlStreamWriter &xmlStream);
39 void loadDomElement(QDomElement element);
41 qreal getWidth()
const {
return width; }
42 qreal getFeather()
const {
return feather; }
43 bool getVariableWidth()
const {
return variableWidth; }
44 int getColourNumber()
const {
return colourNumber; }
45 void decreaseColourNumber() { colourNumber--; }
46 int getVertexSize()
const {
return vertex.size(); }
47 QPointF getOrigin()
const {
return origin; }
48 QPointF getVertex(
int i)
const {
if (i==-1) {
return origin; }
else {
return vertex.at(i);} }
49 QPointF getC1(
int i)
const {
return c1.at(i); }
50 QPointF getC2(
int i)
const {
return c2.at(i); }
51 qreal getPressure(
int i)
const {
return pressure.at(i); }
52 bool isSelected(
int i)
const {
return selected.at(i+1); }
53 bool isSelected()
const {
bool result=
true;
for(
int i=0; i<selected.size(); i++) result = result && selected[i];
return result; }
54 bool isPartlySelected()
const {
bool result=
false;
for(
int i=0; i<selected.size(); i++) result = result || selected[i];
return result; }
55 bool isInvisible()
const {
return invisible; }
56 bool intersects(QPointF point, qreal distance);
57 bool intersects(QRectF rectangle);
59 void setOrigin(
const QPointF& point);
60 void setOrigin(
const QPointF& point,
const qreal& pressureValue,
const bool& trueOrFalse);
61 void setC1(
int i,
const QPointF& point);
62 void setC2(
int i,
const QPointF& point);
63 void setVertex(
int i,
const QPointF& point);
64 void setLastVertex(
const QPointF& point);
65 void setWidth(qreal desiredWidth);
66 void setFeather(qreal desiredFeather);
67 void setVariableWidth(
bool YesOrNo);
68 void setInvisibility(
bool YesOrNo);
69 void setColourNumber(
int colourNumber) { this->colourNumber = colourNumber; }
70 void setSelected(
bool YesOrNo) {
for(
int i=0; i<selected.size(); i++) { selected[i] = YesOrNo; } }
71 void setSelected(
int i,
bool YesOrNo);
74 void transform(QTransform transformation);
76 void appendCubic(
const QPointF& c1Point,
const QPointF& c2Point,
const QPointF& vertexPoint, qreal pressureValue);
77 void addPoint(
int position,
const QPointF point);
78 void addPoint(
int position,
const qreal t);
79 QPointF getPointOnCubic(
int i, qreal t);
80 void removeVertex(
int i);
81 QPainterPath getStraightPath();
82 QPainterPath getSimplePath();
83 QPainterPath getStrokedPath();
84 QPainterPath getStrokedPath(qreal width);
85 QPainterPath getStrokedPath(qreal width,
bool pressure);
86 QRectF getBoundingRect();
88 void drawPath(QPainter& painter,
Object*
object, QTransform transformation,
bool simplified,
bool showThinLines );
95 static qreal eLength(
const QPointF point);
96 static qreal mLength(
const QPointF point);
97 static void normalise(QPointF& point);
98 static qreal findDistance(
BezierCurve curve,
int i, QPointF P, QPointF& nearestPoint, qreal& t);