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 find the partial line segment inside the QPolygonF
Forum Updated to NodeBB v4.3 + New Features

how to find the partial line segment inside the QPolygonF

Scheduled Pinned Locked Moved Unsolved General and Desktop
5 Posts 3 Posters 792 Views 2 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.
  • Q Offline
    Q Offline
    Qt Enthusiast
    wrote on last edited by Qt Enthusiast
    #1

    I have a

    QLineF line
    QPolygonF polygon

    This Line is Partially inside the and partially outside the polygon . I check with documentation http://doc.qt.io/qt-4.8/qlinef-members.html and http://doc.qt.io/qt-4.8/qpolygonf-members.html

    I want to get coordinates of segments of QLineF which is inside the polygon

    I could not way to find the coordinates of QLineF which is inside

    raven-worxR 1 Reply Last reply
    0
    • Q Qt Enthusiast

      I have a

      QLineF line
      QPolygonF polygon

      This Line is Partially inside the and partially outside the polygon . I check with documentation http://doc.qt.io/qt-4.8/qlinef-members.html and http://doc.qt.io/qt-4.8/qpolygonf-members.html

      I want to get coordinates of segments of QLineF which is inside the polygon

      I could not way to find the coordinates of QLineF which is inside

      raven-worxR Offline
      raven-worxR Offline
      raven-worx
      Moderators
      wrote on last edited by
      #2

      @Qt-Enthusiast
      QPolygonF is actually a QVector of QLineF objects. So you are easily able to iterate over them.
      The rest "simply" is then plain mathematics.

      --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
      If you have a question please use the forum so others can benefit from the solution in the future

      1 Reply Last reply
      0
      • Q Offline
        Q Offline
        Qt Enthusiast
        wrote on last edited by
        #3

        I was looking for some optimized algorithm for the same .May be O(n) complexsity

        jsulmJ raven-worxR 2 Replies Last reply
        0
        • Q Qt Enthusiast

          I was looking for some optimized algorithm for the same .May be O(n) complexsity

          jsulmJ Offline
          jsulmJ Offline
          jsulm
          Lifetime Qt Champion
          wrote on last edited by
          #4

          @Qt-Enthusiast You can ask Google

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          1 Reply Last reply
          1
          • Q Qt Enthusiast

            I was looking for some optimized algorithm for the same .May be O(n) complexsity

            raven-worxR Offline
            raven-worxR Offline
            raven-worx
            Moderators
            wrote on last edited by
            #5

            @Qt-Enthusiast
            yes, but this is out-of-scope for Qt since this is solvable with mathematics.
            I am sure you can find various algorithms/formulas on the web for this.

            --- SUPPORT REQUESTS VIA CHAT WILL BE IGNORED ---
            If you have a question please use the forum so others can benefit from the solution in the future

            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