本文整理汇总了C++中TXshLevel类的典型用法代码示例。如果您正苦于以下问题:C++ TXshLevel类的具体用法?C++ TXshLevel怎么用?C++ TXshLevel使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TXshLevel类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: enterEvent
void SceneViewer::enterEvent(QEvent *) {
if (m_isMouseEntered) return;
m_isMouseEntered = true;
TApp *app = TApp::instance();
modifiers = 0;
TTool *tool = app->getCurrentTool()->getTool();
TXshLevel *level = app->getCurrentLevel()->getLevel();
if (level && level->getSimpleLevel())
m_dpiScale =
getCurrentDpiScale(level->getSimpleLevel(), tool->getCurrentFid());
else
m_dpiScale = TPointD(1, 1);
if (m_freezedStatus != NO_FREEZED) return;
invalidateToolStatus();
if (tool && tool->isEnabled()) {
tool->setViewer(this);
tool->updateMatrix();
tool->onEnter();
}
setFocus();
updateGL();
}
开发者ID:hvfrancesco,项目名称:opentoonz,代码行数:27,代码来源:sceneviewerevents.cpp
示例2: onXshLevelSwitched
void TApp::onXshLevelSwitched(TXshLevel *) {
TXshLevel *level = m_currentLevel->getLevel();
if (level) {
TXshSimpleLevel *simpleLevel = level->getSimpleLevel();
// Devo aggiornare la paletta corrente
if (simpleLevel) {
m_paletteController->getCurrentLevelPalette()->setPalette(
simpleLevel->getPalette());
// Se il nuovo livello selezionato e' un ovl,
// la paletta corrente e' una cleanup palette
// => setto come handle corrente quello della paletta di cleanup.
TPalette *currentPalette =
m_paletteController->getCurrentPalette()->getPalette();
if (simpleLevel->getType() == OVL_XSHLEVEL && currentPalette &&
currentPalette->isCleanupPalette())
m_paletteController->editCleanupPalette();
return;
}
TXshPaletteLevel *paletteLevel = level->getPaletteLevel();
if (paletteLevel) {
m_paletteController->getCurrentLevelPalette()->setPalette(
paletteLevel->getPalette());
return;
}
}
m_paletteController->getCurrentLevelPalette()->setPalette(0);
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:33,代码来源:tapp.cpp
示例3: onImageChanged
/*! Notify change of image in \b fid: update icon and notify level change.
*/
void TTool::notifyImageChanged(const TFrameId &fid) {
onImageChanged();
if (!m_application) return;
m_application->getCurrentScene()->setDirtyFlag(true);
if (m_application->getCurrentFrame()->isEditingLevel()) {
TXshLevel *xl = m_application->getCurrentLevel()->getLevel();
if (!xl) return;
TXshSimpleLevel *sl = xl->getSimpleLevel();
if (!sl) return;
sl->setDirtyFlag(true);
IconGenerator::instance()->invalidate(sl, fid);
IconGenerator::instance()->invalidateSceneIcon();
} else {
int row = m_application->getCurrentFrame()->getFrame();
int col = m_application->getCurrentColumn()->getColumnIndex();
if (col < 0) return;
TXsheet *xsh = m_application->getCurrentXsheet()->getXsheet();
if (!xsh) return;
TXshCell cell = xsh->getCell(row, col);
TXshSimpleLevel *sl = cell.getSimpleLevel();
if (sl) {
IconGenerator::instance()->invalidate(sl, fid);
IconGenerator::instance()->invalidateSceneIcon();
sl->setDirtyFlag(true);
}
}
m_application->getCurrentLevel()->notifyLevelChange();
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:32,代码来源:tool.cpp
示例4: assert
void TApp::onLevelColorStyleSwitched() {
TPaletteHandle *ph = m_paletteController->getCurrentLevelPalette();
assert(ph);
if (ToonzCheck::instance()->setColorIndex(ph->getStyleIndex())) {
ToonzCheck *tc = ToonzCheck::instance();
int mask = tc->getChecks();
if (mask & ToonzCheck::eInk || mask & ToonzCheck::ePaint) {
IconGenerator::Settings s;
s.m_blackBgCheck = mask & ToonzCheck::eBlackBg;
s.m_transparencyCheck = mask & ToonzCheck::eTransparency;
s.m_inksOnly = mask & ToonzCheck::eInksOnly;
s.m_inkIndex = mask & ToonzCheck::eInk ? tc->getColorIndex() : -1;
s.m_paintIndex = mask & ToonzCheck::ePaint ? tc->getColorIndex() : -1;
IconGenerator::instance()->setSettings(s);
TXshLevel *sl = m_currentLevel->getLevel();
if (!sl) return;
std::vector<TFrameId> fids;
sl->getFids(fids);
for (int i = 0; i < (int)fids.size(); i++)
IconGenerator::instance()->invalidate(sl, fids[i]);
m_currentLevel->notifyLevelViewChange();
}
/*-- 表示オプションが切り替わっただけなので、DirtyFlagを立てない --*/
m_currentScene->notifySceneChanged(false);
}
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:34,代码来源:tapp.cpp
示例5: updateAllLinkedStyles
void StudioPaletteCmd::updateAllLinkedStyles(TPaletteHandle *paletteHandle,
TXsheetHandle *xsheetHandle) {
if (!xsheetHandle) return;
TXsheet *xsheet = xsheetHandle->getXsheet();
if (!xsheet) return;
ToonzScene *scene = xsheet->getScene();
if (!scene) return;
// emit signal only if something changed
bool somethingChanged = false;
StudioPalette *sp = StudioPalette::instance();
TLevelSet *levelSet = scene->getLevelSet();
for (int i = 0; i < levelSet->getLevelCount(); i++) {
TXshLevel *xl = levelSet->getLevel(i);
TXshSimpleLevel *sl = xl ? xl->getSimpleLevel() : 0;
if (!sl) continue;
TPalette *palette = sl->getPalette();
if (palette) {
somethingChanged = somethingChanged | sp->updateLinkedColors(palette);
if (sl->getType() == TZP_XSHLEVEL) {
std::vector<TFrameId> fids;
sl->getFids(fids);
std::vector<TFrameId>::iterator it;
for (it = fids.begin(); it != fids.end(); ++it) {
TFrameId fid = *it;
std::string id = sl->getImageId(fid);
}
}
}
}
if (!paletteHandle || !paletteHandle->getPalette()) return;
if (somethingChanged) paletteHandle->notifyColorStyleChanged();
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:34,代码来源:studiopalettecmd.cpp
示例6: onXshLevelChanged
void TApp::onXshLevelChanged() {
TXshLevel *level = m_currentLevel->getLevel();
std::vector<TFrameId> fids;
if (level != 0) level->getFids(fids);
m_currentFrame->setFrameIds(fids);
// update current tool
m_currentTool->onImageChanged((TImage::Type)getCurrentImageType());
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:8,代码来源:tapp.cpp
示例7: undo
void undo() const override {
TXshLevel *level = m_levelHandle->getLevel();
if (level) {
std::vector<TFrameId> fids;
level->getFids(fids);
invalidateIcons(level, fids);
}
}
开发者ID:jcome,项目名称:opentoonz,代码行数:8,代码来源:studiopaletteviewer.cpp
示例8: isColumnEmpty
bool TXsheet::setCell(int row, int col, const TXshCell &cell) {
if (row < 0 || col < 0) return false;
bool wasColumnEmpty = isColumnEmpty(col);
TXshCellColumn *cellColumn;
if (!cell.isEmpty()) {
TXshLevel *level = cell.m_level.getPointer();
assert(level);
int levelType = level->getType();
TXshColumn::ColumnType type = TXshColumn::eLevelType;
if (levelType == SND_XSHLEVEL)
type = TXshColumn::eSoundType;
else if (levelType == SND_TXT_XSHLEVEL)
type = TXshColumn::eSoundTextType;
else if (levelType == PLT_XSHLEVEL)
type = TXshColumn::ePaletteType;
else if (levelType == ZERARYFX_XSHLEVEL)
type = TXshColumn::eZeraryFxType;
else if (levelType == MESH_XSHLEVEL)
type = TXshColumn::eMeshType;
cellColumn = touchColumn(col, type)->getCellColumn();
} else {
TXshColumn *column = getColumn(col);
cellColumn = column ? column->getCellColumn() : 0;
}
if (!cellColumn || cellColumn->isLocked()) return false;
cellColumn->setXsheet(this);
if (!cellColumn->setCell(row, cell)) {
if (wasColumnEmpty) {
removeColumn(col);
insertColumn(col);
}
return false;
}
TFx *fx = cellColumn->getFx();
if (wasColumnEmpty && fx && fx->getOutputConnectionCount() == 0 &&
cellColumn->getPaletteColumn() == 0)
getFxDag()->addToXsheet(fx);
if (cell.isEmpty())
updateFrameCount();
else if (row >= m_imp->m_frameCount)
m_imp->m_frameCount = row + 1;
TNotifier::instance()->notify(TXsheetChange());
return true;
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:57,代码来源:txsheet.cpp
示例9: setLevel
void TXshLevelHandle::setLevel(TXshLevel *level) {
if (m_level == level) return;
TXshLevel *oldLevel = m_level;
m_level = level;
if (level) level->addRef();
bool levelExists = oldLevel ? oldLevel->getRefCount() > 1 : false;
if (oldLevel) oldLevel->release();
emit xshLevelSwitched(levelExists ? oldLevel : 0);
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:10,代码来源:txshlevelhandle.cpp
示例10: getLevelCount
TXshLevel *TLevelSet::getLevel(const ToonzScene &scene,
const TFilePath &levelPath) const {
const TFilePath &decodedPath = scene.decodeFilePath(levelPath);
int l, lCount = getLevelCount();
for (l = 0; l != lCount; ++l) {
TXshLevel *level = getLevel(l);
if (decodedPath == scene.decodeFilePath(level->getPath())) return level;
}
return 0;
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:12,代码来源:levelset.cpp
示例11: computeThickness
void FullColorBrushTool::leftButtonUp(const TPointD &pos, const TMouseEvent &e)
{
m_brushPos = m_mousePos = pos;
TRasterImageP ri = (TRasterImageP)getImage(true);
if (!ri)
return;
if (m_points.size() != 1) {
double maxThickness = m_thickness.getValue().second;
double thickness = m_pressure.getValue() ? computeThickness(e.m_pressure, m_thickness) : maxThickness;
double opacity = (m_pressure.getValue() ? computeThickness(e.m_pressure, m_opacity) : m_opacity.getValue().second) * 0.01;
TPointD rasCenter = ri->getRaster()->getCenterD();
TThickPoint point(pos + rasCenter, thickness);
m_points.push_back(point);
int m = m_points.size();
vector<TThickPoint> points;
points.push_back(m_points[m - 3]);
points.push_back(m_points[m - 2]);
points.push_back(m_points[m - 1]);
TRect bbox = m_brush->getBoundFromPoints(points);
updateWorkAndBackupRasters(bbox);
m_tileSaver->save(bbox);
m_brush->addArc(points[0], points[1], points[2], m_oldOpacity, opacity);
m_brush->updateDrawing(ri->getRaster(), m_backUpRas, m_currentColor, bbox, m_opacity.getValue().second * 0.01);
TRectD invalidateRect = ToolUtils::getBounds(points, maxThickness);
invalidate(invalidateRect.enlarge(2) - rasCenter);
m_strokeRect += bbox;
m_lastRect.empty();
}
if (m_brush) {
delete m_brush;
m_brush = 0;
}
m_workRaster->unlock();
if (m_tileSet->getTileCount() > 0) {
delete m_tileSaver;
TTool::Application *app = TTool::getApplication();
TXshLevel *level = app->getCurrentLevel()->getLevel();
TXshSimpleLevelP simLevel = level->getSimpleLevel();
TFrameId frameId = getCurrentFid();
TRasterP ras = ri->getRaster()->extract(m_strokeRect)->clone();
TUndoManager::manager()->add(new FullColorBrushUndo(m_tileSet, simLevel.getPointer(), frameId,
m_isFrameCreated, ras, m_strokeRect.getP00()));
}
notifyImageChanged();
m_strokeRect.empty();
}
开发者ID:ArseniyShestakov,项目名称:opentoonz,代码行数:52,代码来源:fullcolorbrushtool.cpp
示例12: updateWindowTitle
void Filmstrip::onLevelSwitched(TXshLevel *oldLevel) {
updateWindowTitle();
int tc = ToonzCheck::instance()->getChecks();
if (tc & (ToonzCheck::eInk | ToonzCheck::ePaint)) {
TXshLevel *sl = TApp::instance()->getCurrentLevel()->getLevel();
if (!sl) return;
std::vector<TFrameId> fids;
sl->getFids(fids);
removeIcons(sl, fids, true);
}
update();
}
开发者ID:jcome,项目名称:opentoonz,代码行数:13,代码来源:filmstrip.cpp
示例13: onCellSwitched
void MeshifyPopup::onCellSwitched()
{
// In case current cell level is not of the suitable type, disable the
// rasterization parameter
{
TXshLevel *level = ::levelToMeshify();
int type = level ? level->getType() : UNKNOWN_XSHLEVEL;
m_rasterizationDpi->setEnabled(type == PLI_XSHLEVEL || type == CHILD_XSHLEVEL);
}
acquirePreview();
}
开发者ID:JosefMeixner,项目名称:opentoonz,代码行数:13,代码来源:meshifypopup.cpp
示例14: getLevel
QScriptValue getLevel(QScriptContext *ctx, QScriptEngine *eng)
{
QString levelName = ctx->argument(0).toString();
ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene();
TXshLevel *level = scene->getLevelSet()->getLevel(levelName.toStdWString());
if (!level) {
level = scene->createNewLevel(PLI_XSHLEVEL, levelName.toStdWString());
levelName = QString::fromStdWString(level->getName());
}
if (level->getSimpleLevel())
return eng->newQObject(new ScriptWrapper::Level(level->getSimpleLevel()), QScriptEngine::ScriptOwnership);
else
return QScriptValue();
}
开发者ID:ArseniyShestakov,项目名称:opentoonz,代码行数:15,代码来源:scriptengine.cpp
示例15: TFilePath
void CastTreeViewer::dropEvent(QDropEvent *event)
{
m_dropTargetItem = 0;
if (m_dropFilePath != TFilePath()) {
IoCmd::loadScene(m_dropFilePath);
m_dropFilePath = TFilePath();
m_dropTargetItem = 0;
update();
return;
}
if (!event->mimeData()->hasFormat("application/vnd.toonz.levels"))
return;
m_dropTargetItem = itemAt(event->pos());
if (!m_dropTargetItem)
return;
TFilePath folderPath(m_dropTargetItem->data(1, Qt::DisplayRole).toString().toStdWString());
m_dropTargetItem = 0;
update();
if (folderPath.getName() == AudioFolderName) {
event->ignore();
return;
}
event->acceptProposedAction();
TLevelSet *levelSet = getLevelSet();
const CastItems *castItems = dynamic_cast<const CastItems *>(event->mimeData());
assert(castItems);
if (!castItems)
return;
int i;
TUndoManager::manager()->beginBlock();
for (i = 0; i < castItems->getItemCount(); i++) {
CastItem *item = castItems->getItem(i);
if (LevelCastItem *li = dynamic_cast<LevelCastItem *>(item)) {
TXshLevel *level = li->getLevel();
wstring levelName = level->getName();
MoveLevelToFolderUndo *undo = new MoveLevelToFolderUndo(levelSet, levelName, folderPath);
levelSet->moveLevelToFolder(folderPath, level);
TUndoManager::manager()->add(undo);
} else if (SoundCastItem *si = dynamic_cast<SoundCastItem *>(item)) {
}
}
TUndoManager::manager()->endBlock();
emit itemMovedToFolder();
}
开发者ID:ArseniyShestakov,项目名称:opentoonz,代码行数:48,代码来源:castviewer.cpp
示例16: clear
void TLevelSet::clear() {
for (std::vector<TXshLevel *>::iterator it = m_levels.begin();
it != m_levels.end(); ++it) {
TXshLevel *level = *it;
if (level->getSimpleLevel()) level->getSimpleLevel()->clearFrames();
(*it)->release();
}
m_levelTable.clear();
m_levels.clear();
m_folderTable.clear();
m_folders.clear();
m_folders.push_back(defaultRootFolder);
m_folders.push_back(defaultSoundRootFolder);
m_defaultFolder = defaultRootFolder;
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:16,代码来源:levelset.cpp
示例17: MergeCmappedUndo
MergeCmappedUndo(TXshLevel *xl, int mergeCmappedSessionId,
int column, TXshSimpleLevel *level, const std::map<TFrameId, QString> &images,
int mColumn,
TPalette *palette)
: TUndo(), m_xl(xl), m_mergeCmappedSessionId(mergeCmappedSessionId), m_palette(palette->clone()), m_level(level), m_column(column), m_mColumn(mColumn), m_images(images)
{
m_fullpath = m_xl->getPath().getWideString();
}
开发者ID:Xmoggo,项目名称:opentoonz,代码行数:9,代码来源:mergecmapped.cpp
示例18: while
void TXsheet::getUsedLevels(set<TXshLevel *> &levels) const {
set<const TXsheet *> visitedXshs;
vector<const TXsheet *> todoXshs;
visitedXshs.insert(this);
todoXshs.push_back(this);
while (!todoXshs.empty()) {
const TXsheet *xsh = todoXshs.back();
todoXshs.pop_back();
int c0 = 0, c1 = xsh->getColumnCount() - 1;
for (int c = c0; c <= c1; ++c) {
TXshColumnP column = const_cast<TXsheet *>(xsh)->getColumn(c);
if (!column) continue;
TXshCellColumn *cellColumn = column->getCellColumn();
if (!cellColumn) continue;
int r0, r1;
if (!cellColumn->getRange(r0, r1)) continue;
TXshLevel *level = 0;
for (int r = r0; r <= r1; r++) {
TXshCell cell = cellColumn->getCell(r);
if (cell.isEmpty() || !cell.m_level) continue;
if (level != cell.m_level.getPointer()) {
level = cell.m_level.getPointer();
levels.insert(level);
if (level->getChildLevel()) {
TXsheet *childXsh = level->getChildLevel()->getXsheet();
if (visitedXshs.count(childXsh) == 0) {
visitedXshs.insert(childXsh);
todoXshs.push_back(childXsh);
}
}
}
}
}
}
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:42,代码来源:txsheet.cpp
示例19: onPaletteChanged
void TApp::onLevelColorStyleChanged() {
onPaletteChanged();
TXshLevel *level = m_currentLevel->getLevel();
if (!level) return;
TPalette *palette = getCurrentPalette()->getPalette();
TXshSimpleLevel *simpleLevel = level->getSimpleLevel();
if (simpleLevel && simpleLevel->getPalette() == palette) {
notifyPaletteChanged(simpleLevel);
} else {
TLevelSet *levelSet = getCurrentScene()->getScene()->getLevelSet();
for (int i = 0; i < levelSet->getLevelCount(); i++) {
if (levelSet->getLevel(i)) {
simpleLevel = levelSet->getLevel(i)->getSimpleLevel();
if (simpleLevel && simpleLevel->getPalette() == palette) {
notifyPaletteChanged(simpleLevel);
}
}
}
}
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:20,代码来源:tapp.cpp
示例20: selectedItems
void StudioPaletteTreeViewer::loadInCurrentPalette() {
QList<QTreeWidgetItem *> items = selectedItems();
int count = items.size();
if (count == 0) return;
TPalette *palette = m_levelPaletteHandle->getPalette();
if (!palette) return;
if (palette->isLocked()) {
DVGui::warning("Palette is Locked!");
return;
}
TPalette *newPalette =
StudioPalette::instance()->getPalette(getItemPath(items[0]), false);
if (!newPalette) return;
if (m_xsheetHandle) {
int ret = DVGui::eraseStylesInDemand(palette, m_xsheetHandle, newPalette);
if (ret == 0) return;
}
StudioPaletteCmd::loadIntoCurrentPalette(m_levelPaletteHandle, newPalette);
m_currentLevelHandle->notifyLevelChange();
TXshLevel *level = m_currentLevelHandle->getLevel();
if (level) {
std::vector<TFrameId> fids;
level->getFids(fids);
invalidateIcons(level, fids);
}
int i;
for (i = 1; i < count; i++) {
TFilePath path = getItemPath(items[i]);
StudioPaletteCmd::mergeIntoCurrentPalette(m_levelPaletteHandle, path);
}
// in order to update the title bar of palette viewer
m_levelPaletteHandle->getPalette()->setDirtyFlag(true);
m_levelPaletteHandle->notifyPaletteChanged();
}
开发者ID:jcome,项目名称:opentoonz,代码行数:40,代码来源:studiopaletteviewer.cpp
注:本文中的TXshLevel类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论