diff grid.h @ 38:0dfe9e0c01aa

Evnt trails fit with uploads. Smooth button.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Wed, 10 Apr 2013 18:57:05 +0100
parents 8ed7522deaaa
children df7c08faf541
line wrap: on
line diff
--- a/grid.h	Tue Apr 09 17:14:31 2013 +0100
+++ b/grid.h	Wed Apr 10 18:57:05 2013 +0100
@@ -40,13 +40,13 @@
     void draw();  
     void drawGridLines();
     void update(); // change according to zoom
-    int interpLevel;
+    double interpLevel;
     int smallestGridSpacing; // number of pixels when small grid dissappears from view
     vector<int> getParams();
     TwoVector getCoord();
     void setMinZoom();
     void setMaxZoom();
-    
+    void setInterpolation(interpolateModeType mode);
     // HILBERT now does each coord for this
     vector<int> calculateParamsFromCoord(TwoVector coord);
     TwoVector calculateCoordFromParams(vector<int> params);
@@ -63,11 +63,7 @@
     const double minValue;    // smallest zoom
     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
-    
-    */
+
 
     
     TwoVector topLeft; // top left corner of view, surface coords GUI
@@ -82,30 +78,18 @@
     
     bool maxZoom, minZoom;
 
-    /* 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
     
-    // HILBERT void makeCode();
+    
     void checkLimits();
     void viewWasChanged();
     void checkConsistencies();
     
-    // 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
-    // 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!
     
@@ -115,9 +99,30 @@
     void setCoord(TwoVector coord);
     void drawCrossHairs();
     
-    int calculateInterpolateLevel();
+    double calculateInterpolateLevel();
     vector<int> interpVector(vector<int> upper, vector<int> lower, float frac);
+    vector<int> interpHilbert(int bitlevel, TwoVector coord);
 
+    // the old stuff!!!!!!!!!!
+
+     int codeLength; // the 1d size of the code, determines max extent of single tile, related to params per dim
+
+    void makeCode();
+    vector< vector<bool> > vcode; //
+    vector<int> icode;
+    vector<int> transSeq;
+    
+    TwoVector calculateCoordFromParamsOld(vector<int> params) const;
+    vector<int> calculateParamsFromCoordOld(TwoVector coord) const;
+    vector<bool> intToGray(int num, int dimToTravel=3) const;
+    vector<int> coordTobase32(double coord) const;
+    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;
 
     
 };