Results 1 to 1 of 1

Thread: Double Buffering for plot graphs

  1. #1
    Join Date
    Mar 2008
    Posts
    52
    Thanks
    2
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Windows

    Default Double Buffering for plot graphs

    Hi,
    I new to Qt tool.I have written a program to plot a graph using double Buffer concept.I got the plot graph.But i have problem with this Function.
    That name is adjust Axis();



    Qt Code:
    1. void PlotSettings::adjustAxis(double &min, double &max,
    2. int &numTicks)
    3. {
    4. const int MinTicks = 4;
    5. double grossStep = (max - min) / MinTicks;
    6. double step = pow(10.0, floor(log10(grossStep)));
    7.  
    8. if (5 * step < grossStep) {
    9. step *= 5;
    10. } else if (2 * step < grossStep) {
    11. step *= 2;
    12. }
    13.  
    14. numTicks = int(ceil(max / step) - floor(min / step));
    15. if (numTicks < MinTicks)
    16. numTicks = MinTicks;
    17. min = floor(min / step) * step;
    18. max = ceil(max / step) * step;
    19. }
    To copy to clipboard, switch view to plain text mode 
    i copied this code from QT Gui programming Book.How it works i didn't understand.So could you tell me brief discussion About...
    Thank you......



    Regards,
    Tavit.
    Last edited by jpn; 20th March 2008 at 14:11. Reason: missing [code] tags

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.