Beispiel #1
0
// Stop watching all nodes. This detaches the callbacks.
void ShapeMonitor::stopWatchingAll()
{
	for (int i = monitoredObjectsPtrArray.length()-1; i >= 0; i--)
	{
		// Remove the callbacks for this node.
		removeCallbacks(monitoredObjectsPtrArray[i]);

		// Remove this element from the monitored objects array.
		delete monitoredObjectsPtrArray[i];
		monitoredObjectsPtrArray.removeElements(i, i, false);
	}
}
NuiMayaDeviceGrabber::~NuiMayaDeviceGrabber()
{
	if(m_pDevice)
		m_pDevice->stopDevice();
	SafeDelete(m_pDevice);
	SafeDelete(m_pSLAM);

	if(m_pCache)
		m_pCache->clear();
	SafeDelete(m_pCache);

	removeCallbacks();
}
Beispiel #3
0
// Stop watching node(s) that share the given uniqueTextureName.
// In addition, the uniqueTextureName is automatically added to the list of dirty textures.
// (If more than one node has the given uniqueTextureName, we stop to watch all of those that match. 
// This is done to minimize callback overhead.)
void ShapeMonitor::stopWatching(MString mayaNodeName)
{
	for (int i = monitoredObjectsPtrArray.length()-1; i >= 0; i--)
	{
		// If this record's node name matches...
		if (monitoredObjectsPtrArray[i]->mayaNodeName == mayaNodeName)
		{
			// Remove the callbacks for this node.
			removeCallbacks(monitoredObjectsPtrArray[i]);

			// Remove this element from the monitored objects array.
			delete monitoredObjectsPtrArray[i];
			monitoredObjectsPtrArray.removeElements(i, i, false);
		}
	}
}
Beispiel #4
0
/**
 * Sets and initializes all things that need to when we start a touch
 * gesture.
 *
 * @param event The down event
 */
void DialView::startTouch(MotionEvent *event) {
    
    // user is touching the list -> no more fling
    removeCallbacks(mDynamicsRunnable);
    
    mLastRotation = getRotationDegree();
    
    // save the start place
    mTouchStartX = (int) event->getX();
    mTouchStartY = (int) event->getY();
    
    // obtain a velocity tracker and feed it its first event
    mVelocityTracker = VelocityTracker::obtain();
    mVelocityTracker->addMovement(event);
    
    // we don't know if it's a click or a scroll yet, but until we know
    // assume it's a click
    setTouchState(TOUCH_STATE_CLICK);
}