Results 1 to 4 of 4

Thread: Data Visualization GraphicsView/Scene/Item Design

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2015
    Posts
    10
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11

    Default Data Visualization GraphicsView/Scene/Item Design

    Hi,

    I am working on a custom data visualization program.

    My question is how to display/map/transform the data from a model to the view/scene in order to:

    1. Get correct results
    2. Minimize computational effort

    So far, in order to draw a scatterplot, I came up with two different approaches:

    Here is a short pseudocode:

    Qt Code:
    1. //initialize data
    2. A[5], B[5]
    3. i=0
    4.  
    5. //fill vectors with randon data
    6. while (i < 5)
    7. A[i] = rand(10);
    8. B[i] = rand(10);
    9. i++;
    10. myGraphicsScene->addRect(A[i], -B[i], 5, 5);
    11.  
    12. //set scene
    13. myGraphcisView->setScene(myGraphicsscene)
    To copy to clipboard, switch view to plain text mode 

    Since the data is not scaled to the scene coordinates there are two different ways to plot the data (from my current understanding):

    1. Transform/multiply the data with some factor to expess the values in terms of scene coordinates
    2. Fit the scene to the data (myScene->sceneRect(0,-max(B), max(A), max(B)) and then fit the scene to the graphicsview using myview -> fitInView(myscene)

    Now from your experience, which approach would you recommend?
    Are there another way to approach the problem?

    Thank you many times,

    Vincent
    Last edited by vgrunert; 8th April 2015 at 12:31.

Similar Threads

  1. Replies: 0
    Last Post: 3rd March 2015, 09:00
  2. Replies: 4
    Last Post: 15th May 2013, 13:58
  3. Replies: 1
    Last Post: 7th May 2013, 23:04
  4. GraphicsView / Scene window minimize maximize buttons
    By erikusa in forum Qt Programming
    Replies: 0
    Last Post: 16th December 2010, 00:47
  5. Replies: 3
    Last Post: 26th April 2010, 03:15

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.