本文整理汇总了C++中TupScene::layers方法的典型用法代码示例。如果您正苦于以下问题:C++ TupScene::layers方法的具体用法?C++ TupScene::layers怎么用?C++ TupScene::layers使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TupScene
的用法示例。
在下文中一共展示了TupScene::layers方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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());
}
}
}
}