本文整理汇总了C++中AcDbObject::setAcDbObjectIdsInFlux方法的典型用法代码示例。如果您正苦于以下问题:C++ AcDbObject::setAcDbObjectIdsInFlux方法的具体用法?C++ AcDbObject::setAcDbObjectIdsInFlux怎么用?C++ AcDbObject::setAcDbObjectIdsInFlux使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcDbObject
的用法示例。
在下文中一共展示了AcDbObject::setAcDbObjectIdsInFlux方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: dbox
//.........这里部分代码省略.........
// Some form of this code is only necessary if
// anyone has set up an ownership for our object
// other than with an AcDbBlockTableRecord.
//
pOwner->database()->addAcDbObject(pClone);
pClone->setOwnerId(pOwner->objectId());
}
// STEP 3:
// Now we copy our contents to the clone. This is done
// using an AcDbDeepCloneFiler. This filer keeps a
// list of all AcDbHardOwnershipIds and
// AcDbSoftOwnershipIds we, and any classes we derive
// from, have. This list is then used to know what
// additional, "owned" objects need to be cloned below.
//
AcDbDeepCloneFiler filer;
dwgOut(&filer);
// STEP 4:
// Rewind the filer and read the data into the clone.
//
filer.seek(0L, AcDb::kSeekFromStart);
pClone->dwgIn(&filer);
// STEP 5:
// This must be called for all newly created objects
// in deepClone. It is turned off by endDeepClone()
// after it has translated the references to their
// new values.
//
pClone->setAcDbObjectIdsInFlux();
// STEP 6:
// Add the new information to the idMap. We can use
// the idPair started above.
//
idPair.setValue(pClonedObject->objectId());
idPair.setIsCloned(Adesk::kTrue);
idMap.assign(idPair);
// STEP 7:
// Using the filer list created above, find and clone
// any owned objects.
//
AcDbObject *pSubObject;
AcDbObject *pClonedSubObject;
AcDbObjectId id;
Acad::ErrorStatus es;
while (filer.getNextOwnedObject(id)) {
// Open the object and clone it. Note that we now
// set "isPrimary" to kFalse here because the object
// is being cloned, not as part of the primary set,
// but because it is owned by something in the
// primary set.
es = acdbOpenAcDbObject(pSubObject, id, AcDb::kForRead);
if (es != Acad::eOk)
continue; // could have been NULL or erased
pClonedSubObject = NULL;
pSubObject->deepClone(pClonedObject, pClonedSubObject, idMap, Adesk::kFalse);
// If this is a kDcInsert context, the objects
// may be "cheapCloned". In this case, they are