diff --git a/AttractorKernel.hpp b/AttractorKernel.hpp index 4d0a7eb..e303dcf 100644 --- a/AttractorKernel.hpp +++ b/AttractorKernel.hpp @@ -1,13 +1,10 @@ #ifndef ATTRACTORKERNEL_HPP #define ATTRACTORKERNEL_HPP -#include - /* Protocol/interface, what you want */ - class AttractorKernel { public: diff --git a/Canvas.cpp b/Canvas.cpp index 4c71c9e..7852747 100644 --- a/Canvas.cpp +++ b/Canvas.cpp @@ -3,8 +3,6 @@ #include #include #include -//#include -using namespace std; #include "pngwriter/pngwriter.h" @@ -101,8 +99,8 @@ void Canvas::plot(double x, double y, unsigned int c, double intensity) { I/O functions */ void Canvas::output() { - cout << "Canvas: " << endl; - cout << "Dimensions: " << width << " x " << height << " x " << num_colors << endl; + std::cout << "Canvas: " << std::endl; + std::cout << "Dimensions: " << width << " x " << height << " x " << num_colors << std::endl; } void Canvas::output_file(const char * filename){ @@ -134,7 +132,7 @@ void Canvas::output_file(const char * filename){ } if ( n <= 10 ) { - cout << "not enough data" << endl; + std::cout << "not enough data" << std::endl; } } @@ -185,13 +183,13 @@ void Canvas::output_file(const char * filename){ delete max_int; delete power; - cout << "ready for writing file i suppose: " << filename << endl; + std::cout << "ready for writing file i suppose: " << filename << std::endl; - ofstream file(filename); + std::ofstream file(filename); if ( !file ) { - cout << "jij hebt pech, geen png voor jou" << endl; + std::cout << "jij hebt pech, geen png voor jou" << std::endl; } - cout << filename << endl; + std::cout << filename << std::endl; pngFile->close(); @@ -212,7 +210,7 @@ void Canvas::output_file(){ void Canvas::output_raw(const char * filename){ - ofstream outfile (filename, ofstream::binary); + std::ofstream outfile (filename, std::ofstream::binary); outfile.write(reinterpret_cast(int_array), sizeof(unsigned int)*width*height*num_colors); @@ -230,18 +228,18 @@ void Canvas::output_raw(){ } void Canvas::input_raw(const char * filename){ - ifstream infile(filename, ifstream::binary); + std::ifstream infile(filename, std::ifstream::binary); if ( ! infile ) { - cout << "poep" << endl; + std::cout << "poep" << std::endl; return; } - infile.seekg (0, ios::end); + infile.seekg (0, std::ios::end); int length = infile.tellg(); - infile.seekg (0, ios::beg); + infile.seekg (0, std::ios::beg); - cout << "length: " << length << " =? " << static_cast(width*height*num_colors*sizeof(unsigned int)) << endl; + std::cout << "length: " << length << " =? " << static_cast(width*height*num_colors*sizeof(unsigned int)) << std::endl; infile.read (reinterpret_cast(int_array), sizeof (unsigned int)*width*height*num_colors); } diff --git a/Canvas.hpp b/Canvas.hpp index 2e82d8f..e03c8aa 100644 --- a/Canvas.hpp +++ b/Canvas.hpp @@ -1,28 +1,28 @@ -#ifndef CANVAS_HPP -#define CANVAS_HPP - +#ifndef CANVAS_HPP +#define CANVAS_HPP + //#include "Vector.hpp" #include "Attractor.hpp" -#include "Projector.hpp" - -// TODO : Canvas class abstraheren (zodat er makkelijk verschillende soorten canvae gemaakt kunnen worden) +#include "Projector.hpp" + +// TODO : Canvas class abstraheren (zodat er makkelijk verschillende soorten canvae gemaakt kunnen worden) class Canvas{ friend class Projector; - + unsigned int dim; unsigned int width; unsigned int height; - unsigned int num_colors; - + unsigned int num_colors; + unsigned int * size; unsigned int * int_array; - public: - - double v; + public: + + double v; Canvas(unsigned int width, unsigned int height, unsigned int num_colors = 1); @@ -38,13 +38,13 @@ class Canvas{ //void output(Vector& point); void output_file(const char * filename); - void output_file(); - void output_raw(const char * filename); - void output_raw(); + void output_file(); + void output_raw(const char * filename); + void output_raw(); void input_raw(const char * filename); }; - - -#endif // CANVAS_HPP + + +#endif // CANVAS_HPP diff --git a/Projector.cpp b/Projector.cpp index f50db2c..e2994c9 100644 --- a/Projector.cpp +++ b/Projector.cpp @@ -1,8 +1,6 @@ #include #include -#include #include -using namespace std; #include "Projector.hpp" #include "Canvas.hpp" @@ -66,7 +64,7 @@ void Projector::finish_range() { if ( factor * dist > (double)canvas->size[i] ) { factor = (double)canvas->size[i] / dist; //teh_size = canvas->size[i]; - cout << "crap for dim" << i << endl; + std::cout << "crap for dim" << i << std::endl; } } @@ -102,10 +100,10 @@ void Projector::plot(const double * point) { void Projector::output(){ - cout << "Projector properties: " << endl; - cout << " factor: " << factor << endl; + std::cout << "Projector properties: " << std::endl; + std::cout << " factor: " << factor << std::endl; for ( unsigned int i = 0; i < intern_dim; i++ ) { - cout << " dimension " << i << ": offset: " << offset[i] << ", range: [" << range_min[i] << ", " << range_max[i] << "]" << endl; + std::cout << " dimension " << i << ": offset: " << offset[i] << ", range: [" << range_min[i] << ", " << range_max[i] << "]" << std::endl; } } diff --git a/Projector.hpp b/Projector.hpp index 4dfcd9d..4574d26 100644 --- a/Projector.hpp +++ b/Projector.hpp @@ -1,9 +1,5 @@ -#ifndef PROJECTOR_HPP -#define PROJECTOR_HPP - -#include - -#include "Canvas.hpp" +#ifndef PROJECTOR_HPP +#define PROJECTOR_HPP class Canvas; @@ -28,18 +24,18 @@ class Projector{ void finish_range(); - // TODO : Matrix gebruiken voor lineaire afbeelding - // TODO : Over kleuren nadenken - /* - Kleurmodi: - -genormalizeerde coordinaten als kleurintensiteit (gebruikt fp canvas) - -kleurbanden, dus met een periodieke functie (gebruikt int canvas) + // TODO : Matrix gebruiken voor lineaire afbeelding + // TODO : Over kleuren nadenken + /* + Kleurmodi: + -genormalizeerde coordinaten als kleurintensiteit (gebruikt fp canvas) + -kleurbanden, dus met een periodieke functie (gebruikt int canvas) */ void project(const double * point); void plot(const double * point); - + void output(); -}; - -#endif // PROJECTOR_HPP +}; + +#endif // PROJECTOR_HPP diff --git a/kernels/KernelBasicParameter.hpp b/kernels/KernelBasicParameter.hpp index 74b07b4..f7cba04 100644 --- a/kernels/KernelBasicParameter.hpp +++ b/kernels/KernelBasicParameter.hpp @@ -12,6 +12,10 @@ #include "../AttractorKernel.hpp" +/* + This is a partial default implementation of the abstract AttractorKernel class + you can easily use the constructor to initialise the parameters and stuff... + */ class KernelBasicParameter : virtual public AttractorKernel { private: diff --git a/kernels/KernelBasicVector.hpp b/kernels/KernelBasicVector.hpp index 1acbc6e..28c14c3 100644 --- a/kernels/KernelBasicVector.hpp +++ b/kernels/KernelBasicVector.hpp @@ -12,6 +12,10 @@ #include "../AttractorKernel.hpp" +/* + This is a partial default implementation of the abstract AttractorKernel class + you can easily use the constructor to initialise the vectors and stuff... + */ class KernelBasicVector : virtual public AttractorKernel { protected: diff --git a/kernels/Logistic.cpp b/kernels/Logistic.cpp index 1e97022..0943ab7 100644 --- a/kernels/Logistic.cpp +++ b/kernels/Logistic.cpp @@ -7,6 +7,7 @@ // #include "Logistic.hpp" +#include Logistic::Logistic(): KernelBasicParameter(3), diff --git a/kernels/Lorenz3D.cpp b/kernels/Lorenz3D.cpp index 1b137d2..43bd02f 100644 --- a/kernels/Lorenz3D.cpp +++ b/kernels/Lorenz3D.cpp @@ -1,4 +1,5 @@ #include "Lorenz3D.hpp" +#include Lorenz3D::Lorenz3D(): KernelBasicParameter(4), diff --git a/kernels/Polynomial.cpp b/kernels/Polynomial.cpp index 7a36259..7c6a9f1 100644 --- a/kernels/Polynomial.cpp +++ b/kernels/Polynomial.cpp @@ -7,6 +7,7 @@ // #include "Polynomial.hpp" +#include //#include Polynomial::Polynomial(): diff --git a/kernels/PolynomialA3D.cpp b/kernels/PolynomialA3D.cpp index 9b200ed..8dfeccb 100644 --- a/kernels/PolynomialA3D.cpp +++ b/kernels/PolynomialA3D.cpp @@ -7,6 +7,7 @@ // #include "PolynomialA3D.hpp" +#include PolynomialA3D::PolynomialA3D(): KernelBasicParameter(3), diff --git a/kernels/Unravel3D.cpp b/kernels/Unravel3D.cpp index e21d6e4..7842475 100644 --- a/kernels/Unravel3D.cpp +++ b/kernels/Unravel3D.cpp @@ -1,4 +1,5 @@ #include "Unravel3D.hpp" +#include #include Unravel3D::Unravel3D(): diff --git a/myMath.hpp b/myMath.hpp index db88044..73b8524 100644 --- a/myMath.hpp +++ b/myMath.hpp @@ -2,7 +2,6 @@ #define MYMATH_HPP #include -using namespace std; bool even(double x) { return (((int)floor(x)) % 2 == 0);