diff presetManager.h @ 5:5ee5ef99e117

presets have "icons" and save OK. Snapping works. move velocity still frustrating.
author Robert Tubb <rt300@eecs.qmul.ac.uk>
date Wed, 05 Dec 2012 18:42:02 +0000
parents 7541aeaebcdc
children 845ea04f8e33
line wrap: on
line diff
--- a/presetManager.h	Tue Dec 04 18:36:00 2012 +0000
+++ b/presetManager.h	Wed Dec 05 18:42:02 2012 +0000
@@ -24,17 +24,21 @@
     int presetID;
     string name;
     long long savetime;
+    vector<ofColor> pixVals;
     double timemsd = [NSDate timeIntervalSinceReferenceDate];
     
     TwoVector coordinates;
     
-    Preset(TwoVector acoord, string aname,int aID){
+    // from save button press
+    Preset(TwoVector acoord, string aname,int aID, const vector<ofColor> & pixCols){
         coordinates = acoord;
         name = aname;
         presetID = aID;
         
         timemsd = [NSDate timeIntervalSinceReferenceDate];
         savetime = (long long)(timemsd*1000);
+        pixVals = pixCols;
+        
 
     };
     Preset(int aID){
@@ -46,13 +50,17 @@
         
     };
 
-    Preset(TwoVector acoord, string aname,int aID, long long stime){
+    // from file load
+    Preset(TwoVector acoord, string aname,int aID, long long stime, const vector<ofColor> & pixCols){
         coordinates = acoord;
         name = aname;
         presetID = aID;
         savetime = stime;
+        pixVals = pixCols;
         
     };
+    
+    void draw();
 
 };
 
@@ -72,12 +80,14 @@
     
     TwoVector recallPreset(int presetID); // by name ? id?
     TwoVector recallPreset(string name); // by name ? id?
-    vector<TwoVector > getPresetsInRange(TwoVector min, TwoVector max);
+    vector<Preset *>  getPresetsInRange(TwoVector min, TwoVector max);
+    void drawPresetsInRange(const TwoVector min, const TwoVector max);
+    vector<ofColor> makePresetPicture(TwoVector coord);
     void printAll();
     
     void startupLoadAll();  // get stuff from XML
     void exitAndSaveAll();  // save to XML, delete presets array (?)
-    void deleteAll();
+    void clearAll();
     
     PresetManager();
 };
@@ -113,7 +123,6 @@
         }
         TwoVector pcoord(px,py);
         int n = p.loadPreset(pcoord, pname, stime);
-        cout << "read preset : " << n << '\n';
         return(is);
     }