本文整理汇总了C++中ObjectPtr::Invert方法的典型用法代码示例。如果您正苦于以下问题:C++ ObjectPtr::Invert方法的具体用法?C++ ObjectPtr::Invert怎么用?C++ ObjectPtr::Invert使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ObjectPtr
的用法示例。
在下文中一共展示了ObjectPtr::Invert方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Invert_Object
// this function must not be called on CSG objects
void Invert_Object(ObjectPtr Object)
{
if (Object == NULL)
return;
assert((Object->Type & IS_CSG_OBJECT) == 0);
Object->Invert();
}
示例2: Invert_CSG_Object
// Invert_CSG_Object deletes the original object and returns a new one
// we force use of a separate function for this to help ensure that calling code handles this
// we also set the passed pointer to NULL
// (yes, this is ugly and needs to be fixed)
ObjectPtr Invert_CSG_Object(ObjectPtr& Object)
{
CSG *csg_object;
if(Object == NULL)
return NULL;
Object->Invert();
csg_object = dynamic_cast<CSG *>(Object);
assert(csg_object != NULL);
// Morph will delete the old object
csg_object = csg_object->Morph();
Object = NULL;
return csg_object;
}