just a test

Dependencies:   mbed

Fork of scoreLight_Advanced by Alvaro Cassinelli

Committer:
mbedalvaro
Date:
Thu Apr 12 05:16:48 2012 +0000
Revision:
11:62f7183a03e7
Parent:
5:73cd58b58f95
Child:
15:56a0bf424e8d
It seems to work (but not tested on real hardware). ; NEEDS TO DO: ; 1) DOUBLE BUFFERING; 2) template class for vector2D, so as to use unsigned short for the rigid scafold instead of float...;

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 0:345b3bc7a0ea 5 #include "elasticLoop.h"
mbedalvaro 1:a4050fee11f7 6 #include "rigidLoop.h"
mbedalvaro 0:345b3bc7a0ea 7
mbedalvaro 11:62f7183a03e7 8 #include <vector>
mbedalvaro 11:62f7183a03e7 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 11:62f7183a03e7 10 using namespace std;
mbedalvaro 11:62f7183a03e7 11
mbedalvaro 0:345b3bc7a0ea 12 class blobConfig {
mbedalvaro 0:345b3bc7a0ea 13 public:
mbedalvaro 0:345b3bc7a0ea 14
mbedalvaro 0:345b3bc7a0ea 15 //========== Methods =============
mbedalvaro 0:345b3bc7a0ea 16 blobConfig(); // overaloded constructor
mbedalvaro 0:345b3bc7a0ea 17 ~blobConfig();
mbedalvaro 0:345b3bc7a0ea 18
mbedalvaro 0:345b3bc7a0ea 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 0:345b3bc7a0ea 20
mbedalvaro 0:345b3bc7a0ea 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 0:345b3bc7a0ea 22 void allAlive();
mbedalvaro 0:345b3bc7a0ea 23
mbedalvaro 0:345b3bc7a0ea 24 void allStandBy(); //NO update, but rendering may be done (they are "frozen" in their positions)
mbedalvaro 0:345b3bc7a0ea 25 void allResume();
mbedalvaro 0:345b3bc7a0ea 26
mbedalvaro 0:345b3bc7a0ea 27 void allInvisible(); // blobs are invisible, but they may continue to evolve (call to update)
mbedalvaro 0:345b3bc7a0ea 28 void allVisible();
mbedalvaro 0:345b3bc7a0ea 29
mbedalvaro 0:345b3bc7a0ea 30 void update(); // update dynamics
mbedalvaro 0:345b3bc7a0ea 31 void draw(); // draw in the LaserSensingTrajectory object (lsdTrajectory) of each blob, using the openGL laser rendering (not yet done).
mbedalvaro 0:345b3bc7a0ea 32
mbedalvaro 0:345b3bc7a0ea 33 void sendConfData(); // send OSC data for all the blobs
mbedalvaro 0:345b3bc7a0ea 34
mbedalvaro 0:345b3bc7a0ea 35 // ========= Standard configurations: =====================
mbedalvaro 0:345b3bc7a0ea 36 void computeBoundingBox();
mbedalvaro 0:345b3bc7a0ea 37
mbedalvaro 0:345b3bc7a0ea 38 void addOneElasticLoopRelax();
mbedalvaro 0:345b3bc7a0ea 39 void addOneElasticLoopContract();
mbedalvaro 0:345b3bc7a0ea 40 void addOneElasticLoopContractCentral();
mbedalvaro 0:345b3bc7a0ea 41 void addOneElasticContourFollowing();
mbedalvaro 0:345b3bc7a0ea 42 void addOneElasticContourFollowingFAST();
mbedalvaro 0:345b3bc7a0ea 43 void addOneElasticBouncing();
mbedalvaro 0:345b3bc7a0ea 44
mbedalvaro 1:a4050fee11f7 45 void addOneRigidLoopBouncing();
mbedalvaro 1:a4050fee11f7 46 void addOneRigidLoopFollowing();
mbedalvaro 5:73cd58b58f95 47 void addOneRigidLoopTest();
mbedalvaro 1:a4050fee11f7 48
mbedalvaro 0:345b3bc7a0ea 49 //========== Variables =============
mbedalvaro 0:345b3bc7a0ea 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 0:345b3bc7a0ea 51 // BUT ATTENTION when clearing the vector: instantiated objects must be DELETED before.
mbedalvaro 0:345b3bc7a0ea 52 vector<soundSpot*> blobArray;
mbedalvaro 0:345b3bc7a0ea 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