view include/Mandelbrot.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 // Mandelbrot.h
24 // Mandelbrot set calculator class definition
25 //
26 ////////////////////////////////////////////////////////////////////////////////
28 #ifndef MANDELBROT_H
29 #define MANDELBROT_H
31 #include <iostream>
33 #include "Fractal.h"
35 ////////////////////////////////////////////////////////////////////////////////
36 class ViewMandelbrot : public View
37 {
38 public:
39 ViewMandelbrot(std::string t,
40 double re, double im, double s,
41 unsigned int max);
43 private:
44 friend class Mandelbrot;
46 };
48 ////////////////////////////////////////////////////////////////////////////////
49 class Mandelbrot : public Fractal
50 {
51 public:
52 Mandelbrot();
54 bool calc_set();
56 ViewMandelbrot * save_view();
57 void restore_view(View * v);
59 private:
61 };
63 ////////////////////////////////////////////////////////////////////////////////
64 namespace
65 {
66 class MandelbrotFactory : public FractalFactory
67 {
68 public:
69 MandelbrotFactory()
70 {
71 get_Fractal_map()[typeid(Mandelbrot).name()]=this;
72 }
74 Fractal * create() const
75 {
76 return new Mandelbrot;
77 }
78 } the_Mandelbrot_factory;
79 }
81 #endif