Mercurial > hg > wabletios
annotate scanpath.h @ 6:5b659bc0b572
line mesh for supernatant
author | Robert Tubb <rt300@eecs.qmul.ac.uk> |
---|---|
date | Mon, 04 Feb 2013 19:26:08 +0000 |
parents | d346ddc50f70 |
children | 4ea605899aca |
rev | line source |
---|---|
rt300@0 | 1 /* |
rt300@0 | 2 * scanpath.h |
rt300@0 | 3 * springstructure |
rt300@0 | 4 * |
rt300@0 | 5 * Created by Robert Tubb on 09/06/2011. |
rt300@0 | 6 * Copyright 2011 __MyCompanyName__. All rights reserved. |
rt300@0 | 7 * |
rt300@0 | 8 */ |
rt300@0 | 9 |
rt300@0 | 10 #ifndef _SCANPATHH |
rt300@0 | 11 #define _SCANPATHH |
rt300@0 | 12 #include "lump.h" |
rt300@0 | 13 #include "spring.h" |
rt300@0 | 14 #include <vector> |
rt300@3 | 15 struct Element{ |
rt300@3 | 16 Lump * eLump; |
rt300@3 | 17 Spring * eSpring; |
rt300@3 | 18 Element(Lump * aLump, Spring * aSpring){ |
rt300@3 | 19 eLump = aLump; |
rt300@3 | 20 eSpring = aSpring; |
rt300@3 | 21 |
rt300@3 | 22 }; |
rt300@3 | 23 |
rt300@3 | 24 }; |
rt300@0 | 25 |
rt300@0 | 26 class ScanPath{ |
rt300@0 | 27 private: |
rt300@0 | 28 int numElements; |
rt300@0 | 29 int maxElements; |
rt300@0 | 30 |
rt300@0 | 31 bool audioAccessing; |
rt300@0 | 32 bool updateAccessing; |
rt300@0 | 33 |
rt300@6 | 34 bool bidirectional; |
rt300@0 | 35 //Spring ** springPath; |
rt300@0 | 36 // springpath - an array of pointers to the springs in the path |
rt300@3 | 37 // lump path - ditto should be same number |
rt300@3 | 38 vector<Element> pathElements; |
rt300@3 | 39 |
rt300@0 | 40 double * wavetableNew; |
rt300@0 | 41 double * wavetableOld; |
rt300@0 | 42 double * wavetableUpdate; |
rt300@0 | 43 |
rt300@0 | 44 double currentLength; |
rt300@0 | 45 |
rt300@0 | 46 double frameInterpolator; |
rt300@0 | 47 double framesPerSample; |
rt300@0 | 48 |
rt300@0 | 49 |
rt300@0 | 50 |
rt300@0 | 51 |
rt300@0 | 52 public: |
rt300@0 | 53 enum scanModes {DISPLACEMENT,SPEED,SPRING_FORCE,YPOS}; |
rt300@0 | 54 |
rt300@0 | 55 scanModes scanMode; |
rt300@0 | 56 double restLength; |
rt300@0 | 57 |
rt300@0 | 58 ScanPath(); |
rt300@0 | 59 ~ScanPath(); |
rt300@3 | 60 void init(); |
rt300@0 | 61 |
rt300@0 | 62 void inscribe(double ax,double ay); |
rt300@0 | 63 void clear(); |
rt300@0 | 64 |
rt300@0 | 65 void draw(); |
rt300@0 | 66 void drawCubic(); |
rt300@0 | 67 |
rt300@0 | 68 double getTotalLength(); |
rt300@0 | 69 int howManyElements(); |
rt300@0 | 70 |
rt300@0 | 71 |
rt300@0 | 72 void addSpring(); |
rt300@0 | 73 void addLump(); |
rt300@0 | 74 double getNextSample(); |
rt300@0 | 75 double getNextSample(double aPhasor); |
rt300@0 | 76 double getNextSampleCubic(double aPhasor); |
rt300@0 | 77 // redone stuff |
rt300@0 | 78 void initWavetables(); |
rt300@3 | 79 void addElement(Lump* const aLump, Spring * const aSpring); |
rt300@0 | 80 |
rt300@0 | 81 void updateWavetables(); |
rt300@0 | 82 |
rt300@0 | 83 }; |
rt300@0 | 84 |
rt300@0 | 85 #endif |