17#include "vectorimage.h"
24#include <QXmlStreamWriter>
29VectorImage::VectorImage()
39 mOpacity = v2.mOpacity;
42VectorImage::~VectorImage()
54 KeyFrame::operator=(a);
57 mOpacity = a.mOpacity;
90 if (type.
name() !=
"PencilVectorImage")
return false;
93 if (element.
tagName() ==
"image")
95 if (element.
attribute(
"type") ==
"vector")
101 setFileName(filePath);
115 debugInfo <<
"VectorImage::write";
119 QFile file(filePath);
123 qDebug() <<
"VectorImage - Cannot write file" << filePath << file.
error();
124 debugInfo << (
"file.error() = " + file.
errorString());
125 return Status(Status::FAIL, debugInfo);
130 debugInfo <<
"Unrecognized format";
131 return Status(Status::FAIL, debugInfo);
137 xmlStream.
writeDTD(
"<!DOCTYPE PencilVectorImage>");
145 debugInfo.collect(st.details());
146 debugInfo <<
"- xml creation failed";
147 return Status(Status::FAIL, debugInfo);
152 setFileName(filePath);
164 debugInfo <<
"VectorImage::createDomElement";
166 for (
int i = 0; i < mCurves.
size(); i++)
168 Status st = mCurves[i].createDomElement(xmlStream);
171 debugInfo.collect(st.details());
172 debugInfo <<
QString(
"- m_curves[%1] failed to write").
arg(i);
173 return Status(Status::FAIL, debugInfo);
176 for (
int i = 0; i < mArea.
size(); i++)
178 Status st = mArea[i].createDomElement(xmlStream);
181 debugInfo.collect(st.details());
182 debugInfo <<
QString(
"- area[%1] failed to write").
arg(i);
183 return Status(Status::FAIL, debugInfo);
199 if (!atomElement.
isNull())
201 if (atomElement.
tagName() ==
"curve")
204 newCurve.loadDomElement(atomElement);
207 if (atomElement.
tagName() ==
"area")
210 newArea.loadDomElement(atomElement);
232 mCurves[curveNumber].addPoint(vertexNumber, fraction);
234 for (
int j = 0; j < mArea.
size(); j++)
237 for (
int k = 0; k < mArea.
at(j).mVertex.size(); k++)
239 if (mArea[j].getVertexRef(k).curveNumber == curveNumber)
241 if (mArea[j].getVertexRef(k).vertexNumber >= vertexNumber)
243 mArea[j].mVertex[k].vertexNumber++;
248 for (
int k = 1; k < mArea.
at(j).mVertex.size(); k++)
250 if (
VertexRef(curveNumber, vertexNumber + 1) == mArea.
at(j).mVertex.
at(k))
252 if (
VertexRef(curveNumber, vertexNumber - 1) == mArea.
at(j).mVertex.
at(k - 1))
257 if (
VertexRef(curveNumber, vertexNumber - 1) == mArea.
at(j).mVertex.
at(k))
259 if (
VertexRef(curveNumber, vertexNumber + 1) == mArea.
at(j).mVertex.
at(k - 1))
276 for (
int j = 0; j < mArea.
size(); j++)
278 for (
int k = 0; k < mArea.
at(j).mVertex.size(); k++)
280 if (mArea.
at(j).mVertex[k].curveNumber > i) { mArea[j].mVertex[k].curveNumber--; }
297 if (newCurve.getVertexSize() < 1)
304 qreal tol = qMax(newCurve.getWidth() / factor, 3.0 / factor);
313 if (position < 0 || position > mCurves.
size() - 1)
320 for (
int i = 0; i < mArea.
size(); i++)
322 for (
int j = 0; j < mArea.
at(i).mVertex.size(); j++)
324 if (mArea.
at(i).mVertex[j].curveNumber >= position) {
325 mArea[i].mVertex[j].curveNumber++;
329 mCurves.
insert(position, newCurve);
354 QPointF P = newCurve.getVertex(-1);
355 QPointF Q = newCurve.getVertex(newCurve.getVertexSize() - 1);
356 if (BezierCurve::eLength(P - Q) < tolerance)
358 newCurve.setVertex(newCurve.getVertexSize() - 1, P);
362 for (
int i = 0; i < mCurves.
size(); i++)
364 for (
int j = 0; j < mCurves.
at(i).getVertexSize(); j++)
366 QPointF P = newCurve.getVertex(-1);
367 QPointF Q = newCurve.getVertex(newCurve.getVertexSize() - 1);
368 QPointF P1 = mCurves.
at(i).getVertex(j - 1);
370 qreal tol3 = 2.0*sqrt(0.25*((P1 - P2).x()*(P1 - P2).x() + (P1 - P2).y()*(P1 - P2).y()) + tolerance*tolerance);
371 qreal dist1 = BezierCurve::eLength(P - P1);
372 qreal dist2 = BezierCurve::eLength(P - P2);
373 if (dist1 <= 0.2*tolerance)
375 newCurve.setVertex(-1, P1);
379 if (dist2 <= 0.2*tolerance)
381 newCurve.setVertex(-1, P2);
385 if (dist1 + dist2 <= 3 * tol3)
389 qreal distance = BezierCurve::findDistance(mCurves[i], j, P, nearestPoint, t);
390 if (distance < tolerance)
392 newCurve.setOrigin(nearestPoint);
399 dist1 = BezierCurve::eLength(Q - P1);
400 dist2 = BezierCurve::eLength(Q - P2);
401 if (dist1 <= 0.2*tolerance)
403 newCurve.setLastVertex(P1);
407 if (dist2 <= 0.2*tolerance)
409 newCurve.setLastVertex(P2);
413 if (dist1 + dist2 <= 3 * tol3)
417 qreal distance = BezierCurve::findDistance(mCurves[i], j, Q, nearestPoint, t);
418 if (distance < tolerance)
420 newCurve.setLastVertex(nearestPoint);
440 for (
int k = 0; k < newCurve.getVertexSize(); k++)
442 for (
int j = k + 1; j < newCurve.getVertexSize(); j++)
445 bool intersection = BezierCurve::findIntersection(newCurve, k, newCurve, j, intersections);
450 newCurve.addPoint(k, intersections[0].t1);
454 newCurve.addPoint(j, intersections[0].t2);
461 for (
int k = 0; k < newCurve.getVertexSize(); k++)
467 for (
int i = 0; i < mCurves.
size(); i++)
471 QPointF Q = mCurves.
at(i).getVertex(mCurves.
at(i).getVertexSize() - 1);
472 QPointF P1 = newCurve.getVertex(k - 1);
473 QPointF P2 = newCurve.getVertex(k);
474 qreal tol3 = 2.0*sqrt(0.25*((P1 - P2).x()*(P1 - P2).x() + (P1 - P2).y()*(P1 - P2).y()) + tolerance*tolerance);
475 qreal dist1 = BezierCurve::eLength(P - P1);
476 qreal dist2 = BezierCurve::eLength(P - P2);
478 if (dist1 < 0.2*tolerance)
480 mCurves[i].setVertex(-1, P1);
484 if (dist2 < 0.2*tolerance)
486 mCurves[i].setVertex(-1, P2);
490 if (dist1 + dist2 < 3 * tol3)
495 qreal distance = BezierCurve::findDistance(newCurve, k, P, nearestPoint, t);
497 if (distance < tolerance)
507 dist1 = BezierCurve::eLength(Q - P1);
508 dist2 = BezierCurve::eLength(Q - P2);
509 if (dist1 < 0.2*tolerance)
511 mCurves[i].setVertex(mCurves.
at(i).getVertexSize() - 1, P1);
515 if (dist2 < 0.2*tolerance)
517 mCurves[i].setVertex(mCurves.
at(i).getVertexSize() - 1, P2);
521 if (dist1 + dist2 < 3 * tol3)
526 qreal distance = BezierCurve::findDistance(newCurve, k, Q, nearestPoint, t);
528 if (distance < tolerance)
540 for (
int j = 0; j < mCurves.
at(i).getVertexSize(); j++)
543 bool intersection = BezierCurve::findIntersection(newCurve, k, mCurves.
at(i), j, intersections);
547 QPointF intersectionPoint = intersections[0].point;
548 qreal t1 = intersections[0].t1;
549 qreal t2 = intersections[0].t2;
550 if (BezierCurve::eLength(intersectionPoint - newCurve.getVertex(k - 1)) <= 0.1*tolerance)
552 newCurve.setVertex(k - 1, intersectionPoint);
557 if (BezierCurve::eLength(intersectionPoint - newCurve.getVertex(k)) <= 0.1*tolerance)
559 newCurve.setVertex(k, intersectionPoint);
565 newCurve.addPoint(k, t1);
570 if (BezierCurve::eLength(intersectionPoint - mCurves.
at(i).getVertex(j - 1)) <= 0.1*tolerance)
572 mCurves[i].setVertex(j - 1, intersectionPoint);
577 if (BezierCurve::eLength(intersectionPoint - mCurves.
at(i).getVertex(j)) <= 0.1*tolerance)
579 mCurves[i].setVertex(j, intersectionPoint);
595void VectorImage::select(
QRectF rectangle)
597 for (
int i = 0; i < mCurves.
size(); i++)
599 bool bSelected = mCurves[i].intersects(rectangle);
603 for (
int i = 0; i < mArea.
size(); i++)
605 bool b = rectangle.
contains(mArea[i].mPath.boundingRect());
620 mCurves[curveNumber].setSelected(YesOrNo);
623 mSelectionRect |= mCurves[curveNumber].getBoundingRect();
636 mCurves[curveNumber].setSelected(vertexNumber, YesOrNo);
638 if (YesOrNo) mSelectionRect |=
QRectF(vertex.
x(), vertex.
y(), 0.0, 0.0);
650 setSelected(vertexRef.curveNumber, vertexRef.vertexNumber, YesOrNo);
660 for (
int i = 0; i < curveList.
size(); i++)
673 for (
int i = 0; i < vertexList.
size(); i++)
686 mArea[areaNumber].setSelected(YesOrNo);
687 if (YesOrNo) mSelectionRect |= mArea[areaNumber].mPath.boundingRect();
698 return mArea[areaNumber].isSelected();
709 for (
int curveNum : curveNumbers)
715 filled = mCurves[curveNum].isFilled();
728 return mCurves[curveNumber].isSelected();
739 return mCurves[curveNumber].isSelected(vertexNumber);
749 return isSelected(vertexRef.curveNumber, vertexRef.vertexNumber);
760 for (
int i = 0; i < curveList.
size(); i++)
775 for (
int i = 0; i < vertexList.
size(); i++)
789 for (
int i = 0; i < mCurves.
size() && result == -1; i++)
803 for (
int i = 0; i < mArea.
size() && result == -1; i++)
815 for (
int i = 0; i < mCurves.
size(); i++)
819 mSelectionTransformation.
reset();
828 if (mCurves.
isEmpty())
return false;
829 for (
int curve = 0; curve < mCurves.
size(); curve++)
841 if (mCurves.
empty())
return;
842 for (
int i = 0; i < mCurves.
size(); i++)
844 mCurves[i].setSelected(
false);
846 for (
int i = 0; i < mArea.
size(); i++)
848 mArea[i].setSelected(
false);
850 mSelectionRect =
QRectF(0, 0, 0, 0);
851 mSelectionTransformation.
reset();
861 mSelectionRect = rectangle;
865QRectF VectorImage::getBoundsOfTransformedCurves()
const
868 for (
int i = 0; i < mCurves.
size(); i++)
871 if (mCurves.
at(i).isPartlySelected())
873 curve = mCurves[i].transformed(mSelectionTransformation);
874 bounds |= curve.getBoundingRect();
885 mSelectionRect =
QRectF(0, 0, 0, 0);
886 for (
int i = 0; i < mCurves.
size(); i++)
888 if (mCurves.
at(i).isPartlySelected())
889 mSelectionRect |= mCurves[i].getBoundingRect();
899 mSelectionTransformation = transform;
909 for (
int i = 0; i < mArea.
size(); i++)
918 for (
int i = 0; i < mCurves.
size(); i++)
923 for (
int j = 0; j < mArea.
size(); j++)
925 bool toBeDeleted =
false;
926 for (
int k = 0; k < mArea.
at(j).mVertex.size(); k++)
928 if (mArea.
at(j).mVertex[k].curveNumber == i) { toBeDeleted =
true; }
929 if (mArea.
at(j).mVertex[k].curveNumber > i)
931 mArea[j].mVertex[k].curveNumber = mArea[j].mVertex[k].curveNumber - 1;
955 for (
int j = 0; j < mArea.
size(); j++)
957 bool toBeDeleted =
false;
958 for (
int k = 0; k < mArea.
at(j).mVertex.size(); k++)
960 if (mArea.
at(j).mVertex[k].curveNumber == curve && mArea.
at(j).mVertex[k].vertexNumber == vertex) { toBeDeleted =
true; }
970 if (mCurves[curve].getVertexSize() > 1)
975 mCurves[curve].removeVertex(vertex);
978 for (
int j = 0; j < mArea.
size(); j++)
980 for (
int k = 0; k < mArea.
at(j).mVertex.size(); k++)
982 if (mArea.
at(j).mVertex[k].curveNumber == curve && mArea.
at(j).mVertex[k].vertexNumber > vertex) { mArea[j].mVertex[k].vertexNumber--; }
990 for (
int p = vertex; p < n; p++)
994 for (
int p = -1; p <= vertex; p++)
996 newCurve.removeVertex(-1);
999 if (newCurve.getVertexSize() > 0) mCurves.
append(newCurve);
1001 for (
int j = 0; j < mArea.
size(); j++)
1003 for (
int k = 0; k < mArea.
at(j).mVertex.size(); k++)
1005 if (mArea.
at(j).mVertex[k].curveNumber == curve && mArea.
at(j).mVertex[k].vertexNumber > vertex)
1007 mArea[j].mVertex[k].curveNumber = mCurves.
size() - 1;
1008 mArea[j].mVertex[k].vertexNumber = mArea[j].mVertex[k].vertexNumber - vertex - 1;
1032 for (
int i = 0; i < mCurves.
size(); i++)
1036 if (mCurves.
at(i).isSelected(m))
1051 mSelectionRect =
QRect(0, 0, 0, 0);
1052 int n = mCurves.
size();
1057 for (
int i = 0; i < vectorImage.mCurves.
size(); i++)
1060 if (!hasSelection || vectorImage.mCurves.
at(i).isSelected())
1062 mCurves.
append(vectorImage.mCurves.
at(i));
1063 selectedCurves << i;
1064 mSelectionRect |= vectorImage.mCurves[i].getBoundingRect();
1067 for (
int i = 0; i < vectorImage.mArea.
size(); i++)
1071 for (
int j = 0; j < newArea.mVertex.
size(); j++)
1073 int curveNumber = newArea.mVertex.
at(j).curveNumber;
1074 int vertexNumber = newArea.mVertex.
at(j).vertexNumber;
1078 if (!hasSelection || vectorImage.mCurves.
at(curveNumber).isSelected())
1080 newArea.mVertex[j] =
VertexRef(selectedCurves.
indexOf(curveNumber) + n, vertexNumber);
1087 if (ok) mArea.
append(newArea);
1101 if (areaNumber != -1)
1103 result = mArea[areaNumber].mColorNumber;
1117 result = mCurves[curve].getColorNumber();
1122bool VectorImage::isCurveVisible(
int curve)
1124 if (curve > -1 && curve < mCurves.
length())
1126 return !mCurves[curve].isInvisible();
1138 for (
int i = 0; i < mArea.
size(); i++)
1140 if (mArea[i].mColorNumber == index)
return true;
1142 for (
int i = 0; i < mCurves.
size(); i++)
1155 for (
int i = 0; i < mArea.
size(); i++)
1157 int colorNumber = mArea[i].getColorNumber();
1158 if (colorNumber >= index && colorNumber > 0) {
1159 mArea[i].decreaseColorNumber();
1162 for (
int i = 0; i < mCurves.
size(); i++)
1164 int colorNumber = mCurves[i].getColorNumber();
1165 if (colorNumber >= index && colorNumber > 0) {
1166 mCurves[i].decreaseColorNumber();
1171void VectorImage::moveColor(
int start,
int end)
1173 for(
int i=0; i< mArea.
size(); i++)
1175 if (mArea[i].
getColorNumber() == start) mArea[i].setColorNumber(end);
1177 for(
int i=0; i< mCurves.
size(); i++)
1179 if (mCurves[i].
getColorNumber() == start) mCurves[i].setColorNumber(end);
1194 bool showThinCurves,
1209 for (
int i = 0; i < mArea.
size(); i++)
1214 QColor color =
object.getColor(mArea[i].mColorNumber).color;
1240 curve.drawPath(painter,
object, mSelectionTransformation, simplified, showThinCurves);
1261 for (
int i = 0; i < mCurves.
size(); i++)
1263 if (mCurves.
at(i).getVertexSize() == 0)
1285 for (
int i = 0; i < mCurves.
size(); i++)
1287 if (mCurves.
at(i).isPartlySelected())
1289 mCurves[i].transform(transf);
1293 mSelectionTransformation.
reset();
1304 for (
int i = 0; i < mCurves.
size(); i++)
1306 if (mCurves.
at(i).isSelected()) mCurves[i].setColorNumber(colorNumber);
1317 for (
int i = 0; i < mArea.
size(); i++)
1319 if (mArea.
at(i).isSelected()) mArea[i].setColorNumber(colorNumber);
1330 for (
int i = 0; i < mCurves.
size(); i++)
1332 if (mCurves.
at(i).isSelected()) mCurves[i].setWidth(width);
1343 for (
int i = 0; i < mCurves.
size(); i++)
1345 if (mCurves.
at(i).isSelected()) mCurves[i].setFeather(feather);
1357 for (
int i = 0; i < mCurves.
size(); i++)
1370 for (
int i = 0; i < mCurves.
size(); i++)
1372 if (mCurves.
at(i).isSelected()) mCurves[i].setInvisibility(YesOrNo);
1383 for (
int i = 0; i < mCurves.
size(); i++)
1385 if (mCurves.
at(i).isSelected()) {
1386 mCurves[i].setVariableWidth(YesOrNo);
1401 for (
int j = 0; j < mCurves.
size(); j++)
1404 if (mCurves[j].isPartlySelected())
1406 myCurve = mCurves[j].transformed(mSelectionTransformation);
1410 myCurve = mCurves[j];
1412 if (myCurve.intersects(P1, maxDistance))
1416 mGetStrokedPath = myCurve.getStrokedPath(1.0,
true);
1438 for (
int vertexPoint = -1; vertexPoint < curve.getVertexSize(); vertexPoint++)
1440 P2 = curve.getVertex(vertexPoint);
1443 if (distance < minDistance)
1445 minDistance = distance;
1446 result =
VertexRef(curveNum, vertexPoint);
1463 maxDistance *= maxDistance;
1465 for (
int curve = 0; curve < mCurves.
size(); curve++)
1467 for (
int vertex = -1; vertex < mCurves.
at(curve).getVertexSize(); vertex++)
1471 if (distance < maxDistance)
1490 for (
int j = 0; j < listOfPoints->
size(); j++)
1494 if (distance < maxDistance)
1496 result.
append(listOfPoints->
at(j));
1535 for (
int j = 0; j < listOfPoints->
size(); j++)
1539 if (distance < maxDistance)
1541 result.
append(listOfPoints->
at(j));
1569 if (curveNumber > -1 && curveNumber < mCurves.
size())
1572 if (myCurve.isPartlySelected())
1574 myCurve = myCurve.transformed(mSelectionTransformation);
1577 if (vertexNumber > -2 && vertexNumber < myCurve.getVertexSize())
1579 result = myCurve.getVertex(vertexNumber);
1592 return getVertex(vertexRef.curveNumber, vertexRef.vertexNumber);
1604 if (curveNumber > -1 && curveNumber < mCurves.
size())
1607 if (myCurve.isPartlySelected()) myCurve = myCurve.transformed(mSelectionTransformation);
1608 if (vertexNumber > -1 && vertexNumber < myCurve.getVertexSize())
1610 result = myCurve.getC1(vertexNumber);
1623 return getC1(vertexRef.curveNumber, vertexRef.vertexNumber);
1635 if (curveNumber > -1 && curveNumber < mCurves.
size())
1638 if (myCurve.isPartlySelected()) myCurve = myCurve.transformed(mSelectionTransformation);
1639 if (vertexNumber > -1 && vertexNumber < myCurve.getVertexSize())
1641 result = myCurve.getC2(vertexNumber);
1654 return getC2(vertexRef.curveNumber, vertexRef.vertexNumber);
1666 if (curveNumber > -1 && curveNumber < mCurves.
size())
1670 for (
int k = -1; k < myCurve.getVertexSize(); k++)
1673 result.
append(vertexRef);
1687 for (
int j = 0; j < mCurves.
size(); j++)
1689 for (
int k = -1; k < mCurves.
at(j).getVertexSize(); k++)
1692 result.
append(vertexRef);
1706 if (curveNumber > -1 && curveNumber < mCurves.
size())
1708 return mCurves.
at(curveNumber).getVertexSize();
1723 for (
int curve = 0; curve < mCurves.
size(); curve++)
1727 curves.
append(mCurves[curve]);
1740 for (
int curve = 0; curve < mCurves.
size(); curve++)
1757 for (
int curve = 0; curve < mCurves.
size(); curve++)
1774 for (
int i = 0; i < mArea.
size(); i++)
1776 if (mArea[i].mPath.controlPointRect().
contains(currentPoint))
1799 for (
int i = 0; i < vertexList.
size(); i++)
1804 if (vertex.curveNumber != -1 && !vertexPath.
contains(vertex))
1806 vertexPath.
append(vertex);
1814 mCurves[curveNumbers[curve]].setFilled(
true);
1837 for (
QPointF point : contourPath) {
1840 if (vertex.curveNumber != -1 && !vertexPath.
contains(vertex)) {
1841 vertexPath.
append(vertex);
2226 mArea.
append(bezierArea);
2238 for (
int i = 0; i < mArea.
size() && result == -1; i++)
2240 if (mArea[i].mPath.controlPointRect().
contains(point))
2242 if (mArea[i].mPath.
contains(point))
2266 return !mCurves.
isEmpty() ? mCurves.
size() - 1 : 0;
2287 for (
int i = maxAreaNumber; i > -1 && result == -1; i--)
2289 if (mArea[i].mPath.controlPointRect().
contains(point))
2291 if (mArea[i].mPath.
contains(point))
2308 if (areaNumber != -1)
2334 for (
int i = 0; i < bezierArea.mVertex.
size(); i++)
2346 if (bezierArea.mVertex[i - 1].curveNumber == bezierArea.mVertex[i].curveNumber)
2348 if (bezierArea.mVertex[i - 1].vertexNumber < bezierArea.mVertex[i].vertexNumber)
2350 myC1 =
getC1(bezierArea.mVertex[i]);
2351 myC2 =
getC2(bezierArea.mVertex[i]);
2355 myC1 =
getC2(bezierArea.mVertex[i - 1]);
2356 myC2 =
getC1(bezierArea.mVertex[i - 1]);
2358 newPath.
cubicTo(myC1, myC2, myPoint);
2362 if (bezierArea.mVertex[i].vertexNumber == -1)
2374 bezierArea.mPath = newPath;
2404 QRectF rect = updatedCurve.getBoundingRect();
2409 int widthFromLeft = ((topLeft.
x() * -1) * 2) + 2;
2411 if (widthFromLeft > mSize.
width())
2416 int widthFromRight = (bottomRight.
x() * 2) + 2;
2418 if (widthFromRight > mSize.
width())
2423 int heightFromTop = ((topLeft.
y() * -1) * 2) + 2;
2425 if (heightFromTop > mSize.
height())
2430 int heightFromBottom = (bottomRight.
y() * 2) + 2;
2432 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)