41 if (simpleControlPoints.size() == 2)
44 path.moveTo(simpleControlPoints.first());
45 path.lineTo(simpleControlPoints.last());
47 else if (simpleControlPoints.size() == 3)
50 path.moveTo(simpleControlPoints.first());
51 path.quadTo(simpleControlPoints.at(1),
52 simpleControlPoints.last());
57 path = complexPath(simpleControlPoints);
106 assert((fullControlPoints.size() % 3 == 1) && (fullControlPoints.size() > 3));
108 QPainterPath path {fullControlPoints.at(0)};
110 for (
int i = 1; i < fullControlPoints.size(); i += 3)
112 assert(i + 2 < fullControlPoints.size());
114 path.cubicTo(fullControlPoints.at(i), fullControlPoints.at(i + 1), fullControlPoints.at(i + 2));
132 QPointF direction = end - start;
133 QPointF middle = start + 0.5 * direction;
139 armarx::QPoint4Array armarx::SplinePath::smoothTransition(QPointF start, QPointF middle, QPointF end)
141 QPointF parallelLine = end - start;
144 QPointF new1 = middle - relativeDistance * parallelLine;
145 QPointF new2 = middle + relativeDistance * parallelLine;
151 void armarx::SplinePath::pathToString(QPainterPath path)
154 for (
size_t i = 0; i < static_cast<size_t>(path.elementCount()); i++)
156 QPainterPath::Element elem = path.elementAt(i);
162 case QPainterPath::MoveToElement:
168 case QPainterPath::LineToElement:
174 case QPainterPath::CurveToElement:
184 if (elem.type != QPainterPath::CurveToDataElement)