Mercurial > hg > soniczoomios
annotate hilbert.h @ 34:94df2cd72d7b
New hilbert code - does rotations!
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Mon, 08 Apr 2013 12:58:21 +0100 |
parents | |
children | 790939017078 |
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 |
rt300@34 | 23 public: |
rt300@34 | 24 int P; // dimensionas of high D space |
rt300@34 | 25 int N; // number of resolution bits |
rt300@34 | 26 int codeLength; |
rt300@34 | 27 vector<vector <bool> > cubeStartVertices; |
rt300@34 | 28 vector<int> cubeRotations; |
rt300@34 | 29 vector<vector <bool> > theGrayCode; |
rt300@34 | 30 vector<unsigned int> theGrayCodeD; |
rt300@34 | 31 |
rt300@34 | 32 void init(int N, int P); |
rt300@34 | 33 void makeCode(); |
rt300@34 | 34 vector<int> calculateParamsFromIndex(unsigned long long coord); |
rt300@34 | 35 long long calculateIndexFromParams(vector<int> params); |
rt300@34 | 36 void makeRotationRules(); |
rt300@34 | 37 int rotate(int vertex, int entryPoint, int direction); |
rt300@34 | 38 int rotateInverse(int vertex, int entryPoint, int direction) ; |
rt300@34 | 39 }; |
rt300@34 | 40 |
rt300@34 | 41 |
rt300@34 | 42 |