本文整理汇总了C++中TupLayer::frames方法的典型用法代码示例。如果您正苦于以下问题:C++ TupLayer::frames方法的具体用法?C++ TupLayer::frames怎么用?C++ TupLayer::frames使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TupLayer
的用法示例。
在下文中一共展示了TupLayer::frames方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: removeSymbolFromFrame
bool TupProject::removeSymbolFromFrame(const QString &name, TupLibraryObject::Type type)
{
#ifdef K_DEBUG
QString msg = "TupProject::removeSymbolFromFrame() - Removing symbol " + name + " from project...";
#ifdef Q_OS_WIN
qDebug() << msg;
#else
T_FUNCINFO << msg;
#endif
#endif
if (type == TupLibraryObject::Folder)
return true;
int totalScenes = k->scenes.size();
for (int i = 0; i < totalScenes; i++) {
TupScene *scene = k->scenes.at(i);
int totalLayers = scene->layers().size();
for (int j = 0; j < totalLayers; j++) {
TupLayer *layer = scene->layers().at(j);
int totalFrames = layer->frames().size();
for (int t = 0; t < totalFrames; t++) {
TupFrame *frame = layer->frames().at(t);
if (type != TupLibraryObject::Svg)
frame->removeImageItemFromFrame(name);
else
frame->removeSvgItemFromFrame(name);
}
}
TupBackground *bg = scene->background();
if (bg) {
TupFrame *frame = bg->staticFrame();
if (frame) {
if (type == TupLibraryObject::Svg)
frame->removeSvgItemFromFrame(name);
else
frame->removeImageItemFromFrame(name);
}
frame = bg->dynamicFrame();
if (frame) {
if (type == TupLibraryObject::Svg)
frame->removeSvgItemFromFrame(name);
else
frame->removeImageItemFromFrame(name);
}
}
}
// k->library->removeObject(name, true);
return true;
}
示例2: removeSymbol
bool TupProject::removeSymbol(const QString &name, TupLibraryObject::Type type)
{
#ifdef K_DEBUG
#ifdef Q_OS_WIN
qDebug() << "[TupProject::removeSymbol()]";
#else
T_FUNCINFO;
#endif
#endif
int totalScenes = k->scenes.size();
for (int i = 0; i < totalScenes; i++) {
TupScene *scene = k->scenes.at(i);
TupBackground *bg = scene->background();
if (bg) {
TupFrame *frame = bg->staticFrame();
if (frame) {
if (type != TupLibraryObject::Svg)
frame->removeImageItemFromFrame(name);
else
frame->removeSvgItemFromFrame(name);
}
frame = bg->dynamicFrame();
if (frame) {
if (type != TupLibraryObject::Svg)
frame->removeImageItemFromFrame(name);
else
frame->removeSvgItemFromFrame(name);
}
}
int totalLayers = scene->layers().size();
for (int j = 0; j < totalLayers; j++) {
TupLayer *layer = scene->layers().at(j);
int totalFrames = layer->frames().size();
for (int t = 0; t < totalFrames; t++) {
TupFrame *frame = layer->frames().at(t);
if (type != TupLibraryObject::Svg)
frame->removeImageItemFromFrame(name);
else
frame->removeSvgItemFromFrame(name);
}
}
}
return k->library->removeObject(name, true);
}
示例3: updateSymbolId
bool TupProject::updateSymbolId(TupLibraryObject::Type type, const QString &oldId, const QString &newId)
{
int scenesCount = k->scenes.size();
for (int i = 0; i < scenesCount; i++) {
TupScene *scene = k->scenes.at(i);
int layersCount = scene->layers().size();
for (int j = 0; j < layersCount; j++) {
TupLayer *layer = scene->layers().at(j);
int framesCount = layer->frames().size();
for (int t = 0; t < framesCount; t++) {
TupFrame *frame = layer->frames().at(t);
if (type != TupLibraryObject::Svg)
frame->updateIdFromFrame(oldId, newId);
else
frame->updateSvgIdFromFrame(oldId, newId);
}
}
TupBackground *bg = scene->background();
if (bg) {
TupFrame *frame = bg->staticFrame();
if (frame) {
if (type != TupLibraryObject::Svg)
frame->updateIdFromFrame(oldId, newId);
else
frame->updateSvgIdFromFrame(oldId, newId);
}
frame = bg->dynamicFrame();
if (frame) {
if (type != TupLibraryObject::Svg)
frame->updateIdFromFrame(oldId, newId);
else
frame->updateSvgIdFromFrame(oldId, newId);
}
}
}
return true;
}
示例4: reloadLibraryItem
void TupProject::reloadLibraryItem(TupLibraryObject::Type type, const QString &id, TupLibraryObject *object)
{
int scenesCount = k->scenes.size();
for (int i = 0; i < scenesCount; i++) {
TupScene *scene = k->scenes.at(i);
int layersCount = scene->layers().size();
for (int j = 0; j < layersCount; j++) {
TupLayer *layer = scene->layers().at(j);
int framesCount = layer->frames().size();
for (int t = 0; t < framesCount; t++) {
TupFrame *frame = layer->frames().at(t);
if (type == TupLibraryObject::Svg)
frame->reloadSVGItem(id, object);
else
frame->reloadGraphicItem(id, object->dataPath());
}
}
TupBackground *bg = scene->background();
if (bg) {
TupFrame *frame = bg->staticFrame();
if (frame) {
if (type == TupLibraryObject::Svg)
frame->reloadSVGItem(id, object);
else
frame->reloadGraphicItem(id, object->dataPath());
}
frame = bg->dynamicFrame();
if (frame) {
if (type == TupLibraryObject::Svg)
frame->reloadSVGItem(id, object);
else
frame->reloadGraphicItem(id, object->dataPath());
}
}
}
}
示例5: 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;
}
示例6: qMax
int TupAnimationRenderer::Private::calculateTotalPhotograms(TupScene *scene)
{
Layers layers = scene->layers();
int total = 0;
int totalLayers = layers.size();
for (int i = 0; i < totalLayers; i++) {
TupLayer *layer = layers.at(i);
if (layer)
total = qMax(total, layer->frames().count());
}
return total;
}
示例7: 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);
}
}
}
}
//.........这里部分代码省略.........