コード例 #1
0
ファイル: fretboard.cpp プロジェクト: opieproject/opie
void FretBoard::refresh() {
    ce.calculate();

    emit nameChanged(QString(ce.label()));

    for (int i=0; i<6; i++) {
        Finger(i, ce.finger(i));
        // yuk
        switch (i) {
        case 0:
            emit s1nameChanged(QString(ce.name(i)));
            break;
        case 1:
            emit s2nameChanged(QString(ce.name(i)));
            break;
        case 2:
            emit s3nameChanged(QString(ce.name(i)));
            break;
        case 3:
            emit s4nameChanged(QString(ce.name(i)));
            break;
        case 4:
            emit s5nameChanged(QString(ce.name(i)));
            break;
        case 5:
            emit s6nameChanged(QString(ce.name(i)));
            break;
        }
    }

    update();
}
コード例 #2
0
ファイル: FINGER.CPP プロジェクト: cdaffara/symbiandump-os1
TInt E32Main()
//
//
//
	{

	Finger();
	return 0;
	}
コード例 #3
0
ファイル: hand.cpp プロジェクト: ogsh/mudapuro2.0
void Hand::Get(cv::Mat &img, cv::Mat_<unsigned short>& depth) {
	this->he->Extract(img, depth);
	std::vector<Vector2> finPos = this->fe->Get(this->he->ImgMask());
	this->num_fingers = finPos.size();
	this->fingers.resize(this->num_fingers, Finger(Vector2(0, 0)));
	for(int f=0; f < this->num_fingers; f++) {
		this->fingers[f].pos.Set(finPos[f]);
	}	

}
コード例 #4
0
void Listener::onFrame( const Leap::Controller& controller ) 
{
	lock_guard<mutex> lock( *mMutex );
	if ( !mNewFrame ) {
		const Leap::Frame& controllerFrame	= controller.frame();
		const Leap::HandList& hands			= controllerFrame.hands();
		
		HandMap handMap;
		for ( const Leap::Hand& hand : hands ) {
			FingerMap fingerMap;
			ToolMap toolMap;
			const Leap::PointableList& pointables = hand.pointables();
			for ( const Leap::Pointable& pt : pointables ) {
				if ( pt.isValid() ) {
					Pointable pointable( pt );
					if ( pt.isFinger() ) {
						fingerMap[ pt.id() ] = Finger( pointable );
					} else if ( pt.isTool() ) {
						toolMap[ pt.id() ] = Tool( pointable );
					}
				}
			}
			
			float rotAngle			= (float)hand.rotationAngle( mFirstFrame.mFrame );
			Vec3f rotAxis			= toVec3f( hand.rotationAxis( mFirstFrame.mFrame ) );
			Matrix44f rotMatrix		= toMatrix44f( hand.rotationMatrix( mFirstFrame.mFrame ) );
			float scale				= (float)hand.scaleFactor( mFirstFrame.mFrame );
			Vec3f translation		= toVec3f( hand.translation( mFirstFrame.mFrame ) );
			
			handMap[ hand.id() ]	= Hand( hand, fingerMap, toolMap, rotAngle, rotAxis,
										   rotMatrix, scale, translation );
		}

		mFrame		= Frame( controllerFrame, handMap );
		if ( !mFirstFrameReceived ) {
			mFirstFrame			= Frame( controllerFrame, handMap );
			mFirstFrameReceived	= true;
		}
		mNewFrame	= true;
	}
}