本文整理汇总了C++中TXsheet类的典型用法代码示例。如果您正苦于以下问题:C++ TXsheet类的具体用法?C++ TXsheet怎么用?C++ TXsheet使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
在下文中一共展示了TXsheet类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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();
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:32,代码来源:tool.cpp
示例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);
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:7,代码来源:xshcellmover.cpp
示例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);
}
开发者ID:ideasman42,项目名称:opentoonz,代码行数:30,代码来源:stage.cpp
示例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;
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:34,代码来源:xshcellmover.cpp
示例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();
}
开发者ID:titer1,项目名称:opentoonz,代码行数:29,代码来源:skeletontool.cpp
示例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;
}
}
}
开发者ID:titer1,项目名称:opentoonz,代码行数:35,代码来源:multimediarenderer.cpp
示例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();
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:34,代码来源:studiopalettecmd.cpp
示例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);
}
开发者ID:walkerka,项目名称:opentoonz,代码行数:28,代码来源:keyframeselection.cpp
示例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();
}
}
}
}
}
开发者ID:Makoto-Sasahara,项目名称:opentoonz,代码行数:27,代码来源:shifttracetool.cpp
示例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();
}
开发者ID:jcome,项目名称:opentoonz,代码行数:25,代码来源:filmstrip.cpp
示例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();
}
开发者ID:opentoonz,项目名称:opentoonz,代码行数:31,代码来源:columncommand.cpp
示例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);
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:29,代码来源:functionviewer.cpp
示例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;
}
开发者ID:jcome,项目名称:opentoonz,代码行数:33,代码来源:layerheaderpanel.cpp
示例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();
}
开发者ID:SaierMe,项目名称:opentoonz,代码行数:27,代码来源:xshcellmover.cpp
示例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
}
}
开发者ID:calebwoo92,项目名称:opentoonz,代码行数:8,代码来源:tapp.cpp
示例16: undo
void undo() const override {
TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
for (int i = 0; i < (int)m_oldFrames.size(); i++) {
xsh->setCell(m_r0 + i, m_col, m_oldFrames[i]);
}
xsh->updateFrameCount();
TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
}
开发者ID:opentoonz,项目名称:opentoonz,代码行数:8,代码来源:columncommand.cpp
示例17: pos
void RowArea::mousePressEvent(QMouseEvent *event)
{
m_viewer->setQtModifiers(event->modifiers());
if (event->button() == Qt::LeftButton) {
bool playRangeModifierisClicked = false;
TApp *app = TApp::instance();
TXsheet *xsh = app->getCurrentScene()->getScene()->getXsheet();
TPoint pos(event->pos().x(), event->pos().y());
int row = m_viewer->yToRow(pos.y);
QRect visibleRect = visibleRegion().boundingRect();
int playR0, playR1, step;
XsheetGUI::getPlayRange(playR0, playR1, step);
bool playRangeEnabled = playR0 <= playR1;
if (!playRangeEnabled) {
TXsheet *xsh = m_viewer->getXsheet();
playR1 = xsh->getFrameCount() - 1;
playR0 = 0;
}
if (playR1 == -1) { //getFrameCount = 0 i.e. xsheet is empty
setDragTool(XsheetGUI::DragTool::makeCurrentFrameModifierTool(m_viewer));
} else if (m_xa <= pos.x && pos.x <= m_xa + 10 && (row == playR0 || row == playR1)) {
if (!playRangeEnabled)
XsheetGUI::setPlayRange(playR0, playR1, step);
setDragTool(XsheetGUI::DragTool::makePlayRangeModifierTool(m_viewer));
playRangeModifierisClicked = true;
} else
setDragTool(XsheetGUI::DragTool::makeCurrentFrameModifierTool(m_viewer));
//when shift+click the row area, select a single row region in the cell area
if (!playRangeModifierisClicked && 0 != (event->modifiers() & Qt::ShiftModifier)) {
int filledCol;
for (filledCol = xsh->getColumnCount() - 1; filledCol >= 0; filledCol--) {
TXshColumn *currentColumn = xsh->getColumn(filledCol);
if (!currentColumn)
continue;
if (!currentColumn->isEmpty())
break;
}
m_viewer->getCellSelection()->selectNone();
m_viewer->getCellSelection()->selectCells(row, 0, row, tmax(0, filledCol));
m_viewer->updateCellRowAree();
}
m_viewer->dragToolClick(event);
event->accept();
} // left-click
// pan by middle-drag
else if (event->button() == Qt::MidButton) {
m_pos = event->pos();
m_isPanning = true;
}
}
开发者ID:CroW-CZ,项目名称:opentoonz,代码行数:58,代码来源:xshrowviewer.cpp
示例18: selectCellKeyframe
void TCellKeyframeSelection::selectCellKeyframe(int row, int col) {
m_cellSelection->selectCell(row, col);
TXsheet *xsh = m_xsheetHandle->getXsheet();
TStageObjectId id =
col < 0 ? TStageObjectId::CameraId(0) : TStageObjectId::ColumnId(col);
TStageObject *stObj = xsh->getStageObject(id);
m_keyframeSelection->clear();
if (stObj->isKeyframe(row)) m_keyframeSelection->select(row, col);
}
开发者ID:opentoonz,项目名称:opentoonz,代码行数:9,代码来源:cellkeyframeselection.cpp
示例19: isAncestorOf
// return true iff column ancestorIndex is column descentIndex or its parent or the parent of the parent, etc.
bool isAncestorOf(int ancestorIndex, int descendentIndex)
{
TStageObjectId ancestorId = TStageObjectId::ColumnId(ancestorIndex);
TStageObjectId descendentId = TStageObjectId::ColumnId(descendentIndex);
TXsheet *xsh = TTool::getApplication()->getCurrentXsheet()->getXsheet();
while (descendentId != ancestorId && descendentId.isColumn())
descendentId = xsh->getStageObjectParent(descendentId);
return descendentId == ancestorId;
}
开发者ID:titer1,项目名称:opentoonz,代码行数:10,代码来源:skeletontool.cpp
示例20: pasteColumnsAbove
//-----------------------------------------------------------------------------
// pasteColumnsAbove will insert columns after the last column in the selection
void TColumnSelection::pasteColumnsAbove() {
std::set<int> indices;
if (isEmpty()) { // in case that no columns are selected
TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
indices.insert(xsh->getFirstFreeColumnIndex());
} else
indices.insert(*m_indices.rbegin() + 1);
ColumnCmd::pasteColumns(indices);
}
开发者ID:opentoonz,项目名称:opentoonz,代码行数:11,代码来源:columnselection.cpp
注:本文中的TXsheet类示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论