view include/Julia.h @ 4:df02a7de7fe2

I think I've got the Abstract Factory code working pretty robustly now, though I still need to make the factory singletons thread-safe
author Eris Caffee <discordia@eldalin.com>
date Tue, 26 Oct 2010 02:03:47 -0500
parents 0f4ad525f49a
children d691ce98f406
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 <iostream>
16 #include <string>
17 #include <typeinfo>
19 #include "SDL.h"
21 #include "Fractal.h"
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) const;
32 bool set_option(std::string option, void * value);
34 std::string const & get_fractal_name() const;
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;
44 };
46 namespace
47 {
48 class JuliaCreator : public FractalCreator
49 {
50 public:
51 JuliaCreator()
52 {
53 std::cerr << "Julia is called >" << typeid(Julia).name() << "<" << std::endl;
54 get_Fractal_map()[typeid(Julia).name()]=this;
55 }
57 virtual Fractal * create() const
58 {
59 return new Julia;
60 }
61 } the_Julia_creator;
62 }
63 #endif