std::list<TuioObject*> TuioManager::getUntouchedObjects() {
	
	std::list<TuioObject*> untouched;
	for (std::list<TuioObject*>::iterator tuioObject = objectList.begin(); tuioObject!=objectList.end(); tuioObject++) {
		TuioObject *tobj = (*tuioObject);
		if (tobj->getTuioTime()!=currentFrameTime) untouched.push_back(tobj);
	}	
	return untouched;
}
Example #2
0
void TuioServer::commitFrame()
{

    if (updateCursor)
    {
        startCursorBundle();
        for (std::list<TuioCursor *>::iterator tuioCursor = cursorList.begin(); tuioCursor != cursorList.end(); tuioCursor++)
        {

            // start a new packet if we exceed the packet capacity
            if ((oscPacket->Capacity() - oscPacket->Size()) < CUR_MESSAGE_SIZE)
            {
                sendCursorBundle(currentFrame);
                startCursorBundle();
            }

            TuioCursor *tcur = (*tuioCursor);
            if ((full_update) || (tcur->getTuioTime() == currentFrameTime))
                addCursorMessage(tcur);
        }
        sendCursorBundle(currentFrame);
    }
    else if ((!periodic_update) && (lastCursorUpdate < currentFrameTime.getSeconds()))
    {
        lastCursorUpdate = currentFrameTime.getSeconds();
        startCursorBundle();
        sendCursorBundle(currentFrame);
    }
    updateCursor = false;

    if (updateObject)
    {
        startObjectBundle();
        for (std::list<TuioObject *>::iterator tuioObject = objectList.begin(); tuioObject != objectList.end(); tuioObject++)
        {

            // start a new packet if we exceed the packet capacity
            if ((oscPacket->Capacity() - oscPacket->Size()) < OBJ_MESSAGE_SIZE)
            {
                sendObjectBundle(currentFrame);
                startObjectBundle();
            }

            TuioObject *tobj = (*tuioObject);
            if ((full_update) || (tobj->getTuioTime() == currentFrameTime))
                addObjectMessage(tobj);
        }
        sendObjectBundle(currentFrame);
    }
    else if ((!periodic_update) && (lastObjectUpdate < currentFrameTime.getSeconds()))
    {
        lastObjectUpdate = currentFrameTime.getSeconds();
        startObjectBundle();
        sendObjectBundle(currentFrame);
    }
    updateObject = false;
}
void TuioManager::removeUntouchedStoppedObjects() {
	
	std::list<TuioObject*>::iterator tuioObject = objectList.begin();
	while (tuioObject!=objectList.end()) {
		TuioObject *tobj = (*tuioObject);
		if ((tobj->getTuioTime()!=currentFrameTime) && (!tobj->isMoving())) {
			removeTuioObject(tobj);
			tuioObject = objectList.begin();
		} else tuioObject++;
	}
}
Example #4
0
void TuioServer::removeUntouchedStoppedObjects() {
	
	for (std::list<TuioObject*>::iterator tuioObject = objectList.begin(); tuioObject!=objectList.end(); tuioObject++) {
		
		TuioObject *tobj = (*tuioObject);
		if ((tobj->getTuioTime()!=currentFrameTime) && (!tobj->getTuioState()==TUIO_ADDED) && (!tobj->isMoving())) {
			removeTuioObject(tobj);
			removeUntouchedStoppedObjects();
			break;
		}
	}
}
void TuioManager::stopUntouchedMovingObjects() {
	
	std::list<TuioObject*> untouched;
	for (std::list<TuioObject*>::iterator tuioObject = objectList.begin(); tuioObject!=objectList.end(); tuioObject++) {
		
		TuioObject *tobj = (*tuioObject);
		if ((tobj->getTuioTime()!=currentFrameTime) && (tobj->isMoving())) {
			tobj->stop(currentFrameTime);
			updateObject = true;
			if (verbose)		
				std::cout << "set obj " << tobj->getSymbolID() << " (" << tobj->getSessionID() << ") "<< tobj->getX() << " " << tobj->getY() << " " << tobj->getAngle() 
				<< " " << tobj->getXSpeed() << " " << tobj->getYSpeed() << " " << tobj->getRotationSpeed() << " " << tobj->getMotionAccel() << " " << tobj->getRotationAccel() << std::endl;
		}
	}
}