Mercurial > hg > soniczoomios
diff grid.h @ 35:790939017078
V0.5. Now uses new continuous hilbert curve. HOORAY.
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Mon, 08 Apr 2013 17:23:13 +0100 |
parents | 94df2cd72d7b |
children | 8ed7522deaaa |
line wrap: on
line diff
--- a/grid.h Mon Apr 08 12:58:21 2013 +0100 +++ b/grid.h Mon Apr 08 17:23:13 2013 +0100 @@ -42,8 +42,10 @@ void setMinZoom(); void setMaxZoom(); + // HILBERT now does each coord for this vector<int> calculateParamsFromCoord(TwoVector coord) const; TwoVector calculateCoordFromParams(vector<int> params) const; + TwoVector coordToPixel(TwoVector coord); // the inverse stuff @@ -54,10 +56,13 @@ const double maxValue; // width of entire space const double minValue; // smallest zoom - const int paramsPerDim; // no of parameters per dimension ( + int paramsPerDim; // no of parameters per dimension ( + int paramBitDepth; // number of bits for the parameter control data - i.e. always 7 for midi CC + /* HILBERT + int codeLength; // the 1d size of the code, determines max extent of single tile, related to params per dim - const int paramBitDepth; // number of bits for the parameter control data - i.e. always 7 for midi CC + */ TwoVector topLeft; // top left corner of view, surface coords GUI @@ -71,29 +76,31 @@ Preset * closestPreset; // pointer to the currently selected (snapped to ) preset.. NULL if none. bool maxZoom, minZoom; - int cubeWidth; // side of hypercube. 2 for binary coding. + /* HILBERT vector< vector<bool> > vcode; // vector<int> icode; vector<int> transSeq; + */ + int midiCC[10]; // the actual params SHOULD BE INITED FROM 2*paramsPerDim // private functions - void makeCode(); + // HILBERT void makeCode(); void checkLimits(); void viewWasChanged(); void checkConsistencies(); - vector<bool> intToGray(int num, int dimToTravel=3) const; - vector<int> coordTobase32(double coord) const; - vector<int> grayToMidi(vector<vector <bool> > grayCodes) const; + // HILBERT vector<bool> intToGray(int num, int dimToTravel=3) const; + // HILBERT vector<int> coordTobase32(double coord) const; + // HILBERT vector<int> grayToMidi(vector<vector <bool> > grayCodes) const; // the inverse stuff - int grayToInt(vector<bool>) const; - double base32toCoord(vector<int>) const; - vector<vector <bool> > midiToGray(vector<int>) const; - vector<int> codesToBase32(vector<vector<bool> >) const; + // HILBERT int grayToInt(vector<bool>) const; + // HILBERT double base32toCoord(vector<int>) const; + // HILBERT vector<vector <bool> > midiToGray(vector<int>) const; + // HILBERT vector<int> codesToBase32(vector<vector<bool> >) const; vector<int> walkDiff(vector<bool> left, vector<bool> right); // not used... not worth it!