Mercurial > hg > soniczoomios
annotate hilbert.h @ 49:178642d134a7 tip
xtra files
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Wed, 01 May 2013 17:34:33 +0100 |
parents | 0d3a993405e4 |
children |
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@47 | 16 |
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@43 | 25 |
rt300@43 | 26 |
rt300@43 | 27 |
rt300@34 | 28 vector<vector <bool> > cubeStartVertices; |
rt300@34 | 29 vector<int> cubeRotations; |
rt300@34 | 30 vector<vector <bool> > theGrayCode; |
rt300@34 | 31 vector<unsigned int> theGrayCodeD; |
rt300@43 | 32 vector<unsigned int> theEntryVertices; |
rt300@43 | 33 vector<unsigned int> theRotations; |
rt300@37 | 34 |
rt300@34 | 35 void makeCode(); |
rt300@37 | 36 |
rt300@34 | 37 void makeRotationRules(); |
rt300@34 | 38 int rotate(int vertex, int entryPoint, int direction); |
rt300@34 | 39 int rotateInverse(int vertex, int entryPoint, int direction) ; |
rt300@37 | 40 public: |
rt300@43 | 41 Hilbert(); |
rt300@43 | 42 Hilbert(int N, int P); |
rt300@43 | 43 void changeCurve(int aN, int aP); |
rt300@37 | 44 vector<int> calculateParamsFromIndex(unsigned long long coord); |
rt300@37 | 45 unsigned long long calculateIndexFromParams(vector<int> params); |
rt300@37 | 46 |
rt300@34 | 47 }; |
rt300@34 | 48 |
rt300@34 | 49 |
rt300@47 | 50 #endif /* defined(__sonicZoom__hilbert__) */ |