Results 1 to 3 of 3

Thread: Draw a mesh using Qwt?

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Sep 2010
    Posts
    46
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Draw a mesh using Qwt?

    Hello,

    I need to draw an interactive mesh using Qwt 6. I'm attaching a rough screenshot which shows approximately what I mean.

    The mesh should be zoomable / pannable (no problem there), and the user should be able to select the individual triangles (by clicking inside them), as well as multiple triangles using rubber band dragging. The selected triangle has either highlighted sides, or a different fill color (whichever is easier to implement). Each triangle has a number shown inside it, and it should be shown only if the triangle's pixel size is large enough for the text to fit in it.
    I don't have the source data format yet, but I'm sure I can adapt it to whatever format is necessary.

    I've used Qwt in the past for drawing curves, but I have no idea how to approach this problem. I guess the numbers could be drawn as markers (but I will need to somehow show/hide them depending on their triangle size). As for the mesh itself (using a curve for each side seems too much) and the 2 options for triangle selection - I have no idea how to do that.

    Any help (hints, suggestions, pointers, code, ...) would be really appreciated.
    Thanks in advance!

    mesh.png

  2. #2
    Join Date
    Feb 2006
    Location
    Munich, Germany
    Posts
    3,309
    Thanked 879 Times in 827 Posts
    Qt products
    Qt3 Qt4 Qt/Embedded
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Draw a mesh using Qwt?

    You have to implement a new type of plot item: derive from QwtPlotItem.
    ( Using markers or curves absolutely makes no sense. )

    Uwe

  3. #3
    Join Date
    Sep 2010
    Posts
    46
    Thanks
    14
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Draw a mesh using Qwt?

    Thanks, I'll try to do that.

Similar Threads

  1. opengl rendering mesh elements contour problem
    By sujan.dasmahapatra in forum Qt Programming
    Replies: 1
    Last Post: 2nd February 2010, 08:07
  2. How to draw a arc
    By ProTonS in forum Qt Programming
    Replies: 3
    Last Post: 9th September 2009, 16:41
  3. Draw on a Progress Bar
    By fruzzo in forum Qt Programming
    Replies: 1
    Last Post: 8th December 2007, 16:31
  4. From calculator: how to draw
    By mattia in forum Newbie
    Replies: 1
    Last Post: 26th October 2007, 12:22
  5. Best way to draw x,y graphs
    By steg90 in forum Newbie
    Replies: 1
    Last Post: 14th May 2007, 12:52

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
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.