本文整理汇总了C++中TStageObject::getParent方法的典型用法代码示例。如果您正苦于以下问题:C++ TStageObject::getParent方法的具体用法?C++ TStageObject::getParent怎么用?C++ TStageObject::getParent使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TStageObject
的用法示例。
在下文中一共展示了TStageObject::getParent方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: updateEnabled
//.........这里部分代码省略.........
// 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
{
if ((levelType == PLI_XSHLEVEL) && !(targetType & VectorImage))
return (
enable(false),
QObject::tr("The current tool cannot be used on a Vector Level."));
if ((levelType == TZP_XSHLEVEL) && !(targetType & ToonzImage))
return (
enable(false),
QObject::tr("The current tool cannot be used on a Toonz Level."));
if ((levelType == OVL_XSHLEVEL) && !(targetType & RasterImage))
return (
enable(false),
QObject::tr("The current tool cannot be used on a Raster Level."));
if ((levelType == MESH_XSHLEVEL) && !(targetType & MeshImage))
return (
enable(false),
QObject::tr("The current tool cannot be used on a Mesh Level."));
}
// Check against impossibly traceable movements on the column
if ((levelType & LEVELCOLUMN_XSHLEVEL) && !filmstrip) {
// Test for Mesh-deformed levels
const TStageObjectId &parentId = obj->getParent();
if (parentId.isColumn() && obj->getParentHandle()[0] != 'H') {
TXshSimpleLevel *parentSl =
xsh->getCell(rowIndex, parentId.getIndex()).getSimpleLevel();
if (parentSl && parentSl->getType() == MESH_XSHLEVEL)
return (
enable(false),
QObject::tr(
"The current tool cannot be used on a mesh-deformed level"));
}
}
// Check TTool::ImageType tools
if (toolType == TTool::LevelWriteTool) {
// Check level against read-only status
if (sl->isReadOnly()) {
const std::set<TFrameId> &editableFrames = sl->getEditableRange();
TFrameId currentFid = getCurrentFid();
if (editableFrames.find(currentFid) == editableFrames.end())
return (
enable(false),
QObject::tr(
"The current frame is locked: any editing is forbidden."));
}
// Check level type write support
if (sl->getPath().getType() ==
"psd" || // We don't have the API to write psd files
sl->is16BitChannelLevel() || // Inherited by previous implementation.
// Could be fixed?
sl->getProperties()->getBpp() ==
1) // Black & White images. Again, could be fixed?
return (enable(false),
QObject::tr("The current level is not editable."));
}
}
return (enable(true), QString());
}