- UID
- 11376
- 积分
- 160
- 精华
- 贡献
-
- 威望
-
- 活跃度
-
- D豆
-
- 在线时间
- 小时
- 注册时间
- 2002-10-14
- 最后登录
- 1970-1-1
|
楼主 |
发表于 2002-11-21 23:24:25
|
显示全部楼层
不好意思, 我是在help中抄来修改的,sample中写得很严谨:
Acad::ErrorStatus
AsdkPoly::intersectWith(
const AcDbEntity* ent,
AcDb::Intersect intType,
AcGePoint3dArray& points,
int /*thisGsMarker*/,
int /*otherGsMarker*/) const
{
assertReadEnabled();
Acad::ErrorStatus es = Acad::eOk;
if (ent == NULL)
return Acad::eNullEntityPointer;
// The idea is to intersect each side of the polygon
// with the given entity and return all the points.
//
// For non-R12-entities, i.e. the ones that have their
// intersection methods defined, we call that method for
// each of the sides of the polygon. For R12-entities,
// we use the locally defined intersectors since their
// protocols are not implemented.
if (ent->isKindOf(AcDbLine::desc())) {
if ((es = intLine(this, AcDbLine::cast(ent),
intType, NULL, points)) != Acad::eOk)
{
return es;
}
} else if (ent->isKindOf(AcDbArc::desc())) {
if ((es = intArc(this, AcDbArc::cast(ent), intType,
NULL, points)) != Acad::eOk)
{
return es;
}
} else if (ent->isKindOf(AcDbCircle::desc())) {
if ((es = intCircle(this, AcDbCircle::cast(ent),
intType, NULL, points)) != Acad::eOk)
{
return es;
}
} else if (ent->isKindOf(AcDb2dPolyline::desc())) {
if ((es = intPline(this, AcDb2dPolyline::cast(ent),
intType, NULL, points)) != Acad::eOk)
{
return es;
}
} else if (ent->isKindOf(AcDb3dPolyline::desc())) {
if ((es = intPline(this, AcDb3dPolyline::cast(ent),
intType, NULL, points)) != Acad::eOk)
{
return es;
}
} else {
(写不下了...) |
|