本文整理汇总了C++中ToonzScene::getTopXsheet方法的典型用法代码示例。如果您正苦于以下问题:C++ ToonzScene::getTopXsheet方法的具体用法?C++ ToonzScene::getTopXsheet怎么用?C++ ToonzScene::getTopXsheet使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ToonzScene
的用法示例。
在下文中一共展示了ToonzScene::getTopXsheet方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: execute
void execute()
{
TApp *app = TApp::instance();
ToonzScene *scene = app->getCurrentScene()->getScene();
TLevelSet *levelSet = scene->getLevelSet();
std::set<TXshLevel *> usedLevels;
scene->getTopXsheet()->getUsedLevels(usedLevels);
std::vector<TXshLevel *> unused;
for (int i = 0; i < levelSet->getLevelCount(); i++) {
TXshLevel *xl = levelSet->getLevel(i);
if (usedLevels.count(xl) == 0)
unused.push_back(xl);
}
if (unused.empty()) {
DVGui::error(QObject::tr("No unused levels"));
return;
} else {
TUndoManager *um = TUndoManager::manager();
um->beginBlock();
for (int i = 0; i < (int)unused.size(); i++) {
TXshLevel *xl = unused[i];
um->add(new DeleteLevelUndo(xl));
scene->getLevelSet()->removeLevel(xl);
}
TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
TApp::instance()->getCurrentScene()->notifyCastChange();
um->endBlock();
}
}
示例2: updateChooseLevelComboItems
/*! update combo items when the contents of scene cast are changed
*/
void Filmstrip::updateChooseLevelComboItems() {
// clear items
m_chooseLevelCombo->clear();
m_levels.clear();
std::map<TXshSimpleLevel *, TFrameId> new_workingFrames;
// correct and register items
ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene();
if (scene) {
std::vector<TXshLevel *> levels;
scene->getLevelSet()->listLevels(levels);
std::vector<TXshLevel *>::iterator it;
for (it = levels.begin(); it != levels.end(); ++it) {
// register only TLV and PLI
TXshSimpleLevel *sl = (*it)->getSimpleLevel();
if (sl) {
// register only used level in xsheet
if (!scene->getTopXsheet()->isLevelUsed(sl)) continue;
m_levels.push_back(sl);
// create new m_workingFrames map with the new levelset
TFrameId fId;
std::map<TXshSimpleLevel *, TFrameId>::iterator WFit =
m_workingFrames.find(sl);
if (WFit != m_workingFrames.end())
fId = WFit->second;
else
fId = sl->getFirstFid();
new_workingFrames.insert(std::make_pair(sl, fId));
QString levelName = QString::fromStdWString(sl->getName());
if (sl->getProperties()->getDirtyFlag()) levelName += " *";
// append the current working frame number to the item name
if (fId != sl->getFirstFid() && fId.getNumber() >= 0)
levelName +=
QString(" [#") + QString::number(fId.getNumber()) + QString("]");
m_chooseLevelCombo->addItem(levelName);
}
}
}
m_chooseLevelCombo->addItem(tr("- No Current Level -"));
// swap the list
m_workingFrames.clear();
m_workingFrames = new_workingFrames;
// synchronize the current index of combo to the current level
updateCurrentLevelComboItem();
}