本文整理汇总了C++中PatchObject::UnlockObject方法的典型用法代码示例。如果您正苦于以下问题:C++ PatchObject::UnlockObject方法的具体用法?C++ PatchObject::UnlockObject怎么用?C++ PatchObject::UnlockObject使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PatchObject
的用法示例。
在下文中一共展示了PatchObject::UnlockObject方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: ConvertToType
Object* TorusObject::ConvertToType(TimeValue t, Class_ID obtype)
{
#ifndef NO_PATCHES
if (obtype == patchObjectClassID) {
Interval valid = FOREVER;
float radius1, radius2;
int genUVs;
pblock->GetValue(PB_RADIUS,t,radius1,valid);
pblock->GetValue(PB_RADIUS2,t,radius2,valid);
pblock->GetValue(PB_GENUVS,t,genUVs,valid);
PatchObject *ob = new PatchObject();
BuildTorusPatch(t,ob->patch,radius1,radius2,genUVs, GetUsePhysicalScaleUVs());
ob->SetChannelValidity(TOPO_CHAN_NUM,valid);
ob->SetChannelValidity(GEOM_CHAN_NUM,valid);
ob->UnlockObject();
return ob;
}
#endif
#ifndef NO_NURBS
if (obtype == EDITABLE_SURF_CLASS_ID) {
Interval valid = FOREVER;
float radius, radius2, pie1, pie2;
int sliceon, genUVs;
pblock->GetValue(PB_RADIUS,t,radius,valid);
pblock->GetValue(PB_RADIUS2,t,radius2,valid);
pblock->GetValue(PB_PIESLICE1,t,pie1,valid);
pblock->GetValue(PB_PIESLICE2,t,pie2,valid);
pblock->GetValue(PB_SLICEON,t,sliceon,valid);
pblock->GetValue(PB_GENUVS,t,genUVs,valid);
Object *ob = BuildNURBSTorus(radius, radius2, sliceon, pie1, pie2, genUVs);
ob->SetChannelValidity(TOPO_CHAN_NUM,valid);
ob->SetChannelValidity(GEOM_CHAN_NUM,valid);
ob->UnlockObject();
return ob;
}
#endif
#ifdef DESIGN_VER
if (obtype == GENERIC_AMSOLID_CLASS_ID)
{
Interval valid = FOREVER;
float radius1, radius2, pie1, pie2;
int sliceon, genUVs, sides, segs;
pblock->GetValue(PB_RADIUS,t,radius1,valid);
pblock->GetValue(PB_RADIUS2,t,radius2,valid);
pblock->GetValue(PB_PIESLICE1,t,pie1,valid);
pblock->GetValue(PB_PIESLICE2,t,pie2,valid);
pblock->GetValue(PB_SLICEON,t,sliceon,valid);
pblock->GetValue(PB_GENUVS,t,genUVs,valid);
pblock->GetValue(PB_SIDES,t,sides,valid);
pblock->GetValue(PB_SEGMENTS,t,segs,valid);
int smooth;
pblock->GetValue(PB_SMOOTH,t,smooth,valid);
if (radius1 < 0.0f) radius1 = 0.0f;
if (radius2 < 0.0f) radius2 = 0.0f;
Object* solid = (Object*)CreateInstance(GEOMOBJECT_CLASS_ID, GENERIC_AMSOLID_CLASS_ID);
assert(solid);
if(solid)
{
IGeomImp* cacheptr = (IGeomImp*)(solid->GetInterface(I_GEOMIMP));
assert(cacheptr);
if(cacheptr)
{
bool res = cacheptr->createTorus(radius1, radius2, sides, segs, smooth);
solid->ReleaseInterface(I_GEOMIMP, cacheptr);
if(res)
return solid;
else
{
solid->DeleteMe();
}
}
}
return NULL;
}
#endif
return SimpleObject::ConvertToType(t,obtype);
}