just a test

Dependencies:   mbed

Fork of scoreLight_Advanced by Alvaro Cassinelli

Committer:
mbedalvaro
Date:
Thu Apr 12 14:50:50 2012 +0000
Revision:
15:56a0bf424e8d
Parent:
11:62f7183a03e7
Child:
19:228430f1350e
this is not bad, but still two or more spots produce problems. Need to re-trace TWICE a spot - or do like before, do a little more of it's trajectory.

Who changed what in which revision?

UserRevisionLine numberNew contents of line
mbedalvaro 0:345b3bc7a0ea 1 #ifndef blobConf_h
mbedalvaro 0:345b3bc7a0ea 2 #define blobConf_h
mbedalvaro 0:345b3bc7a0ea 3
mbedalvaro 0:345b3bc7a0ea 4 // include all kind of spots classes (childs of soundSpot)
mbedalvaro 15:56a0bf424e8d 5 #include "elasticLoop.h"
mbedalvaro 1:a4050fee11f7 6 #include "rigidLoop.h"
mbedalvaro 0:345b3bc7a0ea 7
mbedalvaro 11:62f7183a03e7 8 #include <vector>
mbedalvaro 15:56a0bf424e8d 9 //#include <deque>; // using a deque instead of a vector can have advantanges in terms of memory (deque can handle fragmented memory), BUT IS SLOWER.
mbedalvaro 15:56a0bf424e8d 10 using namespace std;
mbedalvaro 11:62f7183a03e7 11
mbedalvaro 0:345b3bc7a0ea 12 class blobConfig {
mbedalvaro 15:56a0bf424e8d 13 public:
mbedalvaro 15:56a0bf424e8d 14
mbedalvaro 15:56a0bf424e8d 15 //========== Methods =============
mbedalvaro 15:56a0bf424e8d 16 blobConfig(); // overaloded constructor
mbedalvaro 15:56a0bf424e8d 17 ~blobConfig();
mbedalvaro 15:56a0bf424e8d 18
mbedalvaro 15:56a0bf424e8d 19 void clearConfig(); // actually delete every element of the config (note: the blobArray is a vector of POINTERS, it is not enought to do blobArray.clear()).
mbedalvaro 15:56a0bf424e8d 20
mbedalvaro 15:56a0bf424e8d 21 void allKill(); // this put all the blobs in "dead" mode, meaning that neither rendering nor update is done (but they are not deleted).
mbedalvaro 15:56a0bf424e8d 22 void allAlive();
mbedalvaro 15:56a0bf424e8d 23
mbedalvaro 15:56a0bf424e8d 24 void allStandBy(); //NO update, but rendering may be done (they are "frozen" in their positions)
mbedalvaro 15:56a0bf424e8d 25 void allResume();
mbedalvaro 15:56a0bf424e8d 26
mbedalvaro 15:56a0bf424e8d 27 void allInvisible(); // blobs are invisible, but they may continue to evolve (call to update)
mbedalvaro 15:56a0bf424e8d 28 void allVisible();
mbedalvaro 15:56a0bf424e8d 29
mbedalvaro 15:56a0bf424e8d 30 void update(); // update dynamics
mbedalvaro 15:56a0bf424e8d 31 void draw(); // draw in the LaserSensingTrajectory object (lsdTrajectory) of each blob, using the openGL laser rendering (not yet done).
mbedalvaro 15:56a0bf424e8d 32
mbedalvaro 15:56a0bf424e8d 33 void sendConfData(); // send OSC data for all the blobs
mbedalvaro 15:56a0bf424e8d 34
mbedalvaro 15:56a0bf424e8d 35 // ========= Standard configurations: =====================
mbedalvaro 15:56a0bf424e8d 36 void computeBoundingBox();
mbedalvaro 15:56a0bf424e8d 37
mbedalvaro 15:56a0bf424e8d 38 void addOneElasticLoopRelax();
mbedalvaro 15:56a0bf424e8d 39 void addOneElasticLoopContract();
mbedalvaro 15:56a0bf424e8d 40 void addOneElasticLoopContractCentral();
mbedalvaro 15:56a0bf424e8d 41 void addOneElasticContourFollowing();
mbedalvaro 15:56a0bf424e8d 42 void addOneElasticContourFollowingFAST();
mbedalvaro 15:56a0bf424e8d 43 void addOneElasticBouncing();
mbedalvaro 15:56a0bf424e8d 44
mbedalvaro 15:56a0bf424e8d 45 void addOneRigidLoopBouncing();
mbedalvaro 15:56a0bf424e8d 46 void addOneRigidLoopFollowing();
mbedalvaro 15:56a0bf424e8d 47 void addOneRigidLoopTest();
mbedalvaro 15:56a0bf424e8d 48
mbedalvaro 15:56a0bf424e8d 49 //========== Variables =============
mbedalvaro 15:56a0bf424e8d 50 // I use an array (actually a vector) of POINTERS of polymorphic class soundSpot with virtual methods (this way we can access polymorphic methods - of children - with a pointer)
mbedalvaro 15:56a0bf424e8d 51 // BUT ATTENTION when clearing the vector: instantiated objects must be DELETED before.
mbedalvaro 15:56a0bf424e8d 52 vector<soundSpot*> blobArray;
mbedalvaro 15:56a0bf424e8d 53 int numBlobs;// this is just equal to blobArray.size()
mbedalvaro 0:345b3bc7a0ea 54 };
mbedalvaro 0:345b3bc7a0ea 55
mbedalvaro 0:345b3bc7a0ea 56
mbedalvaro 0:345b3bc7a0ea 57 #endif