Exemplo n.º 1
0
// 選択オブジェクト変更
void AnimationForm::slot_changeSelectObject(QModelIndex index)
{
//	m_pEditData->setSelIndex(index) ;

	if ( !index.isValid() ) { return ; }

	CObjectModel *pModel = m_pEditData->getObjectModel() ;

	if ( pModel->isLayer(index) ) {
		bool valid ;
		ObjectItem *pItem = pModel->getItemFromIndex(index) ;
		FrameData data = pItem->getDisplayFrameData(m_pEditData->getSelectFrame(), &valid) ;
		if ( valid ) {
			slot_setUI(data) ;
		}
		emit sig_changeSelectLayer(index) ;
	}

	ObjectItem *pObj = pModel->getObject(index) ;
	if ( pObj ) {
		ui->spinBox_loop->setValue(pObj->getLoop());
		ui->spinBox_fps->setValue(pObj->getFps()) ;
	}

	m_pDataMarker->repaint();
	m_pGlWidget->update();
}
Exemplo n.º 2
0
// 選択しているフレームデータ取得
bool EditData::getNowSelectFrameData(FrameData &ret)
{
    QModelIndex index = getSelIndex();
    if (!getObjectModel()->isLayer(index))
    {
        return false;
    }

    int frame = getSelectFrame();
    ObjectItem *pItem = getObjectModel()->getItemFromIndex(index);
    bool valid;
    ret = pItem->getDisplayFrameData(frame, &valid);
    return valid;
}
Exemplo n.º 3
0
// 現在フレーム変更
void AnimationForm::slot_frameChanged(int frame)
{
	bool bChange = (m_pEditData->getSelectFrame() != frame) ;
	ui->label_frame->setValue(frame) ;
	m_pEditData->setSelectFrame( frame ) ;
	if ( bChange ) {
		if ( m_pEditData->getSelIndex().isValid() ) {
			ObjectItem *pItem = m_pEditData->getObjectModel()->getItemFromIndex(m_pEditData->getSelIndex()) ;
			if ( pItem ) {
				bool valid ;
				FrameData d = pItem->getDisplayFrameData(frame, &valid) ;
				if ( valid ) {
					slot_setUI(d) ;
				}
			}
		}

		m_pGlWidget->update();
	}
}
Exemplo n.º 4
0
// フレームデータ コピー
void AnimationForm::copyFrameData( void )
{
	CObjectModel *pModel = m_pEditData->getObjectModel() ;
	QModelIndex index = m_pEditData->getSelIndex() ;
	if ( !pModel->isLayer(index) ) { return ; }
	ObjectItem *pItem = pModel->getItemFromIndex(index) ;

	FrameData data, *p ;
	int frame = m_pEditData->getSelectFrame() ;
	p = pItem->getFrameDataPtr(frame) ;
	if ( p ) {
		data = *p ;
	}
	else {
		bool valid ;
		data = pItem->getDisplayFrameData(frame, &valid) ;
		if ( !valid ) { return ; }
	}
	qDebug() << "Copy Framedata" ;
	m_pEditData->setCopyFrameData(data) ;
}
Exemplo n.º 5
0
// キー押しイベント
void AnimationForm::keyPressEvent(QKeyEvent *event)
{
	if ( event->key() == Qt::Key_Control ) {
		m_pGlWidget->setPressCtrl(true) ;
		m_pGlWidget->update() ;
	}

	int key = event->key() ;
	if ( event->modifiers() & Qt::ShiftModifier ) { key |= Qt::SHIFT ; }
	if ( event->modifiers() & Qt::ControlModifier ) { key |= Qt::CTRL ; }
	if ( event->modifiers() & Qt::MetaModifier ) { key |= Qt::META ; }
	if ( event->modifiers() & Qt::AltModifier ) { key |= Qt::ALT ; }
	QKeySequence ks(key) ;

	if ( ks == m_pSetting->getShortcutCopyFrame() ) {
		copyFrameData() ;
	}
	else if ( ks == m_pSetting->getShortcutPasteFrame() ) {
		pasteFrameData() ;
	}
	else if ( ks == m_pSetting->getShortcutPosSelect() ) {
		ui->radioButton_pos->setChecked(true) ;
		slot_clickedRadioPos(true) ;
	}
	else if ( ks == m_pSetting->getShortcutRotSelect() ) {
		ui->radioButton_rot->setChecked(true) ;
		slot_clickedRadioRot(true) ;
	}
	else if ( ks == m_pSetting->getShortcutCenterSelect() ) {
		ui->radioButton_center->setChecked(true) ;
		slot_clickedRadioCenter(true) ;
	}
	else if ( ks == m_pSetting->getShortcutScaleSelect() ) {
		ui->radioButton_scale->setChecked(true) ;
		slot_clickedRadioScale(true) ;
	}
	else if ( ks == m_pSetting->getShortcutPathSelect() ) {
		ui->radioButton_path->setChecked(true) ;
		slot_clickedRadioPath(true) ;
	}
	else if ( ks == m_pSetting->getShortcutPlayAnime() ) {
		if ( m_pEditData->getPlayAnime() ) {
			slot_pauseAnimation() ;
		}
		else {
			slot_playAnimation() ;
		}
	}
	else if ( ks == m_pSetting->getShortcutStopAnime() ) {
		slot_stopAnimation() ;
	}
	else if ( ks == m_pSetting->getShortcutJumpStartFrame() ) {
		jumpStartFrame() ;
	}
	else if ( ks == m_pSetting->getShortcutJumpEndFrame() ) {
		jumpEndFrame() ;
	}
	else if ( ks == m_pSetting->getShortcutAddFrameData() ) {
		CObjectModel *pModel = m_pEditData->getObjectModel() ;
		QModelIndex index = m_pEditData->getSelIndex() ;
		int frame = m_pEditData->getSelectFrame() ;
		if ( !pModel->isLayer(index) ) { return ; }
		ObjectItem *pItem = pModel->getItemFromIndex(index) ;
		FrameData data = pItem->getDisplayFrameData(frame) ;
		data.frame = frame ;
		slot_addNewFrameData(index, frame, data) ;
	}
	else if ( ks == m_pSetting->getShortcutDelFrameData() ) {
		slot_deleteFrameData() ;
	}
	else if ( ks == m_pSetting->getShortcutDelItem() ) {
		slot_deleteObject() ;
	}
	else if ( ks == m_pSetting->getShortcutDispItem() ) {
		slot_changeLayerDisp() ;
	}
	else if ( ks == m_pSetting->getShortcutLockItem() ) {
		slot_changeLayerLock() ;
	}
	else if ( ks == m_pSetting->getShortcutMoveAnimeWindow() ) {
		m_pGlWidget->setPressWindowMove(true) ;
		setCursor(QCursor(Qt::OpenHandCursor));
	}
}