本文整理汇总了C++中TXshColumn::getLevelColumn方法的典型用法代码示例。如果您正苦于以下问题:C++ TXshColumn::getLevelColumn方法的具体用法?C++ TXshColumn::getLevelColumn怎么用?C++ TXshColumn::getLevelColumn使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TXshColumn
的用法示例。
在下文中一共展示了TXshColumn::getLevelColumn方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: resequence
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();
}
示例2: canResequence
bool ColumnCmd::canResequence(int index) {
TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
TXshColumn *column = xsh->getColumn(index);
if (!column) return false;
TXshLevelColumn *lcolumn = column->getLevelColumn();
if (!lcolumn) return false;
int r0 = 0, r1 = -1;
if (lcolumn->getRange(r0, r1) == 0) return false;
assert(r0 <= r1);
TXshCell cell = lcolumn->getCell(r0);
assert(!cell.isEmpty());
TXshLevel *xl = cell.m_level->getChildLevel();
if (!xl) return false;
for (int r = r0 + 1; r <= r1; r++) {
cell = lcolumn->getCell(r);
if (cell.isEmpty()) continue;
if (cell.m_level.getPointer() != xl) return false;
}
return true;
}
示例3: cloneChild
void ColumnCmd::cloneChild(int index) {
if (!canResequence(index)) return;
/*-- カラムを取得 --*/
TXsheet *xsh = TApp::instance()->getCurrentXsheet()->getXsheet();
TXshColumn *column = xsh->getColumn(index);
assert(column);
// get the subxsheet to clone (childLevel, childXsh)
/*-- SubXsheetレベルを取得 --*/
TXshLevelColumn *lcolumn = column->getLevelColumn();
assert(lcolumn);
int r0 = 0, r1 = -1;
lcolumn->getRange(r0, r1);
assert(r0 <= r1);
/*-- SubXsheetの一番頭のセル --*/
TXshCell cell = lcolumn->getCell(r0);
assert(!cell.isEmpty());
/*- cell内に格納されているLevelを取得 -*/
TXshChildLevel *childLevel = cell.m_level->getChildLevel();
assert(childLevel);
/*- SubXsheetのXsheetを取得 -*/
TXsheet *childXsh = childLevel->getXsheet();
// insert a new empty column
/*- 隣に空きColumnをInsertしてCloneに備える -*/
int newColumnIndex = index + 1;
xsh->insertColumn(newColumnIndex);
// create a subxsheet (newChildLevel, newChildXsh)
ToonzScene *scene = TApp::instance()->getCurrentScene()->getScene();
ChildStack *childStack = scene->getChildStack();
TXshChildLevel *newChildLevel = childStack->createChild(0, newColumnIndex);
TXsheet *newChildXsh = newChildLevel->getXsheet();
// copy columns.
std::set<int> indices;
for (int i = 0; i < childXsh->getColumnCount(); i++) indices.insert(i);
StageObjectsData *data = new StageObjectsData();
data->storeColumns(indices, childXsh, 0);
data->storeColumnFxs(indices, childXsh, 0);
std::list<int> restoredSplineIds;
data->restoreObjects(indices, restoredSplineIds, newChildXsh,
StageObjectsData::eDoClone);
delete data;
cloneNotColumnLinkedFxsAndOutputsFx(childXsh, newChildXsh);
cloneXsheetTStageObjectTree(childXsh, newChildXsh);
/*--以下は、Clone SubXsheet
するときに、SubXsheet内にある子SubXsheetをクローンする関数
クローンされた中にある子SubXsheetは、同じもので良いので、スキップする --*/
// cloneSubXsheets(newChildXsh);
/*-- XSheetノードのFxSchematicでのDagNodePosを再現
FxやColumnノードの位置の再現は上のsetColumnで行っている
--*/
newChildXsh->getFxDag()->getXsheetFx()->getAttributes()->setDagNodePos(
childXsh->getFxDag()->getXsheetFx()->getAttributes()->getDagNodePos());
newChildXsh->updateFrameCount();
/*-- TXshChildLevel作成時にsetCellした1つ目のセルを消去 --*/
xsh->removeCells(0, newColumnIndex);
/*-- CloneしたColumnのセル番号順を再現 --*/
for (int r = r0; r <= r1; r++) {
TXshCell cell = lcolumn->getCell(r);
if (cell.isEmpty()) continue;
cell.m_level = newChildLevel;
xsh->setCell(r, newColumnIndex, cell);
}
TStageObjectId currentObjectId =
TApp::instance()->getCurrentObject()->getObjectId();
xsh->getStageObject(TStageObjectId::ColumnId(newColumnIndex))
->setParent(xsh->getStageObjectParent(currentObjectId));
xsh->updateFrameCount();
TUndoManager::manager()->add(
new CloneChildUndo(newChildLevel, newColumnIndex));
// notify changes
TApp::instance()->getCurrentScene()->setDirtyFlag(true);
TApp::instance()->getCurrentXsheet()->notifyXsheetChanged();
}
示例4: updateEnabled
QString TTool::updateEnabled() {
// Disable every tool during playback
if (m_application->getCurrentFrame()->isPlaying())
return (enable(false), QString());
// Release Generic tools at once
int toolType = getToolType();
int targetType = getTargetType();
if (toolType == TTool::GenericTool) return (enable(true), QString());
// Retrieve vars and view modes
TXsheet *xsh = m_application->getCurrentXsheet()->getXsheet();
int rowIndex = m_application->getCurrentFrame()->getFrame();
int columnIndex = m_application->getCurrentColumn()->getColumnIndex();
TXshColumn *column = (columnIndex >= 0) ? xsh->getColumn(columnIndex) : 0;
TXshLevel *xl = m_application->getCurrentLevel()->getLevel();
TXshSimpleLevel *sl = xl ? xl->getSimpleLevel() : 0;
int levelType = sl ? sl->getType() : NO_XSHLEVEL;
TStageObject *obj =
xsh->getStageObject(TStageObjectId::ColumnId(columnIndex));
bool spline = m_application->getCurrentObject()->isSpline();
bool filmstrip = m_application->getCurrentFrame()->isEditingLevel();
/*-- MultiLayerStylePickerONのときは、現状に関わらず使用可能 --*/
if (m_name == T_StylePicker &&
Preferences::instance()->isMultiLayerStylePickerEnabled())
return (enable(true), QString());
// Check against unplaced columns (not in filmstrip mode)
if (column && !filmstrip) {
if (column->isLocked())
return (enable(false), QObject::tr("The current column is locked."));
else if (!column->isCamstandVisible())
return (enable(false), QObject::tr("The current column is hidden."));
else if (column->getSoundColumn())
return (enable(false),
QObject::tr("It is not possible to edit the audio column."));
else if (column->getSoundTextColumn())
return (
enable(false),
QObject::tr(
"Note columns can only be edited in the xsheet or timeline."));
if (toolType == TTool::ColumnTool) {
// Check column target
if (column->getLevelColumn() && !(targetType & LevelColumns))
return (
enable(false),
QObject::tr("The current tool cannot be used on a Level column."));
if (column->getMeshColumn() && !(targetType & MeshColumns))
return (
enable(false),
QObject::tr("The current tool cannot be used on a Mesh column."));
}
}
// Check column tools
if (toolType == TTool::ColumnTool) {
if (filmstrip)
return (
enable(false),
QObject::tr("The current tool cannot be used in Level Strip mode."));
if ((!column || column->isEmpty()) && !(targetType & TTool::EmptyTarget))
return (enable(false), QString());
}
// Check LevelRead & LevelWrite tools
if (toolType & TTool::LevelTool) {
// Check against splines
if (spline) {
return (targetType & Splines)
? (enable(true), QString())
: (enable(false), QObject::tr("The current tool cannot be "
"used to edit a motion path."));
}
// Check against empty levels
if (!xl)
return (targetType & EmptyTarget) ? (enable(true), QString())
: (enable(false), QString());
// Check against simple-level-edness
if (!sl)
return (enable(false),
QObject::tr("The current level is not editable.")); // Does it
// happen at
// all btw?
// Check against level types
{
//.........这里部分代码省略.........