Joshua Moerman
14 years ago
11 changed files with 188 additions and 127 deletions
@ -1,41 +1,53 @@ |
|||
#ifndef PROJECTOR_HPP |
|||
#define PROJECTOR_HPP |
|||
|
|||
class Canvas; |
|||
|
|||
class Projector{ |
|||
public: |
|||
|
|||
unsigned int extern_dim; |
|||
unsigned int intern_dim; |
|||
|
|||
Canvas * canvas; |
|||
double * project_point; |
|||
|
|||
double * range_min; |
|||
double * range_max; |
|||
double factor; |
|||
double * offset; |
|||
|
|||
void init(const double * point); |
|||
void init_vector(); |
|||
void init_range(); |
|||
void update_range(const double * point); |
|||
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) |
|||
*/ |
|||
void project(const double * point); |
|||
void plot(const double * point); |
|||
|
|||
void output(); |
|||
}; |
|||
|
|||
#endif // PROJECTOR_HPP
|
|||
|
|||
#ifndef PROJECTOR_HPP |
|||
#define PROJECTOR_HPP |
|||
|
|||
#include "stfu/stf.hpp" |
|||
|
|||
class Canvas; |
|||
|
|||
class Projector { |
|||
private: |
|||
Canvas* canvas; |
|||
Projector* projector; |
|||
|
|||
allocate(); |
|||
deallocate(); |
|||
|
|||
protected: |
|||
unsigned int inputDimension; |
|||
unsigned int outputDimension; |
|||
|
|||
double* projectedPoint; |
|||
|
|||
double* range_min; |
|||
double* range_max; |
|||
double factor; |
|||
double* offset; |
|||
|
|||
void project(const double* point); |
|||
|
|||
public: |
|||
|
|||
Projector(unsigned int inputDimension, unsigned int outputDimension); |
|||
|
|||
virtual ~Projector(); |
|||
|
|||
static Projector* createProjector(stfu::node const& projector, stfu::node const& system); |
|||
|
|||
|
|||
|
|||
void init(const double* point); |
|||
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