17#include "vectorimage.h"
24#include <QXmlStreamWriter>
28VectorImage::VectorImage()
38 mOpacity = v2.mOpacity;
41VectorImage::~VectorImage()
53 KeyFrame::operator=(a);
56 mOpacity = a.mOpacity;
89 if (type.
name() !=
"PencilVectorImage")
return false;
92 if (element.
tagName() ==
"image")
94 if (element.
attribute(
"type") ==
"vector")
100 setFileName(filePath);
114 debugInfo <<
"VectorImage::write";
118 QFile file(filePath);
122 qDebug() <<
"VectorImage - Cannot write file" << filePath << file.
error();
123 debugInfo << (
"file.error() = " + file.
errorString());
124 return Status(Status::FAIL, debugInfo);
129 debugInfo <<
"Unrecognized format";
130 return Status(Status::FAIL, debugInfo);
136 xmlStream.
writeDTD(
"<!DOCTYPE PencilVectorImage>");
144 debugInfo.collect(st.details());
145 debugInfo <<
"- xml creation failed";
146 return Status(Status::FAIL, debugInfo);
151 setFileName(filePath);
163 debugInfo <<
"VectorImage::createDomElement";
165 for (
int i = 0; i < mCurves.
size(); i++)
167 Status st = mCurves[i].createDomElement(xmlStream);
170 debugInfo.collect(st.details());
171 debugInfo <<
QString(
"- m_curves[%1] failed to write").
arg(i);
172 return Status(Status::FAIL, debugInfo);
175 for (
int i = 0; i < mArea.
size(); i++)
177 Status st = mArea[i].createDomElement(xmlStream);
180 debugInfo.collect(st.details());
181 debugInfo <<
QString(
"- area[%1] failed to write").
arg(i);
182 return Status(Status::FAIL, debugInfo);
198 if (!atomElement.
isNull())
200 if (atomElement.
tagName() ==
"curve")
203 newCurve.loadDomElement(atomElement);
206 if (atomElement.
tagName() ==
"area")
209 newArea.loadDomElement(atomElement);
231 mCurves[curveNumber].addPoint(vertexNumber, fraction);
233 for (
int j = 0; j < mArea.
size(); j++)
236 for (
int k = 0; k < mArea.
at(j).mVertex.size(); k++)
238 if (mArea[j].getVertexRef(k).curveNumber == curveNumber)
240 if (mArea[j].getVertexRef(k).vertexNumber >= vertexNumber)
242 mArea[j].mVertex[k].vertexNumber++;
247 for (
int k = 1; k < mArea.
at(j).mVertex.size(); k++)
249 if (
VertexRef(curveNumber, vertexNumber + 1) == mArea.
at(j).mVertex.
at(k))
251 if (
VertexRef(curveNumber, vertexNumber - 1) == mArea.
at(j).mVertex.
at(k - 1))
256 if (
VertexRef(curveNumber, vertexNumber - 1) == mArea.
at(j).mVertex.
at(k))
258 if (
VertexRef(curveNumber, vertexNumber + 1) == mArea.
at(j).mVertex.
at(k - 1))
275 for (
int j = 0; j < mArea.
size(); j++)
277 for (
int k = 0; k < mArea.
at(j).mVertex.size(); k++)
279 if (mArea.
at(j).mVertex[k].curveNumber > i) { mArea[j].mVertex[k].curveNumber--; }
296 if (newCurve.getVertexSize() < 1)
303 qreal tol = qMax(newCurve.getWidth() / factor, 3.0 / factor);
312 if (position < 0 || position > mCurves.
size() - 1)
319 for (
int i = 0; i < mArea.
size(); i++)
321 for (
int j = 0; j < mArea.
at(i).mVertex.size(); j++)
323 if (mArea.
at(i).mVertex[j].curveNumber >= position) {
324 mArea[i].mVertex[j].curveNumber++;
328 mCurves.
insert(position, newCurve);
353 QPointF P = newCurve.getVertex(-1);
354 QPointF Q = newCurve.getVertex(newCurve.getVertexSize() - 1);
355 if (BezierCurve::eLength(P - Q) < tolerance)
357 newCurve.setVertex(newCurve.getVertexSize() - 1, P);
361 for (
int i = 0; i < mCurves.
size(); i++)
363 for (
int j = 0; j < mCurves.
at(i).getVertexSize(); j++)
365 QPointF P = newCurve.getVertex(-1);
366 QPointF Q = newCurve.getVertex(newCurve.getVertexSize() - 1);
367 QPointF P1 = mCurves.
at(i).getVertex(j - 1);
369 qreal tol3 = 2.0*sqrt(0.25*((P1 - P2).x()*(P1 - P2).x() + (P1 - P2).y()*(P1 - P2).y()) + tolerance*tolerance);
370 qreal dist1 = BezierCurve::eLength(P - P1);
371 qreal dist2 = BezierCurve::eLength(P - P2);
372 if (dist1 <= 0.2*tolerance)
374 newCurve.setVertex(-1, P1);
378 if (dist2 <= 0.2*tolerance)
380 newCurve.setVertex(-1, P2);
384 if (dist1 + dist2 <= 3 * tol3)
388 qreal distance = BezierCurve::findDistance(mCurves[i], j, P, nearestPoint, t);
389 if (distance < tolerance)
391 newCurve.setOrigin(nearestPoint);
398 dist1 = BezierCurve::eLength(Q - P1);
399 dist2 = BezierCurve::eLength(Q - P2);
400 if (dist1 <= 0.2*tolerance)
402 newCurve.setLastVertex(P1);
406 if (dist2 <= 0.2*tolerance)
408 newCurve.setLastVertex(P2);
412 if (dist1 + dist2 <= 3 * tol3)
416 qreal distance = BezierCurve::findDistance(mCurves[i], j, Q, nearestPoint, t);
417 if (distance < tolerance)
419 newCurve.setLastVertex(nearestPoint);
439 for (
int k = 0; k < newCurve.getVertexSize(); k++)
441 for (
int j = k + 1; j < newCurve.getVertexSize(); j++)
444 bool intersection = BezierCurve::findIntersection(newCurve, k, newCurve, j, intersections);
449 newCurve.addPoint(k, intersections[0].t1);
453 newCurve.addPoint(j, intersections[0].t2);
460 for (
int k = 0; k < newCurve.getVertexSize(); k++)
466 for (
int i = 0; i < mCurves.
size(); i++)
470 QPointF Q = mCurves.
at(i).getVertex(mCurves.
at(i).getVertexSize() - 1);
471 QPointF P1 = newCurve.getVertex(k - 1);
472 QPointF P2 = newCurve.getVertex(k);
473 qreal tol3 = 2.0*sqrt(0.25*((P1 - P2).x()*(P1 - P2).x() + (P1 - P2).y()*(P1 - P2).y()) + tolerance*tolerance);
474 qreal dist1 = BezierCurve::eLength(P - P1);
475 qreal dist2 = BezierCurve::eLength(P - P2);
477 if (dist1 < 0.2*tolerance)
479 mCurves[i].setVertex(-1, P1);
483 if (dist2 < 0.2*tolerance)
485 mCurves[i].setVertex(-1, P2);
489 if (dist1 + dist2 < 3 * tol3)
494 qreal distance = BezierCurve::findDistance(newCurve, k, P, nearestPoint, t);
496 if (distance < tolerance)
506 dist1 = BezierCurve::eLength(Q - P1);
507 dist2 = BezierCurve::eLength(Q - P2);
508 if (dist1 < 0.2*tolerance)
510 mCurves[i].setVertex(mCurves.
at(i).getVertexSize() - 1, P1);
514 if (dist2 < 0.2*tolerance)
516 mCurves[i].setVertex(mCurves.
at(i).getVertexSize() - 1, P2);
520 if (dist1 + dist2 < 3 * tol3)
525 qreal distance = BezierCurve::findDistance(newCurve, k, Q, nearestPoint, t);
527 if (distance < tolerance)
539 for (
int j = 0; j < mCurves.
at(i).getVertexSize(); j++)
542 bool intersection = BezierCurve::findIntersection(newCurve, k, mCurves.
at(i), j, intersections);
546 QPointF intersectionPoint = intersections[0].point;
547 qreal t1 = intersections[0].t1;
548 qreal t2 = intersections[0].t2;
549 if (BezierCurve::eLength(intersectionPoint - newCurve.getVertex(k - 1)) <= 0.1*tolerance)
551 newCurve.setVertex(k - 1, intersectionPoint);
556 if (BezierCurve::eLength(intersectionPoint - newCurve.getVertex(k)) <= 0.1*tolerance)
558 newCurve.setVertex(k, intersectionPoint);
564 newCurve.addPoint(k, t1);
569 if (BezierCurve::eLength(intersectionPoint - mCurves.
at(i).getVertex(j - 1)) <= 0.1*tolerance)
571 mCurves[i].setVertex(j - 1, intersectionPoint);
576 if (BezierCurve::eLength(intersectionPoint - mCurves.
at(i).getVertex(j)) <= 0.1*tolerance)
578 mCurves[i].setVertex(j, intersectionPoint);
594void VectorImage::select(
QRectF rectangle)
596 for (
int i = 0; i < mCurves.
size(); i++)
598 bool bSelected = mCurves[i].intersects(rectangle);
602 for (
int i = 0; i < mArea.
size(); i++)
604 bool b = rectangle.
contains(mArea[i].mPath.boundingRect());
619 mCurves[curveNumber].setSelected(YesOrNo);
622 mSelectionRect |= mCurves[curveNumber].getBoundingRect();
635 mCurves[curveNumber].setSelected(vertexNumber, YesOrNo);
637 if (YesOrNo) mSelectionRect |=
QRectF(vertex.
x(), vertex.
y(), 0.0, 0.0);
649 setSelected(vertexRef.curveNumber, vertexRef.vertexNumber, YesOrNo);
659 for (
int i = 0; i < curveList.
size(); i++)
672 for (
int i = 0; i < vertexList.
size(); i++)
685 mArea[areaNumber].setSelected(YesOrNo);
686 if (YesOrNo) mSelectionRect |= mArea[areaNumber].mPath.boundingRect();
697 return mArea[areaNumber].isSelected();
708 for (
int curveNum : curveNumbers)
714 filled = mCurves[curveNum].isFilled();
727 return mCurves[curveNumber].isSelected();
738 return mCurves[curveNumber].isSelected(vertexNumber);
748 return isSelected(vertexRef.curveNumber, vertexRef.vertexNumber);
759 for (
int i = 0; i < curveList.
size(); i++)
774 for (
int i = 0; i < vertexList.
size(); i++)
788 for (
int i = 0; i < mCurves.
size() && result == -1; i++)
802 for (
int i = 0; i < mArea.
size() && result == -1; i++)
814 for (
int i = 0; i < mCurves.
size(); i++)
818 mSelectionTransformation.
reset();
827 if (mCurves.
isEmpty())
return false;
828 for (
int curve = 0; curve < mCurves.
size(); curve++)
840 if (mCurves.
empty())
return;
841 for (
int i = 0; i < mCurves.
size(); i++)
843 mCurves[i].setSelected(
false);
845 for (
int i = 0; i < mArea.
size(); i++)
847 mArea[i].setSelected(
false);
849 mSelectionRect =
QRectF(0, 0, 0, 0);
850 mSelectionTransformation.
reset();
860 mSelectionRect = rectangle;
864QRectF VectorImage::getBoundsOfTransformedCurves()
const
867 for (
int i = 0; i < mCurves.
size(); i++)
870 if (mCurves.
at(i).isPartlySelected())
872 curve = mCurves[i].transformed(mSelectionTransformation);
873 bounds |= curve.getBoundingRect();
884 mSelectionRect =
QRectF(0, 0, 0, 0);
885 for (
int i = 0; i < mCurves.
size(); i++)
887 if (mCurves.
at(i).isPartlySelected())
888 mSelectionRect |= mCurves[i].getBoundingRect();
898 mSelectionTransformation = transform;
908 for (
int i = 0; i < mArea.
size(); i++)
917 for (
int i = 0; i < mCurves.
size(); i++)
922 for (
int j = 0; j < mArea.
size(); j++)
924 bool toBeDeleted =
false;
925 for (
int k = 0; k < mArea.
at(j).mVertex.size(); k++)
927 if (mArea.
at(j).mVertex[k].curveNumber == i) { toBeDeleted =
true; }
928 if (mArea.
at(j).mVertex[k].curveNumber > i)
930 mArea[j].mVertex[k].curveNumber = mArea[j].mVertex[k].curveNumber - 1;
954 for (
int j = 0; j < mArea.
size(); j++)
956 bool toBeDeleted =
false;
957 for (
int k = 0; k < mArea.
at(j).mVertex.size(); k++)
959 if (mArea.
at(j).mVertex[k].curveNumber == curve && mArea.
at(j).mVertex[k].vertexNumber == vertex) { toBeDeleted =
true; }
969 if (mCurves[curve].getVertexSize() > 1)
974 mCurves[curve].removeVertex(vertex);
977 for (
int j = 0; j < mArea.
size(); j++)
979 for (
int k = 0; k < mArea.
at(j).mVertex.size(); k++)
981 if (mArea.
at(j).mVertex[k].curveNumber == curve && mArea.
at(j).mVertex[k].vertexNumber > vertex) { mArea[j].mVertex[k].vertexNumber--; }
989 for (
int p = vertex; p < n; p++)
993 for (
int p = -1; p <= vertex; p++)
995 newCurve.removeVertex(-1);
998 if (newCurve.getVertexSize() > 0) mCurves.
append(newCurve);
1000 for (
int j = 0; j < mArea.
size(); j++)
1002 for (
int k = 0; k < mArea.
at(j).mVertex.size(); k++)
1004 if (mArea.
at(j).mVertex[k].curveNumber == curve && mArea.
at(j).mVertex[k].vertexNumber > vertex)
1006 mArea[j].mVertex[k].curveNumber = mCurves.
size() - 1;
1007 mArea[j].mVertex[k].vertexNumber = mArea[j].mVertex[k].vertexNumber - vertex - 1;
1031 for (
int i = 0; i < mCurves.
size(); i++)
1035 if (mCurves.
at(i).isSelected(m))
1050 mSelectionRect =
QRect(0, 0, 0, 0);
1051 int n = mCurves.
size();
1056 for (
int i = 0; i < vectorImage.mCurves.
size(); i++)
1059 if (!hasSelection || vectorImage.mCurves.
at(i).isSelected())
1061 mCurves.
append(vectorImage.mCurves.
at(i));
1062 selectedCurves << i;
1063 mSelectionRect |= vectorImage.mCurves[i].getBoundingRect();
1066 for (
int i = 0; i < vectorImage.mArea.
size(); i++)
1070 for (
int j = 0; j < newArea.mVertex.
size(); j++)
1072 int curveNumber = newArea.mVertex.
at(j).curveNumber;
1073 int vertexNumber = newArea.mVertex.
at(j).vertexNumber;
1077 if (!hasSelection || vectorImage.mCurves.
at(curveNumber).isSelected())
1079 newArea.mVertex[j] =
VertexRef(selectedCurves.
indexOf(curveNumber) + n, vertexNumber);
1086 if (ok) mArea.
append(newArea);
1100 if (areaNumber != -1)
1102 result = mArea[areaNumber].mColorNumber;
1116 result = mCurves[curve].getColorNumber();
1121bool VectorImage::isCurveVisible(
int curve)
1123 if (curve > -1 && curve < mCurves.
length())
1125 return !mCurves[curve].isInvisible();
1137 for (
int i = 0; i < mArea.
size(); i++)
1139 if (mArea[i].mColorNumber == index)
return true;
1141 for (
int i = 0; i < mCurves.
size(); i++)
1154 for (
int i = 0; i < mArea.
size(); i++)
1156 int colorNumber = mArea[i].getColorNumber();
1157 if (colorNumber >= index && colorNumber > 0) {
1158 mArea[i].decreaseColorNumber();
1161 for (
int i = 0; i < mCurves.
size(); i++)
1163 int colorNumber = mCurves[i].getColorNumber();
1164 if (colorNumber >= index && colorNumber > 0) {
1165 mCurves[i].decreaseColorNumber();
1170void VectorImage::moveColor(
int start,
int end)
1172 for(
int i=0; i< mArea.
size(); i++)
1174 if (mArea[i].
getColorNumber() == start) mArea[i].setColorNumber(end);
1176 for(
int i=0; i< mCurves.
size(); i++)
1178 if (mCurves[i].
getColorNumber() == start) mCurves[i].setColorNumber(end);
1193 bool showThinCurves,
1208 for (
int i = 0; i < mArea.
size(); i++)
1213 QColor color =
object.getColor(mArea[i].mColorNumber).color;
1239 curve.drawPath(painter,
object, mSelectionTransformation, simplified, showThinCurves);
1260 for (
int i = 0; i < mCurves.
size(); i++)
1262 if (mCurves.
at(i).getVertexSize() == 0)
1284 for (
int i = 0; i < mCurves.
size(); i++)
1286 if (mCurves.
at(i).isPartlySelected())
1288 mCurves[i].transform(transf);
1292 mSelectionTransformation.
reset();
1303 for (
int i = 0; i < mCurves.
size(); i++)
1305 if (mCurves.
at(i).isSelected()) mCurves[i].setColorNumber(colorNumber);
1316 for (
int i = 0; i < mArea.
size(); i++)
1318 if (mArea.
at(i).isSelected()) mArea[i].setColorNumber(colorNumber);
1329 for (
int i = 0; i < mCurves.
size(); i++)
1331 if (mCurves.
at(i).isSelected()) mCurves[i].setWidth(width);
1342 for (
int i = 0; i < mCurves.
size(); i++)
1344 if (mCurves.
at(i).isSelected()) mCurves[i].setFeather(feather);
1356 for (
int i = 0; i < mCurves.
size(); i++)
1369 for (
int i = 0; i < mCurves.
size(); i++)
1371 if (mCurves.
at(i).isSelected()) mCurves[i].setInvisibility(YesOrNo);
1382 for (
int i = 0; i < mCurves.
size(); i++)
1384 if (mCurves.
at(i).isSelected()) {
1385 mCurves[i].setVariableWidth(YesOrNo);
1400 for (
int j = 0; j < mCurves.
size(); j++)
1403 if (mCurves[j].isPartlySelected())
1405 myCurve = mCurves[j].transformed(mSelectionTransformation);
1409 myCurve = mCurves[j];
1411 if (myCurve.intersects(P1, maxDistance))
1415 mGetStrokedPath = myCurve.getStrokedPath(1.0,
true);
1437 for (
int vertexPoint = -1; vertexPoint < curve.getVertexSize(); vertexPoint++)
1439 P2 = curve.getVertex(vertexPoint);
1442 if (distance < minDistance)
1444 minDistance = distance;
1445 result =
VertexRef(curveNum, vertexPoint);
1462 maxDistance *= maxDistance;
1464 for (
int curve = 0; curve < mCurves.
size(); curve++)
1466 for (
int vertex = -1; vertex < mCurves.
at(curve).getVertexSize(); vertex++)
1470 if (distance < maxDistance)
1489 for (
int j = 0; j < listOfPoints->
size(); j++)
1493 if (distance < maxDistance)
1495 result.
append(listOfPoints->
at(j));
1534 for (
int j = 0; j < listOfPoints->
size(); j++)
1538 if (distance < maxDistance)
1540 result.
append(listOfPoints->
at(j));
1568 if (curveNumber > -1 && curveNumber < mCurves.
size())
1571 if (myCurve.isPartlySelected())
1573 myCurve = myCurve.transformed(mSelectionTransformation);
1576 if (vertexNumber > -2 && vertexNumber < myCurve.getVertexSize())
1578 result = myCurve.getVertex(vertexNumber);
1591 return getVertex(vertexRef.curveNumber, vertexRef.vertexNumber);
1603 if (curveNumber > -1 && curveNumber < mCurves.
size())
1606 if (myCurve.isPartlySelected()) myCurve = myCurve.transformed(mSelectionTransformation);
1607 if (vertexNumber > -1 && vertexNumber < myCurve.getVertexSize())
1609 result = myCurve.getC1(vertexNumber);
1622 return getC1(vertexRef.curveNumber, vertexRef.vertexNumber);
1634 if (curveNumber > -1 && curveNumber < mCurves.
size())
1637 if (myCurve.isPartlySelected()) myCurve = myCurve.transformed(mSelectionTransformation);
1638 if (vertexNumber > -1 && vertexNumber < myCurve.getVertexSize())
1640 result = myCurve.getC2(vertexNumber);
1653 return getC2(vertexRef.curveNumber, vertexRef.vertexNumber);
1665 if (curveNumber > -1 && curveNumber < mCurves.
size())
1669 for (
int k = -1; k < myCurve.getVertexSize(); k++)
1672 result.
append(vertexRef);
1686 for (
int j = 0; j < mCurves.
size(); j++)
1688 for (
int k = -1; k < mCurves.
at(j).getVertexSize(); k++)
1691 result.
append(vertexRef);
1705 if (curveNumber > -1 && curveNumber < mCurves.
size())
1707 return mCurves.
at(curveNumber).getVertexSize();
1722 for (
int curve = 0; curve < mCurves.
size(); curve++)
1726 curves.
append(mCurves[curve]);
1739 for (
int curve = 0; curve < mCurves.
size(); curve++)
1756 for (
int curve = 0; curve < mCurves.
size(); curve++)
1773 for (
int i = 0; i < mArea.
size(); i++)
1775 if (mArea[i].mPath.controlPointRect().
contains(currentPoint))
1798 for (
int i = 0; i < vertexList.
size(); i++)
1803 if (vertex.curveNumber != -1 && !vertexPath.
contains(vertex))
1805 vertexPath.
append(vertex);
1813 mCurves[curveNumbers[curve]].setFilled(
true);
1836 for (
QPointF point : contourPath) {
1839 if (vertex.curveNumber != -1 && !vertexPath.
contains(vertex)) {
1840 vertexPath.
append(vertex);
2225 mArea.
append(bezierArea);
2237 for (
int i = 0; i < mArea.
size() && result == -1; i++)
2239 if (mArea[i].mPath.controlPointRect().
contains(point))
2241 if (mArea[i].mPath.
contains(point))
2265 return !mCurves.
isEmpty() ? mCurves.
size() - 1 : 0;
2286 for (
int i = maxAreaNumber; i > -1 && result == -1; i--)
2288 if (mArea[i].mPath.controlPointRect().
contains(point))
2290 if (mArea[i].mPath.
contains(point))
2307 if (areaNumber != -1)
2333 for (
int i = 0; i < bezierArea.mVertex.
size(); i++)
2345 if (bezierArea.mVertex[i - 1].curveNumber == bezierArea.mVertex[i].curveNumber)
2347 if (bezierArea.mVertex[i - 1].vertexNumber < bezierArea.mVertex[i].vertexNumber)
2349 myC1 =
getC1(bezierArea.mVertex[i]);
2350 myC2 =
getC2(bezierArea.mVertex[i]);
2354 myC1 =
getC2(bezierArea.mVertex[i - 1]);
2355 myC2 =
getC1(bezierArea.mVertex[i - 1]);
2357 newPath.
cubicTo(myC1, myC2, myPoint);
2361 if (bezierArea.mVertex[i].vertexNumber == -1)
2373 bezierArea.mPath = newPath;
2403 QRectF rect = updatedCurve.getBoundingRect();
2408 int widthFromLeft = ((topLeft.
x() * -1) * 2) + 2;
2410 if (widthFromLeft > mSize.
width())
2415 int widthFromRight = (bottomRight.
x() * 2) + 2;
2417 if (widthFromRight > mSize.
width())
2422 int heightFromTop = ((topLeft.
y() * -1) * 2) + 2;
2424 if (heightFromTop > mSize.
height())
2429 int heightFromBottom = (bottomRight.
y() * 2) + 2;
2431 if (heightFromBottom > mSize.
height())
void applyInvisibilityToSelection(bool YesOrNo)
VectorImage::applyInvisibilityToSelection.
void applyColorToSelectedArea(int colorNumber)
VectorImage::applyColorToSelectedArea.
void addArea(BezierArea bezierArea)
VectorImage::addArea.
VertexRef getClosestVertexTo(const BezierCurve &curve, int curveNum, QPointF thisPoint)
VectorImage::getClosestVertexTo.
qreal getDistance(VertexRef r1, VertexRef r2)
VectorImage::getDistance.
void applyFeatherToSelection(qreal feather)
VectorImage::applyFeatherToSelection.
BezierCurve getLastCurve()
VectorImage::getLastCurve.
void updateArea(BezierArea &bezierArea)
VectorImage::updateArea.
void fillSelectedPath(int color)
VectorImage::fillSelectedPath.
Status createDomElement(QXmlStreamWriter &doc)
VectorImage::createDomElement.
QList< VertexRef > getCurveVertices(int curveNumber)
VectorImage::getCurveVertices.
void removeArea(QPointF point)
VectorImage::removeArea.
void deselectAll()
VectorImage::deselectAll.
void loadDomElement(QDomElement element)
VectorImage::loadDomElement.
int getNumOfCurvesSelected()
VectorImage::numOfCurvesSelected.
bool isAreaSelected(int areaNumber)
VectorImage::isAreaSelected.
void paste(VectorImage &)
VectorImage::paste.
QList< int > getSelectedCurveNumbers()
VectorImage::getSelectedCurveNumber.
void applyVariableWidthToSelection(bool YesOrNo)
VectorImage::applyVariableWidthToSelection.
void removeCurveAt(int i)
VectorImage::removeCurveAt.
void setSelected(int curveNumber, bool YesOrNo)
VectorImage::setSelected.
void paintImage(QPainter &painter, const Object &object, bool simplified, bool showThinCurves, bool antialiasing)
VectorImage::paintImage.
void calculateSelectionRect()
VectorImage::calculateSelectionRect.
int getLastCurveNumber()
VectorImage::getLastCurveNumber.
void removeAreaInCurve(int curve, int areaNumber)
VectorImage::removeAreaInCurve.
bool isPathFilled()
VectorImage::isPathFilled.
void applyColorToSelectedCurve(int colorNumber)
VectorImage::applyColorToSelectedCurve.
BezierArea getSelectedArea(QPointF currentPoint)
VectorImage::getSelectedArea.
bool usesColor(int index)
VectorImage::usesColor.
void addCurve(BezierCurve &newCurve, qreal factor, bool interacts=true)
VectorImage::addCurve.
QPointF getC1(int curveNumber, int vertexNumber)
VectorImage::getC1.
void addPoint(int curveNumber, int vertexNumber, qreal fraction)
VectorImage::addPoint.
QList< VertexRef > getAllVertices()
VectorImage::getAllVertices.
int getColorNumber(QPointF point)
VectorImage::getColorNumber.
void removeVertex(int curve, int vertex)
VectorImage::removeVertex.
void removeColor(int index)
VectorImage::removeColor.
bool read(QString filePath)
VectorImage::read.
void fillContour(QList< QPointF > contourPath, int color)
VectorImage::fillContour.
void checkCurveExtremity(BezierCurve &newCurve, qreal tolerance)
VectorImage::checkCurveExtremity.
Status write(QString filePath, QString format)
VectorImage::write.
void applyWidthToSelection(qreal width)
VectorImage::applyWidthToSelection.
int getLastAreaNumber(QPointF point)
VectorImage::getLastAreaNumber.
int getFirstSelectedArea()
VectorImage::getFirstSelectedArea.
void selectAll()
VectorImage::selectAll.
QList< VertexRef > getAndRemoveVerticesCloseTo(QPointF thisPoint, qreal maxDistance, QList< VertexRef > *listOfPoints)
VectorImage::getAndRemoveVerticesCloseTo.
int getCurvesColor(int curve)
VectorImage::getCurvesColor.
QPointF getC2(int curveNumber, int vertexNumber)
VectorImage::getC2.
QList< BezierCurve > getSelectedCurves()
VectorImage::getSelectedCurve.
void applyOpacityToSelection(qreal opacity)
VectorImage::applyOpacityToSelection.
int getFirstSelectedCurve()
VectorImage::getFirstSelectedCurve.
void checkCurveIntersections(BezierCurve &newCurve, qreal tolerance)
VectorImage::checkCurveIntersections.
QPointF getVertex(int curveNumber, int vertexNumber)
VectorImage::getVertex.
void clear()
VectorImage::clear.
void deleteSelectedPoints()
VectorImage::deleteSelectedPoints.
void clean()
VectorImage::clean.
void setAreaSelected(int areaNumber, bool YesOrNo)
VectorImage::setAreaSelected.
void insertCurve(int position, BezierCurve &newCurve, qreal factor, bool interacts)
VectorImage::insertCurve.
void applySelectionTransformation()
VectorImage::applySelectionTransformation.
void setSelectionTransformation(QTransform transform)
VectorImage::setSelectionTransformation.
void setSelectionRect(QRectF rectange)
VectorImage::setSelectionRect.
int getFirstAreaNumber(QPointF point)
VectorImage::getFirstAreaNumber.
QList< VertexRef > getVerticesCloseTo(QPointF thisPoint, qreal maxDistance)
VectorImage::getVerticesCloseTo.
bool isAnyCurveSelected()
VectorImage::isAnyCurveSelected.
bool isSelected(int curveNumber)
VectorImage::isSelected.
QList< int > getCurvesCloseTo(QPointF thisPoint, qreal maxDistance)
VectorImage::getCurvesCloseTo.
void updateImageSize(BezierCurve &updatedCurve)
VectorImage::updateImageSize.
int getCurveSize(int curveNumber)
VectorImage::getCurveSize.
void deleteSelection()
VectorImage::deleteSelection.
QDomDocumentType doctype() const const
QDomElement documentElement() const const
bool setContent(const QByteArray &data, bool namespaceProcessing, QString *errorMsg, int *errorLine, int *errorColumn)
QString name() const const
QString attribute(const QString &name, const QString &defValue) const const
QString tagName() const const
QDomNode firstChild() const const
bool isNull() const const
QDomNode nextSibling() const const
QDomElement toElement() const const
virtual bool open(QIODevice::OpenMode mode) override
QFileDevice::FileError error() const const
QString errorString() const const
void append(const T &value)
const T & at(int i) const const
bool contains(const T &value) const const
int indexOf(const T &value, int from) const const
void insert(int i, const T &value)
bool isEmpty() const const
QPaintDevice * device() const const
void drawPath(const QPainterPath &path)
void setBrush(const QBrush &brush)
void setClipping(bool enable)
void setPen(const QColor &color)
void setRenderHint(QPainter::RenderHint hint, bool on)
void setWorldMatrixEnabled(bool enable)
void cubicTo(const QPointF &c1, const QPointF &c2, const QPointF &endPoint)
void lineTo(const QPointF &endPoint)
void moveTo(const QPointF &point)
void setFillRule(Qt::FillRule fillRule)
qreal dotProduct(const QPointF &p1, const QPointF &p2)
QPoint toPoint() const const
QPointF bottomRight() const const
bool contains(const QRectF &rectangle) const const
QPointF topLeft() const const
void setHeight(int height)
QString & append(QChar ch)
QString arg(qlonglong a, int fieldWidth, int base, QChar fillChar) const const
void writeAttribute(const QString &qualifiedName, const QString &value)
void writeDTD(const QString &dtd)
void writeStartDocument()
void writeStartElement(const QString &qualifiedName)