本文整理汇总了C++中TXsheet类的典型用法代码示例。如果您正苦于以下问题:C++ TXsheet类的具体用法?C++ TXsheet怎么用?C++ TXsheet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TXsheet类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: 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();
}
示例2: getXsheet
void CellsMover::emptyColumns(int c) const {
std::set<int> ii;
for (int i = 0; i < m_colCount; i++) ii.insert(c + i);
ColumnCmd::deleteColumns(ii, false, true);
TXsheet *xsh = getXsheet();
for (int i = 0; i < m_colCount; i++) xsh->insertColumn(c);
}
示例3: visit
void Stage::visit(Visitor &visitor, const VisitArgs &args) {
ToonzScene *scene = args.m_scene;
TXsheet *xsh = args.m_xsh;
int row = args.m_row;
int col = args.m_col;
const OnionSkinMask *osm = args.m_osm;
bool camera3d = args.m_camera3d;
int xsheetLevel = args.m_xsheetLevel;
bool isPlaying = args.m_isPlaying;
StageBuilder sb;
sb.m_vs = &visitor.m_vs;
TStageObjectId cameraId = xsh->getStageObjectTree()->getCurrentCameraId();
TStageObject *camera = xsh->getStageObject(cameraId);
TAffine cameraAff = camera->getPlacement(row);
double z = camera->getZ(row);
sb.m_cameraPlacement = ZPlacement(cameraAff, z);
sb.m_camera3d = camera3d;
sb.m_currentColumnIndex = col;
sb.m_xsheetLevel = xsheetLevel;
sb.m_onionSkinMask = *osm;
Player::m_onionSkinFrontSize = 0;
Player::m_onionSkinBackSize = 0;
sb.addFrame(sb.m_players, scene, xsh, row, 0, args.m_onlyVisible,
args.m_checkPreviewVisibility);
updateOnionSkinSize(sb.m_players);
sb.visit(sb.m_players, visitor, isPlaying);
}
示例4: getViewer
bool LevelMoverTool::canMoveColumns(const TPoint &pos) {
TXsheet *xsh = getViewer()->getXsheet();
if (pos.x < 0) return false;
if (pos.x != m_lastPos.x) {
int count = 0;
// controlla il tipo
for (int i = 0; i < m_range.lx; i++) {
int srcIndex = m_lastPos.x + i;
int dstIndex = pos.x + i;
TXshColumn *srcColumn = xsh->getColumn(srcIndex);
if (srcColumn && srcColumn->isLocked()) continue;
TXshColumn *dstColumn = xsh->getColumn(dstIndex);
TXshColumn::ColumnType srcType = TXshColumn::eLevelType;
if (srcColumn) srcType = srcColumn->getColumnType();
if (srcType == TXshColumn::eZeraryFxType) return false;
/*
qDebug() << "check: " << srcIndex << ":" <<
(srcColumn ? QString::number(srcType) : "empty") <<
" => " << dstIndex << ":" <<
(dstColumn ? QString::number(dstColumn->getColumnType()) : "empty");
*/
if (dstColumn && !dstColumn->isEmpty() &&
dstColumn->getColumnType() != srcType) {
return false;
}
if (!dstColumn || dstColumn->isLocked() == false) {
count++;
}
}
if (count == 0) return false;
}
return true;
}
示例5: magicLink
void SkeletonTool::magicLink(int index)
{
if (index < 0 || index >= (int)m_magicLinks.size())
return;
HookData h0 = m_magicLinks[index].m_h0;
HookData h1 = m_magicLinks[index].m_h1;
TTool::Application *app = TTool::getApplication();
TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
int columnIndex = app->getCurrentColumn()->getColumnIndex();
TStageObjectId id = TStageObjectId::ColumnId(columnIndex);
TStageObject *obj = xsh->getStageObject(id);
int parentColumnIndex = h1.m_columnIndex;
TStageObjectId parentId = TStageObjectId::ColumnId(parentColumnIndex);
std::string parentHandle = h1.getHandle();
std::string handle = "";
if (h0.m_columnIndex < 0) {
handle = obj->getHandle();
} else {
handle = h0.getHandle();
}
//TUndoManager *undoManager = TUndoManager::manager();
//undoManager->beginBlock();
TStageObjectCmd::setHandle(id, handle, app->getCurrentXsheet());
TStageObjectCmd::setParent(id, parentId, parentHandle, app->getCurrentXsheet());
//undoManager->endBlock();
}
示例6:
//!Build the scene fx for each node below the xsheet one.
//!Remember that left xsheet ports must not be expanded.
void MultimediaRenderer::Imp::scanSceneForLayers()
{
//Retrieve the terminal fxs (ie, fxs which are implicitly
//connected to the xsheet one)
TXsheet *xsh = m_scene->getXsheet();
TFxSet *fxs = xsh->getFxDag()->getTerminalFxs();
//Examine all of them and - eventually - expand left xsheet
//ports (ie fx nodes who allow implicit overlaying)
for (int i = 0; i < fxs->getFxCount(); ++i) {
TFx *fx = fxs->getFx(i);
TFxPort *leftXSheetPort;
retry:
if (!fx)
continue;
leftXSheetPort = fx->getXsheetPort();
if (!leftXSheetPort) {
m_fxsToRender.addFx(fx);
continue;
}
//If the leftXSheetPort is not connected, retry on port 0
if (leftXSheetPort->isConnected())
m_fxsToRender.addFx(fx);
else {
fx = fx->getInputPort(0)->getFx();
goto retry;
}
}
}
示例7: 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();
}
示例8: setKeyframes
void TKeyframeSelection::setKeyframes() {
TApp *app = TApp::instance();
TXsheetHandle *xsheetHandle = app->getCurrentXsheet();
TXsheet *xsh = xsheetHandle->getXsheet();
TStageObjectId cameraId = xsh->getStageObjectTree()->getCurrentCameraId();
if (isEmpty()) return;
Position pos = *m_positions.begin();
int row = pos.first;
int col = pos.second;
TStageObjectId id = col < 0 ? cameraId : TStageObjectId::ColumnId(col);
TStageObject *pegbar = xsh->getStageObject(id);
if (!pegbar) return;
if (pegbar->isKeyframe(row)) {
TStageObject::Keyframe key = pegbar->getKeyframe(row);
pegbar->removeKeyframeWithoutUndo(row);
UndoRemoveKeyFrame *undo =
new UndoRemoveKeyFrame(id, row, key, xsheetHandle);
undo->setObjectHandle(app->getCurrentObject());
TUndoManager::manager()->add(undo);
} else {
pegbar->setKeyframeWithoutUndo(row);
UndoSetKeyFrame *undo = new UndoSetKeyFrame(id, row, xsheetHandle);
undo->setObjectHandle(app->getCurrentObject());
TUndoManager::manager()->add(undo);
}
TApp::instance()->getCurrentScene()->setDirtyFlag(true);
TApp::instance()->getCurrentObject()->notifyObjectIdChanged(false);
}
示例9: updateBox
void ShiftTraceTool::updateBox() {
if (0 <= m_ghostIndex && m_ghostIndex < 2 && m_row[m_ghostIndex] >= 0) {
int col = TApp::instance()->getCurrentColumn()->getColumnIndex();
int row = m_row[m_ghostIndex];
TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
TXshCell cell = xsh->getCell(row, col);
TXshSimpleLevel *sl = cell.getSimpleLevel();
if (sl) {
m_dpiAff = getDpiAffine(sl, cell.m_frameId);
TImageP img = cell.getImage(false);
if (img) {
if (TRasterImageP ri = img) {
TRasterP ras = ri->getRaster();
m_box = (convert(ras->getBounds()) - ras->getCenterD()) *
ri->getSubsampling();
} else if (TToonzImageP ti = img) {
TRasterP ras = ti->getRaster();
m_box = (convert(ras->getBounds()) - ras->getCenterD()) *
ti->getSubsampling();
} else if (TVectorImageP vi = img) {
m_box = vi->getBBox();
}
}
}
}
}
示例10: onFrameSwitched
void FilmstripFrames::onFrameSwitched() {
// no. interferische con lo shift-click per la selezione.
// m_selection->selectNone();
TApp *app = TApp::instance();
TFrameHandle *fh = app->getCurrentFrame();
TFrameId fid;
if (fh->isEditingLevel())
fid = fh->getFid();
else {
TXsheet *xsh = app->getCurrentXsheet()->getXsheet();
int col = app->getCurrentColumn()->getColumnIndex();
int row = fh->getFrame();
if (row < 0 || col < 0) return;
TXshCell cell = xsh->getCell(row, col);
if (cell.isEmpty()) return;
fid = cell.getFrameId();
}
int index = fid2index(fid);
if (index >= 0) {
exponeFrame(index);
// clear selection and select only the destination frame
select(index, ONLY_SELECT);
}
update();
}
示例11: assert
void ColumnCmd::resequence(int index) {
if (!canResequence(index)) return;
TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
TXshColumn *column = xsh->getColumn(index);
assert(column);
TXshLevelColumn *lcolumn = column->getLevelColumn();
assert(lcolumn);
int r0 = 0, r1 = -1;
lcolumn->getRange(r0, r1);
assert(r0 <= r1);
TXshCell cell = lcolumn->getCell(r0);
assert(!cell.isEmpty());
TXshChildLevel *xl = cell.m_level->getChildLevel();
assert(xl);
TXsheet *childXsh = xl->getXsheet();
int frameCount = childXsh->getFrameCount();
if (frameCount < 1) frameCount = 1;
TUndoManager::manager()->add(new ResequenceUndo(index, frameCount));
lcolumn->clearCells(r0, r1 - r0 + 1);
for (int i = 0; i < frameCount; i++) {
cell.m_frameId = TFrameId(i + 1);
lcolumn->setCell(r0 + i, cell);
}
xsh->updateFrameCount();
TApp::instance()->getCurrentScene()->setDirtyFlag(true);
TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
}
示例12: refreshModel
void FunctionViewer::refreshModel() {
TXsheet *xsh = m_xshHandle ? m_xshHandle->getXsheet() : 0;
m_functionGraph->getModel()->refreshData(xsh);
if (xsh) {
int rowCount = xsh->getFrameCount();
m_numericalColumns->setRowCount(rowCount);
m_numericalColumns->updateAll();
ToonzScene *scene = xsh->getScene();
if (!scene) // This seems wrong. It should rather be
return; // asserted - though I'm not touching it now...
TFilePath scenePath = scene->getScenePath().getParentDir();
if (scene->isUntitled())
scenePath =
TProjectManager::instance()->getCurrentProject()->getScenesPath();
m_treeView->setCurrentScenePath(scenePath);
int distance, offset;
scene->getProperties()->getMarkers(distance, offset);
m_numericalColumns->setMarkRow(distance, offset);
}
m_treeView->updateAll();
m_toolbar->setCurve(0);
}
示例13: mouseReleaseEvent
void LayerHeaderPanel::mouseReleaseEvent(QMouseEvent *event) {
TApp *app = TApp::instance();
TXsheet *xsh = m_viewer->getXsheet();
int col, totcols = xsh->getColumnCount();
bool sound_changed = false;
if (m_doOnRelease != 0 && totcols > 0) {
for (col = 0; col < totcols; col++) {
if (!xsh->isColumnEmpty(col)) {
TXshColumn *column = xsh->getColumn(col);
if (m_doOnRelease == ToggleAllPreviewVisible) {
column->setPreviewVisible(!column->isPreviewVisible());
} else if (m_doOnRelease == ToggleAllTransparency) {
column->setCamstandVisible(!column->isCamstandVisible());
if (column->getSoundColumn()) sound_changed = true;
} else if (m_doOnRelease == ToggleAllLock) {
column->lock(!column->isLocked());
}
}
}
if (sound_changed) {
app->getCurrentXsheet()->notifyXsheetSoundChanged();
}
app->getCurrentScene()->notifySceneChanged();
app->getCurrentXsheet()->notifyXsheetChanged();
}
m_viewer->updateColumnArea();
update();
m_doOnRelease = 0;
}
示例14: redo
void redo() const override {
int ca = m_cellsMover.getStartPos().x;
int cb = m_cellsMover.getPos().x;
int colCount = m_cellsMover.getColumnCount();
if (ca != cb) {
if (m_cellsMover.m_uffa & 1) m_cellsMover.emptyColumns(ca);
if (m_cellsMover.m_uffa & 2) m_cellsMover.restoreColumns(cb);
}
if ((m_cellsMover.getQualifiers() & CellsMover::eCopyCells) == 0 &&
(m_cellsMover.getQualifiers() & CellsMover::eOverwriteCells) == 0)
m_cellsMover.undoMoveCells(m_cellsMover.getStartPos());
if (m_cellsMover.getQualifiers() &
CellsMover::eOverwriteCells) { // rimuove le celle vecchie
int c, ra = m_cellsMover.getStartPos().y,
rowCount = m_cellsMover.getRowCount();
TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
for (c = ca; c < ca + colCount; c++) xsh->clearCells(ra, c, rowCount);
}
m_cellsMover.moveCells();
TApp::instance()->getCurrentXsheet()->getXsheet()->updateFrameCount();
TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
if (m_cellsMover.getColumnTypeFromCell(0) == TXshColumn::eSoundType)
TApp::instance()->getCurrentXsheet()->notifyXsheetSoundChanged();
}
示例15: onSplineChanged
void TApp::onSplineChanged()
{
if (m_currentObject->isSpline()) {
TXsheet *xsh = m_currentXsheet->getXsheet();
TStageObject *currentObject = xsh->getStageObject(m_currentObject->getObjectId());
currentObject->setOffset(currentObject->getOffset()); //invalidate currentObject
}
}