本文整理汇总了C++中ofxTuioCursor::getSessionId方法的典型用法代码示例。如果您正苦于以下问题:C++ ofxTuioCursor::getSessionId方法的具体用法?C++ ofxTuioCursor::getSessionId怎么用?C++ ofxTuioCursor::getSessionId使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ofxTuioCursor
的用法示例。
在下文中一共展示了ofxTuioCursor::getSessionId方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: tuioUpdated
void electromagnetica::tuioUpdated(ofxTuioCursor &tuioCursor){
int mx = W_WIDTH*tuioCursor.getX();
int my = W_HEIGHT*tuioCursor.getY();
hands.notifySlide(mx, my,tuioCursor.getSessionId(),tuioCursor.getMotionAccel());
wavesm.slide(mx, my,tuioCursor.getSessionId(),tuioCursor.getMotionAccel());
// updateMagneticField(100,mx,my);
}
示例2: tuioRemoved
void electromagnetica::tuioRemoved(ofxTuioCursor &tuioCursor){
ofPoint loc = ofPoint(tuioCursor.getX()*W_WIDTH,tuioCursor.getY()*W_HEIGHT);
//cout << "Point n" << tuioCursor.getSessionId() << " remove at " << loc << endl;
/*
if(id_slider1==tuioCursor.getSessionId()) id_slider1=NULL;
if(id_jumpingRect==tuioCursor.getSessionId()) id_jumpingRect=NULL;
if(id_moverect==tuioCursor.getSessionId()) id_moverect=NULL;*/
hands.removeObjectByTuioID(tuioCursor.getSessionId() );
wavesm.touchUp(tuioCursor.getSessionId());
cheapComm::getInstance()->sendAudio0("/audio/electromagnetism/hand_off_event");
}
示例3: tuioRemoved
void testApp::tuioRemoved(ofxTuioCursor &tuioCursor){
ofLog()<< "tuioRemoved" << endl;
ofPoint loc = ofPoint(tuioCursor.getX()*W_WIDTH,tuioCursor.getY()*W_HEIGHT);
//cout << "Point n" << tuioCursor.getSessionId() << " remove at " << loc << endl;
/*
if(id_slider1==tuioCursor.getSessionId()) id_slider1=NULL;
if(id_jumpingRect==tuioCursor.getSessionId()) id_jumpingRect=NULL;
if(id_moverect==tuioCursor.getSessionId()) id_moverect=NULL;*/
touchElements.removeObjectByTuioID(tuioCursor.getSessionId() );
touchElements.notifyTouchUp( tuioCursor.getSessionId() );
}
示例4: tuioAdded
void testApp::tuioAdded(ofxTuioCursor &tuioCursor){
ofLog()<< "tuioAdded" << endl;
ofPoint loc = ofPoint(tuioCursor.getX()*W_WIDTH,tuioCursor.getY()*W_HEIGHT);
cout << "Point n" << tuioCursor.getSessionId() << " add at " << tuioCursor.getX() << " " << tuioCursor.getY()<< endl;
// o1.touch(loc.x, loc.y,tuioCursor.getSessionId());
// h1.touch(loc.x, loc.y,tuioCursor.getSessionId());
handShadow *h1 = new handShadow();
h1->setup();
touchElements.addObject(*h1);
touchElements.notifyTouch(loc.x, loc.y,tuioCursor.getSessionId());
}
示例5: tuioRemoved
void ofxMtPhoto::tuioRemoved(ofxTuioCursor &tuioCursor){
ofVec2f loc = ofVec2f(tuioCursor.getX()*ofGetWidth(),tuioCursor.getY()*ofGetHeight());
for (int i = 0; i < cursorsOnBorder.size(); i++ )
if (cursorsOnBorder[i].idN == tuioCursor.getSessionId())
cursorsOnBorder.erase(cursorsOnBorder.begin()+i);
}
示例6: tuioAdded
void ofApp::tuioAdded(ofxTuioCursor &tuioCursor)
{
tuioPoints.push_back(tuioContainer());
tuioPoints.back().sid = tuioCursor.getSessionId();
tuioPoints.back().location.set(tuioCursor.getX(), tuioCursor.getY());
tuioPoints.back().setLastLocation();
}
示例7: tuioUpdated
//--------------------------------------------------------------
void gFrameApp::tuioUpdated(ofxTuioCursor &cursor)
{
if(input_tuio)
{
GPoint the_point;
float x,y;
x = cursor.getX();
y = cursor.getY();
the_point.setLocation(ofVec2f(x, y));
the_point.setId(cursor.getFingerId());
the_point.setStrokeId(cursor.getSessionId());
the_point.setColor(localBrushColor);
the_point.setType(TUIO);
the_point.setStyle(current_style);
stroke_list.add(the_point);
finger_positions[cursor.getFingerId()] = ofVec2f(x, y);
//flowfield
simple_flow.inputUpdate(x, y, cursor.getFingerId());
simple_flow_2.inputUpdate(x, y, cursor.getFingerId());
ledFrame.stopPulsing();
ledFrame.updateLastPointsTime();
}
}
示例8: tuioAdded
void menu::tuioAdded(ofxTuioCursor &tuioCursor){
// int mx = W_WIDTH*tuioCursor.getX();
//// int mx = W_WIDTH*(tuioCursor.getX()+0.5);
// int my = W_HEIGHT*tuioCursor.getY();
// ofPoint loc = ofPoint(mx,my);
ofPoint loc = transf_PosTUIO(tuioCursor);
cout << "Point n" << tuioCursor.getSessionId() << " add at " << loc << endl;
handShadow *h1 = new handShadow();
h1->setup();
hands.addObject(*h1);
hands.notifyTouch(loc.x, loc.y,tuioCursor.getSessionId());
// touchElements.notifyTouch(loc.x, loc.y,tuioCursor.getSessionId());
}
示例9: tuioRemoved
void ofApp::tuioRemoved(ofxTuioCursor &tuioCursor)
{
int cursorIndex = getTuioPointIndex(tuioCursor.getSessionId());
if (cursorIndex >= 0)
{
tuioPoints.erase(tuioPoints.begin() + cursorIndex);
}
}
示例10: tuioRemoved
void menu::tuioRemoved(ofxTuioCursor &tuioCursor){
// int mx = W_WIDTH*tuioCursor.getX();
//// int mx = W_WIDTH*(tuioCursor.getX()+0.5);
// int my = W_HEIGHT*tuioCursor.getY();
// ofPoint loc = ofPoint(mx,my);
ofPoint loc = transf_PosTUIO(tuioCursor);
cout << "Point n" << tuioCursor.getSessionId() << " remove at " << loc << endl;
/*
if(id_slider1==tuioCursor.getSessionId()) id_slider1=NULL;
if(id_jumpingRect==tuioCursor.getSessionId()) id_jumpingRect=NULL;
if(id_moverect==tuioCursor.getSessionId()) id_moverect=NULL;
*/
//
hands.removeObjectByTuioID(tuioCursor.getSessionId() );
// touchElements.notifyTouchUp( tuioCursor.getSessionId() );
}
示例11: tuioAdded
void electromagnetica::tuioAdded(ofxTuioCursor &tuioCursor){
ofPoint loc = ofPoint(tuioCursor.getX()*W_WIDTH,tuioCursor.getY()*W_HEIGHT);
//cout << "Point n" << tuioCursor.getSessionId() << " add at " << loc << endl;
// o1.touch(loc.x, loc.y,tuioCursor.getSessionId());
// h1.touch(loc.x, loc.y,tuioCursor.getSessionId());
noiseShadow *h1 = new noiseShadow();
h1->setup();
//h1->setColor(colours[(int)( tuioCursor.getSessionId() % colours.size()-1) ]);
// h1->setColor(ofColor::black);
hands.addObject(*h1);
hands.notifyTouch(loc.x, loc.y,tuioCursor.getSessionId());
//mwave.addPoint(loc.x,loc.y,tuioCursor.getSessionId());
wavesm.touch(loc.x, loc.y,tuioCursor.getSessionId());
// updateMagneticField(100,loc.x,loc.y);
cheapComm::getInstance()->sendAudio0("/audio/electromagnetism/hand_on_event");
}
示例12: tuioUpdated
void ofApp::tuioUpdated(ofxTuioCursor &tuioCursor)
{
// ofPoint loc = ofPoint(tuioCursor.getX()*ofGetWidth(),tuioCursor.getY()*ofGetHeight());
int cursorIndex = getTuioPointIndex(tuioCursor.getSessionId());
if (cursorIndex < 0)
{
return;
}
tuioPoints.at(cursorIndex).setLastLocation();
tuioPoints.at(cursorIndex).location.set(tuioCursor.getX(), tuioCursor.getY());
}
示例13: tuioUpdated
void menu::tuioUpdated(ofxTuioCursor &tuioCursor){
// int mx = W_WIDTH*tuioCursor.getX();
//// int mx = W_WIDTH*(tuioCursor.getX()+0.5);
// int my = W_HEIGHT*tuioCursor.getY();
// ofPoint loc = ofPoint(mx,my);
ofPoint loc = transf_PosTUIO(tuioCursor);
// cout << "Point n" << tuioCursor.getSessionId() << " updated at " << loc << endl;
hands.notifySlide(loc.x, loc.y, tuioCursor.getSessionId(),tuioCursor.getMotionAccel());
// touchElements.notifySlide(loc.x, loc.y,tuioCursor.getSessionId(),tuioCursor.getMotionAccel());
}
示例14: tuioUpdated
void testApp::tuioUpdated(ofxTuioCursor &tuioCursor){
ofLog()<< "tuioUpdated" << endl;
int mx = W_WIDTH*tuioCursor.getX();
int my = W_HEIGHT*tuioCursor.getY();
ofPoint loc = ofPoint(tuioCursor.getX()*W_WIDTH,tuioCursor.getY()*W_HEIGHT);
//cout << "Point n" << tuioCursor.getSessionId() << " updated at " << loc << endl;
//o1.slide(loc.x, loc.y,tuioCursor.getSessionId(),tuioCursor.getMotionAccel());
// h1.slide(loc.x, loc.y,tuioCursor.getSessionId(),tuioCursor.getMotionAccel());
touchElements.notifySlide(loc.x, loc.y,tuioCursor.getSessionId(),tuioCursor.getMotionAccel());
puntoX=tuioCursor.getX();
puntoY=tuioCursor.getY();
cout << tuioCursor.getX() << endl;
}
示例15: tuioAdded
void ofxMtPhoto::tuioAdded(ofxTuioCursor &tuioCursor){
ofVec2f loc = ofVec2f(tuioCursor.getX()*ofGetWidth(),tuioCursor.getY()*ofGetHeight());
if (isOver(loc)){
tCursor c;
c.idN = tuioCursor.getSessionId();
c.loc = loc;
// PRIMER dedo sobre la imagen
if (cursorsOnBorder.size() == 0){
cursorsOnBorder.push_back(c);
} // SEGUNDO dedo sobre la imagen
else if (cursorsOnBorder.size() == 1){
cursorsOnBorder.push_back(c);
oldLoc[0] = cursorsOnBorder[0].loc;
oldLoc[1] = cursorsOnBorder[1].loc;
}
}
}