view include/Julia.h @ 5:d691ce98f406

OK. This is the first release. Honest.
author Eris Caffee <discordia@eldalin.com>
date Fri, 12 Nov 2010 23:58:48 -0600
parents df02a7de7fe2
children
line source
1 ////////////////////////////////////////////////////////////////////////////////
2 //
3 // Fracter - A simple Mandelbrot Set viewer.
4 //
5 // Copyright (C) 2010 Sarah Eris Horsley Caffee
6 //
7 // This file is part of Fracter.
8 //
9 // Fracter is free software: you can redistribute it and/or modify
10 // it under the terms of the GNU General Public License as published by
11 // the Free Software Foundation, either version 3 of the License, or
12 // (at your option) any later version.
13 //
14 // This program is distributed in the hope that it will be useful,
15 // but WITHOUT ANY WARRANTY; without even the implied warranty of
16 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
17 // GNU General Public License for more details.
18 //
19 // You should have received a copy of the GNU General Public License
20 // along with this program. If not, see <http://www.gnu.org/licenses/>.
21 //
22 //
23 // Julia.h
24 // Julia set calculator class definition
25 //
26 ////////////////////////////////////////////////////////////////////////////////
28 #ifndef JULIA_H
29 #define JULIA_H
31 #include <iostream>
33 #include <string>
35 #include "Fractal.h"
37 ////////////////////////////////////////////////////////////////////////////////
38 class ViewJulia : public View
39 {
40 public:
41 ViewJulia(std::string t,
42 double re, double im, double s,
43 unsigned int max,
44 double kr, double ki);
46 private:
47 friend class Julia;
49 double k_re;
50 double k_im;
52 };
54 ////////////////////////////////////////////////////////////////////////////////
55 class Julia : public Fractal
56 {
57 public:
58 Julia();
60 bool calc_set();
62 bool get_option(std::string option, void * value) const;
63 bool set_option(std::string option, void * value);
64 ViewJulia * save_view();
65 void restore_view(View * v);
67 private:
69 void set_display_name();
71 double k_re;
72 double k_im;
74 };
76 ////////////////////////////////////////////////////////////////////////////////
77 namespace
78 {
79 class JuliaFactory : public FractalFactory
80 {
81 public:
82 JuliaFactory()
83 {
84 get_Fractal_map()[typeid(Julia).name()]=this;
85 }
87 Fractal * create() const
88 {
89 return new Julia;
90 }
91 } the_Julia_factory;
92 }
93 #endif