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. Change direction of polar data visualization
QtWS25 Last Chance

Change direction of polar data visualization

Scheduled Pinned Locked Moved Unsolved General and Desktop
visualizationdata visualizat
9 Posts 2 Posters 4.1k Views
  • 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.
  • B Offline
    B Offline
    beecksche
    wrote on 18 Jul 2016, 09:48 last edited by beecksche
    #1

    Hi,
    is it possible to change the direction of the polar coordinate system?
    In the Surface example the direction is clockwise:

    Polar example

    Can i change it to anti clockwise?

    Thanks

    K 1 Reply Last reply 18 Jul 2016, 21:23
    0
    • B beecksche
      18 Jul 2016, 09:48

      Hi,
      is it possible to change the direction of the polar coordinate system?
      In the Surface example the direction is clockwise:

      Polar example

      Can i change it to anti clockwise?

      Thanks

      K Offline
      K Offline
      kshegunov
      Moderators
      wrote on 18 Jul 2016, 21:23 last edited by
      #2

      @beecksche
      Hey,
      In physics we call this parity. Flipping the coordinates will do what you want (i.e. if you make a reflection through the coordinate system's 0). I may be wrong, but probably the easiest way to do what you want is to actually change the coordinate system. In Qt it goes from left to right and top to bottom, if you switch it somehow (I don't know QML and I have no idea how this can be accomplished) so that it goes right to left, and bottom to top then you should be good to go.
      I hope that helps somewhat.

      Kind regards.

      Read and abide by the Qt Code of Conduct

      B 1 Reply Last reply 20 Jul 2016, 07:35
      0
      • K kshegunov
        18 Jul 2016, 21:23

        @beecksche
        Hey,
        In physics we call this parity. Flipping the coordinates will do what you want (i.e. if you make a reflection through the coordinate system's 0). I may be wrong, but probably the easiest way to do what you want is to actually change the coordinate system. In Qt it goes from left to right and top to bottom, if you switch it somehow (I don't know QML and I have no idea how this can be accomplished) so that it goes right to left, and bottom to top then you should be good to go.
        I hope that helps somewhat.

        Kind regards.

        B Offline
        B Offline
        beecksche
        wrote on 20 Jul 2016, 07:35 last edited by beecksche
        #3

        @kshegunov
        Thanks for your reply.

        The doc says:

        The X axis becomes the angular axis and the Z axis becomes the radial axis. Polar mode is not available for bar graphs.

        I can change the reversed setting of the X axis. So i should change the direction, or am i wrong?

        Edit:
        I have tested the reveres setting, but the graph doesn't change.

        K 1 Reply Last reply 20 Jul 2016, 09:06
        0
        • B beecksche
          20 Jul 2016, 07:35

          @kshegunov
          Thanks for your reply.

          The doc says:

          The X axis becomes the angular axis and the Z axis becomes the radial axis. Polar mode is not available for bar graphs.

          I can change the reversed setting of the X axis. So i should change the direction, or am i wrong?

          Edit:
          I have tested the reveres setting, but the graph doesn't change.

          K Offline
          K Offline
          kshegunov
          Moderators
          wrote on 20 Jul 2016, 09:06 last edited by kshegunov
          #4

          @beecksche
          Hi,
          I'm sorry I didn't realize you're using that module, I thought you're doing the graph yourself. Sadly, I have no idea how I can help with the data visualization module. I believe it was included in opensource only recently, so I haven't any experience with it.

          Kind regards.

          Read and abide by the Qt Code of Conduct

          B 1 Reply Last reply 20 Jul 2016, 09:23
          0
          • K kshegunov
            20 Jul 2016, 09:06

            @beecksche
            Hi,
            I'm sorry I didn't realize you're using that module, I thought you're doing the graph yourself. Sadly, I have no idea how I can help with the data visualization module. I believe it was included in opensource only recently, so I haven't any experience with it.

            Kind regards.

            B Offline
            B Offline
            beecksche
            wrote on 20 Jul 2016, 09:23 last edited by beecksche
            #5

            @kshegunov
            Oh sorry! It is my fault, i didn't mentioned anywhere.

            Since Qt 5.7 the Qt Data Visualization module is available under the GPL license, see this blog post.

            Now i have read some informations about the coordinate systems:
            The coordinate system used in the module is called azimuth system and it is mainly used in geography:

            For me as engineer, it would be interesting to use the "real" polar system ;-). Where the positve angle is count anti clockwise
            .

            But so far i haven't found any settings to change the systems.

            K 1 Reply Last reply 20 Jul 2016, 10:45
            0
            • B beecksche
              20 Jul 2016, 09:23

              @kshegunov
              Oh sorry! It is my fault, i didn't mentioned anywhere.

              Since Qt 5.7 the Qt Data Visualization module is available under the GPL license, see this blog post.

              Now i have read some informations about the coordinate systems:
              The coordinate system used in the module is called azimuth system and it is mainly used in geography:

              For me as engineer, it would be interesting to use the "real" polar system ;-). Where the positve angle is count anti clockwise
              .

              But so far i haven't found any settings to change the systems.

              K Offline
              K Offline
              kshegunov
              Moderators
              wrote on 20 Jul 2016, 10:45 last edited by kshegunov
              #6

              @beecksche
              Hi,

              I can change the reversed setting of the X axis. So i should change the direction, or am i wrong?

              No I meant you should reflect the rectangular coordinate. (There's an error in my first post, as you need to reflect only one of the coordinates, since this is a 2 dimensional space). What I mean is that instead of feeding (x, y, color) tuples to the chart you feed it (-x, y, color). This would reverse the "handedness", but also might screw up the labels ... I don't know ... try it out.

              Since Qt 5.7 the Qt Data Visualization module is available under the GPL license, see this blog post.

              Yes, that's what I mean. Until very recently it was available only for commercial users.

              The coordinate system used in the module is called azimuth system and it is mainly used in geography

              That's because they "look from" the center of the earth, not from the pole as one would expect. But in any case it's a very strange choice on account of the module developers, I'll grant you.

              For me as engineer, it would be interesting to use the "real" polar system

              I sympathize. I being a physicist wouldn't ever even consider using a left-handed coordinate system ...
              My advice is to address the developers directly on the mailing list if in a day or two you don't get a better answer here.

              Kind regards.

              Read and abide by the Qt Code of Conduct

              B 1 Reply Last reply 20 Jul 2016, 12:21
              0
              • K kshegunov
                20 Jul 2016, 10:45

                @beecksche
                Hi,

                I can change the reversed setting of the X axis. So i should change the direction, or am i wrong?

                No I meant you should reflect the rectangular coordinate. (There's an error in my first post, as you need to reflect only one of the coordinates, since this is a 2 dimensional space). What I mean is that instead of feeding (x, y, color) tuples to the chart you feed it (-x, y, color). This would reverse the "handedness", but also might screw up the labels ... I don't know ... try it out.

                Since Qt 5.7 the Qt Data Visualization module is available under the GPL license, see this blog post.

                Yes, that's what I mean. Until very recently it was available only for commercial users.

                The coordinate system used in the module is called azimuth system and it is mainly used in geography

                That's because they "look from" the center of the earth, not from the pole as one would expect. But in any case it's a very strange choice on account of the module developers, I'll grant you.

                For me as engineer, it would be interesting to use the "real" polar system

                I sympathize. I being a physicist wouldn't ever even consider using a left-handed coordinate system ...
                My advice is to address the developers directly on the mailing list if in a day or two you don't get a better answer here.

                Kind regards.

                B Offline
                B Offline
                beecksche
                wrote on 20 Jul 2016, 12:21 last edited by
                #7

                @kshegunov
                The data for the visualization is stored in cylindrical coordinates r, phi and z.

                I tried to change the angle phi to -phi, but then no visualization is rendered.

                The data is stored in a QItemModelSurfaceDataProxy, maybe i find some hints there!

                I'm going to write the developers, like you suggested. Thanks a lot!

                K 1 Reply Last reply 20 Jul 2016, 12:40
                0
                • B beecksche
                  20 Jul 2016, 12:21

                  @kshegunov
                  The data for the visualization is stored in cylindrical coordinates r, phi and z.

                  I tried to change the angle phi to -phi, but then no visualization is rendered.

                  The data is stored in a QItemModelSurfaceDataProxy, maybe i find some hints there!

                  I'm going to write the developers, like you suggested. Thanks a lot!

                  K Offline
                  K Offline
                  kshegunov
                  Moderators
                  wrote on 20 Jul 2016, 12:40 last edited by kshegunov
                  #8

                  @beecksche said:

                  I tried to change the angle phi to -phi, but then no visualization is rendered.

                  It wouldn't make any difference ordinarily, but are you sure the drawing can handle negative angles ...? You could do a very fast conversion of angles (after the inversion phi = -phi):

                  angle = std::fmod(angle, 360);
                  if (angle < 0)
                      angle += 360;
                  
                  // Angle is now always positive ...
                  

                  Sorry I couldn't be of more help. Good luck!

                  Read and abide by the Qt Code of Conduct

                  B 1 Reply Last reply 20 Jul 2016, 13:59
                  0
                  • K kshegunov
                    20 Jul 2016, 12:40

                    @beecksche said:

                    I tried to change the angle phi to -phi, but then no visualization is rendered.

                    It wouldn't make any difference ordinarily, but are you sure the drawing can handle negative angles ...? You could do a very fast conversion of angles (after the inversion phi = -phi):

                    angle = std::fmod(angle, 360);
                    if (angle < 0)
                        angle += 360;
                    
                    // Angle is now always positive ...
                    

                    Sorry I couldn't be of more help. Good luck!

                    B Offline
                    B Offline
                    beecksche
                    wrote on 20 Jul 2016, 13:59 last edited by beecksche
                    #9

                    @kshegunov
                    No negative angles are not allowed.

                    If i get an answer from the developers i'm going to post it here!

                    1 Reply Last reply
                    2

                    9/9

                    20 Jul 2016, 13:59

                    • Login

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