本文整理汇总了C++中ObjectItem::getFrameDataPtr方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectItem::getFrameDataPtr方法的具体用法?C++ ObjectItem::getFrameDataPtr怎么用?C++ ObjectItem::getFrameDataPtr使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectItem
的用法示例。
在下文中一共展示了ObjectItem::getFrameDataPtr方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: mousePressEvent
void DataMarkerLabel::mousePressEvent(QMouseEvent *ev)
{
m_bMouseMove = false;
m_bPressLeft = false;
m_moveMode = kMoveMode_None;
#if 0
if ( ev->button() != Qt::LeftButton ) {
ev->ignore();
return ;
}
#endif
m_oldMousePos = ev->pos();
m_bPressLeft = true;
m_pressFrame = m_pressCurrentFrame = -1;
ObjectModel *pModel = m_pEditData->getObjectModel();
QModelIndex index = m_pEditData->getSelIndex();
ObjectItem *pItem = pModel->getItemFromIndex(index);
// 移動予定のフレームデータ取得
if (ev->y() < height() / 3)
{
if (pModel->isLayer(index))
{
for (int i = m_frameStart; i <= m_frameEnd; i++)
{
if (ev->pos().x() >= getX(i) && ev->pos().x() < getX(i + 1))
{
if (pItem->getFrameDataPtr(i))
{
m_pressCurrentFrame = m_pressFrame = i;
m_moveMode = kMoveMode_Layer;
}
break;
}
}
}
}
else if (pModel->isObject(index) && ev->y() < height() * 2 / 3)
{
for (int i = m_frameStart; i <= m_frameEnd; i++)
{
if (ev->pos().x() >= getX(i) && ev->pos().x() < getX(i + 1))
{
if (pItem->getFrameDataPtr(i, true))
{
m_pressCurrentFrame = m_pressFrame = i;
m_moveMode = kMoveMode_Object;
}
break;
}
}
}
}
示例2: slot_setColorFromPicker
void AnimationForm::slot_setColorFromPicker(QRgb rgba)
{
CObjectModel *pModel = m_pEditData->getObjectModel() ;
QModelIndex index = m_pEditData->getSelIndex() ;
if ( !pModel->isLayer(index) ) { return ; }
int frame = m_pEditData->getSelectFrame() ;
ObjectItem *pItem = pModel->getItemFromIndex(index) ;
FrameData *pData = pItem->getFrameDataPtr(frame) ;
if ( !pData ) {
pData = pModel->getFrameDataFromPrevFrame(index, frame, true) ;
if ( !pData ) { return ; }
FrameData *pNext = pModel->getFrameDataFromNextFrame(index, frame) ;
FrameData data = pData->getInterpolation(pNext, frame) ;
data.rgba[0] = qRed(rgba) ;
data.rgba[1] = qGreen(rgba) ;
data.rgba[2] = qBlue(rgba) ;
slot_addNewFrameData(index, frame, data);
}
else {
pData->rgba[0] = qRed(rgba) ;
pData->rgba[1] = qGreen(rgba) ;
pData->rgba[2] = qBlue(rgba) ;
addCommandEdit(*pData);
}
}
示例3:
FrameData *ObjectItem::getParentFrameDataPtr(int frame)
{
ObjectItem *parent = m_pParent ;
while ( parent ) {
FrameData *p = parent->getFrameDataPtr(frame) ;
if ( p ) { return p ; }
parent = parent->m_pParent ;
}
return NULL ;
}
示例4: setSelectFrameDataFromFrame
// 指定フレームのフレームデータを選択する
bool AnimationForm::setSelectFrameDataFromFrame( int frame, QModelIndex indexLayer )
{
CObjectModel *pModel = m_pEditData->getObjectModel() ;
if ( !pModel->isLayer(indexLayer) ) { return false ; }
ObjectItem *pItem = pModel->getItemFromIndex(indexLayer) ;
FrameData *pData = pItem->getFrameDataPtr(frame) ;
if ( !pData ) { return false ; }
ui->spinBox_nowSequence->setValue(frame);
slot_setUI(*pData);
m_pGlWidget->update();
return true ;
}
示例5: slot_frameDataMoveEnd
// マウスでのデータ編集終了時
void AnimationForm::slot_frameDataMoveEnd( FrameData dataOld )
{
CObjectModel *pModel = m_pEditData->getObjectModel() ;
QModelIndex index = m_pEditData->getSelIndex() ;
if ( !pModel->isLayer(index) ) { return ; }
ObjectItem *pItem = pModel->getItemFromIndex(index) ;
if ( !pItem ) { return ; }
FrameData *p = pItem->getFrameDataPtr(m_pEditData->getSelectFrame()) ;
if ( !p ) { return ; }
if ( *p != dataOld ) {
addCommandEdit(*p, &dataOld) ;
}
}
示例6: slot_moveFrameData
// フレームデータ 移動
void AnimationForm::slot_moveFrameData(int prevFrame, int nextFrame)
{
CObjectModel *pModel = m_pEditData->getObjectModel() ;
QModelIndex index = m_pEditData->getSelIndex() ;
if ( !pModel->isLayer(index) ) { return ; }
if ( prevFrame < 0 || nextFrame < 0 ) { return ; }
ObjectItem *pItem = pModel->getItemFromIndex(index) ;
if ( !pItem ) { return ; }
if ( !pItem->getFrameDataPtr(prevFrame) ) { return ; }
QList<QWidget *> widgets ;
widgets << m_pDataMarker << m_pGlWidget ;
m_pEditData->cmd_moveFrameData(index, prevFrame, nextFrame, widgets) ;
}
示例7: slot_selectLayerChanged
// 選択レイヤ変更
void AnimationForm::slot_selectLayerChanged( QModelIndex indexLayer )
{
if ( indexLayer.isValid() ) {
ui->treeView->setCurrentIndex(indexLayer) ;
// m_pEditData->setSelIndex(indexLayer) ;
}
ObjectItem *p = m_pEditData->getObjectModel()->getItemFromIndex(indexLayer) ;
FrameData *pData = p->getFrameDataPtr(m_pEditData->getSelectFrame()) ;
if ( pData ) {
slot_setUI(*pData) ;
}
m_pGlWidget->update();
emit sig_changeSelectLayer(indexLayer) ;
}
示例8: slot_deleteFrameData
// フレームデータ削除
void AnimationForm::slot_deleteFrameData(void)
{
CObjectModel *pModel = m_pEditData->getObjectModel() ;
QModelIndex index = m_pEditData->getSelIndex() ;
if ( !index.isValid() ) { return ; }
if ( !pModel->isLayer(index) ) { return ; }
ObjectItem *pItem = pModel->getItemFromIndex(index) ;
if ( !pItem ) { return ; }
int frame = m_pEditData->getSelectFrame() ;
if ( !pItem->getFrameDataPtr(frame) ) { return ; }
QList<QWidget *> update ;
update << m_pDataMarker << m_pGlWidget ;
m_pEditData->cmd_delFrameData(index, frame, update) ;
}
示例9: jumpEndFrame
void AnimationForm::jumpEndFrame()
{
CObjectModel *pModel = m_pEditData->getObjectModel() ;
QModelIndex index = m_pEditData->getSelIndex() ;
if ( !pModel->isLayer(index) ) { return ; }
ObjectItem *pItem = pModel->getItemFromIndex(index) ;
if ( !pItem ) { return ; }
int maxFrame = -1 ;
const QList<FrameData> &datas = pItem->getFrameData() ;
for ( int i = 0 ; i < datas.size() ; i ++ ) {
if ( maxFrame < datas.at(i).frame ) {
maxFrame = datas.at(i).frame ;
}
}
if ( !pItem->getFrameDataPtr(maxFrame) ) { return ; }
slot_frameChanged(maxFrame) ;
}
示例10: addNowSelectLayerAndFrame
// 選択レイヤの選択フレームにフレームデータを追加
void AnimationForm::addNowSelectLayerAndFrame( void )
{
CObjectModel *pModel = m_pEditData->getObjectModel() ;
QModelIndex index = m_pEditData->getSelIndex() ;
if ( !pModel->isLayer(index) ) { return ; }
ObjectItem *pItem = pModel->getItemFromIndex(index) ;
if ( !pItem ) { return ; }
int frame = m_pEditData->getSelectFrame() ;
if ( pItem->getFrameDataPtr(frame) ) { return ; }
FrameData *pPrev = pModel->getFrameDataFromPrevFrame(index, frame, true) ;
if ( !pPrev ) { return ; }
FrameData *pNext = pModel->getFrameDataFromNextFrame(index, frame) ;
FrameData data = pPrev->getInterpolation(pNext, frame) ;
slot_addNewFrameData(index, frame, data) ; // フレームデータ追加
}
示例11: copyFrameData
// フレームデータ コピー
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) ;
}
示例12: pasteFrameData
// フレームデータ ペースト
void AnimationForm::pasteFrameData( void )
{
if ( !m_pEditData->isCopyData() ) {
return ;
}
CObjectModel *pModel = m_pEditData->getObjectModel() ;
QModelIndex index = m_pEditData->getSelIndex() ;
if ( !pModel->isLayer(index) ) { return ; }
ObjectItem *pItem = pModel->getItemFromIndex(index) ;
int frame = m_pEditData->getSelectFrame() ;
FrameData *pData = pItem->getFrameDataPtr(frame) ;
if ( pData ) {
FrameData data = m_pEditData->getCopyFrameData() ;
data.frame = frame ;
addCommandEdit(data, pData) ;
}
else {
slot_addNewFrameData(index, frame, m_pEditData->getCopyFrameData()) ; // フレームデータ追加
}
qDebug() << "Paste Framedata" ;
}