|
[code]在下文中一共展示了AcDbEntity::getGeomExtents方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C++代码示例。
示例1: ZoomToEntities
▲ 点赞 9 ▼
void ArxEntityHelper::ZoomToEntities( const AcDbObjectIdArray& objIds )
{
AcTransaction* pTrans = actrTransactionManager->startTransaction();
if( pTrans == 0 ) return;
AcDbExtents exts;
int len = objIds.length();
for( int i = 0; i < len; i++ )
{
AcDbObject* pObj;
if( Acad::eOk != pTrans->getObject( pObj, objIds[i], AcDb::kForRead ) ) continue;
AcDbEntity* pEnt = AcDbEntity::cast( pObj );
if( pEnt == 0 ) continue;
AcDbExtents extents;
if( Acad::eOk != pEnt->getGeomExtents( extents ) ) continue;
exts.addPoint( extents.minPoint() );
exts.addPoint( extents.maxPoint() );
}
actrTransactionManager->endTransaction();
AcGePoint3d minPt = exts.minPoint();
AcGePoint3d maxPt = exts.maxPoint();
if( minPt.x <= maxPt.x && minPt.y <= maxPt.y && minPt.z <= maxPt.z )
{
ZoomEntity_Helper( minPt, maxPt );
}
}
开发者ID:kanbang,项目名称:TIDS,代码行数:31,代码来源:ArxEntityHelper.cpp
示例2: ZoomToEntity
▲ 点赞 7 ▼
void ArxEntityHelper::ZoomToEntity( const AcDbObjectId& objId )
{
AcTransaction* pTrans = actrTransactionManager->startTransaction();
if( pTrans == 0 ) return;
AcDbObject* pObj;
if( Acad::eOk != pTrans->getObject( pObj, objId, AcDb::kForRead ) )
{
actrTransactionManager->abortTransaction();
return;
}
AcDbEntity* pEnt = AcDbEntity::cast( pObj );
if( pEnt == 0 )
{
actrTransactionManager->abortTransaction();
return;
}
AcDbExtents extents;
bool ret = ( Acad::eOk == pEnt->getGeomExtents( extents ) );
actrTransactionManager->endTransaction();
if( ret && IsValidExtent( extents ) )
{
ZoomEntity_Helper( extents.minPoint(), extents.maxPoint() );
}
}
开发者ID:kanbang,项目名称:TIDS,代码行数:29,代码来源:ArxEntityHelper.cpp
示例3: Get_CenterPt
▲ 点赞 6 ▼
AcGePoint3d Additional_Class::Get_CenterPt( AcDbObjectId ObjID )
{
AcDbEntity *pEnt = NULL;
AcGePoint3d ptMax, ptMin, ptRes;
ptRes.set(0,0,0);
if (Acad::eOk == acdbOpenAcDbEntity(pEnt, ObjID, AcDb::kForWrite))
{
AcDbExtents pEntExtent;
pEnt->getGeomExtents(pEntExtent);
ptMax = pEntExtent.maxPoint();
ptMin = pEntExtent.minPoint();
ptRes.x = (ptMax.x + ptMin.x)/2;
ptRes.y = (ptMax.y + ptMin.y)/2;
ptRes.z = (ptMax.z + ptMin.z)/2;
}
pEnt->close();
return ptRes;
}
开发者ID:TobeGodman,项目名称:AutoTrader,代码行数:18,代码来源:Additional_Class.cpp
示例4: ZoomToEntity
▲ 点赞 2 ▼
void ZoomToEntity( const AcDbObjectId& objId )
{
AcTransaction* pTrans = actrTransactionManager->startTransaction();
if( pTrans == 0 ) return;
AcDbObject* pObj;
if( Acad::eOk != pTrans->getObject( pObj, objId, AcDb::kForRead ) )
{
actrTransactionManager->abortTransaction();
return;
}
//AcApDocument
//AcApDocManager
//AcDbBlockTableRecord
AcDbEntity* pEnt = AcDbEntity::cast( pObj );
if( pEnt == 0 )
{
actrTransactionManager->abortTransaction();
return;
}
AcDbExtents extents;
bool ret = ( Acad::eOk == pEnt->getGeomExtents( extents ) );
actrTransactionManager->endTransaction();
if( !ret )
{
acutPrintf( _T( "\n1) exten无效" ) );
}
else if( !IsValidExtent( extents ) )
{
acutPrintf( _T( "\n2) exten无效" ) );
}
else
{
ZoomEntity_Helper( extents.minPoint(), extents.maxPoint() );
}
}[/code] |
|