00001 /* 00002 Copyright 2010 Pierre SCHWARTZ 00003 00004 Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated 00005 documentation files (the "Software"), to deal in the Software without restriction, including without 00006 limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies 00007 of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following 00008 conditions: The above copyright notice and this permission notice shall be included in all copies or 00009 substantial portions of the Software. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, 00010 EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR 00011 PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, 00012 DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF 00013 OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. 00014 */ 00015 00023 #ifndef H__fractale__ 00024 #define H__fractale__ 00025 00026 #include <complex> 00027 #include <QtGui> 00028 00032 class fractale : public QObject{ 00033 Q_OBJECT 00034 public: 00041 fractale(std::complex<float>& s, long i):start(s), tmp(s), maxIterations(i), nbIterations(0){} 00042 fractale(){}; 00046 virtual ~fractale(){}; 00047 virtual std::complex<float> next(std::complex<float>&)=0; 00048 virtual bool stop() = 0; 00049 virtual std::complex<float> renderingDestination(std::complex<float>&) = 0; 00050 void setMaxIterations(long i){ 00051 maxIterations = i; 00052 } 00053 void setStart(std::complex<float> &s){ 00054 start = s; 00055 nbIterations = 0; 00056 } 00057 int getMaxIterations(){ 00058 return maxIterations; 00059 } 00060 inline virtual bool isVerticalSymetric() = 0; 00061 inline virtual bool isImpair() = 0; 00062 00063 virtual fractale* clone()=0; 00064 virtual QString getName()=0; 00065 protected: 00066 std::complex<float> start, tmp; 00067 long maxIterations, nbIterations; 00068 }; 00069 00070 #endif 00071