view include/Julia.h @ 3:0f4ad525f49a

Lot's of cleanup. Applied AbstractFactory to class Fractal and derivatives. Decoupled most objects. Removed remaining standard C function calls. Improved old_views handling.
author Eris Caffee <discordia@eldalin.com>
date Sat, 23 Oct 2010 04:24:48 -0500
parents 0684158d38a8
children df02a7de7fe2
line source
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // (C) 2010 Sarah Eris Horsley Caffee
4 //
5 // mandelbrot - A simple Mandelbrot Set viewer.
6 //
7 // Julia.h
8 // Julia set calculator class definition
9 //
10 ////////////////////////////////////////////////////////////////////////////////
12 #ifndef JULIA_H
13 #define JULIA_H
15 #include <string>
17 #include "SDL.h"
19 #include "Fractal.h"
21 #define JULIA_TYPE_NAME "Julia"
23 class Julia : public Fractal
24 {
25 public:
26 Julia();
28 bool calc_set();
29 bool init(SDL_Surface * surf);
31 bool get_option(std::string option, void * value);
32 bool set_option(std::string option, void * value);
34 const char * get_type_name();
36 private:
38 void draw_pixel(int x, int y, Uint32 * color);
39 void set_display_name();
41 double k_re;
42 double k_im;
43 };
45 namespace
46 {
47 class JuliaCreator : public FractalCreator
48 {
49 public:
50 JuliaCreator()
51 {
52 get_Fractal_map()["Julia"]=this;
53 }
54 virtual Fractal * create() const
55 {
56 return new Julia;
57 }
58 } theCreator;
59 }
60 #endif