rt300@34: // rt300@34: // hilbert.h rt300@34: // sonicZoom rt300@34: // rt300@34: // Created by Robert Tubb on 04/04/2013. rt300@34: // rt300@34: // Handles the hilbert curve stuff rt300@34: rt300@34: #ifndef __sonicZoom__hilbert__ rt300@34: #define __sonicZoom__hilbert__ rt300@34: rt300@34: #include rt300@34: #include rt300@34: #include "ofMain.h" rt300@34: #include "rot_rules.h" rt300@47: rt300@34: rt300@34: rt300@34: rt300@34: class Hilbert{ rt300@34: private: rt300@34: int P; // dimensionas of high D space rt300@34: int N; // number of resolution bits rt300@34: int codeLength; rt300@43: rt300@43: rt300@43: rt300@34: vector > cubeStartVertices; rt300@34: vector cubeRotations; rt300@34: vector > theGrayCode; rt300@34: vector theGrayCodeD; rt300@43: vector theEntryVertices; rt300@43: vector theRotations; rt300@37: rt300@34: void makeCode(); rt300@37: rt300@34: void makeRotationRules(); rt300@34: int rotate(int vertex, int entryPoint, int direction); rt300@34: int rotateInverse(int vertex, int entryPoint, int direction) ; rt300@37: public: rt300@43: Hilbert(); rt300@43: Hilbert(int N, int P); rt300@43: void changeCurve(int aN, int aP); rt300@37: vector calculateParamsFromIndex(unsigned long long coord); rt300@37: unsigned long long calculateIndexFromParams(vector params); rt300@37: rt300@34: }; rt300@34: rt300@34: rt300@47: #endif /* defined(__sonicZoom__hilbert__) */