Parameterize your clothoid curve such that you can obtain the x(t) and y(t) coordinates for a parameter t in [0:1] where 0 is the starting point and the 1 is the last point of your curve. Then you can simply draw your curve in the paint event of a widget like this:
{
painter.setPen(Qt::blue);
for (double t = 0; t <= 1; t = t+0.01)
painter.
drawLine(QLineF(x
(t
), y
(t
), x
(t
+0.01), y
(t
+0.01));
}
void SimpleExampleWidget::paintEvent(QPaintEvent *)
{
QPainter painter(this);
painter.setPen(Qt::blue);
for (double t = 0; t <= 1; t = t+0.01)
painter.drawLine(QLineF(x(t), y(t), x(t+0.01), y(t+0.01));
}
To copy to clipboard, switch view to plain text mode
Bookmarks