本文整理汇总了C++中TupLayer::frame方法的典型用法代码示例。如果您正苦于以下问题:C++ TupLayer::frame方法的具体用法?C++ TupLayer::frame怎么用?C++ TupLayer::frame使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TupLayer
的用法示例。
在下文中一共展示了TupLayer::frame方法的12个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: insertSymbolIntoFrame
bool TupCommandExecutor::insertSymbolIntoFrame(TupLibraryResponse *response)
{
#ifdef K_DEBUG
tFatal() << "TupCommandExecutor::insertSymbolIntoFrame() - Adding symbol to project: " << response->arg().toString();
#endif
if (m_project->scenesTotal() > 0) {
if (m_project->insertSymbolIntoFrame(response->spaceMode(), response->arg().toString(),
response->sceneIndex(), response->layerIndex(), response->frameIndex())) {
TupScene *scene = m_project->scene(response->sceneIndex());
if (scene) {
TupLayer *layer = scene->layer(response->layerIndex());
if (layer) {
TupFrame *frame = layer->frame(response->frameIndex());
if (frame)
response->setFrameState(frame->isEmpty());
}
}
emit responsed(response);
return true;
}
} else {
#ifdef K_DEBUG
tError() << "TupCommandExecutor::insertSymbolIntoFrame() - No scenes available!";
#endif
}
return false;
}
示例2: resetFrame
bool TupCommandExecutor::resetFrame(TupFrameResponse *response)
{
int scenePos = response->sceneIndex();
int layerPos = response->layerIndex();
int position = response->frameIndex();
TupScene *scene = m_project->scene(scenePos);
if (scene) {
scene->resetStoryBoardScene(position);
TupLayer *layer = scene->layer(layerPos);
if (layer) {
TupFrame *frame = layer->frame(position);
if (frame) {
/*
QDomDocument doc;
doc.appendChild(frame->toXml(doc));
response->setArg(frame->frameName());
*/
if (layer->resetFrame(position)) {
//response->setState(doc.toString(0));
emit responsed(response);
return true;
}
}
}
}
return false;
}
示例3: removeSymbolFromFrame
bool TupCommandExecutor::removeSymbolFromFrame(TupLibraryResponse *response)
{
#ifdef K_DEBUG
T_FUNCINFO;
#endif
if (m_project->scenesTotal() > 0) {
if (m_project->removeSymbolFromFrame(response->arg().toString(), response->symbolType())) {
TupScene *scene = m_project->scene(response->sceneIndex());
if (scene) {
TupLayer *layer = scene->layer(response->layerIndex());
if (layer) {
TupFrame *frame = layer->frame(response->frameIndex());
if (frame)
response->setFrameState(frame->isEmpty());
}
}
emit responsed(response);
return true;
} else {
#ifdef K_DEBUG
tError() << "TupCommandExecutor::removeSymbolFromFrame() - Error: Symbol can't be removed from project!";
#endif
}
} else {
#ifdef K_DEBUG
tError() << "TupCommandExecutor::removeSymbolFromFrame() - No scenes available!";
#endif
}
return false;
}
示例4: setFrameVisibility
bool TupCommandExecutor::setFrameVisibility(TupFrameResponse *response)
{
int scenePos = response->sceneIndex();
int layerPos = response->layerIndex();
int position = response->frameIndex();
bool view = response->arg().toBool();
TupScene *scene = m_project->scene(scenePos);
if (!scene)
return false;
TupLayer *layer = scene->layer(layerPos);
if (layer) {
TupFrame *frame = layer->frame(position);
if (! frame)
return false;
frame->setVisible(view);
emit responsed(response);
return true;
}
return false;
}
示例5: addGraphicObject
void TupGraphicsScene::addGraphicObject(TupGraphicObject *object, double opacity)
{
/*
#ifdef K_DEBUG
T_FUNCINFO;
#endif
*/
QGraphicsItem *item = object->item();
k->onionSkin.opacityMap.insert(item, opacity);
if (TupItemGroup *group = qgraphicsitem_cast<TupItemGroup *>(item))
group->recoverChilds();
if (! qgraphicsitem_cast<TupItemGroup *>(item->parentItem())) {
item->setSelected(false);
TupLayer *layer = k->scene->layer(k->framePosition.layer);
if (layer) {
TupFrame *frame = layer->frame(k->framePosition.frame);
if (frame) {
item->setOpacity(opacity);
// k->objectCounter++;
addItem(item);
}
}
}
}
示例6: tFatal
TupFrame *TupGraphicsScene::currentFrame()
{
if (k->scene) {
if (k->scene->layersTotal() > 0) {
if (k->framePosition.layer < k->scene->layersTotal()) {
if (k->scene->layers().contains(k->framePosition.layer)) {
TupLayer *layer = k->scene->layer(k->framePosition.layer);
Q_CHECK_PTR(layer);
if (layer) {
if (!layer->frames().isEmpty())
return layer->frame(k->framePosition.frame);
} else {
#ifdef K_DEBUG
tFatal() << "TupGraphicsScene::currentFrame - No layer available: " << k->framePosition.frame;
#endif
}
} else {
#ifdef K_DEBUG
tFatal() << "TupGraphicsScene::currentFrame - Layer index incorrect!";
#endif
}
} else {
TupLayer *layer = k->scene->layer(k->scene->layersTotal() - 1);
if (layer) {
if (!layer->frames().isEmpty())
return layer->frame(k->framePosition.frame);
}
}
}
}
return 0;
}
示例7: selectFrame
bool TupCommandExecutor::selectFrame(TupFrameResponse *response)
{
#ifdef K_DEBUG
#ifdef Q_OS_WIN32
qDebug() << "[TupCommandExecutor::selectFrame()]";
#else
T_FUNCINFO;
#endif
#endif
int scenePos = response->sceneIndex();
int layerPos = response->layerIndex();
int position = response->frameIndex();
// bool prioritary = response->arg().toBool();
TupScene *scene = m_project->scene(scenePos);
if (!scene || scenePos < 0 || position < 0)
return false;
TupLayer *layer = scene->layer(layerPos);
if (layer) {
if (position < layer->framesTotal()) {
TupFrame *frame = layer->frame(position);
if (! frame)
return false;
emit responsed(response);
return true;
} else {
#ifdef K_DEBUG
QString msg = "TupCommandExecutor::selectFrame() - Invalid frame index -> " + QString::number(position);
#ifdef Q_OS_WIN32
qDebug() << msg;
#else
tError() << msg;
#endif
#endif
return false;
}
}
return false;
}
示例8: renameFrame
bool TupCommandExecutor::renameFrame(TupFrameResponse *response)
{
#ifdef K_DEBUG
#ifdef Q_OS_WIN32
qDebug() << "[TupCommandExecutor::renameFrame()]";
#else
T_FUNCINFO;
#endif
#endif
int scenePos = response->sceneIndex();
int layerPos = response->layerIndex();
int position = response->frameIndex();
QString newName= response->arg().toString();
QString oldName;
TupScene *scene = m_project->scene(scenePos);
if (!scene)
return false;
TupLayer *layer = scene->layer(layerPos);
if (layer) {
TupFrame *frame = layer->frame(position);
if (! frame)
return false;
oldName = frame->frameName();
if (oldName.compare(newName) != 0)
frame->setFrameName(newName);
emit responsed(response);
return true;
}
return false;
}
示例9: addSvgObject
void TupGraphicsScene::addSvgObject(TupSvgItem *svgItem, double opacity)
{
#ifdef K_DEBUG
T_FUNCINFO;
#endif
if (svgItem) {
k->onionSkin.opacityMap.insert(svgItem, opacity);
svgItem->setSelected(false);
TupLayer *layer = k->scene->layer(k->framePosition.layer);
if (layer) {
TupFrame *frame = layer->frame(k->framePosition.frame);
if (frame) {
svgItem->setOpacity(opacity);
if (svgItem->symbolName().compare("dollar.svg")==0)
connect(svgItem, SIGNAL(enabledChanged()), this, SIGNAL(showInfoWidget()));
addItem(svgItem);
} else {
#ifdef K_DEBUG
tFatal() << "TupGraphicsScene::addSvgObject() - Error: Frame #" << k->framePosition.frame << " NO available!";
#endif
}
} else {
#ifdef K_DEBUG
tFatal() << "TupGraphicsScene::addSvgObject() - Error: Layer #" << k->framePosition.layer << " NO available!";
#endif
}
} else {
#ifdef K_DEBUG
tFatal() << "TupGraphicsScene::addSvgObject() - Error: No SVG item!";
#endif
}
}
示例10: pasteFrame
bool TupCommandExecutor::pasteFrame(TupFrameResponse *response)
{
#ifdef K_DEBUG
#ifdef Q_OS_WIN32
qDebug() << "[TupCommandExecutor::pasteFrame()]";
#else
T_FUNCINFO;
#endif
#endif
int scenePos = response->sceneIndex();
int layerPos = response->layerIndex();
int position = response->frameIndex();
QString copyFrame = response->arg().toString();
TupScene *scene = m_project->scene(scenePos);
if (scene) {
TupLayer *layer = scene->layer(layerPos);
if (layer) {
TupFrame *frame = layer->frame(position);
if (frame) {
QString name = frame->frameName();
QDomDocument doc;
doc.appendChild(frame->toXml(doc));
response->setArg(doc.toString(0));
frame->clear();
frame->fromXml(copyFrame);
frame->setFrameName(name);
response->setFrameState(frame->isEmpty());
emit responsed(response);
return true;
}
}
}
return false;
}
示例11: includeObject
void TupGraphicsScene::includeObject(QGraphicsItem *object)
{
if (k->spaceMode == TupProject::FRAMES_EDITION) {
TupLayer *layer = k->scene->layer(k->framePosition.layer);
if (layer) {
TupFrame *frame = layer->frame(k->framePosition.frame);
if (frame) {
int zLevel = frame->getTopZLevel();
object->setZValue(zLevel);
addItem(object);
}
}
} else {
TupBackground *bg = k->scene->background();
TupFrame *frame = bg->frame();
if (frame) {
int zLevel = frame->getTopZLevel();
object->setZValue(zLevel);
addItem(object);
}
}
}
示例12: drawPhotogram
void TupGraphicsScene::drawPhotogram(int photogram)
{
/*
#ifdef K_DEBUG
T_FUNCINFO;
#endif
*/
// Q_CHECK_PTR(k->scene);
if (photogram < 0 || !k->scene)
return;
cleanWorkSpace();
bool valid = false;
// Drawing frames from another layers
for (int i=0; i < k->scene->layersTotal(); i++) {
TupLayer *layer = k->scene->layer(i);
if (layer->framesTotal() > 0 && photogram < layer->framesTotal()) {
TupFrame *mainFrame = layer->frame(photogram);
QString currentFrame = "";
if (mainFrame) {
currentFrame = mainFrame->frameName();
if (layer) {
if (layer->isVisible()) {
// Painting the background
drawBackground();
// Painting previews frames
if (k->onionSkin.previous > 0 && photogram > 0) {
double opacity = k->opacity;
double opacityFactor = opacity / (double)qMin(layer->frames().count(), k->onionSkin.previous);
int limit = photogram - k->onionSkin.previous;
if (limit < 0)
limit = 0;
QString frameBehind = "";
for (int frameIndex = photogram-1; frameIndex >= limit; frameIndex--) {
TupFrame *frame = layer->frame(frameIndex);
QString previousFrame = frame->frameName();
if (frame && previousFrame.compare(currentFrame) != 0
&& frameBehind.compare(previousFrame) != 0) {
addFrame(frame, opacity, Preview);
}
frameBehind = previousFrame;
opacity -= opacityFactor;
}
}
// valid = true;
// k->layerCounter = i;
addFrame(mainFrame, TupGraphicsScene::Current);
// Painting next frames
if (k->onionSkin.next > 0 && layer->framesTotal() > photogram + 1) {
double opacity = k->opacity;
double opacityFactor = opacity / (double)qMin(layer->frames().count(), k->onionSkin.next);
int limit = photogram + k->onionSkin.next;
if (limit >= layer->frames().count())
limit = layer->frames().count() - 1;
QString frameLater = "";
for (int frameIndex = photogram+1; frameIndex <= limit; frameIndex++) {
TupFrame * frame = layer->frame(frameIndex);
QString nextFrame = frame->frameName();
if (frame && nextFrame.compare(currentFrame) != 0
&& frameLater.compare(nextFrame) != 0) {
addFrame(frame, opacity, Next);
}
frameLater = nextFrame;
opacity -= opacityFactor;
}
}
// SQA: Crashpoint when layers are deleted
valid = true;
k->layerCounter = i;
// addFrame(mainFrame, TupGraphicsScene::Current);
}
}
}
}
//.........这里部分代码省略.........