Results 1 to 20 of 72

Thread: QGraphicsScene/QGraphicsView performance problems

Threaded View

Previous Post Previous Post   Next Post Next Post
  1. #11
    Join Date
    Aug 2006
    Location
    Bangalore,India
    Posts
    419
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11
    Thanks
    37
    Thanked 53 Times in 40 Posts

    Default Re: QGraphicsScene/QGraphicsView performance problems

    Quote Originally Posted by bnilsson View Post
    Ok, now I understand.
    I will have the following kinds of objects to draw:

    FieldBoundary:
    This object is 'virtual', and the drawing of this is optional, to indicate for the viewer how the pattern layout is divided into fields.
    It is always rectangular (special case quadratic), the same size and shape throughout the whole drawing. Typically 800 by 800 micrometer in size. The size is predefined in the file header, and the pattern data comes as position x,y referenced from the upper left corner of the chip.
    SubFieldBoundary:
    This object is 'virtual', and the drawing of this is optional, to indicate for the viewer how the pattern layout in the field is divided into subfields.
    It is always rectangular (special case quadratic), the same size and shape throughout the whole drawing. The subfield size is ALWAYS smaller or equal to the field size, typically 100 by 100 microns in size. The size is predefined in the file header, and the pattern data comes as position x,y referenced from the upper left corner of the current field.
    The Real shapes below are ALWAYS contained and enclosed within one subfield, and thus always smaller.
    XRectangle:
    Should always be drawn. The X side is longer than the Y side. The input data comes as x0,y0,w,h, referenced from the upper left corner of the current subfield.
    YRectangle:
    Should always be drawn. The Y side is longer than the X side. The input data comes as x0,y0,w,h, referenced from the upper left corner of the current subfield.
    XTrapezoid:
    Top and bottom sides parallell. Degenerated into triangles may occur. The input data comes as x0,y0,x1,x2,x3,y3, referenced from the upper left corner of the current subfield.
    YTrapezoid:
    Left and right sides parallell. Degenerated into triangles may occur. The input data comes as x0,y0,y1,y2,x3,y3, referenced from the upper left corner of the current subfield.
    Line:
    Just a line from x0,y0 to x1,y1, referenced from the upper left corner of the current subfield.

    Exposure dose index:
    In the input data file, each Real shape may have a tag to control the exposure dose. Here we us colors (up to 63 colors) to present this.

    Hope this helps.
    May be you can have only one item to represent the field and its contents and by contents i don't mean child items.

    I am using the terminology "item" to represent an entity on scene and which inherits QGraphicsItem.

    The field item is the item responsible to draw its subfields and contents of subfield.

    Now if levelOfDetail is very less, just draw the outer boundary of field item only.
    If levelOfDetail is less, but not very less, then draw subfield boundary also.
    Only if levelOfDetail is greater enough so that user can see detail, draw all the shapes.
    Again you can finetune more by drawing rect when level of detail is medium and polygon if levelOfDetail is sufficiently large.

    And for the values of levelOfDetail, you have to experiment.

    Edit:
    Chipsize 50000.000 um, 3844 fields, 246016 subfields, 246016 rects, 246016 polys
    Chipsize 100000.000 um, 15625 fields, 1000000 subfields, 1000000 rects, 1000000 polys
    Chipsize 125000.000 um, 24336 fields, 1557504 subfields, 1557504 rects, 1557504 polys
    As you can see considering worst case, you can represent all your data by 24336 field items (instead of 24336 + 1557504 + 1557504 items! ) and chip demo has 50k items!!
    I think your app can be smooth enough if you design it carefully
    All the best
    Last edited by Gopala Krishna; 9th January 2008 at 11:02.
    The biggest difference between time and space is that you can't reuse time.
    -- Merrick Furst

Similar Threads

  1. Performance problems with overlapping qgraphicsitems
    By brjames in forum Qt Programming
    Replies: 13
    Last Post: 4th May 2008, 21:42
  2. Poor performance with Qt 4.3 and Microsoft SQL Server
    By Korgen in forum Qt Programming
    Replies: 2
    Last Post: 23rd November 2007, 10:28
  3. GraphicsView performance problems
    By Gopala Krishna in forum Qt Programming
    Replies: 79
    Last Post: 8th August 2007, 17:32
  4. Replies: 2
    Last Post: 8th March 2007, 22:22
  5. Replies: 1
    Last Post: 4th October 2006, 16:05

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.