Browse Source

cleaing up includes and namespace shit

master
Joshua Moerman 15 years ago
parent
commit
6cc3750f3b
  1. 3
      AttractorKernel.hpp
  2. 28
      Canvas.cpp
  3. 10
      Projector.cpp
  4. 4
      Projector.hpp
  5. 4
      kernels/KernelBasicParameter.hpp
  6. 4
      kernels/KernelBasicVector.hpp
  7. 1
      kernels/Logistic.cpp
  8. 1
      kernels/Lorenz3D.cpp
  9. 1
      kernels/Polynomial.cpp
  10. 1
      kernels/PolynomialA3D.cpp
  11. 1
      kernels/Unravel3D.cpp
  12. 1
      myMath.hpp

3
AttractorKernel.hpp

@ -1,13 +1,10 @@
#ifndef ATTRACTORKERNEL_HPP #ifndef ATTRACTORKERNEL_HPP
#define ATTRACTORKERNEL_HPP #define ATTRACTORKERNEL_HPP
#include <string>
/* /*
Protocol/interface, what you want Protocol/interface, what you want
*/ */
class AttractorKernel { class AttractorKernel {
public: public:

28
Canvas.cpp

@ -3,8 +3,6 @@
#include <cmath> #include <cmath>
#include <cstdlib> #include <cstdlib>
#include <cassert> #include <cassert>
//#include <cstdint>
using namespace std;
#include "pngwriter/pngwriter.h" #include "pngwriter/pngwriter.h"
@ -101,8 +99,8 @@ void Canvas::plot(double x, double y, unsigned int c, double intensity) {
I/O functions I/O functions
*/ */
void Canvas::output() { void Canvas::output() {
cout << "Canvas: " << endl; std::cout << "Canvas: " << std::endl;
cout << "Dimensions: " << width << " x " << height << " x " << num_colors << endl; std::cout << "Dimensions: " << width << " x " << height << " x " << num_colors << std::endl;
} }
void Canvas::output_file(const char * filename){ void Canvas::output_file(const char * filename){
@ -134,7 +132,7 @@ void Canvas::output_file(const char * filename){
} }
if ( n <= 10 ) { 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 max_int;
delete power; 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 ) { 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(); pngFile->close();
@ -212,7 +210,7 @@ void Canvas::output_file(){
void Canvas::output_raw(const char * filename){ void Canvas::output_raw(const char * filename){
ofstream outfile (filename, ofstream::binary); std::ofstream outfile (filename, std::ofstream::binary);
outfile.write(reinterpret_cast<char*>(int_array), sizeof(unsigned int)*width*height*num_colors); outfile.write(reinterpret_cast<char*>(int_array), sizeof(unsigned int)*width*height*num_colors);
@ -230,18 +228,18 @@ void Canvas::output_raw(){
} }
void Canvas::input_raw(const char * filename){ void Canvas::input_raw(const char * filename){
ifstream infile(filename, ifstream::binary); std::ifstream infile(filename, std::ifstream::binary);
if ( ! infile ) { if ( ! infile ) {
cout << "poep" << endl; std::cout << "poep" << std::endl;
return; return;
} }
infile.seekg (0, ios::end); infile.seekg (0, std::ios::end);
int length = infile.tellg(); int length = infile.tellg();
infile.seekg (0, ios::beg); infile.seekg (0, std::ios::beg);
cout << "length: " << length << " =? " << static_cast<int>(width*height*num_colors*sizeof(unsigned int)) << endl; std::cout << "length: " << length << " =? " << static_cast<int>(width*height*num_colors*sizeof(unsigned int)) << std::endl;
infile.read (reinterpret_cast<char*>(int_array), sizeof (unsigned int)*width*height*num_colors); infile.read (reinterpret_cast<char*>(int_array), sizeof (unsigned int)*width*height*num_colors);
} }

10
Projector.cpp

@ -1,8 +1,6 @@
#include <iostream> #include <iostream>
#include <cmath> #include <cmath>
#include <vector>
#include <cassert> #include <cassert>
using namespace std;
#include "Projector.hpp" #include "Projector.hpp"
#include "Canvas.hpp" #include "Canvas.hpp"
@ -66,7 +64,7 @@ void Projector::finish_range() {
if ( factor * dist > (double)canvas->size[i] ) { if ( factor * dist > (double)canvas->size[i] ) {
factor = (double)canvas->size[i] / dist; factor = (double)canvas->size[i] / dist;
//teh_size = canvas->size[i]; //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(){ void Projector::output(){
cout << "Projector properties: " << endl; std::cout << "Projector properties: " << std::endl;
cout << " factor: " << factor << endl; std::cout << " factor: " << factor << std::endl;
for ( unsigned int i = 0; i < intern_dim; i++ ) { 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;
} }
} }

4
Projector.hpp

@ -1,10 +1,6 @@
#ifndef PROJECTOR_HPP #ifndef PROJECTOR_HPP
#define PROJECTOR_HPP #define PROJECTOR_HPP
#include <vector>
#include "Canvas.hpp"
class Canvas; class Canvas;
class Projector{ class Projector{

4
kernels/KernelBasicParameter.hpp

@ -12,6 +12,10 @@
#include "../AttractorKernel.hpp" #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 { class KernelBasicParameter : virtual public AttractorKernel {
private: private:

4
kernels/KernelBasicVector.hpp

@ -12,6 +12,10 @@
#include "../AttractorKernel.hpp" #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 { class KernelBasicVector : virtual public AttractorKernel {
protected: protected:

1
kernels/Logistic.cpp

@ -7,6 +7,7 @@
// //
#include "Logistic.hpp" #include "Logistic.hpp"
#include <algorithm>
Logistic::Logistic(): Logistic::Logistic():
KernelBasicParameter(3), KernelBasicParameter(3),

1
kernels/Lorenz3D.cpp

@ -1,4 +1,5 @@
#include "Lorenz3D.hpp" #include "Lorenz3D.hpp"
#include <algorithm>
Lorenz3D::Lorenz3D(): Lorenz3D::Lorenz3D():
KernelBasicParameter(4), KernelBasicParameter(4),

1
kernels/Polynomial.cpp

@ -7,6 +7,7 @@
// //
#include "Polynomial.hpp" #include "Polynomial.hpp"
#include <algorithm>
//#include <iostream> //#include <iostream>
Polynomial::Polynomial(): Polynomial::Polynomial():

1
kernels/PolynomialA3D.cpp

@ -7,6 +7,7 @@
// //
#include "PolynomialA3D.hpp" #include "PolynomialA3D.hpp"
#include <algorithm>
PolynomialA3D::PolynomialA3D(): PolynomialA3D::PolynomialA3D():
KernelBasicParameter(3), KernelBasicParameter(3),

1
kernels/Unravel3D.cpp

@ -1,4 +1,5 @@
#include "Unravel3D.hpp" #include "Unravel3D.hpp"
#include <algorithm>
#include <cmath> #include <cmath>
Unravel3D::Unravel3D(): Unravel3D::Unravel3D():

1
myMath.hpp

@ -2,7 +2,6 @@
#define MYMATH_HPP #define MYMATH_HPP
#include <cmath> #include <cmath>
using namespace std;
bool even(double x) { bool even(double x) {
return (((int)floor(x)) % 2 == 0); return (((int)floor(x)) % 2 == 0);