Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2014
45
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.25 KB | None | 0 0
  1. #ifndef FRACTAL_H
  2. #define FRACTAL_H
  3.  
  4. #include <QPainter>
  5. #include <QRect>
  6. #include <QDebug>
  7.  
  8. class Fractal
  9. {
  10. public:
  11. virtual void render(QPainter &painter, QRect target) = 0;
  12. };
  13.  
  14. #endif // FRACTAL_H
  15.  
  16. #ifndef CANTOR_H
  17. #define CANTOR_H
  18.  
  19. #include "Fractal.h"
  20.  
  21. class Cantor : public Fractal
  22. {
  23. public:
  24. void render(QPainter &painter, QRect target) Q_DECL_OVERRIDE;
  25. };
  26.  
  27. #endif // CANTOR_H
  28.  
  29. #include "Cantor.h"
  30.  
  31. void Cantor::render(QPainter &painter, QRect target)
  32. {
  33. Q_UNUSED(painter);
  34. Q_UNUSED(target);
  35.  
  36. qDebug() << "Rendering Cantor's Discontinuum...";
  37. }
  38.  
  39. #ifndef SIERPINSKI_H
  40. #define SIERPINSKI_H
  41.  
  42. #include "Fractal.h"
  43.  
  44. class Sierpinski : public Fractal
  45. {
  46. public:
  47. void render(QPainter &painter, QRect target) Q_DECL_OVERRIDE;
  48. };
  49.  
  50. #endif // SIERPINSKI_H
  51.  
  52. #include "Sierpinski.h"
  53.  
  54. void Sierpinski::render(QPainter &painter, QRect target)
  55. {
  56. Q_UNUSED(painter);
  57. Q_UNUSED(target);
  58.  
  59. qDebug() << "Rendering Sierpinski triangle...";
  60. }
  61.  
  62. #ifndef SIERPINSKI_H
  63. #define SIERPINSKI_H
  64.  
  65. #include "Fractal.h"
  66.  
  67. class Sierpinski : public Fractal
  68. {
  69. public:
  70. void render(QPainter &painter, QRect target)
  71. {
  72. Q_UNUSED(painter);
  73. Q_UNUSED(target);
  74.  
  75. qDebug() << "Rendering Sierpinski triangle...";
  76. }
  77. };
  78.  
  79. #endif // SIERPINSKI_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement