Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. how to handle millions of items ?

how to handle millions of items ?

Scheduled Pinned Locked Moved Unsolved General and Desktop
19 Posts 7 Posters 4.7k Views 3 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • SGaistS SGaist

    Hi and welcome to devnet,

    The usual technique is: render only what make sense to show.

    There's no use trying to render each feather of a Kiwi bird if you are looking at it from the top of a building.

    The same goes the other way around, there's no use rendering the full building since you're on top of it trying to look at a Kiwi bird.

    S Offline
    S Offline
    student
    wrote on last edited by
    #10

    @SGaist thanks for your reply, i am a newer to Qt.
    yes, I don't want to show them at full pic view, so I just show them when zoom in to a specific value, in the paint function for each item, I use :

    option->levelOfDetailFromTransform(painter->worldTransform()) < SpecificValue: return

    but it doesn't help much.

    Could you help to describe more about how to filter them ? or is there any example ?
    thanks very much !

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #11

      Before going further, what kind of rendering are you looking at ? Just to ensure you are choosing the right tool for your task.

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      S 1 Reply Last reply
      0
      • SGaistS SGaist

        Before going further, what kind of rendering are you looking at ? Just to ensure you are choosing the right tool for your task.

        S Offline
        S Offline
        student
        wrote on last edited by
        #12

        @SGaist I have many polygon shapes, and need to view / edit them, for view/edit, i think just when zoom in, without zoom in, a rough picture is enough.
        as you said: """ There's no use trying to render each feather of a Kiwi bird if you are looking at it from the top of a building.

        The same goes the other way around, there's no use rendering the full building since you're on top of it trying to look at a Kiwi bird."""

        that's it.

        1 Reply Last reply
        0
        • SGaistS Offline
          SGaistS Offline
          SGaist
          Lifetime Qt Champion
          wrote on last edited by
          #13

          Is it a 3D scene ?

          Interested in AI ? www.idiap.ch
          Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

          S 1 Reply Last reply
          0
          • SGaistS SGaist

            Is it a 3D scene ?

            S Offline
            S Offline
            student
            wrote on last edited by
            #14

            @SGaist no, just 2D polygons.

            1 Reply Last reply
            0
            • S Offline
              S Offline
              student
              wrote on last edited by
              #15

              any new idea?

              K 1 Reply Last reply
              0
              • S student

                any new idea?

                K Offline
                K Offline
                kenchan
                wrote on last edited by kenchan
                #16

                @student
                are these polygon shapes single polygons or meshes of polygons?
                Are they overlapping i.e. can be hidden behind or hide others?
                Do they have some measure of coherence you can exploit?

                These are the kind of questions you should be asking yourself so you can determine the best strategies for LOD.
                The obvious strategies are minimum pixel coverage, removing items completely hidden items, removing items outside the viewport.

                If you really want to do it brute force use the GPU directly via OpenGL calls to do the drawing and don't rely on the Qt graphics items at all. Even then you might need to use some clever LOD strategies with that many polygons.

                S 1 Reply Last reply
                1
                • fcarneyF Offline
                  fcarneyF Offline
                  fcarney
                  wrote on last edited by
                  #17

                  drawing millions of objects in qt

                  C++ is a perfectly valid school of magic.

                  1 Reply Last reply
                  -1
                  • K kenchan

                    @student
                    are these polygon shapes single polygons or meshes of polygons?
                    Are they overlapping i.e. can be hidden behind or hide others?
                    Do they have some measure of coherence you can exploit?

                    These are the kind of questions you should be asking yourself so you can determine the best strategies for LOD.
                    The obvious strategies are minimum pixel coverage, removing items completely hidden items, removing items outside the viewport.

                    If you really want to do it brute force use the GPU directly via OpenGL calls to do the drawing and don't rely on the Qt graphics items at all. Even then you might need to use some clever LOD strategies with that many polygons.

                    S Offline
                    S Offline
                    student
                    wrote on last edited by
                    #18

                    @kenchan Thanks. they are single polygons, some of them may overlapping each other.
                    yes, I agree I need to minimum the piexl coverage, that means filter out the ones need to render.
                    the question is how to filter them out according to view port with so many polygons quickly.
                    when zoom to an area, it should respond quickly, when fit the view, also quickly.
                    I don't think it's a special case just for me. this should be a general case in many applications.
                    So i want to see if there is existing framework which can handle such case.

                    kshegunovK 1 Reply Last reply
                    0
                    • S student

                      @kenchan Thanks. they are single polygons, some of them may overlapping each other.
                      yes, I agree I need to minimum the piexl coverage, that means filter out the ones need to render.
                      the question is how to filter them out according to view port with so many polygons quickly.
                      when zoom to an area, it should respond quickly, when fit the view, also quickly.
                      I don't think it's a special case just for me. this should be a general case in many applications.
                      So i want to see if there is existing framework which can handle such case.

                      kshegunovK Offline
                      kshegunovK Offline
                      kshegunov
                      Moderators
                      wrote on last edited by
                      #19

                      As suggested you should research LOD algorithms. For example this may be of some use or maybe a clustering algorithm. You may also benefit from a space partitioning scheme that's not the one implemented by the graphics scene, but something custom. In any case such problems are not trivial.

                      Read and abide by the Qt Code of Conduct

                      1 Reply Last reply
                      3

                      • Login

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • Users
                      • Groups
                      • Search
                      • Get Qt Extensions
                      • Unsolved