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 get all boundry items from QgraphicsScene?
Forum Updated to NodeBB v4.3 + New Features

How to get all boundry items from QgraphicsScene?

Scheduled Pinned Locked Moved General and Desktop
2 Posts 2 Posters 1.7k Views 1 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.
  • M Offline
    M Offline
    MyQT
    wrote on last edited by
    #1

    Hi,

    I have drawn @200 GPS location points on QgraphicsScene/QgraphicsView
    Now i want to draw a boundry line by connecting all points which are at boundry.
    Is there any way of getting all points list which are at boundry from QGraphicsScene so that I can draw the boundry line?
    Thanks in advance.

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      No, because there really is no standard way to define what is the boundary.

      Qt only can give you the bounding rectangle of your points, but I guess that that is not enough for your purpose. You'll have to either find an existing algorithm to do what you want, or device your own. I think it is doable to find a simple polygon to surround all points, but I have never tried.

      Anyway, you should probably look for "convex hull algorithms".

      Edit:
      Here is one "implementation":http://en.wikibooks.org/wiki/Algorithm_Implementation/Geometry/Convex_hull/Monotone_chain you might use. It is not the fastest algorithm, but probably fast enough for only 200 points.

      1 Reply Last reply
      0

      • Login

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