本文整理汇总了C++中Preferences::getDefLevelType方法的典型用法代码示例。如果您正苦于以下问题:C++ Preferences::getDefLevelType方法的具体用法?C++ Preferences::getDefLevelType怎么用?C++ Preferences::getDefLevelType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Preferences
的用法示例。
在下文中一共展示了Preferences::getDefLevelType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: update
void LevelCreatePopup::update() {
updatePath();
Preferences *pref = Preferences::instance();
if (pref->isNewLevelSizeToCameraSizeEnabled()) {
TCamera *currCamera =
TApp::instance()->getCurrentScene()->getScene()->getCurrentCamera();
TDimensionD camSize = currCamera->getSize();
m_widthFld->setValue(camSize.lx);
m_heightFld->setValue(camSize.ly);
m_dpiFld->setValue(currCamera->getDpi().x);
} else {
m_widthFld->setValue(pref->getDefLevelWidth());
m_heightFld->setValue(pref->getDefLevelHeight());
m_dpiFld->setValue(pref->getDefLevelDpi());
}
int levelType = pref->getDefLevelType();
int index = -1;
switch (levelType) {
case TZI_XSHLEVEL:
index = m_levelTypeOm->findText(ScanLevel);
break;
case PLI_XSHLEVEL:
index = m_levelTypeOm->findText(VectorLevel);
break;
case TZP_XSHLEVEL:
index = m_levelTypeOm->findText(ToonzLevel);
break;
case OVL_XSHLEVEL:
index = m_levelTypeOm->findText(RasterLevel);
break;
}
if (index >= 0) m_levelTypeOm->setCurrentIndex(index);
/*
(old behaviour)
TCamera* camera = scene->getCurrentCamera();
TDimensionD cameraSize = camera->getSize();
m_widthFld->setValue(cameraSize.lx);
m_heightFld->setValue(cameraSize.ly);
if(camera->isXPrevalence())
m_dpiFld->setValue(camera->getDpi().x);
else
m_dpiFld->setValue(camera->getDpi().y);
*/
}
示例2: while
//.........这里部分代码省略.........
TFrameId fid = getNewFrameId(sl, row);
// create the new drawing
TImageP img = sl->createEmptyFrame();
m_isFrameCreated = true;
// insert the drawing in the level
sl->setFrame(fid, img);
// update the cell
cell = TXshCell(sl, fid);
xsh->setCell(row, col, cell);
// create holds
if (!isAutoStretchEnabled) {
m_cellsData.push_back(row);
m_cellsData.push_back(row);
m_cellsData.push_back(2); // vuoto => nuovo
} else {
if (a >= r0) {
// create a hold before : [a+1, row-1]
TXshCell aCell = xsh->getCell(a, col);
for (int i = a + 1; i < row; i++) xsh->setCell(i, col, aCell);
m_cellsData.push_back(a + 1);
m_cellsData.push_back(row - 1);
m_cellsData.push_back(1); // vuoto => vecchio
if (b <= r1 && xsh->getCell(b, col).getSimpleLevel() == sl) {
// create also a hold after
for (int i = row + 1; i < b; i++) xsh->setCell(i, col, cell);
m_cellsData.push_back(row);
m_cellsData.push_back(b - 1);
m_cellsData.push_back(2); // vuoto => nuovo
} else {
m_cellsData.push_back(row);
m_cellsData.push_back(row);
m_cellsData.push_back(2); // vuoto => nuovo
}
} else if (b <= r1) {
// create a hold after
for (int i = row + 1; i < b; i++) xsh->setCell(i, col, cell);
m_cellsData.push_back(row);
m_cellsData.push_back(b - 1);
m_cellsData.push_back(2); // vuoto => nuovo
}
}
}
// notify & return
currentXsheet->notifyXsheetChanged();
currentScene->notifyCastChange();
currentLevel->notifyLevelChange();
return cell.getImage(true).getPointer();
}
if (row > 0 && xsh->getCell(row - 1, col).getSimpleLevel() != 0 &&
!animationSheetEnabled) {
sl = xsh->getCell(row - 1, col).getSimpleLevel();
if (sl->getType() != OVL_XSHLEVEL ||
sl->getPath().getFrame() != TFrameId::NO_FRAME) {
// la cella precedente contiene un drawing di un livello. animationSheet
// e' disabilitato
// creo un nuovo frame
currentLevel->setLevel(sl);
if (sl->isSubsequence() || sl->isReadOnly()) return 0;
TFrameId fid = sl->index2fid(sl->getFrameCount());
TImageP img = sl->createEmptyFrame();
m_isFrameCreated = true;
sl->setFrame(fid, img);
cell = TXshCell(sl, fid);
xsh->setCell(row, col, cell);
currentXsheet->notifyXsheetChanged();
currentScene->notifyCastChange();
currentLevel->notifyLevelChange();
return img.getPointer();
}
}
// animation sheet disabled or empty column. autoCreate is enabled: we must
// create a new level
int levelType = pref->getDefLevelType();
TXshLevel *xl = scene->createNewLevel(levelType);
sl = xl->getSimpleLevel();
m_isLevelCreated = true;
// create the drawing
TFrameId fid = animationSheetEnabled ? getNewFrameId(sl, row) : TFrameId(1);
TImageP img = sl->createEmptyFrame();
m_isFrameCreated = true;
sl->setFrame(fid, img);
cell = TXshCell(sl, fid);
xsh->setCell(row, col, cell);
if (animationSheetEnabled) {
m_cellsData.push_back(row);
m_cellsData.push_back(row);
m_cellsData.push_back(2); // vuoto => nuovo
}
currentXsheet->notifyXsheetChanged();
currentScene->notifyCastChange();
currentLevel->notifyLevelChange();
return img.getPointer();
}
}