TuioCursor* TuioServer::addTuioCursor(float x, float y, float z) {
    sessionID++;

    int cursorID = (int)cursorList.size();
    if (((int)(cursorList.size())<=maxCursorID) && ((int)(freeCursorList.size())>0)) {
        std::list<TuioCursor*>::iterator closestCursor = freeCursorList.begin();

        for(std::list<TuioCursor*>::iterator iter = freeCursorList.begin(); iter!= freeCursorList.end(); iter++) {
            if((*iter)->getDistance(x,y,z)<(*closestCursor)->getDistance(x,y,z)) closestCursor = iter;
        }

        TuioCursor *freeCursor = (*closestCursor);
        cursorID = (*closestCursor)->getCursorID();
        freeCursorList.erase(closestCursor);
        delete freeCursor;
    } else maxCursorID = cursorID;

    TuioCursor *tcur = new TuioCursor(currentFrameTime, sessionID, cursorID, x, y, z);
    cursorList.push_back(tcur);
    updateCursor = true;

    if (verbose) {
        if (mode3d) {
            std::cout << "add cur " << tcur->getCursorID() << " (" <<  tcur->getSessionID() << ") " << tcur->getX() << " " << tcur->getY() << " " << tcur->getZ() << std::endl;
        } else {
            std::cout << "add cur " << tcur->getCursorID() << " (" <<  tcur->getSessionID() << ") " << tcur->getX() << " " << tcur->getY() << std::endl;
        }
    }

    return tcur;
}
Пример #2
0
TuioCursor* TuioManager::addTuioCursor(float x, float y) {
	sessionID++;
	
	int cursorID = (int)cursorList.size();
	if ((int)(cursorList.size())<=maxCursorID) {
		std::list<TuioCursor*>::iterator closestCursor = freeCursorList.begin();
		
		for(std::list<TuioCursor*>::iterator iter = freeCursorList.begin();iter!= freeCursorList.end(); iter++) {
			if((*iter)->getDistance(x,y)<(*closestCursor)->getDistance(x,y)) closestCursor = iter;
		}
		
		TuioCursor *freeCursor = (*closestCursor);
		cursorID = (*closestCursor)->getCursorID();
		freeCursorList.erase(closestCursor);
		delete freeCursor;
	} else maxCursorID = cursorID;	
	
	TuioCursor *tcur = new TuioCursor(currentFrameTime, sessionID, cursorID, x, y);
	cursorList.push_back(tcur);
	updateCursor = true;

	for (std::list<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
		(*listener)->addTuioCursor(tcur);
	
	if (verbose) 
		std::cout << "add cur " << tcur->getCursorID() << " (" <<  tcur->getSessionID() << ") " << tcur->getX() << " " << tcur->getY() << std::endl;

	return tcur;
}
void TuioServer::stopUntouchedMovingCursors() {

    std::list<TuioCursor*> untouched;
    for (std::list<TuioCursor*>::iterator tuioCursor = cursorList.begin(); tuioCursor!=cursorList.end(); tuioCursor++) {
        TuioCursor *tcur = (*tuioCursor);
        if ((tcur->getTuioTime()!=currentFrameTime) && (tcur->isMoving())) {
            tcur->stop(currentFrameTime);
            updateCursor = true;
            if (verbose) {
                if (mode3d) {
                    std::cout << "set cur " << tcur->getCursorID() << " (" <<  tcur->getSessionID() << ") " << tcur->getX() << " " << tcur->getY() << " " << tcur->getZ()
                              << " " << tcur->getXSpeed() << " " << tcur->getYSpeed()<< " " << tcur->getZSpeed()<< " " << tcur->getMotionAccel() << " " << std::endl;
                } else {
                    std::cout << "set cur " << tcur->getCursorID() << " (" <<  tcur->getSessionID() << ") " << tcur->getX() << " " << tcur->getY()
                              << " " << tcur->getXSpeed() << " " << tcur->getYSpeed()<< " " << tcur->getMotionAccel() << " " << std::endl;
                }
            }
        }
    }
}
Пример #4
0
void IupTuioListener::initCursorInfo(int cursor_count, int* pid, int* pstate)
{
  std::list<TuioCursor*>& cursorList = this->client->getCursorList();
  std::list <TuioCursor*>::iterator iter;
  int i;

  for (i = 0, iter = cursorList.begin() ; i<cursor_count; iter++, i++) 
  {
    TuioCursor* tcur = (*iter);
    pid[i] = (int)tcur->getSessionID();
    pstate[i] = 0;  /* mark to be updated later */
  }
}
Пример #5
0
int IupTuioListener::GetMainCursor()
{
  std::list<TuioCursor*>& cursorList = this->client->getCursorList();
  std::list <TuioCursor*>::iterator iter;
  std::list <TuioCursor*>::iterator end = cursorList.end();
  int min_id = -1;

  for (iter = cursorList.begin(); iter!=end; iter++) 
  {
    TuioCursor* tcur = (*iter);
    int id = (int)tcur->getSessionID();
    if (min_id == -1 || id < min_id)
      min_id = id;
  }

  return min_id;
}
Пример #6
0
void ofxTuioClient::drawCursors(){
    std::list<TuioCursor*> cursorList = client->getTuioCursors();
	std::list<TuioCursor*>::iterator tit;
	client->lockCursorList();
	for (tit=cursorList.begin(); tit != cursorList.end(); tit++) {
		TuioCursor * cur = (*tit);
		//if(tcur!=0){
			//TuioCursor cur = *tcur;
			glColor3f(0.0,0.0,0.0);
			ofEllipse(cur->getX()*ofGetWidth(), cur->getY()*ofGetHeight(), 10.0, 10.0);
			string str = "SessionId: "+ofToString((int)(cur->getSessionID()));
			ofDrawBitmapString(str, cur->getX()*ofGetWidth()-10.0, cur->getY()*ofGetHeight()+25.0);
			str = "CursorId: "+ofToString((int)(cur->getCursorID()));
			ofDrawBitmapString(str, cur->getX()*ofGetWidth()-10.0, cur->getY()*ofGetHeight()+40.0);
		//}
	}
	client->unlockCursorList();
}
void testApp::tuioCursorUpdated(TuioCursor & tcur){
	/*cout << " cursor updated: " + ofToString(tcur.getCursorID())+
	 " X: "+ofToString(tcur.getXSpeed())+
	 " Y: "+ofToString(tcur.getYSpeed())
	 << endl;*/
	
	ofxMultiTouchCustomDataSF multiTouchCustomData;
	multiTouchCustomData.sessionID = tcur.getSessionID();
	
	mtActionsHub.touchMoved(tcur.getX(), tcur.getY(), tcur.getCursorID(), &multiTouchCustomData);
	mtSliderHub.touchMoved(tcur.getX(), tcur.getY(), tcur.getCursorID(), &multiTouchCustomData);
	/*
	draggableRotatableScalableItem.touchMoved(tcur.getX(), tcur.getY(), tcur.getCursorID(), NULL);
	if(draggableRotatableScalableItem.ownTouchCursor(tcur.getSessionID())) {
		return;
	}
	*/
	//forward the touch events to ofxMultiTouch for the InteractiveObjects
	ofxMultiTouch.touchMoved(tcur.getX(), tcur.getY(), tcur.getCursorID(), NULL);
}
Пример #8
0
void TuioClient::oscMessageReceived (const OSCMessage& message)  {
    
    
    
    if( message.getAddressPattern() == "/tuio/2Dcur" ) {
        String cmd;
        cmd = message[0].getString();
        
        if (cmd == "set") {
            
            int32 s_id;
            float xpos, ypos, xspeed, yspeed, maccel;
            s_id=message[1].getInt32();
            xpos=message[2].getFloat32();
            ypos=message[3].getFloat32();
            xspeed =message[4].getFloat32();
            yspeed=message[5].getFloat32();
            maccel=message[6].getFloat32();
            
            
            std::list<TuioCursor*>::iterator tcur;
            for (tcur=cursorList.begin(); tcur!= cursorList.end(); tcur++)
                if((*tcur)->getSessionID()==(long)s_id) break;
            
            if (tcur==cursorList.end()) {
                
                TuioCursor *addCursor = new TuioCursor((long)s_id,-1,xpos,ypos);
                frameCursors.push_back(addCursor);
                
            } else if ( ((*tcur)->getX()!=xpos) || ((*tcur)->getY()!=ypos) || ((*tcur)->getXSpeed()!=xspeed) || ((*tcur)->getYSpeed()!=yspeed) || ((*tcur)->getMotionAccel()!=maccel) ) {
                
                int id = (*tcur)->getCursorID();
                TuioCursor *updateCursor = new TuioCursor((long)s_id,id,xpos,ypos);
                updateCursor->update(xpos,ypos,xspeed,yspeed,maccel);
                frameCursors.push_back(updateCursor);
                
                
                
                
            }
            
            
            
            
        } else if (cmd=="alive") {
            
            aliveCursorList.clear();
            for(int i = 1; i < message.size() ; i++) {
                aliveCursorList.push_back(message[i].getInt32());
            }
            

        } else if( cmd== "fseq"  ){
            
            int32 fseq;
            fseq = message[1].getInt32();
            bool lateFrame = false;
            if (fseq>0) {
                if (fseq>currentFrame) currentTime = TuioTime::getSessionTime();
                if ((fseq>=currentFrame) || ((currentFrame-fseq)>100)) currentFrame = fseq;
                else lateFrame = true;
            }  else if ((TuioTime::getSessionTime().getTotalMilliseconds()-currentTime.getTotalMilliseconds())>100) {
                currentTime = TuioTime::getSessionTime();
            }
			
            if (!lateFrame) {
                
                //                lockCursorList();
                // find the removed cursors first
                for (std::list<TuioCursor*>::iterator tcur=cursorList.begin(); tcur != cursorList.end(); tcur++) {
                    std::list<long>::iterator iter = find(aliveCursorList.begin(), aliveCursorList.end(), (*tcur)->getSessionID());
                    
                    if (iter == aliveCursorList.end()) {
                        (*tcur)->remove(currentTime);
                        frameCursors.push_back(*tcur);
                    }
                }
                //                unlockCursorList();
                
                for (std::list<TuioCursor*>::iterator iter=frameCursors.begin(); iter != frameCursors.end(); iter++) {
                    TuioCursor *tcur = (*iter);
                    
                    int c_id = -1;
                    TuioCursor *frameCursor = NULL;
                    switch (tcur->getTuioState()) {
                        case TUIO_REMOVED:
                            frameCursor = tcur;
                            frameCursor->remove(currentTime);
                            
                            for (std::list<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
                                (*listener)->removeTuioCursor(frameCursor);
                            
                            //                            lockCursorList();
                            for (std::list<TuioCursor*>::iterator delcur=cursorList.begin(); delcur!=cursorList.end(); delcur++) {
                                if((*delcur)->getSessionID()==frameCursor->getSessionID()) {
                                    cursorList.erase(delcur);
                                    break;
                                }
                            }
                            
                            if (frameCursor->getCursorID()==maxCursorID) {
                                maxCursorID = -1;
                                delete frameCursor;
                                
                                if (cursorList.size()>0) {
                                    std::list<TuioCursor*>::iterator clist;
                                    for (clist=cursorList.begin(); clist != cursorList.end(); clist++) {
                                        c_id = (*clist)->getCursorID();
                                        if (c_id>maxCursorID) maxCursorID=c_id;
                                    }
                                    
                                    freeCursorBuffer.clear();
                                    for (std::list<TuioCursor*>::iterator flist=freeCursorList.begin(); flist != freeCursorList.end(); flist++) {
                                        TuioCursor *freeCursor = (*flist);
                                        if (freeCursor->getCursorID()>maxCursorID) delete freeCursor;
                                        else freeCursorBuffer.push_back(freeCursor);
                                    }
                                    freeCursorList = freeCursorBuffer;
                                    
                                } else {
                                    for (std::list<TuioCursor*>::iterator flist=freeCursorList.begin(); flist != freeCursorList.end(); flist++) {
                                        TuioCursor *freeCursor = (*flist);
                                        delete freeCursor;
                                    }
                                    freeCursorList.clear();
                                }
                            } else if (frameCursor->getCursorID()<maxCursorID) {
                                freeCursorList.push_back(frameCursor);
                            }
                            
                            //                            unlockCursorList();
                            break;
                        case TUIO_ADDED:
                            
                            //                            lockCursorList();
                            c_id = (int)cursorList.size();
                            if (((int)(cursorList.size())<=maxCursorID) && ((int)(freeCursorList.size())>0)) {
                                std::list<TuioCursor*>::iterator closestCursor = freeCursorList.begin();
                                
                                for(std::list<TuioCursor*>::iterator iter = freeCursorList.begin();iter!= freeCursorList.end(); iter++) {
                                    if((*iter)->getDistance(tcur)<(*closestCursor)->getDistance(tcur)) closestCursor = iter;
                                }
                                
                                TuioCursor *freeCursor = (*closestCursor);
                                c_id = freeCursor->getCursorID();
                                freeCursorList.erase(closestCursor);
                                delete freeCursor;
                            } else maxCursorID = c_id;
                            
                            frameCursor = new TuioCursor(currentTime,tcur->getSessionID(),c_id,tcur->getX(),tcur->getY());
                            cursorList.push_back(frameCursor);
                            
                            delete tcur;
                            //                            unlockCursorList();
                            
                            for (std::list<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++){
                                (*listener)->addTuioCursor(frameCursor);
                            }
                            
                            break;
                        default:
                            
                            //                            lockCursorList();
                            std::list<TuioCursor*>::iterator iter;
                            for (iter=cursorList.begin(); iter != cursorList.end(); iter++) {
                                if((*iter)->getSessionID()==tcur->getSessionID()) {
                                    frameCursor = (*iter);
                                    break;
                                }
                            }
                            
                            if ( (tcur->getX()!=frameCursor->getX() && tcur->getXSpeed()==0) || (tcur->getY()!=frameCursor->getY() && tcur->getYSpeed()==0) )
                                frameCursor->update(currentTime,tcur->getX(),tcur->getY());
                            else
                                frameCursor->update(currentTime,tcur->getX(),tcur->getY(),tcur->getXSpeed(),tcur->getYSpeed(),tcur->getMotionAccel());
                            
                            delete tcur;
                            //                            unlockCursorList();
                            
                            for (std::list<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
                                (*listener)->updateTuioCursor(frameCursor);
                    }
                }
                
                for (std::list<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
                    (*listener)->refresh(currentTime);
                
            } else {
                for (std::list<TuioCursor*>::iterator iter=frameCursors.begin(); iter != frameCursors.end(); iter++) {
                    TuioCursor *tcur = (*iter);
                    delete tcur;
                }
            }
            
            frameCursors.clear();
        }
    }
    else if( message.getAddressPattern()== "/tuio/2Dobj" ){
        
        //        String cmd = message[0].getString();
        //
        //        if (cmd=="set") {
        //
        //            int32 s_id, c_id;
        //            float xpos, ypos, angle, xspeed, yspeed, rspeed, maccel, raccel;
        //            s_id=message[1].getInt32();
        //            c_id=message[2].getInt32();
        //            xpos=message[3].getFloat32();
        //            ypos=message[4].getFloat32();
        //            angle=message[5].getFloat32();
        //            xspeed =message[6].getFloat32();
        //            yspeed=message[7].getFloat32();
        //            rspeed=message[8].getFloat32();
        //            maccel=message[9].getFloat32();
        //            raccel=message[10].getFloat32();
        //
        //            lockObjectList();
        //            std::list<TuioObject*>::iterator tobj;
        //            for (tobj=objectList.begin(); tobj!= objectList.end(); tobj++)
        //                if((*tobj)->getSessionID()==(long)s_id) break;
        //
        //            if (tobj == objectList.end()) {
        //
        //                TuioObject *addObject = new TuioObject((long)s_id,(int)c_id,xpos,ypos,angle);
        //                frameObjects.push_back(addObject);
        //
        //            } else if ( ((*tobj)->getX()!=xpos) || ((*tobj)->getY()!=ypos) || ((*tobj)->getAngle()!=angle) || ((*tobj)->getXSpeed()!=xspeed) || ((*tobj)->getYSpeed()!=yspeed) || ((*tobj)->getRotationSpeed()!=rspeed) || ((*tobj)->getMotionAccel()!=maccel) || ((*tobj)->getRotationAccel()!=raccel) ) {
        //
        //                TuioObject *updateObject = new TuioObject((long)s_id,(*tobj)->getSymbolID(),xpos,ypos,angle);
        //                updateObject->update(xpos,ypos,angle,xspeed,yspeed,rspeed,maccel,raccel);
        //                frameObjects.push_back(updateObject);
        //
        //            }
        //            unlockObjectList();
        //
        //        }
        //        else if (cmd=="alive") {
        //
        //            aliveObjectList.clear();
        //            for(int i = 1 ; i < message.size() ; i++){
        //                aliveObjectList.push_back(message[i].getInt32());
        //            }
        //
        //        } else if (cmd == "fseq") {
        //
        //            int32 fseq;
        //            fseq = message[1].getInt32();
        //            bool lateFrame = false;
        //            if (fseq>0) {
        //                if (fseq>currentFrame) currentTime = TuioTime::getSessionTime();
        //                if ((fseq>=currentFrame) || ((currentFrame-fseq)>100)) currentFrame = fseq;
        //                else lateFrame = true;
        //            } else if ((TuioTime::getSessionTime().getTotalMilliseconds()-currentTime.getTotalMilliseconds())>100) {
        //                currentTime = TuioTime::getSessionTime();
        //            }
        //
        //            if (!lateFrame) {
        //
        //                lockObjectList();
        //                //find the removed objects first
        //                for (std::list<TuioObject*>::iterator tobj=objectList.begin(); tobj != objectList.end(); tobj++) {
        //                    std::list<long>::iterator iter = find(aliveObjectList.begin(), aliveObjectList.end(), (*tobj)->getSessionID());
        //                    if (iter == aliveObjectList.end()) {
        //                        (*tobj)->remove(currentTime);
        //                        frameObjects.push_back(*tobj);
        //                    }
        //                }
        //                unlockObjectList();
        //
        //                for (std::list<TuioObject*>::iterator iter=frameObjects.begin(); iter != frameObjects.end(); iter++) {
        //                    TuioObject *tobj = (*iter);
        //
        //                    TuioObject *frameObject = NULL;
        //                    switch (tobj->getTuioState()) {
        //                        case TUIO_REMOVED:
        //                            frameObject = tobj;
        //                            frameObject->remove(currentTime);
        //
        //                            for (std::list<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
        //                                (*listener)->removeTuioObject(frameObject);
        //
        //                            lockObjectList();
        //                            for (std::list<TuioObject*>::iterator delobj=objectList.begin(); delobj!=objectList.end(); delobj++) {
        //                                if((*delobj)->getSessionID()==frameObject->getSessionID()) {
        //                                    objectList.erase(delobj);
        //                                    break;
        //                                }
        //                            }
        //                            unlockObjectList();
        //                            break;
        //                        case TUIO_ADDED:
        //
        //                            lockObjectList();
        //                            frameObject = new TuioObject(currentTime,tobj->getSessionID(),tobj->getSymbolID(),tobj->getX(),tobj->getY(),tobj->getAngle());
        //                            objectList.push_back(frameObject);
        //                            unlockObjectList();
        //
        //                            for (std::list<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
        //                                (*listener)->addTuioObject(frameObject);
        //
        //                            break;
        //                        default:
        //
        //                            lockObjectList();
        //                            std::list<TuioObject*>::iterator iter;
        //                            for (iter=objectList.begin(); iter != objectList.end(); iter++) {
        //                                if((*iter)->getSessionID()==tobj->getSessionID()) {
        //                                    frameObject = (*iter);
        //                                    break;
        //                                }
        //                            }
        //                            if(iter==objectList.end()) break;
        //
        //                            if ( (tobj->getX()!=frameObject->getX() && tobj->getXSpeed()==0) || (tobj->getY()!=frameObject->getY() && tobj->getYSpeed()==0) )
        //                                frameObject->update(currentTime,tobj->getX(),tobj->getY(),tobj->getAngle());
        //                            else
        //                                frameObject->update(currentTime,tobj->getX(),tobj->getY(),tobj->getAngle(),tobj->getXSpeed(),tobj->getYSpeed(),tobj->getRotationSpeed(),tobj->getMotionAccel(),tobj->getRotationAccel());
        //                            unlockObjectList();
        //
        //                            for (std::list<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
        //                                (*listener)->updateTuioObject(frameObject);
        //
        //                    }
        //                    delete tobj;
        //                }
        //
        //                for (std::list<TuioListener*>::iterator listener=listenerList.begin(); listener != listenerList.end(); listener++)
        //                    (*listener)->refresh(currentTime);
        //
        //            } else {
        //                for (std::list<TuioObject*>::iterator iter=frameObjects.begin(); iter != frameObjects.end(); iter++) {
        //                    TuioObject *tobj = (*iter);
        //                    delete tobj;
        //                }
        //            }
        //
        //            frameObjects.clear();
        //        }
    }
	
}
Пример #9
0
void HTTUIOServer::handleEvents(const std::vector<HTBlobInterpreter::TrackRecord>& events)
{
	const unsigned len = events.size();
	if (len == 0)
		return;

	if (!tuioServer || !tuioServer->isConnected())
	{
		printf("HTTUIOServer::handleEvents : Connection not set up, skipping...\n");
		return;
	}

	TuioCursor* cursor = 0;
	std::map<unsigned int, TuioOutput>::iterator curIter;

	tuioServer->initFrame(TUIO::TuioTime::getSessionTime());


	for (unsigned i = 0; i < len; i++)
	{
		const HTBlobInterpreter::TrackRecord* rec = &(events[i]);
		//for now, skip person events
		//float cX = (float)((int)((lMargin + (rec->curX * (rMargin - lMargin))) * 1000.f)) / 1000.f;
		//float cY = (float)((int)(rec->curY * 1000.f) / 1000.f);
		float cX = (lMargin + (rec->curXsmooth * (rMargin - lMargin)));
		float cY = 0.f;

		if (rec->brtype == HTIBlobResultTarget::BRT_HAND)
			cY = rec->curYsmooth;
//		else
//			printf("PERSON!\n");

		switch (rec->type)
		{
		case HTBlobInterpreter::HTET_DRAG_NEW:
			cursor = tuioServer->addTuioCursor(cX, cY);
			printf("Adding   Cursor... BlobID: %i SID: %li (X: %f, Y: %f)\n", rec->blobID, cursor->getSessionID(), cursor->getPosition().getX(), cursor->getPosition().getY());
			TuioOutput to;
			to.cursor = cursor;
			//to.filter = new HTKalmanFilter(cX, cY);
			cursorMap.insert(std::pair<unsigned int, TuioOutput>(rec->blobID, to));
			break;

		case HTBlobInterpreter::HTET_DRAG_CONT:
			curIter = cursorMap.find(rec->blobID);
			if (curIter == cursorMap.end())
			{
				printf("(HTTUIOServer::handleEvents) WARNING: DRAG_CONT: Cursor (ID: %i) not found which should be in the list. Continuing...\n", rec->blobID);
				break;
			}
			//curIter->second.filter->updateMeasurement(cX, cY, &cX, &cY);
			//            if (cX > .98f || cX < 0.02f || cY > .98f || cY < .02f)
			//            {

			//            }
			if (cX > .999f)
				cX = .999f;
			if (cX < 0.f)
				cX = 0.f;

			if (cY > .999f)
				cY = .999f;
			if (cY < 0.f)
				cY = 0.f;

			printf("CUR %f, %f\n", cX, cY);

			tuioServer->updateTuioCursor(curIter->second.cursor, cX, cY);
			break;

		case HTBlobInterpreter::HTET_DRAG_OFF:
			curIter = cursorMap.find(rec->blobID);
			if (curIter == cursorMap.end())
			{
				printf("(HTTUIOServer::handleEvents) WARNING: DRAG_OFF: Cursor (ID: %i) not found which should be in the list. Continuing...\n", rec->blobID);
				break;
			}
			//delete curIter->second.filter;
			printf("Removing Cursor... BlobID: %i SID: %li (mapsize: %lu)\n", rec->blobID, curIter->second.cursor->getSessionID(), cursorMap.size() - 1);
			tuioServer->removeTuioCursor(curIter->second.cursor);
			cursorMap.erase(curIter);
			break;

		default:
			break;
		}
	}

	tuioServer->commitFrame();
}