|
[code]在下文中一共展示了AcDbObjectIdArray::append方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: if
▲ 点赞 11 ▼
void
ArxDbgAppEditorReactor::searchOneDictionary(AcDbDictionary* dict, AcDbObjectIdArray& objIds)
{
// get an iterator over this dictionary
AcDbDictionaryIterator* dictIter = dict->newIterator();
ASSERT(dictIter != NULL);
// walk dictionary and just collect all the entries that are of the
// given type
AcDbObject* obj;
for (; !dictIter->done(); dictIter->next()) {
if (acdbOpenAcDbObject(obj, dictIter->objectId(), AcDb::kForRead) == Acad::eOk) {
if (obj->isKindOf(ArxDbgDbDictRecord::desc())) {
objIds.append(obj->objectId());
}
else if (obj->isKindOf(AcDbDictionary::desc())) {
searchOneDictionary(AcDbDictionary::cast(obj), objIds);
}
obj->close();
}
}
delete dictIter;
dict->close();
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:25,代码来源:ArxDbgAppEditorReactor.cpp
示例2: FindGasBoundary
▲ 点赞 6 ▼
// 查找采空区的其它边
void FindGasBoundary( const AcDbObjectIdArray& objIds,
const AcDbVoidPtrArray& lines,
AcGePoint3dArray& spts,
AcGePoint3dArray& epts,
AcGeDoubleArray& dirs,
AcDbIntArray& gas_types,
AcDbObjectIdArray& gas_objIds )
{
// 查找所有的采空区
AcDbObjectIdArray goaf_objIds;
FindAllGoafs( goaf_objIds );
// 将采空区多边形转换成一个1维数组
AcGePoint3dArray polygons;
AcDbIntArray polygon_counts;
BuildGoafPolygonArray( goaf_objIds, polygons, polygon_counts );
// 标记采空区分支是否与其它采空区有共线边
AcDbIntArray colinearEdges;
FindPolygonColinearEdges( polygons, polygon_counts, colinearEdges );
// 查找所有的工作面
AcDbVoidPtrArray ws_lines;
FilterLines( lines, ws_lines, true );
// 划分采空区多边形(工作面、两帮、开切眼)
AcDbIntArray parTypes;
PartitionGoafPolygons( ws_lines, polygons, polygon_counts, parTypes );
assert( parTypes.length() == polygons.length() );
// 工作面需要特殊处理
AcDbIntArray gas_linePos;
AdjustGoafPolygon(
lines, polygons, polygon_counts,
colinearEdges, parTypes,
spts, epts, dirs,
gas_types, gas_linePos );
assert( gas_types.length() == gas_linePos.length() );
for( int i = 0; i < gas_linePos.length(); i++ )
{
int pos = gas_linePos[i];
if( pos != -1 )
{
gas_objIds.append( objIds[pos] );
}
else
{
gas_objIds.append( AcDbObjectId::kNull );
}
}
}
开发者ID:kanbang,项目名称:myexercise,代码行数:55,代码来源:FindGasBoundary.cpp
示例3: openSymbolTable
▲ 点赞 4 ▼
Acad::ErrorStatus
ArxDbgUtils::collectSymbolIds(AcRxClass* symTblClass,
AcDbObjectIdArray& objIds, AcDbDatabase* db)
{
ASSERT(symTblClass != NULL);
ASSERT(db != NULL);
Acad::ErrorStatus retCode = Acad::eInvalidInput;
AcDbSymbolTable* symTbl = openSymbolTable(symTblClass, AcDb::kForRead, db);
if (symTbl != NULL) {
// get an iterator over this symbol Table
AcDbSymbolTableIterator* tblIter;
if (symTbl->newIterator(tblIter) == Acad::eOk) {
// walk table and just collect all the objIds
// of the entries
if (symTbl->isKindOf(AcDbLayerTable::desc()))
static_cast<AcDbLayerTableIterator*>(tblIter)->setSkipHidden(false);
Acad::ErrorStatus es;
AcDbObjectId tblRecId;
for (; !tblIter->done(); tblIter->step()) {
es = tblIter->getRecordId(tblRecId);
if (es == Acad::eOk)
objIds.append(tblRecId);
}
delete tblIter;
retCode = Acad::eOk;
}
symTbl->close();
}
return retCode;
}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:32,代码来源:ArxDbgUtilsSymTbl.cpp
示例4: draw
▲ 点赞 2 ▼
AcDbObjectId DoubleLine::draw()
{
//计算始端的2个坐标
AcGePoint3d m_leftStartPt, m_leftEndPt;
AcGePoint3d m_rightStartPt, m_rightEndPt;
caclStartPoint( m_leftStartPt, m_rightStartPt );
//计算末端的2个坐标
caclEndPoint( m_leftEndPt, m_rightEndPt );
//绘制2条直线
AcDbObjectId line1 = ArxDrawHelper::DrawLine( m_leftStartPt, m_leftEndPt );
AcDbObjectId line2 = ArxDrawHelper::DrawLine( m_rightStartPt, m_rightEndPt );
//构造group
AcDbObjectIdArray objIds;
objIds.append( line1 );
objIds.append( line2 );
//构造临时的组名
CString name;
name.Format( _T( "巷道%d" ), count++ );
AcDbObjectId groupId = ArxGroupHelper::CreateGroup( name, objIds );
if( !groupId.isNull() )
{
ArxGroupHelper::ConvertToAnonymousGroup( groupId );
}
return groupId;
}
开发者ID:hunanhd,项目名称:cbm,代码行数:26,代码来源:DoubleLine.cpp
示例5: FindLinesByPoint
▲ 点赞 1 ▼
// 查找连接点junctionPt关联的分支图元(包含隐形的图元)
static void FindLinesByPoint( const AcGePoint3d& junctionPt, AcDbObjectIdArray& objIds )
{
AcDbBlockTable* pBlkTbl;
acdbHostApplicationServices()->workingDatabase()->getSymbolTable( pBlkTbl, AcDb::kForRead );
AcDbBlockTableRecord* pBlkTblRcd;
pBlkTbl->getAt( ACDB_MODEL_SPACE, pBlkTblRcd, AcDb::kForRead );
pBlkTbl->close();
AcDbBlockTableRecordIterator* pBlkTblRcdItr;
pBlkTblRcd->newIterator( pBlkTblRcdItr );
for ( pBlkTblRcdItr->start(); !pBlkTblRcdItr->done(); pBlkTblRcdItr->step() )
{
// 不采用transaction的方法查找LinkedGE,
// 等价于排除当前正在以write状态编辑的LinkedGE
// 重要(***)
AcDbEntity* pEnt = 0;
if( Acad::eOk != pBlkTblRcdItr->getEntity( pEnt, AcDb::kForRead ) ) continue;
LinkedGE* pEdge = LinkedGE::cast( pEnt );
if( pEdge != 0 )
{
AcGePoint3d startPt, endPt;
pEdge->getSEPoint( startPt, endPt );
if( startPt == junctionPt || endPt == junctionPt )
{
objIds.append( pEdge->objectId() );
}
}
pEnt->close();
}
delete pBlkTblRcdItr;
pBlkTblRcd->close();
}
开发者ID:kanbang,项目名称:TIDS,代码行数:36,代码来源:EdgeJunctionClosure.cpp
示例6: if
▲ 点赞 1 ▼
void
ArxDbgUtils::collectVertices(const AcDbPolyFaceMesh* pface, AcDbObjectIdArray& vfaces, AcGePoint3dArray& pts)
{
AcDbObjectIterator* vertexIter = pface->vertexIterator();
if (vertexIter == NULL)
return;
AcDbFaceRecord* vface;
AcDbPolyFaceMeshVertex* pfaceVertex;
AcDbObject* obj;
// walk through and seperate vfaces and vertices into two
// seperate arrays
Acad::ErrorStatus es;
for (; !vertexIter->done(); vertexIter->step()) {
es = acdbOpenObject(obj, vertexIter->objectId(), AcDb::kForRead);
if (es == Acad::eOk) {
if ((vface = AcDbFaceRecord::cast(obj)) != NULL)
vfaces.append(obj->objectId());
else if ((pfaceVertex = AcDbPolyFaceMeshVertex::cast(obj)) != NULL)
pts.append(pfaceVertex->position());
else {
ASSERT(0);
}
obj->close();
}
else
ArxDbgUtils::rxErrorMsg(es);
}
delete vertexIter;
}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:31,代码来源:ArxDbgUtilsDb.cpp
示例7: MfcArxsyj_mfc
▲ 点赞 1 ▼
// - MfcArx.syj_mfc command (do not rename)
static void MfcArxsyj_mfc(void)
{
// Add your code for command MfcArx.syj_mfc here
ads_name ss;
resbuf rb;
AcDbObjectIdArray objIds = NULL;
acedSSGet(NULL,NULL,NULL,NULL,ss);
long len;
//取得选择集的长度
acedSSLength(ss,&len);
//遍历选择集中的实体,将其打开并修改其颜色为红色
for (int i =0;i<len;i++)
{
ads_name entres;
AcDbObjectId objId;
//取得选择集中实体的名称ads_name
acedSSName(ss,i,entres);
//取得实体的ObjectId
acdbGetObjectId(objId,entres);
objIds.append(objId);
}
acedSSFree(ss);
CDetailShow ds(objIds,NULL,NULL);
ds.DoModal();
}
开发者ID:geozzu,项目名称:myarx,代码行数:27,代码来源:acrxEntryPoint.cpp
示例8:
▲ 点赞 1 ▼
void
ArxDbgUiTdcObjReactorsBase::OnObjAttach()
{
CString newHandle, str;
AcDbObjectId objId;
// see if specified handle is valid
m_ebHandle.GetWindowText(newHandle);
if (ArxDbgUtils::handleStrToObjId(acdbHostApplicationServices()->workingDatabase(),
newHandle, objId, false) != Acad::eOk) {
str.Format(_T("\"%s\" is not a valid handle."), newHandle);
ArxDbgUtils::alertBox(str);
m_ebHandle.SetSel(0, -1); // reset to select all
m_ebHandle.SetFocus();
return;
}
AcDbObjectIdArray newObjIds;
newObjIds.append(objId);
attachObjReactors(newObjIds);
m_ebHandle.SetWindowText(_T("")); // reset edit box to be empty for new handle
displayObjList();
}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:26,代码来源:ArxDbgUiTdcObjReactorsBase.cpp
示例9: GetDataObjectFromExtDict
▲ 点赞 1 ▼
// 从图元的扩展词典中查找数据对象
static void GetDataObjectFromExtDict( AcDbObjectIdArray& dbObjIds )
{
AcDbObjectIdArray allObjIds;
ArxDataTool::GetEntsByType( _T( "MineGE" ), allObjIds, true );
// 判断是否数据对象DataObject
// 且类型名称==type
if( allObjIds.isEmpty() ) return;
AcTransaction* pTrans = actrTransactionManager->startTransaction();
if( pTrans == 0 ) return;
int len = allObjIds.length();
for( int i = 0; i < len; i++ )
{
AcDbObject* pObj;
if( Acad::eOk != pTrans->getObject( pObj, allObjIds[i], AcDb::kForRead ) ) continue;
MineGE* pGE = MineGE::cast( pObj );
if( pGE == 0 ) continue;
AcDbObjectId dbObjId = pGE->getDataObject();
if( !dbObjId.isNull() )
{
dbObjIds.append( dbObjId );
}
}
actrTransactionManager->endTransaction();
}
开发者ID:kanbang,项目名称:myexercise,代码行数:30,代码来源:FieldHelper.cpp
示例10: YCROYCRO_CG_AddRegion
▲ 点赞 1 ▼
static void YCROYCRO_CG_AddRegion()
{
ads_name ss;
int rt = acedSSGet(NULL, NULL, NULL, NULL, ss);
AcDbObjectIdArray objIds;
if (rt == RTNORM)
{
long length;
acedSSLength(ss, &length);
for (int i = 0; i < length; i++)
{
ads_name ent;
acedSSName(ss, i, ent);
AcDbObjectId objId;
acdbGetObjectId(objId, ent);
objIds.append(objId);
}
}
acedSSFree(ss);
AcDbObjectIdArray regionIds;
regionIds = CCreateEnt::CreateRegion(objIds);
int number = regionIds.length();
if (number > 0)
{
acutPrintf(_T("\n已经创建%d个面域!"), number);
}
else
{
acutPrintf(_T("\n创建0个面域!"));
}
}
开发者ID:freudshow,项目名称:raffles-codes,代码行数:31,代码来源:acrxEntryPoint.cpp
示例11: getPersistentEntReactor
▲ 点赞 1 ▼
void
ArxDbgUiTdcPersistentReactors::getAttachedEntities(AcDbObjectIdArray& objIds)
{
AcDbVoidPtrArray dbPtrs;
ArxDbgUtils::getAllDatabases(dbPtrs);
AcDbObjectId prId;
ArxDbgPersistentEntReactor* peReactor;
Acad::ErrorStatus es;
AcDbObjectIdArray tmpIds;
int len = dbPtrs.length();
for (int i=0; i<len; i++) {
prId = getPersistentEntReactor(static_cast<AcDbDatabase*>(dbPtrs[i]), false);
es = acdbOpenObject(peReactor, prId, AcDb::kForRead);
if (es == Acad::eOk) {
tmpIds.setLogicalLength(0); // reusing array for each database
peReactor->getAttachedToObjs(tmpIds);
peReactor->close();
objIds.append(tmpIds);
}
}
}
开发者ID:kevinzhwl,项目名称:ObjectARXMod,代码行数:26,代码来源:ArxDbgUiTdcPersistentReactors.cpp
示例12: getAllSymbolRecordsIds
▲ 点赞 1 ▼
int getAllSymbolRecordsIds(AcRxClass* pTableClass, AcDbObjectIdArray & idaAll)
{
CLogger::Print(_T("*Call: getAllSymbolRecordsIds()"));
Acad::ErrorStatus es;
idaAll.setLogicalLength(0);
AcDbDatabase* pDb = acdbHostApplicationServices()->workingDatabase();
AcDbSymbolTable* pSymbolTable = NULL;
if (AcRx::kEqual == pTableClass->comparedTo(AcDbBlockTable::desc())) {
CLogger::Print(_T("> This is BlockTable!"));
es = pDb->getBlockTable(pSymbolTable, AcDb::kForRead);
}
else if (AcRx::kEqual == pTableClass->comparedTo(AcDbLayerTable::desc())) {
CLogger::Print(_T("> This is LayerTable!"));
es = pDb->getLayerTable(pSymbolTable, AcDb::kForRead);
}
else if (AcRx::kEqual == pTableClass->comparedTo(AcDbLinetypeTable::desc())) {
CLogger::Print(_T("> This is LinetypeTable!"));
es = pDb->getLinetypeTable(pSymbolTable, AcDb::kForRead);
}
else if (AcRx::kEqual == pTableClass->comparedTo(AcDbTextStyleTable::desc())) {
CLogger::Print(_T("> This is TextStyleTable!"));
es = pDb->getTextStyleTable(pSymbolTable, AcDb::kForRead);
}
else {
CLogger::Print(_T("*Exit: getAllSymbolRecordsIds() - This kind of SymbolTable is not supported!"));
return -1;
}
if (Acad::eOk != es) {
CLogger::Print(_T("*Exit: getAllSymbolRecordsIds() - Fail to get SymbolTable!"));
return -1;
}
//------------
// Get the SymbolTable's iterator.
AcDbSymbolTableIterator* pSymbolTableIter = NULL;
es = pSymbolTable->newIterator(pSymbolTableIter);
pSymbolTable->close();
if (Acad::eOk != es) {
CLogger::Print(_T("*Exit: getAllSymbolRecordsIds() - Fail to get the SymbolTable's iterator!"));
return -1;
}
//------------
// Steps through the SymbolTable's records.
// Then get the SymbolTableRecord's ObjectID.
for (; !pSymbolTableIter->done(); pSymbolTableIter->step()) {
AcDbObjectId idObj = AcDbObjectId::kNull;
if (Acad::eOk == pSymbolTableIter->getRecordId(idObj))
idaAll.append(idObj);
}
delete pSymbolTableIter;
CLogger::Print(_T("*Exit: getAllSymbolRecordsIds() - Count: %02d"), idaAll.length());
return idaAll.length();
}
开发者ID:vuonganh1993,项目名称:arxlss,代码行数:58,代码来源:LSS08.cpp
示例13: FindWindStationHosts
▲ 点赞 1 ▼
static void FindWindStationHosts( const AcDbObjectIdArray& objIds, AcDbObjectIdArray& hosts )
{
FWSHelper fws;
int len = objIds.length();
for( int i = 0; i < len; i++ )
{
hosts.append( fws.doFWS( objIds[i] ) );
}
}
开发者ID:kanbang,项目名称:myexercise,代码行数:9,代码来源:WindStationDockBarChildDlg.cpp
示例14: if
▲ 点赞 1 ▼
void
ArxDbgDbAdeskLogo::getCloneReferences(AcDb::DeepCloneType type,
AcDbObjectIdArray& refIds,
AcDbIntArray& refTypes) const
{
// these types should have been filtered out. NOTE that kDcObjects
// is usually ambiguous and has been mapped to kDcBlock or kDcCopy.
ASSERT((type != AcDb::kDcExplode) &&
(type != AcDb::kDcInsert) &&
(type != AcDb::kDcInsertCopy) &&
(type != AcDb::kDcSymTableMerge) &&
(type != AcDb::kDcXrefBind) &&
(type != AcDb::kDcXrefInsert) &&
(type != AcDb::kDcObjects));
if (type == AcDb::kDcCopy) {
refIds.append(m_arbitraryRefEnt);
refTypes.append(kClone); // you could set this to kNoClone and both would point to the same one.
}
else if (type == AcDb::kDcBlock) {
refIds.append(m_arbitraryRefEnt);
refTypes.append(kClone);
// LongTransactions (RefEdit) will not allow our object to be checked
// out from a block definition unless its accompanying style def is
// also in the check out set (which it won't be by default). So, we
// have to tell ::deepClone() to fake like it cloned the style definition
// so it will pass LongTransaction's checkOut validation.
refIds.append(m_logoStyleId);
refTypes.append(kFakeClone);
}
else if (type == AcDb::kDcWblock) {
refIds.append(m_arbitraryRefEnt);
refTypes.append(kClone);
}
else if (type == AcDb::kDcWblkObjects) {
refIds.append(m_arbitraryRefEnt);
refTypes.append(kClone);
}
else {
ASSERT(0); // which context did we not account for?
}
}
开发者ID:FengLuanShuangWu,项目名称:AutoCADPlugin-HeatSource,代码行数:43,代码来源:ArxDbgDbAdeskLogo.cpp
示例15: cloneObjects
▲ 点赞 1 ▼
Acad::ErrorStatus
ArxDbgUtils::cloneObjects(AcDbDatabase* db, const AcDbObjectId& entToClone,
const AcDbObjectId& ownerBlockId, bool debugSpeak)
{
ASSERT(db != NULL);
AcDbObjectIdArray objIdList;
objIdList.append(entToClone);
return cloneObjects(db, objIdList, ownerBlockId, debugSpeak);
}[/code] |
|