Joshua Moerman
14 years ago
11 changed files with 188 additions and 127 deletions
@ -1,41 +1,53 @@ |
|||||
#ifndef PROJECTOR_HPP |
#ifndef PROJECTOR_HPP |
||||
#define PROJECTOR_HPP |
#define PROJECTOR_HPP |
||||
|
|
||||
class Canvas; |
#include "stfu/stf.hpp" |
||||
|
|
||||
class Projector{ |
class Canvas; |
||||
public: |
|
||||
|
class Projector { |
||||
unsigned int extern_dim; |
private: |
||||
unsigned int intern_dim; |
Canvas* canvas; |
||||
|
Projector* projector; |
||||
Canvas * canvas; |
|
||||
double * project_point; |
allocate(); |
||||
|
deallocate(); |
||||
double * range_min; |
|
||||
double * range_max; |
protected: |
||||
double factor; |
unsigned int inputDimension; |
||||
double * offset; |
unsigned int outputDimension; |
||||
|
|
||||
void init(const double * point); |
double* projectedPoint; |
||||
void init_vector(); |
|
||||
void init_range(); |
double* range_min; |
||||
void update_range(const double * point); |
double* range_max; |
||||
void finish_range(); |
double factor; |
||||
|
double* offset; |
||||
|
|
||||
// TODO : Matrix gebruiken voor lineaire afbeelding
|
void project(const double* point); |
||||
// TODO : Over kleuren nadenken
|
|
||||
/*
|
public: |
||||
Kleurmodi: |
|
||||
-genormalizeerde coordinaten als kleurintensiteit (gebruikt fp canvas) |
Projector(unsigned int inputDimension, unsigned int outputDimension); |
||||
-kleurbanden, dus met een periodieke functie (gebruikt int canvas) |
|
||||
*/ |
virtual ~Projector(); |
||||
void project(const double * point); |
|
||||
void plot(const double * point); |
static Projector* createProjector(stfu::node const& projector, stfu::node const& system); |
||||
|
|
||||
void output(); |
|
||||
}; |
|
||||
|
void init(const double* point); |
||||
#endif // PROJECTOR_HPP
|
void init_vector(); |
||||
|
void init_range(); |
||||
|
void update_range(const double* point); |
||||
|
void finish_range(); |
||||
|
|
||||
|
void plot(const double* point); |
||||
|
|
||||
|
|
||||
|
|
||||
|
void output(); |
||||
|
}; |
||||
|
|
||||
|
#endif // PROJECTOR_HPP
|
||||
|
|
||||
|
@ -0,0 +1,24 @@ |
|||||
|
#ifndef OSTREAM_HELPERS_HPP |
||||
|
#define OSTREAM_HELPERS_HPP |
||||
|
|
||||
|
#include <iterator> |
||||
|
#include <algorithm> |
||||
|
|
||||
|
#include "AttractorKernel.hpp" |
||||
|
#include "Attractor.hpp" |
||||
|
|
||||
|
std::ostream& operator<<(std::ostream& os, AttractorKernel const& x) { |
||||
|
const unsigned int dimension = x.getDimension(); |
||||
|
const double * point = x.vector(); |
||||
|
|
||||
|
std::copy(point, point+dimension, std::ostream_iterator<double>(os, ", ")); |
||||
|
return os; |
||||
|
} |
||||
|
|
||||
|
std::ostream& operator<<(std::ostream& os, Attractor const& x) { |
||||
|
os << x.kernel << "\n"; |
||||
|
os << x.projector << "\n"; |
||||
|
return os; |
||||
|
} |
||||
|
|
||||
|
#endif // OSTREAM_HELPERS_HPP
|
Reference in new issue