コード例 #1
0
void NodePalette::disconnectSignals()
{
    // signals and slots disconnetions
    disconnect(editEditButton, SIGNAL(clicked()), this, SLOT(EndEdit()));
    disconnect(DeleteNode, SIGNAL(clicked()), this, SLOT(DelN()));
    disconnect(AddNode, SIGNAL(clicked()), this, SLOT(AddN()));
    disconnect(MoveNode, SIGNAL(clicked()), this, SLOT(MoveN()));
    disconnect(AsymMove, SIGNAL(clicked()), this, SLOT(SetAsym()));
    disconnect(SymMove, SIGNAL(clicked()), this, SLOT(SetSym()));
    disconnect(ResNode, SIGNAL(clicked()), this, SLOT(ResetControl()));
    disconnect(Res1Node, SIGNAL(clicked()), this, SLOT(Reset1Control()));
    disconnect(BezierClose, SIGNAL(clicked()), this, SLOT(CloseBezier()));
    disconnect(PolySplit, SIGNAL(clicked()), this, SLOT(SplitPoly()));
    disconnect(MoveControl, SIGNAL(clicked()), this, SLOT(MoveK()));
    disconnect(XSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
    disconnect(YSpin, SIGNAL(valueChanged(double)), this, SLOT(MovePoint()));
    disconnect(PolyMirrorH, SIGNAL(clicked()), this, SLOT(MirrorH()));
    disconnect(PolyMirrorV, SIGNAL(clicked()), this, SLOT(MirrorV()));
    disconnect(PolyShearR, SIGNAL(clicked()), this, SLOT(ShearR()));
    disconnect(PolyShearL, SIGNAL(clicked()), this, SLOT(ShearL()));
    disconnect(PolyShearU, SIGNAL(clicked()), this, SLOT(ShearU()));
    disconnect(PolyShearD, SIGNAL(clicked()), this, SLOT(ShearD()));
    disconnect(RotateCCW, SIGNAL(clicked()), this, SLOT(doRotCCW()));
    disconnect(RotateCW, SIGNAL(clicked()), this, SLOT(doRotCW()));
    disconnect(Shrink, SIGNAL(clicked()), this, SLOT(doShrink()));
    disconnect(Expand, SIGNAL(clicked()), this, SLOT(doExpand()));
    disconnect(Reduce, SIGNAL(clicked()), this, SLOT(doReduce()));
    disconnect(Enlarge, SIGNAL(clicked()), this, SLOT(doEnlarge()));
    disconnect(ResetCont, SIGNAL(clicked()), this, SLOT(ResetContour()));
    disconnect(ResetContClip, SIGNAL(clicked()), this, SLOT(ResetContourToImageClip()));
    disconnect(ResetShape2Clip, SIGNAL(clicked()), this, SLOT(ResetShapeToImageClip()));
}
コード例 #2
0
void NodePalette::HaveNode(bool have, bool mov)
{
    if (doc==0)
        return;
    bool setter = have ? true : false;
    if (doc->nodeEdit.SelNode.count() > 1)
    {
        XSpin->setEnabled(false);
        YSpin->setEnabled(false);
    }
    else
    {
        XSpin->setEnabled(setter);
        YSpin->setEnabled(setter);
    }
    if (setter == true)
    {
        if (doc->nodeEdit.EdPoints)
            ResNode->setEnabled(setter);
        else
            Res1Node->setEnabled(setter);
    }
    else
    {
        ResNode->setEnabled(setter);
        Res1Node->setEnabled(setter);
    }
    if (doc->nodeEdit.submode == NodeEditContext::MOVE_POINT)
    {
        disconnect(AsymMove, SIGNAL(clicked()), this, SLOT(SetAsym()));
        disconnect(SymMove, SIGNAL(clicked()), this, SLOT(SetSym()));
        if (mov)
        {
            SymMove->setChecked(true);
            AsymMove->setChecked(false);
        }
        else
        {
            AsymMove->setChecked(true);
            SymMove->setChecked(false);
        }
        connect(AsymMove, SIGNAL(clicked()), this, SLOT(SetAsym()));
        connect(SymMove, SIGNAL(clicked()), this, SLOT(SetSym()));
    }
    if (doc->nodeEdit.submode == NodeEditContext::DEL_POINT)
    {
        uint cc;
        bool leaveEd = false;
        PageItem*currItem=doc->m_Selection->itemAt(0);
        if (doc->nodeEdit.isContourLine)
            cc = currItem->ContourLine.size();
        else
            cc = currItem->PoLine.size();
        if (currItem->asPolyLine())
        {
            if (cc < 5)
                leaveEd = true;
        }
        else
        {
            if (cc < 13)
                leaveEd = true;
        }
        if (leaveEd)
        {
            MoveN();
            MoveControl->setEnabled(true);
        }
    }
}
コード例 #3
0
ファイル: rps.cpp プロジェクト: toughie88/MameRoid3D
int CRps::CalcTraQ( TSELEM* tsptr, int chksym )
{
	if( !m_pelem || !m_traq ){
		_ASSERT( 0 );
		return 1;
	}

	int ret;
	ret = SetSkipFlag();
	_ASSERT( !ret );


	int frameno = 2;

	ret = m_traq->CalcTorso( m_traq, m_pelem, frameno, m_skipflag[SKEL_TORSO] );
	_ASSERT( !ret );

	ret = m_traq->CalcNeck( m_model, tsptr, m_traq, m_pelem, frameno, m_skipflag[SKEL_NECK] );
	_ASSERT( !ret );


	ret = m_traq->CalcQ( m_model, tsptr, m_traq, m_pelem, frameno, SKEL_TORSO, SKEL_LEFT_HIP, 3 );
	_ASSERT( !ret );
	ret = m_traq->CalcQ( m_model, tsptr, m_traq, m_pelem, frameno, SKEL_LEFT_HIP, SKEL_LEFT_KNEE, m_skipflag[SKEL_LEFT_KNEE] );
	_ASSERT( !ret );
	ret = m_traq->CalcQ( m_model, tsptr, m_traq, m_pelem, frameno, SKEL_LEFT_KNEE, SKEL_LEFT_FOOT, m_skipflag[SKEL_LEFT_FOOT] );
	_ASSERT( !ret );


	ret = m_traq->CalcQ( m_model, tsptr, m_traq, m_pelem, frameno, SKEL_TORSO, SKEL_RIGHT_HIP, 3 );
	_ASSERT( !ret );
	ret = m_traq->CalcQ( m_model, tsptr, m_traq, m_pelem, frameno, SKEL_RIGHT_HIP, SKEL_RIGHT_KNEE, m_skipflag[SKEL_RIGHT_KNEE] );
	_ASSERT( !ret );
	ret = m_traq->CalcQ( m_model, tsptr, m_traq, m_pelem, frameno, SKEL_RIGHT_KNEE, SKEL_RIGHT_FOOT, m_skipflag[SKEL_RIGHT_FOOT] );
	_ASSERT( !ret );


	ret = m_traq->CalcQ( m_model, tsptr, m_traq, m_pelem, frameno, SKEL_NECK, SKEL_HEAD, m_skipflag[SKEL_HEAD] );
	_ASSERT( !ret );


	ret = m_traq->CalcQ( m_model, tsptr, m_traq, m_pelem, frameno, SKEL_NECK, SKEL_LEFT_SHOULDER, 3 );
	_ASSERT( !ret );
	ret = m_traq->CalcQ( m_model, tsptr, m_traq, m_pelem, frameno, SKEL_LEFT_SHOULDER, SKEL_LEFT_ELBOW, m_skipflag[SKEL_LEFT_ELBOW] );
	_ASSERT( !ret );
	ret = m_traq->CalcQ( m_model, tsptr, m_traq, m_pelem, frameno, SKEL_LEFT_ELBOW, SKEL_LEFT_HAND, m_skipflag[SKEL_LEFT_HAND] );
	_ASSERT( !ret );


	ret = m_traq->CalcQ( m_model, tsptr, m_traq, m_pelem, frameno, SKEL_NECK, SKEL_RIGHT_SHOULDER, 3 );
	_ASSERT( !ret );
	ret = m_traq->CalcQ( m_model, tsptr, m_traq, m_pelem, frameno, SKEL_RIGHT_SHOULDER, SKEL_RIGHT_ELBOW, m_skipflag[SKEL_RIGHT_ELBOW] );
	_ASSERT( !ret );
	ret = m_traq->CalcQ( m_model, tsptr, m_traq, m_pelem, frameno, SKEL_RIGHT_ELBOW, SKEL_RIGHT_HAND, m_skipflag[SKEL_RIGHT_HAND] );
	_ASSERT( !ret );


	//sym
	if( chksym == 1 ){
		ret = SetSym( SKEL_TOPOFJOINT, SKEL_TOPOFJOINT, tsptr, m_model );
		_ASSERT( !ret );
		ret = SetSym( SKEL_TORSO, SKEL_TORSO, tsptr, m_model );
		_ASSERT( !ret );

		ret = SetSym( SKEL_LEFT_HIP, SKEL_RIGHT_HIP, tsptr, m_model );
		_ASSERT( !ret );
		ret = SetSym( SKEL_LEFT_KNEE, SKEL_RIGHT_KNEE, tsptr, m_model );
		_ASSERT( !ret );
		ret = SetSym( SKEL_LEFT_FOOT, SKEL_RIGHT_FOOT, tsptr, m_model );
		_ASSERT( !ret );

		ret = SetSym( SKEL_NECK, SKEL_NECK, tsptr, m_model );
		_ASSERT( !ret );
		ret = SetSym( SKEL_HEAD, SKEL_HEAD, tsptr, m_model );
		_ASSERT( !ret );

		ret = SetSym( SKEL_LEFT_SHOULDER, SKEL_RIGHT_SHOULDER, tsptr, m_model );
		_ASSERT( !ret );
		ret = SetSym( SKEL_LEFT_ELBOW, SKEL_RIGHT_ELBOW, tsptr, m_model );
		_ASSERT( !ret );
		ret = SetSym( SKEL_LEFT_HAND, SKEL_RIGHT_HAND, tsptr, m_model );
		_ASSERT( !ret );
	}

	//m_q --> m_finalqへコピー
	for( int frameno = 0; frameno < 3; frameno++ ){
		for( int skelno = 0; skelno < SKEL_MAX; skelno++ ){
			(m_traq + frameno * SKEL_MAX + skelno)->m_finalq = (m_traq + frameno * SKEL_MAX + skelno)->m_q;
			(m_traq + frameno * SKEL_MAX + skelno)->m_finaltra = (m_traq + frameno * SKEL_MAX + skelno)->m_tra;
			(m_traq + frameno * SKEL_MAX + skelno)->m_finaleul = (m_traq + frameno * SKEL_MAX + skelno)->m_cureul;

			(m_traq + frameno * SKEL_MAX + skelno)->m_orgq = (m_traq + frameno * SKEL_MAX + skelno)->m_q;
			(m_traq + frameno * SKEL_MAX + skelno)->m_orgtra = (m_traq + frameno * SKEL_MAX + skelno)->m_tra;
			(m_traq + frameno * SKEL_MAX + skelno)->m_orgeul = (m_traq + frameno * SKEL_MAX + skelno)->m_cureul;
		}
	}

	return 0;
}