2012-01-24 15:13:07 +01:00
|
|
|
/*
|
|
|
|
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
|
|
|
|
~ author: dviid
|
|
|
|
|
~ contact: dviid@labs.ciid.dk
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#pragma once
|
|
|
|
|
|
|
|
|
|
#include "ofMain.h"
|
2012-02-11 18:54:46 +01:00
|
|
|
#include "ofEvents.h"
|
2012-01-24 15:13:07 +01:00
|
|
|
|
|
|
|
|
#include "AbstractAnalysis.h"
|
|
|
|
|
#include "AnalysisAdaptor.h"
|
|
|
|
|
|
|
|
|
|
|
2012-02-15 07:58:10 +01:00
|
|
|
typedef map<string, AnalysisAdaptor*> TAnalysisMap;
|
|
|
|
|
typedef vector<AnalysisAdaptor*> TAnalysisVec;
|
|
|
|
|
|
2012-01-24 15:13:07 +01:00
|
|
|
class RefractiveIndex : public ofBaseApp
|
|
|
|
|
{
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
|
|
// ofx
|
|
|
|
|
void setup();
|
|
|
|
|
void update();
|
|
|
|
|
void draw();
|
2012-02-12 09:39:36 +01:00
|
|
|
void exit();
|
2012-01-24 15:13:07 +01:00
|
|
|
|
2012-02-15 07:58:10 +01:00
|
|
|
// camera
|
2012-01-24 15:13:07 +01:00
|
|
|
void setup_camera();
|
2012-02-12 09:39:36 +01:00
|
|
|
void stop_camera();
|
2012-02-15 07:58:10 +01:00
|
|
|
|
|
|
|
|
// starts the whole process
|
2012-02-11 18:54:46 +01:00
|
|
|
void start_analysis();
|
2012-02-15 07:58:10 +01:00
|
|
|
|
|
|
|
|
// stops the whole process
|
2012-02-11 18:54:46 +01:00
|
|
|
void stop_analysis();
|
2012-02-15 07:58:10 +01:00
|
|
|
|
|
|
|
|
// callbacks
|
|
|
|
|
void acquire_cb(string & analysis);
|
|
|
|
|
void synthesize_cb(string & analysis);
|
|
|
|
|
|
|
|
|
|
// state machine
|
|
|
|
|
void state_machine_analysis();
|
2012-01-24 15:13:07 +01:00
|
|
|
|
|
|
|
|
// ofx
|
|
|
|
|
void keyPressed (int key);
|
|
|
|
|
void keyReleased(int key){;}
|
|
|
|
|
void mouseMoved(int x, int y ){;}
|
2012-02-12 09:39:36 +01:00
|
|
|
void mouseDragged(int x, int y, int button){;}
|
|
|
|
|
void mousePressed(int x, int y, int button){;}
|
|
|
|
|
void mouseReleased(int x, int y, int button){;}
|
2012-01-24 15:13:07 +01:00
|
|
|
void windowResized(int w, int h){;}
|
|
|
|
|
|
|
|
|
|
protected:
|
2012-02-15 07:58:10 +01:00
|
|
|
|
|
|
|
|
AbstractAnalysis* _currentAnalysis;
|
|
|
|
|
AnalysisAdaptor* _currentAnalysisAdaptor;
|
|
|
|
|
AnalysisAdaptor* _currentSynthesisAdaptor;
|
|
|
|
|
TAnalysisMap::iterator _currentAnalysisIndx;
|
2012-01-24 15:13:07 +01:00
|
|
|
|
2012-02-15 07:58:10 +01:00
|
|
|
TAnalysisMap _acquisitionMap;
|
|
|
|
|
TAnalysisMap _synthesisMap;
|
2012-01-24 15:13:07 +01:00
|
|
|
|
2012-02-15 07:58:10 +01:00
|
|
|
TAnalysisVec _display_results_vector;
|
|
|
|
|
|
2012-01-24 16:52:22 +01:00
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
// acquisition
|
|
|
|
|
static ofPixels _pixels;
|
|
|
|
|
static ofVideoGrabber _vidGrabber;
|
2012-02-11 18:54:46 +01:00
|
|
|
vector<string> videoSourceList;
|
2012-01-24 16:52:22 +01:00
|
|
|
static int _vid_w, _vid_h, _vid_id;
|
|
|
|
|
static bool _vid_stream_open;
|
|
|
|
|
static bool _vid_toggle_on;
|
2012-02-11 18:54:46 +01:00
|
|
|
|
|
|
|
|
// this should be in xml
|
2012-02-15 07:58:10 +01:00
|
|
|
static string _location;
|
2012-01-24 16:52:22 +01:00
|
|
|
|
2012-01-24 15:13:07 +01:00
|
|
|
};
|