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 {
AcGePoint3dArray vertexArray;
if ((es = getVertices3d(vertexArray))
!= Acad::eOk)
{
return es;
}
if (intType == AcDb::kExtendArg
|| intType == AcDb::kExtendBoth)
{
intType = AcDb::kExtendThis;
}
AcDbLine *pAcadLine;
for (int i = 0; i < vertexArray.length() - 1; i++) {
pAcadLine = new AcDbLine();
pAcadLine->setStartPoint(vertexArray[i]);
pAcadLine->setEndPoint(vertexArray[i + 1]);
pAcadLine->setNormal(normal());
if ((es = ent->intersectWith(pAcadLine, intType,
points)) != Acad::eOk)
{
delete pAcadLine;
return es;
}
delete pAcadLine;
}
}
return es;
}
Acad::ErrorStatus
AsdkPoly::intersectWith(
const AcDbEntity* ent,
AcDb::Intersect intType,
const AcGePlane& projPlane,
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, with 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, &projPlane, points)) != Acad::eOk)
{
return es;
}
} else if (ent->isKindOf(AcDbArc::desc())) {
if ((es = intArc(this, AcDbArc::cast(ent), intType,