本文整理汇总了C++中OP_Context::getThread方法的典型用法代码示例。如果您正苦于以下问题:C++ OP_Context::getThread方法的具体用法?C++ OP_Context::getThread怎么用?C++ OP_Context::getThread使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类OP_Context
的用法示例。
在下文中一共展示了OP_Context::getThread方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: readLock
OP_ERROR
GusdOBJ_usdcamera::_Cook(OP_Context& ctx)
{
_LoadCamera(ctx.getTime(), ctx.getThread());
/* XXX: There's a potential race condition here, between
loading and stealing cached errors.
Would be better to keep the camera cache locked
until the error stealing is done.*/
UT_AutoReadLock readLock(_lock);
stealErrors(_errors, /*borrow*/ true);
return error();
}
示例2: ctm
int
GusdOBJ_usdcamera::applyInputIndependentTransform(OP_Context& ctx, UT_DMatrix4& mx)
{
mx.identity();
fpreal t = ctx.getTime();
if(UsdGeomCamera cam = _LoadCamera(t, ctx.getThread()))
{
float frame = evalFloat(_frameIdx, 0, t);
GfMatrix4d ctm(1.);
bool stat = true;
bool resetsXformStack = false;
switch(evalInt("xformmode", 0, t))
{
case _POSTMULTCTM_TRANSFORM:
stat = true;
ctm = cam.ComputeLocalToWorldTransform(frame);
break;
case _CTM_TRANSFORM:
stat = true;
ctm = cam.ComputeParentToWorldTransform(frame);
break;
case _OBJ_TRANSFORM:
// XXX: how do we reset xformStack here?
// Is that (or should that
// be) handled by the Compute calls above?
stat = cam.GetLocalTransformation(&ctm, &resetsXformStack, frame);
break;
default: // _IGNORE_TRANSFORM:
stat = true;
ctm.SetIdentity();
break;
}
if(!stat)
{
stealErrors(_errors, /*borrow*/ true);
return 0;
}
mx = GusdUT_Gf::Cast(ctm);
}
return OBJ_Camera::applyInputIndependentTransform(ctx, mx);
}