本文整理汇总了C++中TStageObject::getPlasticSkeletonDeformation方法的典型用法代码示例。如果您正苦于以下问题:C++ TStageObject::getPlasticSkeletonDeformation方法的具体用法?C++ TStageObject::getPlasticSkeletonDeformation怎么用?C++ TStageObject::getPlasticSkeletonDeformation使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TStageObject
的用法示例。
在下文中一共展示了TStageObject::getPlasticSkeletonDeformation方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: isMeshDeformed
static inline bool isMeshDeformed(TXsheet *xsh, TStageObject *obj,
const ImagePainter::VisualSettings *vs) {
const TStageObjectId &parentId = obj->getParent();
if (parentId.isColumn() && obj->getParentHandle()[0] != 'H') {
TStageObject *parentObj = xsh->getStageObject(parentId);
if (!parentObj->getPlasticSkeletonDeformation()) return false;
TXshColumn *parentCol = xsh->getColumn(parentId.getIndex());
return (parentCol->getColumnType() == TXshColumn::eMeshType) &&
(parentCol != vs->m_plasticVisualSettings.m_showOriginalColumn);
}
return false;
}
示例2: getHandlePos
TPointD XshHandleManager::getHandlePos(const TStageObjectId &id,
const std::string &handle,
int row) const {
static const double unit = 8.0;
assert(m_xsh->getScene());
if (handle == "")
return TPointD();
else if (handle[0] == 'H' && handle.length() > 1) {
// Hook port case
if (!id.isColumn()) return TPointD();
int hookIndex = 0;
{
int h, hLength = handle.length();
for (h = 1; h != hLength; ++h)
hookIndex = hookIndex * 10 + (handle[h] - '0');
}
TStageObject *obj = m_xsh->getStageObject(id);
if (const PlasticSkeletonDeformationP &def =
obj->getPlasticSkeletonDeformation()) {
int skelId = def->skeletonId(row);
PlasticSkeleton skel;
def->storeDeformedSkeleton(skelId, row, skel);
int v = def->vertexIndex(hookIndex, skelId);
return (v >= 0) ? TScale(1.0 / Stage::inch) * skel.vertex(v).P()
: TPointD();
}
--hookIndex;
int col = id.getIndex();
TXshCell cell(m_xsh->getCell(row, col));
TXshLevel *xl = cell.m_level.getPointer();
if (!xl) return TPointD();
TXshSimpleLevel *sl = xl->getSimpleLevel();
if (!sl) return TPointD();
Hook *hook = sl->getHookSet()->getHook(hookIndex);
if (!hook) return TPointD();
TFrameId fid(cell.m_frameId);
TPointD pos = hook->getAPos(fid) * (1.0 / Stage::inch);
TPointD delta;
for (int r = row - 1; r >= 0; --r) {
cell = m_xsh->getCell(r, col);
if (cell.m_level.getPointer() != xl) break;
const TFrameId &precFid = cell.m_frameId;
delta += computePassHook(fid, precFid, sl, hook);
fid = precFid;
}
pos += delta * (1.0 / Stage::inch);
pos = getDpiAffine(sl, cell.m_frameId, true) * pos;
return pos;
} else if ('A' <= handle[0] && handle[0] <= 'Z')
return TPointD(unit * (handle[0] - 'B'), 0);
else if ('a' <= handle[0] && handle[0] <= 'z')
return TPointD(0.5 * unit * (handle[0] - 'b'), 0);
else
return TPointD();
}