本文整理汇总了C++中AcDbDictionary::newIterator方法的典型用法代码示例。如果您正苦于以下问题:C++ AcDbDictionary::newIterator方法的具体用法?C++ AcDbDictionary::newIterator怎么用?C++ AcDbDictionary::newIterator使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类AcDbDictionary
的用法示例。
在下文中一共展示了AcDbDictionary::newIterator方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: acdbHostApplicationServices
// The list tree function runs through all objects in the ASDK_DICT dictionary,
// follows their ownership trees, and lists out information
// on all objects in the tree.
//
void
listTree()
{
AcDbDictionary *pNamedobj;
AcDbDictionary *pDict;
acdbHostApplicationServices()->workingDatabase()
->getNamedObjectsDictionary(pNamedobj, AcDb::kForWrite);
// Get a pointer to the ASDK_DICT dictionary.
//
if (pNamedobj->getAt(_T("ASDK_DICT"), (AcDbObject*&) pDict,
AcDb::kForRead) == Acad::eKeyNotFound)
{
pNamedobj->close();
return ;
}
pNamedobj->close();
// Run through the entries and list their backpointers.
//
AcDbDictionaryIterator *pDictItr = pDict->newIterator();
for (; !pDictItr->done(); pDictItr->next()) {
printOut(pDictItr->objectId());
}
delete pDictItr;
pDict->close();
}
示例2: GetDictObject
void ArxDictTool2::getAllEntries( AcDbObjectIdArray& objIds )
{
AcDbDictionary* pDict = GetDictObject( m_dictId );
if( pDict == 0 ) return;
AcDbDictionaryIterator* pIter = pDict->newIterator();
for ( ; !pIter->done(); pIter->next() )
{
objIds.append( pIter->objectId() );
}
delete pIter;
pDict->close();
}
示例3: acdbOpenObject
//.........这里部分代码省略.........
es = pDestNamedDict->getAt(kpDictionary, dictId);
// If our dictionary does not yet exist in the
// NamedObjects dictionary, which is not itself
// cloned, we have to both clone and add our
// dictionary to it. Since dictionary entries are
// ownership references, all of our entries will
// also be cloned at this point, so we are done.
//
if (es == Acad::eKeyNotFound) {
pClone = NULL;
pSrcDict->deepClone(pDestNamedDict,
pClone, idMap);
// Unless we have overridden the deepClone
// of our dictionary, we should expect it to
// always be cloned here.
//
if (pClone == NULL) {
*pRetStat = Acad::eNullObjectId;
break;
}
pDestNamedDict->setAt(kpDictionary,
pClone, dictId);
pDestNamedDict->close();
pClone->close();
break;
}
pDestNamedDict->close();
// Our dictionary already exists in the destination
// database, so now we must "merge" the entries
// into it. Since we have not cloned our
// destination dictionary, its objectIds are not in
// flux, and we can use getAt() and setAt() on it.
//
AcDbDictionary *pDestDict;
acdbOpenObject(pDestDict, dictId, AcDb::kForWrite);
AcDbObject *pObj, *pObjClone;
AcDbDictionaryIterator* pIter;
pIter = pSrcDict->newIterator();
for (; !pIter->done(); pIter->next()) {
const char *pName = pIter->name();
pIter->getObject(pObj, AcDb::kForRead);
// If the dictionary contains any references
// and/or other objects have references to it,
// you must either use deepClone() or put the
// idPairs into the idMap here, so that they
// will be in the map for translation.
//
pObjClone = NULL;
pObj->deepClone(pDestDict, pObjClone, idMap);
// INSERT usually uses a method of cloning
// called CheapClone, where it "moves" objects
// into the destination database instead of
// actually cloning them. When this happens,
// pObj and pObjClone are pointers to the
// same object. We only want to close pObj
// here if it really is a different object.
//
if (pObj != pObjClone)
pObj->close();
if (pObjClone == NULL)
continue;
// If the name already exists in our
// destination dictionary, it must be changed
// to something unique. In this example, the
// name is changed to an annonymous entry.
// The setAt() method will automatically append
// a unique identifier to each name beginning
// with "*". It will become something like,
// "*S04".
//
if ( pDestDict->getAt(pName, dictId)
== Acad::eKeyNotFound)
pDestDict->setAt(pName, pObjClone, dictId);
else
pDestDict->setAt("*S", pObjClone, dictId);
pObjClone->close();
}
delete pIter;
pDestDict->close();
break;
default:
break;
}
pSrcDict->close();
}