Results 1 to 7 of 7

Thread: drawing clothoid segments

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Jul 2011
    Posts
    16
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: drawing clothoid segments

    When you were saying plotting curves myself did you have some method in mind? Or were you referring to the QWT library?

  2. #2
    Join Date
    Apr 2010
    Posts
    769
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    1
    Thanked 94 Times in 86 Posts

    Default Re: drawing clothoid segments

    Either way. You can plot points (or, more likely, line segments) in QPainter, or you can embed a Qwt plot in your UI.

  3. #3
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Thanks
    101
    Thanked 15 Times in 15 Posts

    Default Re: drawing clothoid segments

    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:

    Qt Code:
    1. void SimpleExampleWidget::paintEvent(QPaintEvent *)
    2. {
    3. QPainter painter(this);
    4. painter.setPen(Qt::blue);
    5.  
    6. for (double t = 0; t <= 1; t = t+0.01)
    7. painter.drawLine(QLineF(x(t), y(t), x(t+0.01), y(t+0.01));
    8. }
    To copy to clipboard, switch view to plain text mode 

Similar Threads

  1. Drawing multiple line segments
    By twells5 in forum Qt Programming
    Replies: 8
    Last Post: 3rd June 2011, 14:23
  2. Qt Drawing
    By Talguy in forum Newbie
    Replies: 4
    Last Post: 12th January 2011, 04:14
  3. Help drawing a gui
    By franco.amato in forum Qt Programming
    Replies: 16
    Last Post: 7th October 2010, 11:26
  4. Replies: 1
    Last Post: 6th May 2009, 15:29
  5. Drawing an arc.
    By munna in forum Qt Programming
    Replies: 6
    Last Post: 13th June 2006, 05:36

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Qt is a trademark of The Qt Company.