annotate hilbert.h @ 37:8ed7522deaaa

Interpolation.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Tue, 09 Apr 2013 17:14:31 +0100
parents 790939017078
children b91a1859829a
rev   line source
rt300@34 1 //
rt300@34 2 // hilbert.h
rt300@34 3 // sonicZoom
rt300@34 4 //
rt300@34 5 // Created by Robert Tubb on 04/04/2013.
rt300@34 6 //
rt300@34 7 // Handles the hilbert curve stuff
rt300@34 8
rt300@34 9 #ifndef __sonicZoom__hilbert__
rt300@34 10 #define __sonicZoom__hilbert__
rt300@34 11
rt300@34 12 #include <iostream>
rt300@34 13 #include <vector.h>
rt300@34 14 #include "ofMain.h"
rt300@34 15 #include "rot_rules.h"
rt300@34 16 #endif /* defined(__sonicZoom__hilbert__) */
rt300@34 17
rt300@34 18
rt300@34 19
rt300@34 20 class Hilbert{
rt300@34 21 private:
rt300@34 22 int P; // dimensionas of high D space
rt300@34 23 int N; // number of resolution bits
rt300@34 24 int codeLength;
rt300@34 25 vector<vector <bool> > cubeStartVertices;
rt300@34 26 vector<int> cubeRotations;
rt300@34 27 vector<vector <bool> > theGrayCode;
rt300@34 28 vector<unsigned int> theGrayCodeD;
rt300@34 29
rt300@37 30
rt300@34 31 void makeCode();
rt300@37 32
rt300@34 33 void makeRotationRules();
rt300@34 34 int rotate(int vertex, int entryPoint, int direction);
rt300@34 35 int rotateInverse(int vertex, int entryPoint, int direction) ;
rt300@37 36 public:
rt300@37 37 void init(int N, int P);
rt300@37 38 vector<int> calculateParamsFromIndex(unsigned long long coord);
rt300@37 39 unsigned long long calculateIndexFromParams(vector<int> params);
rt300@37 40
rt300@34 41 };
rt300@34 42
rt300@34 43
rt300@34 44