view include/Fractal.h @ 2:0684158d38a8

Before cleanup. Still has experimental code in it.
author Eris Caffee <discordia@eldalin.com>
date Fri, 22 Oct 2010 02:21:52 -0500
parents 455406f5f021
children 0f4ad525f49a
line source
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // (C) 2010 Sarah Eris Horsley Caffee
4 //
5 // mandelbrot - A simple Mandelbrot Set viewer.
6 //
7 // Fractal.h
8 // Fractal calculator virtual class definition. Actual fractals should
9 // implement this.
10 //
11 ////////////////////////////////////////////////////////////////////////////////
13 #ifndef FRACTAL_H
14 #define FRACTAL_H
16 #include <string>
18 class Fractal
19 {
20 public:
21 Fractal();
23 virtual bool calc_set() = 0;
24 virtual bool init(SDL_Surface * surf) = 0;
25 void set_re_min(const double r_min);
26 void set_im_max(const double i_max);
27 void set_size(const double s);
28 void set_max_iter(const unsigned int iter);
29 void inc_max_iter();
30 void dec_max_iter();
31 void set_calc_needed();
33 double get_re_min();
34 double get_im_max();
35 double get_size();
36 unsigned int get_max_iter();
37 const char * get_name();
40 protected:
42 virtual void draw_pixel(int x, int y, Uint32 * color);
44 std::string name;
45 double re_min;
46 double im_max;
47 double size;
48 unsigned int max_iter;
49 bool calc_needed;
51 SDL_Surface * surface;
54 };
56 #endif