本文整理汇总了C++中TApp::getCurrentImageType方法的典型用法代码示例。如果您正苦于以下问题:C++ TApp::getCurrentImageType方法的具体用法?C++ TApp::getCurrentImageType怎么用?C++ TApp::getCurrentImageType使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TApp
的用法示例。
在下文中一共展示了TApp::getCurrentImageType方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: apply
//.........这里部分代码省略.........
parentDir = scene->decodeFilePath(parentDir);
if (!TFileStatus(parentDir).doesExist()) {
QString question;
/*question = "Folder " +toQString(parentDir) +
" doesn't exist.\nDo you
want to create it?";*/
question = tr("Folder %1 doesn't exist.\nDo you want to create it?")
.arg(toQString(parentDir));
int ret = DVGui::MsgBox(question, QObject::tr("Yes"), QObject::tr("No"));
if (ret == 0 || ret == 2) return false;
try {
TSystem::mkDir(parentDir);
DvDirModel::instance()->refreshFolder(parentDir.getParentDir());
} catch (...) {
error(tr("Unable to create") + toQString(parentDir));
return false;
}
}
TXshLevel *level =
scene->createNewLevel(lType, levelName, TDimension(), 0, fp);
TXshSimpleLevel *sl = dynamic_cast<TXshSimpleLevel *>(level);
assert(sl);
sl->setPath(fp, true);
if (lType == TZP_XSHLEVEL || lType == OVL_XSHLEVEL) {
sl->getProperties()->setDpiPolicy(LevelProperties::DP_ImageDpi);
sl->getProperties()->setDpi(dpi);
sl->getProperties()->setImageDpi(TPointD(dpi, dpi));
sl->getProperties()->setImageRes(TDimension(xres, yres));
}
/*-- これからLevelを配置しようとしているセルが空いているかどうかのチェック
* --*/
bool areColumnsShifted = false;
TXshCell cell = xsh->getCell(row, col);
bool isInRange = true;
for (i = row; i < row + numFrames; i++) {
if (!cell.isEmpty()) {
isInRange = false;
break;
}
cell = xsh->getCell(i, col);
}
if (!validColumn) {
isInRange = false;
}
/*-- 別のLevelに占有されていた場合、Columnを1つ右に移動 --*/
if (!isInRange) {
col += 1;
TApp::instance()->getCurrentColumn()->setColumnIndex(col);
areColumnsShifted = true;
xsh->insertColumn(col);
}
CreateLevelUndo *undo =
new CreateLevelUndo(row, col, numFrames, step, areColumnsShifted);
TUndoManager::manager()->add(undo);
for (i = from; i <= to; i += inc) {
TFrameId fid(i);
TXshCell cell(sl, fid);
if (lType == PLI_XSHLEVEL)
sl->setFrame(fid, new TVectorImage());
else if (lType == TZP_XSHLEVEL) {
TRasterCM32P raster(xres, yres);
raster->fill(TPixelCM32());
TToonzImageP ti(raster, TRect());
ti->setDpi(dpi, dpi);
sl->setFrame(fid, ti);
ti->setSavebox(TRect(0, 0, xres - 1, yres - 1));
} else if (lType == OVL_XSHLEVEL) {
TRaster32P raster(xres, yres);
raster->clear();
TRasterImageP ri(raster);
ri->setDpi(dpi, dpi);
sl->setFrame(fid, ri);
}
for (j = 0; j < step; j++) xsh->setCell(row++, col, cell);
}
if (lType == TZP_XSHLEVEL || lType == OVL_XSHLEVEL) {
sl->save(fp);
DvDirModel::instance()->refreshFolder(fp.getParentDir());
}
undo->onAdd(sl);
app->getCurrentScene()->notifySceneChanged();
app->getCurrentScene()->notifyCastChange();
app->getCurrentXsheet()->notifyXsheetChanged();
// Cambia l'immagine corrente ma non cambiano ne' il frame ne' la colonna
// corrente
// (entrambi notificano il cambiamento dell'immagine al tool).
// devo verfificare che sia settato il tool giusto.
app->getCurrentTool()->onImageChanged(
(TImage::Type)app->getCurrentImageType());
return true;
}