Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Polar Plots (repost)

Polar Plots (repost)

Scheduled Pinned Locked Moved C / C++ / MFC
c++graphicstutorialquestion
7 Posts 5 Posters 0 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.
  • J Offline
    J Offline
    jhorstkamp
    wrote on last edited by
    #1

    All, Has anyone here done any work with polar plots and graphs in vc++. If so can you give me any tips as to how to start? Any graphics classes out there that have implemented polar plots etc? Thanks in advance. Sorry for the repost - for some reason it thought I hit the submit button before I started the main part of this message... John

    J G 2 Replies Last reply
    0
    • J jhorstkamp

      All, Has anyone here done any work with polar plots and graphs in vc++. If so can you give me any tips as to how to start? Any graphics classes out there that have implemented polar plots etc? Thanks in advance. Sorry for the repost - for some reason it thought I hit the submit button before I started the main part of this message... John

      J Offline
      J Offline
      Jason Henderson
      wrote on last edited by
      #2

      I haven't done it in C++ but what do you need to know? The math behind it or drawing to the window?

      "We have done so much in the last 2 years, and it doesn't happen by standing around with your finger in your ear, hoping everyone thinks that that's nice." - Donald Rumsfeld

      Jason Henderson
      blog

      J 1 Reply Last reply
      0
      • J Jason Henderson

        I haven't done it in C++ but what do you need to know? The math behind it or drawing to the window?

        "We have done so much in the last 2 years, and it doesn't happen by standing around with your finger in your ear, hoping everyone thinks that that's nice." - Donald Rumsfeld

        Jason Henderson
        blog

        J Offline
        J Offline
        jhorstkamp
        wrote on last edited by
        #3

        Mainly drawing to the window...I think :) For a variety of reasons I've been tasked to port a Matlab script (and add more functionality) to vc++. I've got my coordinate data, and in looking into Matlab, it seems like they just draw a circle, translate the polar coordinates to xy and draw lines in the circle. There's got to be more to it than that. I don't know how to start drawing this in a window (dialog). Can I do this in a dialog, or do I need a view and a DC? If so, can I put a view in a dialog? Any help or pointers in the right direction would be appreciated! Thanks John

        R I J 3 Replies Last reply
        0
        • J jhorstkamp

          Mainly drawing to the window...I think :) For a variety of reasons I've been tasked to port a Matlab script (and add more functionality) to vc++. I've got my coordinate data, and in looking into Matlab, it seems like they just draw a circle, translate the polar coordinates to xy and draw lines in the circle. There's got to be more to it than that. I don't know how to start drawing this in a window (dialog). Can I do this in a dialog, or do I need a view and a DC? If so, can I put a view in a dialog? Any help or pointers in the right direction would be appreciated! Thanks John

          R Offline
          R Offline
          Rick York
          wrote on last edited by
          #4

          Step one is to get a DC. Alternatively, you can pass in an HWND and obtain one. You do not need a view - just a DC that you can obtain window coordinates from. A polar to window coords conversion function will come in handy too. Good luck. The Ten Commandments For C Programmers

          1 Reply Last reply
          0
          • J jhorstkamp

            Mainly drawing to the window...I think :) For a variety of reasons I've been tasked to port a Matlab script (and add more functionality) to vc++. I've got my coordinate data, and in looking into Matlab, it seems like they just draw a circle, translate the polar coordinates to xy and draw lines in the circle. There's got to be more to it than that. I don't know how to start drawing this in a window (dialog). Can I do this in a dialog, or do I need a view and a DC? If so, can I put a view in a dialog? Any help or pointers in the right direction would be appreciated! Thanks John

            I Offline
            I Offline
            IGeorgeI
            wrote on last edited by
            #5

            Hi John 1) first you need a DC to the dialog - I suggest you add an empty control to the dialog first, and get the DC from the control. That way your coordiante system is relative to the control(drawing area) this make life easier. 2) create a "polar transform" method that is fast and efficient. - this transform will be called every single time any rendering or user interaction with the graph occurrs so BE efficient. - All incomming polar data is to be formatted through this transform and the resulting cartesian data will be rendered in your offset DC fron the control. There is of course a lot more to it, especially when you consider user interaction, zooming, flicker free panning etc. But that is all pretty standard stuff. If you want to see a very good example of an XY or polar plot, check out our company website at homepage - www.zsystems.ca Active x - www.zsystems.ca/devtools.htm ZAX download - http://www.zsystems.ca/downloads.htm Download the ZAX demo and play around with the XY/Polar plot in there. If you have any questions on how we did anything, feel free to contact me directly. Good luck George W Software Developer www.zsystems.ca

            1 Reply Last reply
            0
            • J jhorstkamp

              Mainly drawing to the window...I think :) For a variety of reasons I've been tasked to port a Matlab script (and add more functionality) to vc++. I've got my coordinate data, and in looking into Matlab, it seems like they just draw a circle, translate the polar coordinates to xy and draw lines in the circle. There's got to be more to it than that. I don't know how to start drawing this in a window (dialog). Can I do this in a dialog, or do I need a view and a DC? If so, can I put a view in a dialog? Any help or pointers in the right direction would be appreciated! Thanks John

              J Offline
              J Offline
              jhorstkamp
              wrote on last edited by
              #6

              Thanks for the advice guys! This will give me a starting point. I may have more questions... John

              1 Reply Last reply
              0
              • J jhorstkamp

                All, Has anyone here done any work with polar plots and graphs in vc++. If so can you give me any tips as to how to start? Any graphics classes out there that have implemented polar plots etc? Thanks in advance. Sorry for the repost - for some reason it thought I hit the submit button before I started the main part of this message... John

                G Offline
                G Offline
                Gary R Wheeler
                wrote on last edited by
                #7

                John - I don't know how deep your pockets are, but you may want to look into a third party library. That might be faster and a lot easier than building your own charting capability. you might check out the Dundas Chart gizmo; it's advertised here on Code Project.


                Software Zen: delete this;

                1 Reply Last reply
                0
                Reply
                • Reply as topic
                Log in to reply
                • Oldest to Newest
                • Newest to Oldest
                • Most Votes


                • Login

                • Don't have an account? Register

                • Login or register to search.
                • First post
                  Last post
                0
                • Categories
                • Recent
                • Tags
                • Popular
                • World
                • Users
                • Groups